| | |
| | | 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, |
| | |
| | | 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(' '); |
| | |
| | | } else { |
| | | this.showResembleQuery = false; |
| | | } |
| | | // console.log(this.hasResemble, "this.hasResemblethis.hasResemble"); |
| | | this.$nextTick(() => { |
| | | this.$refs.FormTemplate.templateRender( |
| | | res.data.formDefineVO.items |
| | |
| | | that.showCodeApply = false; |
| | | } |
| | | } |
| | | // console.log(' this.secVOList',that.secVOList) |
| | | // console.log(' res.data.data.secVOList',res.data.data.secVOList) |
| | | }); |
| | | }, |
| | | getFormData(form) { |
| | |
| | | } else if (item.secType == "coderefersec") { |
| | | //引用码段 |
| | | params = JSON.parse(item.referValueInfo); |
| | | // console.log('item',item) |
| | | console.log('params',params) |
| | | } |
| | | return params; |
| | | }, |
| | |
| | | }, |
| | | // 参照组件数据变更 |
| | | referConfigDataUpdate(data) { |
| | | const { field } = data; |
| | | this.secVOList = this.secVOList.map((item) => { |
| | | if (item.parentClassifySecOid === field) { |
| | | this.$refs.CodeApply.form[item.oid] = undefined; |
| | | this.$refs.CodeApply.form[item.name] = undefined; |
| | | } |
| | | return item; |
| | | }); |
| | | this.$refs.CodeApply.templateRender(this.secVOList); |
| | | const {field} = data; |
| | | this.secVOList = this.secVOList.map((item) => { |
| | | if (item.parentClassifySecOid === field) { |
| | | this.$refs.CodeApply.form[item.oid] = undefined; |
| | | this.$refs.CodeApply.form[item.name] = undefined; |
| | | item.readOnly = false; |
| | | item.referConfig.extraParams.parentClassifyValueOid = data.value; |
| | | } |
| | | return item; |
| | | }); |
| | | this.$refs.CodeApply.templateRender(this.secVOList); |
| | | }, |
| | | isRequired(item) { |
| | | return item.nullableFlag != "true"; |
| | |
| | | </el-dialog> |
| | | |
| | | <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> |
| | | <!--<avue-input-table ref="referTable" :props="props" :column="column" :on-load="onLoad" v-model="value" :placeholder="title" ></avue-input-table> |
| | | --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | }else if(!validatenull(this.referConfig.options.tableConfig.limit)){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.limit |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | queryParams['referBo'] = this.options['referBo'] || this.options['referType']; |
| | | } |
| | | queryParams['referType'] = queryParams['referBo'] |
| | | if (this.options.remoteSort && this.options.initSort) { |
| | | if (this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//方法 |
| | | queryParams['sort'] = this.options.initSort.field;//字段 |
| | | } |
| | |
| | | text.push(itemText); |
| | | } |
| | | }) |
| | | let mapFields; |
| | | if (this.options.mapFields == "") { |
| | | mapFields = this.referConfig.fieldMap; |
| | | } else { |
| | | mapFields = Object.assign(this.referConfig.fieldMap, JSON.parse(this.options.mapFields)); |
| | | |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | } |
| | | }catch (e) { |
| | | |
| | | } |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | |
| | | </el-dialog> |
| | | |
| | | <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> |
| | | <!--<avue-input-table ref="referTable" :props="props" :column="column" :on-load="onLoad" v-model="value" :placeholder="title" ></avue-input-table> |
| | | --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | }else if(!validatenull(this.referConfig.options.tableConfig.limit)){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.limit |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.referCrud.doLayout() |
| | |
| | | queryParams['referBo'] = this.options['referBo'] || this.options['referType']; |
| | | } |
| | | queryParams['referType']= queryParams['referBo'] |
| | | if (this.options.remoteSort && this.options.initSort) { |
| | | if (this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//方法 |
| | | queryParams['sort'] = this.options.initSort.field;//字段 |
| | | } |
| | |
| | | text.push(itemText); |
| | | } |
| | | }) |
| | | let mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | } |
| | | }catch (e) { |
| | | |
| | | } |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields}); |
| | |
| | | <template> |
| | | <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> |
| | | <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :blur="valueChange" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | }, |
| | | treeUrl: this.referConfig.options.url || '/api/ubcs-code/mdmEngineController/defaultReferTree', |
| | | treeData: [], |
| | | selectionList: [], |
| | | checkedData:[], |
| | | currentNode:{}, |
| | | params: {}, |
| | | loadType: {'all': 'all', 'node': 'node'}, |
| | |
| | | }, |
| | | created() { |
| | | this.getParams(); |
| | | // console.log('referConfig:') |
| | | // console.log(this.referConfig) |
| | | }, |
| | | mounted() { |
| | | if(!this.lazy){ |
| | |
| | | queryParams['loadType'] = this.options.loadType; |
| | | queryParams['multipleSelect'] = this.isMuti; |
| | | queryParams['isMuti'] = queryParams['multipleSelect']; |
| | | if (this.options.remoteSort && this.options.initSort) { |
| | | if (this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//方法 |
| | | queryParams['sort'] = this.options.initSort.field;//字段 |
| | | } |
| | | if (this.options.rootParams) { |
| | | for (var key in this.options.rootParams) { |
| | | queryParams[key] = this.options.rootParams[key]; |
| | | } |
| | | } |
| | | if(this.options.sortField){ |
| | | queryParams['sort'] = this.options.sortField;//字段 |
| | | } |
| | | if(this.options.sortType){ |
| | | queryParams['order'] = this.options.sortType;//方法 |
| | | } |
| | | if (this.options.rootParams) { |
| | | for (var key in this.options.rootParams) { |
| | | queryParams[key] = this.options.rootParams[key]; |
| | | } |
| | | } |
| | | if (this.options.conditionParams) { |
| | | //说明是扩展属性 |
| | |
| | | queryParams['replaceMap["' + key + '"]'] = this.options.replaceParams[key];//新的方式 |
| | | } |
| | | } |
| | | queryParams['parentValue']='\\IN(SELECT oid from PL_CODE_CLASSIFY where id =\'hesuanfenlei\')' |
| | | this.params=queryParams; |
| | | |
| | | }, |
| | |
| | | } |
| | | }, |
| | | checked(checkedNode, checkedData) { |
| | | this.setValue(checkedData) |
| | | this.checkedData=checkedData |
| | | }, |
| | | valueChange(){ |
| | | if(this.isMuti){ |
| | | // this.setValue(this.checkedData) |
| | | } |
| | | }, |
| | | setValue:function (checkedData){ |
| | | var value = []; |
| | |
| | | } |
| | | text.push(tempRaw.join(textSep)); |
| | | } |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | } |
| | | }catch (e) { |
| | | |
| | | } |
| | | this.value = value.join(','); |
| | | this.text = text.join(',') |
| | | this.text = text.join(','); |
| | | this.$emit("setValue", { |
| | | field: this.referConfig.field, |
| | | showField: this.referConfig.showField, |
| | |
| | | text: this.text || '', |
| | | isTreeMuti:this.isMuti, |
| | | rawData: checkedData.checkedNodes, |
| | | fieldMap:this.referConfig.fieldMap |
| | | fieldMap:mapFields |
| | | }); |
| | | } |
| | | }, |