| | |
| | | v-loading="loading" |
| | | ref="form" |
| | | :style="{ minHeight: loading ? '300px' : '' }" |
| | | :key="updateIndex" |
| | | > |
| | | <template :slot="item.prop + 'Label'" v-for="item in slotColumnList"> |
| | | <span> |
| | |
| | | :referConfig="item.referConfig || {}" |
| | | :value="form[item.referConfig.field] || item.value" |
| | | :text="form[item.referConfig.showField]" |
| | | :disabled="item.disabled" |
| | | :display="item.display" |
| | | @setReferValue="setReferValue" |
| | | ></vciWebRefer> |
| | | </template> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | formIndex: 0, |
| | | updateIndex: 0, |
| | | form: {}, |
| | | option: { |
| | | emptyBtn: false, |
| | |
| | | collapse: true, |
| | | column: [], |
| | | }); |
| | | return; |
| | | } |
| | | if ( |
| | | formItem.type === "combox" && |
| | |
| | | display: !formItem.hidden, |
| | | maxlength: formItem.maxlength, |
| | | filterable: true, |
| | | referConfig:formItem.type=='refer'?{ |
| | | title:formItem.text , |
| | | showField:formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | placeholder: formItem.inputTip, |
| | | options:formItem.referConfig |
| | | }:{}, |
| | | referConfig: |
| | | formItem.type == "refer" |
| | | ? { |
| | | title: formItem.text, |
| | | showField: formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | placeholder: formItem.inputTip, |
| | | options: formItem.referConfig, |
| | | } |
| | | : {}, |
| | | span: formItem.type === "textarea" ? 24 : this.trendsSpan, |
| | | rules: [ |
| | | { |
| | |
| | | this.slotColumnList = slotColumnList; |
| | | this.$set(this.option, "column", column); |
| | | this.$set(this.option, "group", group); |
| | | this.formIndex++; |
| | | if (this.type === 'add') { |
| | | this.updateIndex++; |
| | | if (this.type === "add") { |
| | | this.loading = false; |
| | | } |
| | | this.geDictData(dictKeys); |
| | |
| | | handleResize() { |
| | | let windowWidth = document.body.clientWidth; |
| | | this.trendsSpan = 24 / Math.floor(windowWidth / 500); |
| | | this.formIndex++; |
| | | this.updateIndex++; |
| | | }, |
| | | // 前后缀 |
| | | preOrSufFixShow(type, val) { |
| | |
| | | }, |
| | | // 获取表单详情数据 |
| | | getFormDetail() { |
| | | if (this.type === 'add') return |
| | | if (this.type === "add") return; |
| | | getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }).then( |
| | | (res) => { |
| | | this.form = Object.assign(this.form, res.data.data[0]) |
| | | this.form = Object.assign(this.form, res.data.data[0]); |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | setReferValue(data){ |
| | | if(data.field){ |
| | | this.form[data.field]=data.value || ''; |
| | | this.form[data.showField]=data.text || ''; |
| | | setReferValue(data) { |
| | | if (data.field) { |
| | | this.form[data.field] = data.value || ""; |
| | | this.form[data.showField] = data.text || ""; |
| | | this.$emit("getFormData", this.form); |
| | | this.$emit("referConfigDataUpdate", data); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | watch: { |
| | | // 表单数据修改反馈到父组件 |