Forráskód Böngészése

Merge branch 'test' into ChronicMag_zxc

zhangxc 6 éve
szülő
commit
44a7d91c76

+ 2 - 0
src/components/preTreat/PubIndeptQa.vue

@@ -376,7 +376,9 @@
         if(response.code==='0'){
           this.showFileList = true;
           this.form.region13 = '{imageUrlPrefix}'+response.data.url;
+          this.sendData();
         }else{
+          this.imgList = [];
           this.showFileList=false;
           this.warning(response.msg);
         }

+ 16 - 11
src/components/preTreat/PubSelect.vue

@@ -3,10 +3,10 @@
         <el-form>
             <div class="operation-row">
                 <el-checkbox-group size="small">
-                    <el-checkbox-button :label="0" @change="handlePlaceholder(0)">文字输入框占位符</el-checkbox-button>
+                    <el-checkbox-button :label="0" :disabled="disableBtn" @change="handlePlaceholder(0)">文字输入框占位符</el-checkbox-button>
                 </el-checkbox-group>
                 <el-checkbox-group size="small">
-                    <el-checkbox-button :label="0" @change="handlePlaceholder(1)">数字输入框占位符</el-checkbox-button>
+                    <el-checkbox-button :label="0" :disabled="disableBtn" @change="handlePlaceholder(1)">数字输入框占位符</el-checkbox-button>
                 </el-checkbox-group>
                 <el-checkbox-group size="small" v-if="type==2">
                     <el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
@@ -148,6 +148,7 @@
         rows:[...initRows],
         focusOn:-1,         //聚焦的行index
         focusName:'name',        //是否聚焦医生界面输入框
+        disableBtn:false,       //占位符是否禁用
       }
     },
     mounted(){
@@ -193,6 +194,12 @@
       selectRow(index,name){
         this.focusOn = index;
         this.focusName = name;
+        const placeReg = /(\$\{number_\S*?\})|(\$\{input_\S*?\})/g;
+        if(placeReg.test(this.rows[index][name])){
+          this.disableBtn = true;
+          return;
+        }
+        this.disableBtn = false;
       },
       handlePlaceholder(type){          //占位符类型,type=0文本输入框,type=1数字输入框
         const i = this.focusOn;
@@ -207,6 +214,7 @@
         const maps = {0:'${input_输入}',1:'${number_输入}'};
         const key = this.focusName;
         this.rows[i][key] = this.rows[i][key]+maps[type];
+        this.disableBtn = true;
         //this.rows[i].description = this.rows[i].description+maps[type];
       },
       handleExclu(){
@@ -241,16 +249,13 @@
       },
       HandleInputName(i, name, isName) {
         const pureName=name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
-        //console.log(pureName);
+        const hasPlace = /(\$\{number_\S*?\})|(\$\{input_\S*?\})/g.test(name);
+        if(hasPlace&&this.disableBtn==false){
+          this.disableBtn = true;
+        }else if(!hasPlace&&this.disableBtn==true){
+          this.disableBtn = false;
+        }
         if(pureName.length > 30) {
-          /*if(isName){
-            Vue.set(this.rows[i], 'name', this.rows[i].name.slice(0, 30));
-            this.$refs.inputName[i].currentValue = this.rows[i].name;
-          }else{
-            Vue.set(this.rows[i], 'description', this.rows[i].description.slice(0, 30));
-            this.$refs.inputDesc[i].currentValue = this.rows[i].description;
-          }*/
-
           this.$message({
             message: '最多输入30个字',
             type: 'warning',