|
@@ -156,15 +156,11 @@
|
|
|
const arr = options.filter((it)=>{
|
|
|
return it.name;
|
|
|
});
|
|
|
- /*const arrLen = arr.length;
|
|
|
- if(arrLen < 4) {
|
|
|
- for (let i = 0; i < 4 - arrLen; i++) {
|
|
|
- arr.push(Object.assign({},initRow,{orderNo:arr.length}));
|
|
|
- }
|
|
|
- }*/
|
|
|
this.rows = arr;
|
|
|
const items = utils.simpleOptionData(this.rows);
|
|
|
this.$emit('pushValues',items);
|
|
|
+ }else{
|
|
|
+ this.initData();
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -178,23 +174,20 @@
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- ascription(newVal, preVal) {
|
|
|
- if (newVal != preVal) {
|
|
|
- this.rows = [...utils.getInitRow(initRow,4)];
|
|
|
- }
|
|
|
- },
|
|
|
- type(newVal, preVal) {
|
|
|
- if (newVal != preVal) {
|
|
|
- this.rows = [...utils.getInitRow(initRow,4)];
|
|
|
- }
|
|
|
+ /*ascription(newVal, preVal) { //永远检测不到,因为归属修改时类型被清空,本组件被销毁
|
|
|
+ this.rows = [...utils.getInitRow(initRow,4)];
|
|
|
+ },*/
|
|
|
+ type() {
|
|
|
+ this.initData();
|
|
|
},
|
|
|
- sexType(newVal, preVal) {
|
|
|
- if (newVal != preVal) {
|
|
|
- this.rows = [...utils.getInitRow(initRow,4)];
|
|
|
- }
|
|
|
+ sexType() {
|
|
|
+ this.initData();
|
|
|
},
|
|
|
},
|
|
|
methods:{
|
|
|
+ initData(){
|
|
|
+ this.rows = [...utils.getInitRow(initRow,4)];
|
|
|
+ },
|
|
|
addRow(){
|
|
|
this.rows.push(Object.assign({},initRow,{orderNo:this.rows.length}));
|
|
|
},
|
|
@@ -248,7 +241,9 @@
|
|
|
this.$emit('pushValues',items);
|
|
|
},
|
|
|
HandleInputName(i, name, isName) {
|
|
|
- if(name.length > 30) {
|
|
|
+ const pureName=name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
|
|
|
+ //console.log(pureName);
|
|
|
+ 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;
|