|
@@ -21,6 +21,8 @@
|
|
<el-input v-model="rows[i].name"
|
|
<el-input v-model="rows[i].name"
|
|
v-bind:class="{select:focusOn==i}"
|
|
v-bind:class="{select:focusOn==i}"
|
|
@focus="selectRow(i)"
|
|
@focus="selectRow(i)"
|
|
|
|
+ ref = "inputName"
|
|
|
|
+ @input="HandleInputName(i, rows[i].name)"
|
|
@blur="emitValues"></el-input>
|
|
@blur="emitValues"></el-input>
|
|
<el-tag type="info" size="mini" v-if="showTag(it)">{{showTag(it)}}</el-tag>
|
|
<el-tag type="info" size="mini" v-if="showTag(it)">{{showTag(it)}}</el-tag>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -81,6 +83,7 @@
|
|
</style>
|
|
</style>
|
|
<script>
|
|
<script>
|
|
import utils from '@api/utils.js';
|
|
import utils from '@api/utils.js';
|
|
|
|
+ import Vue from 'vue';
|
|
export default {
|
|
export default {
|
|
props:['type','options','ascription','sexType'],
|
|
props:['type','options','ascription','sexType'],
|
|
data(){
|
|
data(){
|
|
@@ -96,6 +99,12 @@
|
|
const arr = options.map((it)=>{
|
|
const arr = options.map((it)=>{
|
|
return {name:it.name,defaultSelect:it.defaultSelect=='1'?true:false,isBan:it.code==1?true:'',isNone:it.code==2?true:'',isError:it.abnormal==1?true:''};
|
|
return {name:it.name,defaultSelect:it.defaultSelect=='1'?true:false,isBan:it.code==1?true:'',isNone:it.code==2?true:'',isError:it.abnormal==1?true:''};
|
|
});
|
|
});
|
|
|
|
+ const arrLen = arr.length;
|
|
|
|
+ if(arrLen < 4) {
|
|
|
|
+ for (let i = 0; i < 4 - arrLen; i++) {
|
|
|
|
+ arr.push({name:'',defaultSelect:'',isBan:'',isNone:'',isError:''})
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.rows = arr;
|
|
this.rows = arr;
|
|
const items = utils.simpleOptionData(this.rows);
|
|
const items = utils.simpleOptionData(this.rows);
|
|
this.$emit('pushValues',items);
|
|
this.$emit('pushValues',items);
|
|
@@ -177,6 +186,18 @@
|
|
const items = utils.simpleOptionData(this.rows);
|
|
const items = utils.simpleOptionData(this.rows);
|
|
this.$emit('pushValues',items);
|
|
this.$emit('pushValues',items);
|
|
},
|
|
},
|
|
|
|
+ HandleInputName(i, name) {
|
|
|
|
+ if(name.length > 30) {
|
|
|
|
+ Vue.set(this.rows[i], 'name', this.rows[i].name.slice(0, 30))
|
|
|
|
+ this.$refs.inputName[i].currentValue = this.rows[i].namebvcx
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '最多输入30个字',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
delRow(){
|
|
delRow(){
|
|
if(this.focusOn==-1){
|
|
if(this.focusOn==-1){
|
|
this.$message({
|
|
this.$message({
|