瀏覽代碼

命名维护输入限制需求更改

liucf 6 年之前
父節點
當前提交
645cc9e4ed

+ 1 - 1
src/components/icss/AddMedicalInfo.vue

@@ -5,7 +5,7 @@
                 @click="back"
         ></i> 医学术语属性--{{isEdit?'修改':'添加'}}</div> -->
         <crumbs
-          :title=" isEdit? '医学术语属性-修改':'医学术语属性-添加'"
+          :title=" isEdit? '术语医学属性-修改':'术语医学属性-添加'"
           class="topBack"
           linkTo="/admin/LT-YXSYKWH-SYYXSXWH"
         ></crumbs>

+ 51 - 7
src/components/icss/AddMedicalName.vue

@@ -4,7 +4,7 @@
     <div class="contents">
       <div class="content">
         <h3>添加术语:</h3>
-        <p class="titl">标准术语:</p>
+        <p class="titl">医学标准术语:</p>
         <table class="deptbox">
           <tr>
             <td class="ind">序号</td>
@@ -16,7 +16,11 @@
             <td class="ind">1</td>
             <td :title="data.name&&data.name.length>9?data.name:''">
               <!-- <el-input v-model="data.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(1)"></el-input> -->
-              <input type="text" v-model="data.name" placeholder="请输入术语" maxlength="30" @input="handleInput(1)">
+              <!-- 修改时标准词不能修改,修改了会当做新增处理 4-17 -->
+              <p v-if="id">{{data.name}}</p>
+              <!-- <input v-else type="text" v-model="data.name" placeholder="请输入术语" maxlength="30" @input="handleInput(1)"> -->
+              <!-- 4-18 需求变更 -->
+              <input v-else type="text" v-model="data.name" placeholder="请输入术语" maxlength="30" @blur="handleBlur(1)">
             </td>
             <td>
               <el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small">
@@ -31,7 +35,7 @@
             </td>
             <td class="desc">
               <!-- <el-input v-model="data.remark" placeholder="请输入术语说明" maxlength="120" size="small" @input="handleRemark"></el-input> -->
-              <input v-model="data.remark" placeholder="请输入术语说明" maxlength="120" @input="handleRemark(1)"></input>
+              <input v-model="data.remark" placeholder="请输入术语说明" maxlength="120" @blur="handleRemark(1)"></input>
             </td>
           </tr>
         </table>
@@ -49,7 +53,8 @@
             <td :title="item.name&&item.name.length>9?item.name:''">
               <!-- 使用原生input,输入限制 -->
               <!-- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(2,index)"></el-input> -->
-              <input type="text" v-model="item.name" placeholder="请输入术语" maxlength="30" @input="handleInput(2,index)">
+              <!-- <input type="text" v-model="item.name" placeholder="请输入术语" maxlength="30" @input="handleInput(2,index)"> -->
+              <input type="text" v-model="item.name" placeholder="请输入术语" maxlength="30" @blur="handleBlur(2,index)">
             </td>
             <td>
               <!-- <el-select v-model="item.type" clearable placeholder="请选择">
@@ -64,7 +69,7 @@
             </td>
             <td class="desc">
               <!-- <el-input v-model="item.remark" placeholder="请输入术语说明" maxlength="120" size="small" @input="handleRemark(index,item.name)"></el-input> -->
-              <input v-model="item.remark" placeholder="请输入术语说明" maxlength="120" @input="handleRemark(2,index)"></input>
+              <input v-model="item.remark" placeholder="请输入术语说明" maxlength="120" @blur="handleRemark(2,index)"></input>
             </td>
             <td v-if="id">
               <span @click="deleLine(index)" class="delete">删除</span>
@@ -165,7 +170,7 @@ import api from '@api/icss.js';
         });
       },
       // handleInput(index,name){
