| | |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | sourceData: { |
| | | sourceData:{ |
| | | //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据 |
| | | type: Object, |
| | | type:Object, |
| | | default: {} |
| | | }, |
| | | dataStore:{ |
| | | //弹窗时按钮所属区域选中数据 |
| | | type:Array, |
| | | default: [] |
| | | }, |
| | | paramVOS: { |
| | | type: Object, |
| | | default: {} |
| | | }, |
| | | isShow: { |
| | | //所在区域是否已显示,针对tab和collapse |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | }, |
| | | data() { |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // console.log('componentVO--',this.componentVO.tableDefineVO.cols[0]) |
| | | }, |
| | | computed: { |
| | | option() { |
| | |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | height: 300, |
| | | column: this.formColumn(this.componentVO.tableDefineVO.cols[0]) |
| | | column: this.getColumnData(0) |
| | | } |
| | | }, |
| | | slotData() { |
| | | return this.formColumn(this.componentVO.tableDefineVO.cols[0]) |
| | | return this.getColumnData(0) |
| | | } |
| | | }, |
| | | watch:{ |
| | | sourceData:{ |
| | | handler(newval) { |
| | | console.log(this.areasName); |
| | | console.log(newval); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | //转化数据 |
| | | formColumn(formList) { |
| | | return formList.map(item => { |
| | | const typeValue = item.type === 'text' ? 'input' : item.type === 'combox' ? 'select' : item.type; |
| | | return formList.map(item => { |
| | | const typeValue = item.type === 'text' ? 'input' : item.type === 'combox' ? 'select' : item.type; |
| | | |
| | | return { |
| | | label: item.text, |
| | | prop: item.field, |
| | | type: typeValue, |
| | | value: item.defaultValue, |
| | | dicData: item.type === 'combox' ? item.dicData : item.dicUrl, |
| | | readonly: item.readOnly, |
| | | disabled: item.disabled, |
| | | labelSuffix: item.suffix, |
| | | suffixIcon: item.prefix, |
| | | placeholder: item.placeholder, |
| | | clearable: item.clearable, |
| | | tip: item.tooltips, |
| | | keyAttr: item.keyAttr, |
| | | rules: [{ |
| | | required: item.required, |
| | | message: `请输入${item.text}!`, |
| | | trigger: "blur" |
| | | }] |
| | | } |
| | | }) |
| | | return { |
| | | label: item.text, |
| | | prop: item.field, |
| | | type: typeValue, |
| | | value: item.defaultValue, |
| | | dicData: item.type === 'combox' ? item.dicData : item.dicUrl, |
| | | readonly: item.readOnly, |
| | | disabled: item.disabled, |
| | | labelSuffix: item.suffix, |
| | | suffixIcon: item.prefix, |
| | | placeholder: item.placeholder, |
| | | clearable: item.clearable, |
| | | tip: item.tooltips, |
| | | keyAttr: item.keyAttr, |
| | | rules: [{ |
| | | required: item.required, |
| | | message: `请输入${item.text}!`, |
| | | trigger: "blur" |
| | | }] |
| | | }; |
| | | }); |
| | | }, |
| | | |
| | | //数据判空 |
| | | getColumnData(index) { |
| | | if (this.componentVO && this.componentVO.tableDefineVO && this.componentVO.tableDefineVO.cols && this.componentVO.tableDefineVO.cols.length > 0) { |
| | | return this.formColumn(this.componentVO.tableDefineVO.cols[index]) |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | |
| | | buttonClick(item) { |
| | | console.log(item.id) |
| | | }, |