|
@@ -7,15 +7,29 @@ require('./../resources/images/empty2.png');
|
|
|
const {currentIIData} = require('./data.js')
|
|
|
const initData = currentIIData[14]
|
|
|
|
|
|
-for(let i = 0; i < 3; i++){
|
|
|
- let str = `<span class="example" id="example${i+1}" data-index=${i}>示例${i+1}</span>`
|
|
|
- $('.btnBox').append(str)
|
|
|
+for(let i = 0; i < currentIIData.length; i++){
|
|
|
+ let str = `<p class="example" id="example${i+1}" data-index=${i}>示例${i+1}</p>`;
|
|
|
+ $('.exampleList .pop-body').append(str)
|
|
|
}
|
|
|
|
|
|
$('.example').click(function(){
|
|
|
- const index = $(this).attr('data-index')
|
|
|
- $('#infoTxt').val(currentIIData[index])
|
|
|
- getEntityPredict();
|
|
|
+ $(".example").removeClass("selected");
|
|
|
+ $(this).addClass("selected");
|
|
|
+});
|
|
|
+
|
|
|
+$('.exampleList .pop-ok').click(()=>{
|
|
|
+ $(".pop-box").hide();
|
|
|
+ const index = $(".example.selected").attr('data-index');
|
|
|
+ $('#infoTxt').val(currentIIData[index]);
|
|
|
+ getEntityPredict();
|
|
|
+});
|
|
|
+
|
|
|
+$("#showEgBtn").click(function(){
|
|
|
+ $(".pop-box").show();
|
|
|
+});
|
|
|
+/******弹窗事件******/
|
|
|
+$(".pop-cover,.pop-close,.pop-cancel").click(()=>{
|
|
|
+ $(".pop-box").hide();
|
|
|
})
|
|
|
|
|
|
$('#infoTxt').val(initData)
|
|
@@ -35,7 +49,9 @@ function getEntityPredict(){
|
|
|
|
|
|
]
|
|
|
|
|
|
- }
|
|
|
+ };
|
|
|
+ $(".resultBoxInfo").html(`<p style="color: #aaa;text-align: center;margin-top:50px;">正在分析...</p>`);
|
|
|
+ $('.empty').hide();
|
|
|
post(api.entity_predict, param).then(res =>{
|
|
|
if(res.data.code == '0'){
|
|
|
const data = JSON.parse(res.data.data)
|