|
@@ -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}));
|
|
|
},
|