|
@@ -3,10 +3,10 @@
|
|
<el-form>
|
|
<el-form>
|
|
<div class="operation-row">
|
|
<div class="operation-row">
|
|
<el-checkbox-group size="small">
|
|
<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>
|
|
<el-checkbox-group size="small">
|
|
<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>
|
|
<el-checkbox-group size="small" v-if="type==2">
|
|
<el-checkbox-group size="small" v-if="type==2">
|
|
<el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
|
|
<el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
|
|
@@ -148,6 +148,7 @@
|
|
rows:[...initRows],
|
|
rows:[...initRows],
|
|
focusOn:-1, //聚焦的行index
|
|
focusOn:-1, //聚焦的行index
|
|
focusName:'name', //是否聚焦医生界面输入框
|
|
focusName:'name', //是否聚焦医生界面输入框
|
|
|
|
+ disableBtn:false, //占位符是否禁用
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
@@ -194,6 +195,12 @@
|
|
selectRow(index,name){
|
|
selectRow(index,name){
|
|
this.focusOn = index;
|
|
this.focusOn = index;
|
|
this.focusName = name;
|
|
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数字输入框
|
|
handlePlaceholder(type){ //占位符类型,type=0文本输入框,type=1数字输入框
|
|
const i = this.focusOn;
|
|
const i = this.focusOn;
|
|
@@ -208,6 +215,7 @@
|
|
const maps = {0:'${input_输入}',1:'${number_输入}'};
|
|
const maps = {0:'${input_输入}',1:'${number_输入}'};
|
|
const key = this.focusName;
|
|
const key = this.focusName;
|
|
this.rows[i][key] = this.rows[i][key]+maps[type];
|
|
this.rows[i][key] = this.rows[i][key]+maps[type];
|
|
|
|
+ this.disableBtn = true;
|
|
//this.rows[i].description = this.rows[i].description+maps[type];
|
|
//this.rows[i].description = this.rows[i].description+maps[type];
|
|
},
|
|
},
|
|
handleExclu(){
|
|
handleExclu(){
|
|
@@ -242,16 +250,13 @@
|
|
},
|
|
},
|
|
HandleInputName(i, name, isName) {
|
|
HandleInputName(i, name, isName) {
|
|
const pureName=name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
|
|
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(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({
|
|
this.$message({
|
|
message: '最多输入30个字',
|
|
message: '最多输入30个字',
|
|
type: 'warning',
|
|
type: 'warning',
|