zhangxc před 5 roky
rodič
revize
59bd9af7e7
5 změnil soubory, kde provedl 89 přidání a 5 odebrání
  1. 20 1
      src/css/participle.less
  2. 1 1
      src/html/participle.html
  3. 1 1
      src/js/api.js
  4. 53 1
      src/js/data.js
  5. 14 1
      src/js/participle.js

+ 20 - 1
src/css/participle.less

@@ -85,11 +85,12 @@
             }
 
         .btnBox{
+            height: 36px;
             padding: 20px 0;
             position: relative;
         }
         .btn{
-            position: relative;
+            position: absolute;
             left: 50%;
             margin-left: -48px;
             background-color: #5A8EEE;
@@ -100,6 +101,24 @@
             border-radius:4px;
             font-size: 14px;
             display: inline-block;
+            cursor: pointer;
+        }
+        .example{
+            border-color: #5A8EEE;
+            border: 1px solid #5A8EEE;
+            color: #5A8EEE;
+            padding: 9px 20px;
+            text-align: center;
+            border-radius:4px;
+            font-size: 14px;
+            display: inline-block;
+            margin: 0 10px 0 0;
+            cursor: pointer;
+        }
+        .example:hover{
+            background-color: #5A8EEE;
+            border-color: #5A8EEE;
+            color: #fff;
         }
         .resultBox{
             white-space: pre-wrap;

+ 1 - 1
src/html/participle.html

@@ -21,7 +21,7 @@
 					<textarea name="" id="infoTxt" class="infoTxt" cols="30" rows="10" placeholder="请输入病例内容......"></textarea>
 				</div>
 				<div class="btnBox clearfix">
-					<span class="btn disabled" id="analy">开始分析</span>
+					<span class="btn" id="analy">开始分析</span>
 				</div>
 			</div>
 			<div class="contentInfoBox">

+ 1 - 1
src/js/api.js

@@ -4,7 +4,7 @@ const api = {
   getNode:'/api/ltkg/kg/getNode',
   getSchema:'/api/ltkg/kg/getSchema',
   getTree:'/api/ltkg/kg/getTree',
-  entity_predict:'api/ltkg/nlp/getNlp'
+  entity_predict:'api/ltkg/nlp/getNlp',
 };
 
 const getUrlArgObject = function(name) {//

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 53 - 1
src/js/data.js


+ 14 - 1
src/js/participle.js

@@ -4,10 +4,23 @@ require("./../css/participle.less");
 require("./../css/common.css");
 const { post, api } = require('./api.js');
 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)
+}
 
-function insertStr(soure, start, newStr){   
+$('.example').click(function(){
+    const index = $(this).attr('data-index')
+    $('#infoTxt').val(currentIIData[index])
+    getEntityPredict();
+})
 
+$('#infoTxt').val(initData)
+getEntityPredict();
+function insertStr(soure, start, newStr){   
     return soure.slice(0, start) + newStr + soure.slice(start);
  }
 function getEntityPredict(){