| | |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | }, |
| | | computed: { |
| | | localTrendsSpan() { |
| | | if (this.trendsSpan) { |
| | |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | this.TreeValueForm=newval; |
| | | // console.log(this.TreeValueForm) |
| | | } |
| | | }, |
| | | deep:true, |
| | |
| | | if (this.eventList) { |
| | | this.eventFlag= this.eventList.some(item => { |
| | | if (item.classifyInvokeEditFlag === 'true') { |
| | | console.log('even', item); |
| | | this.eventObject = item; |
| | | return true; |
| | | } |
| | | }); |
| | | // console.log('add',add) |
| | | } |
| | | // 无需分组数据 |
| | | let column = []; |
| | | let group = []; |
| | | let dictKeys = []; |
| | | let slotColumnList = []; |
| | | let value='' |
| | | formItemList.forEach((formItem) => { |
| | | formItem = this.resetFormConfig(formItem); |
| | | console.log(formItem) |
| | | // console.log('formItem.dicData.value',formItem.dicData) |
| | | if (formItem.type === "line") { |
| | | group.push({ |
| | | label: formItem.text, |
| | |
| | | referConfig: |
| | | formItem.type == "refer" |
| | | ? { |
| | | title: formItem.text, |
| | | showField: formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | fieldMap:formItem.fieldMap || {fieldMapKey:'id'}, |
| | | placeholder: formItem.inputTip, |
| | | options: formItem.referConfig |
| | | } |
| | | title: formItem.text, |
| | | showField: formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | fieldMap:formItem.fieldMap || {fieldMapKey:'id'}, |
| | | placeholder: formItem.inputTip, |
| | | options: formItem.referConfig |
| | | } |
| | | : {}, |
| | | span: formItem.span |
| | | ? formItem.span |
| | | : formItem.type === "textarea" |
| | | ? 24 |
| | | : this.localTrendsSpan, |
| | | ? 24 |
| | | : this.localTrendsSpan, |
| | | rules: [ |
| | | { |
| | | required: formItem.required, |
| | |
| | | value: "key", |
| | | }, |
| | | }; |
| | | // console.log('columnItem',columnItem) |
| | | slotColumnList.push(columnItem); |
| | | // console.log('slotColumnList',slotColumnList) |
| | | if (group.length === 0) { |
| | | column.push(columnItem); |
| | | } else { |
| | |
| | | }, |
| | | // 使用传入的表单数据配置 |
| | | resetFormConfig(formItem) { |
| | | // console.log(this.selfColumnConfig) |
| | | for (const configType in this.selfColumnConfig) { |
| | | if (Object.hasOwnProperty.call(this.selfColumnConfig, configType)) { |
| | | const element = this.selfColumnConfig[configType]; |
| | |
| | | if (Object.hasOwnProperty.call(element, newAttr)) { |
| | | const oldAttr = element[newAttr]; |
| | | formItem[newAttr] = formItem[oldAttr]; |
| | | // console.log(formItem) |
| | | // console.log(newAttr,oldAttr) |
| | | // console.log(formItem[newAttr],formItem[oldAttr]) |
| | | } |
| | | } |
| | | } else if (configType === "directVoluation") { |
| | |
| | | ); |
| | | }, |
| | | setReferValue(data) { |
| | | // console.log(data) |
| | | debugger; |
| | | if (data.field) { |
| | | this.form[data.field] = data.value || ""; |
| | | this.form[data.showField] = data.text || ""; |
| | |
| | | if (!_item.attributes) { |
| | | _item.attributes = _item; |
| | | } |
| | | if (!_item.attributes.data) { |
| | | _item.attributes.data = {}; |
| | | } |
| | | if (mapFields.length == 1) { |
| | | var mapField = mapFields[0]; |
| | | if (mapField.indexOf("attribute.") > -1) { |
| | | temp = _item['attributes'][mapField.subString("attribute.".length)]; |
| | | temp = _item['attributes'][mapField.subString("attribute.".length)] || _item['attributes']['data'][mapField.subString("attribute.".length)]; |
| | | } else { |
| | | temp = _item['attributes'][mapField] || _item[mapField]; |
| | | temp = _item['attributes'][mapField] ||_item['attributes']['data'][mapField] || _item[mapField]; |
| | | } |
| | | } else { |
| | | //有多个 |
| | | var mutiTemp = []; |
| | | layui.each(mapFields, function (_indexField, _itemField) { |
| | | if (_itemField.indexOf("attribute.") > -1) { |
| | | mutiTemp.push(_item['attributes'][_itemField.subString("attribute.".length)]); |
| | | mutiTemp.push(_item['attributes'][_itemField.subString("attribute.".length)] || _item['attributes']['data'][_itemField.subString("attribute.".length)]); |
| | | } else { |
| | | mutiTemp.push(_item['attributes'][_itemField] || _item[_itemField]); |
| | | mutiTemp.push(_item['attributes'][_itemField] || _item['attributes']['data'][_itemField] || _item[_itemField]); |
| | | } |
| | | }); |
| | | temp = mutiTemp.join(' '); |