-      handleInput(type,index){
+     /* handleInput(type,index){
         // 可输入内容:字母、数字、汉字、特殊字符:%  ——  其余不可输入;
         // if(!name){//标准词输入
         if(type==1){//标准词输入
@@ -173,15 +178,54 @@ import api from '@api/icss.js';
         }else{
           this.synonymous[index].name = this.synonymous[index].name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
         }
+      },*/
+      handleBlur(type,index){
+        // 不能为纯数字、纯字符、纯数字加字符 4-18
+        const pattern = /[^~@#$%^&*_\-+=,,.。::"“??”;;、!!0-9]/g;
+        if(type==1){//标准词输入
+          if(!pattern.test(this.data.name)){
+            this.$message({
+              message:'无法输入纯数字或者纯字符,请输入正确数据!',
+              type:'warning'
+            });
+            this.data.name = '';
+          }
+        }else{
+          if(!pattern.test(this.synonymous[index].name)){
+            this.$message({
+              message:'无法输入纯数字或者纯字符,请输入正确数据!',
+              type:'warning'
+            });
+            this.synonymous[index].name = '';
+          }
+        }
       },
       // handleRemark(index,name){
       handleRemark(type,index){
       //说明只能输入中文
         // if(!name){//标准词输入
-        if(type==1){//标准词输入
+        /*if(type==1){//标准词输入
           this.data.remark = this.data.remark.replace(/[^\u4e00-\u9fa5]/g,'');
         }else{
           this.synonymous[index].remark = this.synonymous[index].remark.replace(/[^\u4e00-\u9fa5]/g,'');
+        }*/
+        const pattern = /[^~@#$%/^&*_\-+=,,.。::"“??”;;、!!0-9]/g;
+        if(type==1){//标准词输入
+          if(!pattern.test(this.data.remark)){
+            this.$message({
+              message:'无法输入纯数字或者纯字符,请输入正确数据!',
+              type:'warning'
+            });
+            this.data.remark = '';
+          }
+        }else{
+          if(!pattern.test(this.synonymous[index].remark)){
+            this.$message({
+              message:'无法输入纯数字或者纯字符,请输入正确数据!',
+              type:'warning'
+            });
+            this.synonymous[index].remark = '';
+          }
         }
       },
       addSpan(){

+ 13 - 6
src/components/icss/AddMedicinePrompt.vue

@@ -19,11 +19,11 @@
                                filterable
                                remote
                                clearable
-                               value-key="id"
+                               value-key="conceptId"
                                ref="termName"
                                placeholder="搜索术语"
                                :remote-method="searchTerms">
-                        <el-option v-for="term in terms" :key="term.id" :label="term.name+'-('+term.type+')'" :value="term" ></el-option>
+                        <el-option v-for="term in terms" :key="term.conceptId" :label="term.libName+'-('+term.libType+')'" :value="term" ></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="已选择术语标签:">
@@ -100,7 +100,13 @@
         },
         rules: {
           source: [
-            { required: true, message: '请输入静态知识来源', trigger: 'change' }
+            { required: true, message: '请输入静态知识来源', trigger: 'change' },
+            { validator: (rule,value,callback)=>{
+                if(value.length>30){
+                  callback(new Error('段落标题不能超过30字'));
+                }else{
+                  callback();
+                }}, trigger: 'change' }
           ],
           selectedTerm: [
             { required: true, message: '请选择术语标签', trigger: 'change' }
@@ -110,10 +116,10 @@
     },
     watch:{
       'form.selectedTerm':function(newVal){
-        const name = newVal.name;
+        const name = newVal.libName;
         //this.editData.selectedTermName = name;
         this.form.selectedTermName = name;
-        this.form.selectedTermType = newVal.type;
+        this.form.selectedTermType = newVal.libType;
         this.form.conceptId = newVal.conceptId;
       }
     },
@@ -198,7 +204,8 @@
         const param = Object.assign({},item,{
                                                 position:typeof item.position=='string'?item.position:item.position.join(","),
                                                 source:this.form.source,
-                                                conceptId:this.form.conceptId,isTip:1,
+                                                conceptId:this.form.conceptId,
+                                                isTip:1,
                                               });
         this.showSaveDialog(param,'是否保存该静态知识?');
       },

+ 1 - 0
src/components/icss/IndeptLabel.vue

@@ -65,6 +65,7 @@
                         label="操作">
                     <template slot-scope="scope">
                         <el-button  @click="modifyIndeptTag(scope.row)" type="text" size="small">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
                         <el-button @click="showDelDialog(scope.row.id)" class="delete" type="text" size="small">删除</el-button>
                     </template>
                 </el-table-column>

+ 1 - 0
src/components/icss/LabelGroup.vue

@@ -65,6 +65,7 @@
                     label="操作">
                     <template slot-scope="scope">
                         <el-button  @click="modifyTagGroup(scope.row)" type="text" size="small">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
                         <el-button @click="showDelDialog(scope.row.id,scope.row.type)" class="delete" type="text" size="small">删除</el-button>
                     </template>
                 </el-table-column>

+ 2 - 2
src/components/icss/MedicalInfo.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <crumbs title="医学术语属性维护">
+        <crumbs title="术语医学属性维护">
             <el-form :inline="true" class="demo-form-inline">
                 <el-form-item label="医学标准术语:">
                     <el-input size="mini" v-model="filter.termName" placeholder="输入医学标准"></el-input>
@@ -24,7 +24,7 @@
                     <el-button size="mini" @click="uploadClick">导入</el-button>
                     <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
                     <router-link to="/admin/LT-YXSYKWH-TJYXSYXX" style="margin:0 10px">
-                        <el-button size="mini" type="warning">添加医学术语属性</el-button>
+                        <el-button size="mini" type="warning">添加术语医学属性</el-button>
                     </router-link>
                 </el-form-item>
             </el-form>

+ 1 - 1
src/components/icss/MedicalName.vue

@@ -24,7 +24,7 @@
                     <el-button size="mini" @click="uploadClick">导入</el-button>
                     <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
                     <router-link to="/admin/LT-YXSYKWH-TJYXSY" style="margin:0 10px">
-                        <el-button size="mini" type="warning">添加术语</el-button>
+                        <el-button size="mini" type="warning">添加医学标准术语</el-button>
                     </router-link>
                 </el-form-item>
             </el-form>

+ 8 - 2
src/components/icss/MedicineInfoPg.vue

@@ -14,7 +14,7 @@
             </el-checkbox-group>
         </el-form-item>
         <el-form-item label="标题" prop="title" label-width="130px">
-            <el-input v-model="data.title" maxlength="120"></el-input>
+            <el-input v-model="data.title"></el-input>
         </el-form-item>
         <el-form-item label="内容" prop="content" label-width="130px">
             <quillEditor v-model="data.content" :options="editorOption"></quillEditor>
@@ -75,7 +75,13 @@
             { required: true, message: '请选择显示位置', trigger: 'change' }
           ],
           title: [
-            { required: true, message: '请输入段落标题', trigger: 'change' }
+            { required: true, message: '请输入段落标题', trigger: 'change' },
+            { validator: (rule,value,callback)=>{
+                if(value.length>30){
+                  callback(new Error('段落标题不能超过30字'));
+                }else{
+                  callback();
+                }}, trigger: 'change' }
           ],
           content: [
             { required: true, message: '请输入段落内容', trigger: 'change' }

+ 1 - 1
src/components/icss/MedicinePrompt.vue

@@ -66,7 +66,7 @@
                     <template slot-scope="scope">
                         <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
                         <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" @click="showDelDialog(scope.row)">删除</el-button>
+                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row)">删除</el-button>
                     </template>
                 </el-table-column>
             </el-table>