我希望<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script type="text/javascript">
$(function () {
$("#createCartable").click(function () {
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('car model')/items?$Select= Car_x0020_Type/Title, Car_x0020_model, Number &$expand= Car_x0020_Type";
$.ajax({
url: requestUri,
async: false,
type: "GET",
headers: {
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
},
success: onSuccess,
error: function (error) {
console.log(JSON.stringify(error));
}
})
var Type = "";
var MaxSpeed = "";
// Second Call to Car type
function onSuccessIncident(data) {
Type = data.d.results[0].Type;
dataStarted = data.d.results[0].Max_x0020_Speed;
}
function onSuccess(data) {
var _Results = data.d.results;
var grouped = _.groupBy(_Results, function (item) {
return item.Car_x0020_Type.Title
})
_.each(grouped, function (v, k) {
var maxItem = _.max(v, function (item) { return item.Number; });
var requestUriTwo = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Car Type')/items?$filter=Title eq '" + maxItem.Car_x0020_Type.Title.toString() + "'&$Select=Title,Gear_x0020_type";
$.ajax({
url: requestUriTwo,
async: false,
type: "GET",
headers: {
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
},
success: function (data) {
var typeItem = data.d.results[0];
if (typeItem.Gear_x0020_type === "Auto")
$('#table_id > tbody').append('<tr><td>' + typeItem.Title + '</td><td>' + maxItem.Car_x0020_model + '</td><td>' + maxItem.Number + '</td><td style="background-color:green">' + typeItem.Gear_x0020_type + '</td></tr>');
else
$('#table_id > tbody').append('<tr><td>' + typeItem.Title + '</td><td>' + maxItem.Car_x0020_model + '</td><td>' + maxItem.Number + '</td><td style="background-color:red">' + typeItem.Gear_x0020_type + '</td></tr>');
},
error: function (error) {
console.log(JSON.stringify(error));
}
})
})
//for (var i = 0; i < data.d.results.length; i++) {
// var items = data.d.results[i];
//}
}
})
})
</script>
<input id="createCartable" type="button" value="createCartable" />
<table id="table_id" class="display" style="text-align:center;border:1px solid" cellspacing="0" width="100%">
<thead>
<tr>
<th>Type</th>
<th>Car Model</th>
<th>Number</th>
<th>Gear Type</th>
</tr>
</thead>
<tbody></tbody>
</table>
在句子中检测到Dialogflow
并给它一个a
。
示例:我想吃 a 鸡饭。
number = 1
应该检测为:
Dialogflow
我已经有一个实体来检测产品,打算检测一个订单或多个订单,
即“我要2鸡肉饭和2咖啡”。 这将同时返回数字和产品。
但是我无法'a' = @sys.number, Resolved value : one or 1
"chicken rice" = @delivery-product, resolved value : chicken rice
进行检测:
我要一杯咖啡
我要2个鸡肉饭和 a 咖啡。
有人对解决这个问题有什么建议吗?
谢谢!