From 4a2835ddadb796c69f180097b95f971dbab4687d Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 13 九月 2023 09:09:14 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/mixins/codeApply.js | 380 +++++++++++++++++++++++++++--------------------------- 1 files changed, 190 insertions(+), 190 deletions(-) diff --git a/Source/UBCS-WEB/src/mixins/codeApply.js b/Source/UBCS-WEB/src/mixins/codeApply.js index ffe002e..4416eab 100644 --- a/Source/UBCS-WEB/src/mixins/codeApply.js +++ b/Source/UBCS-WEB/src/mixins/codeApply.js @@ -1,190 +1,190 @@ -import { getCodeRule } from "@/api/formTemplate.js"; -export default { - data() { - return { - secVOList: [], - localSecVOList: [], - showCodeApply: false, - selfColumnType: { - codefixedsec: "combox", - codeclassifysec: "refer", - codevariablesec: "text", - coderefersec: "refer", - }, - selfColumnConfig: { - function: { - required: this.isRequired, - dicData: this.getOptionList, - type: this.getType, - referConfig: this.getReferConfig, - readOnly: this.getDisabled, - }, - exchange: { - text: "name", - field: "oid", - prop: "oid", - showField: "name", - parentClassifySecOid: "parentClassifySecOid", - label: "name", - maxlength: "codeSecLength", - data: "fixedValueVOList", - }, - directVoluation: { - search: true, - span: 12, - props: { - label: "id", - value: "id", - }, - }, - }, - codeApplyForm: {}, - } - }, - created() { - if (this.type === 'batchImportApply') { - this.getCodeRule() - } - }, - methods: { - // 鑾峰彇鐮佸�肩敵璇锋暟鎹� - getCodeRule() { - getCodeRule({ codeClassifyOid: this.localCodeClassifyOid || this.codeClassifyOid }).then((res) => { - if (res.data && res.data.code === 200) { - const typeList = [ - "codefixedsec", - "codeclassifysec", - "codevariablesec", - "coderefersec", - ]; - this.secVOList = res.data.data.secVOList || [] - this.localSecVOList = (res.data.data.secVOList || []).filter((item) => - typeList.includes(item.secType) - ); - if (this.localSecVOList.length > 0) { - this.showCodeApply = true - this.$nextTick(() => { - if (this.batchApplyCodeTableData) { - this.batchApplyCodeTableData[this.codeRuleOid]["localSecVOList"] = this.localSecVOList - } - this.$refs.CodeApply.templateRender(this.localSecVOList); - }); - } else { - this.showCodeApply = false - } - - } - }); - }, - getCodeApplyFormData(codeApplyForm) { - this.codeApplyForm = codeApplyForm; - if (this.batchApplyCodeTableData) { - this.batchApplyCodeTableData[this.codeRuleOid]["codeApply"] = codeApplyForm - } - }, - getType(item) { - console.log(item.secType, 'item.secType'); - return this.selfColumnType[item.secType]; - }, - getReferConfig(item) { - let params = {}; - if (item.secType == "codeclassifysec") { - params = { - isMuti: false, - type: "grid", - tableConfig: { - limit: -1, - cols: [ - { - field: "id", - title: "鑻辨枃鍚嶇О", - sort: true, - width: 150, - }, - { - field: "name", - title: "涓枃鍚嶇О", - sort: true, - width: 150, - }, - { - field: "description", - title: "鎻忚堪", - width: 250, - }, - ], - queryColumns: [ - { - field: "id", - title: "鑻辨枃鍚嶇О", - }, - { - field: "name", - title: "涓枃鍚嶇О", - }, - ], - }, - url: "api/ubcs-code/ubcs-code/mdmEngineController/listCodeClassifyValueBySecOid", - extraParams: { - classifySecOid: item.oid, - parentClassifyValueOid: item.parentClassifySecOid - ? this.codeApplyForm[item.parentClassifySecOid] - : "", - }, - }; - } else if (item.secType == "coderefersec") { - params = JSON.parse(item.referValueInfo); - } - return params; - }, - getDisabled(item) { - if (item.secType === "codeclassifysec") { - if (item.parentClassifySecOid) { - if (!this.codeApplyForm[item.parentClassifySecOid]) { - return true; - } else { - return false; - } - } - } - }, - isRequired(item) { - return item.nullableFlag != "true"; - }, - getOptionList(item) { - if ( - Array.isArray(item.fixedValueVOList) && - item.fixedValueVOList.length > 0 - ) { - const configAttr = { - key: "id", - value: "id", - }; - const optionList = item.fixedValueVOList.map((item) => { - for (const key in configAttr) { - if (Object.hasOwnProperty.call(configAttr, key)) { - const element = configAttr[key]; - item[key] = item[element]; - } - } - return item; - }); - return optionList; - } else { - return []; - } - }, - // 鍙傜収缁勪欢鏁版嵁鍙樻洿 - referConfigDataUpdate(data) { - const { field } = data; - this.localSecVOList = this.localSecVOList.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.localSecVOList); - }, - } -} \ No newline at end of file +import { getCodeRule } from "@/api/formTemplate.js"; +export default { + data() { + return { + secVOList: [], + localSecVOList: [], + showCodeApply: false, + selfColumnType: { + codefixedsec: "combox", + codeclassifysec: "refer", + codevariablesec: "text", + coderefersec: "refer", + }, + selfColumnConfig: { + function: { + required: this.isRequired, + dicData: this.getOptionList, + type: this.getType, + referConfig: this.getReferConfig, + readOnly: this.getDisabled, + }, + exchange: { + text: "name", + field: "oid", + prop: "oid", + showField: "name", + parentClassifySecOid: "parentClassifySecOid", + label: "name", + maxlength: "codeSecLength", + data: "fixedValueVOList", + }, + directVoluation: { + search: true, + span: 12, + props: { + label: "id", + value: "id", + }, + }, + }, + codeApplyForm: {}, + } + }, + created() { + if (this.type === 'batchImportApply') { + this.getCodeRule() + } + }, + methods: { + // 鑾峰彇鐮佸�肩敵璇锋暟鎹� + getCodeRule() { + getCodeRule({ codeClassifyOid: this.localCodeClassifyOid || this.codeClassifyOid }).then((res) => { + if (res.data && res.data.code === 200) { + const typeList = [ + "codefixedsec", + "codeclassifysec", + "codevariablesec", + "coderefersec", + ]; + this.secVOList = res.data.data.secVOList || [] + this.localSecVOList = (res.data.data.secVOList || []).filter((item) => + typeList.includes(item.secType) + ); + if (this.localSecVOList.length > 0) { + this.showCodeApply = true + this.$nextTick(() => { + if (this.batchApplyCodeTableData) { + this.batchApplyCodeTableData[this.codeRuleOid]["localSecVOList"] = this.localSecVOList + } + this.$refs.CodeApply.templateRender(this.localSecVOList); + }); + } else { + this.showCodeApply = false + } + + } + }); + }, + getCodeApplyFormData(codeApplyForm) { + this.codeApplyForm = codeApplyForm; + if (this.batchApplyCodeTableData) { + this.batchApplyCodeTableData[this.codeRuleOid]["codeApply"] = codeApplyForm + } + }, + getType(item) { + console.log(item.secType, 'item.secType'); + return this.selfColumnType[item.secType]; + }, + getReferConfig(item) { + let params = {}; + if (item.secType == "codeclassifysec") { + params = { + isMuti: false, + type: "grid", + tableConfig: { + limit: -1, + cols: [ + { + field: "id", + title: "鑻辨枃鍚嶇О", + sort: true, + width: 150, + }, + { + field: "name", + title: "涓枃鍚嶇О", + sort: true, + width: 150, + }, + { + field: "description", + title: "鎻忚堪", + width: 250, + }, + ], + queryColumns: [ + { + field: "id", + title: "鑻辨枃鍚嶇О", + }, + { + field: "name", + title: "涓枃鍚嶇О", + }, + ], + }, + url: "api/ubcs-code/ubcs-code/mdmEngineController/listCodeClassifyValueBySecOid", + extraParams: { + classifySecOid: item.oid, + parentClassifyValueOid: item.parentClassifySecOid + ? this.codeApplyForm[item.parentClassifySecOid] + : "", + }, + }; + } else if (item.secType == "coderefersec") { + params = JSON.parse(item.referValueInfo); + } + return params; + }, + getDisabled(item) { + if (item.secType === "codeclassifysec") { + if (item.parentClassifySecOid) { + if (!this.codeApplyForm[item.parentClassifySecOid]) { + return true; + } else { + return false; + } + } + } + }, + isRequired(item) { + return item.nullableFlag != "true"; + }, + getOptionList(item) { + if ( + Array.isArray(item.fixedValueVOList) && + item.fixedValueVOList.length > 0 + ) { + const configAttr = { + key: "id", + value: "id", + }; + const optionList = item.fixedValueVOList.map((item) => { + for (const key in configAttr) { + if (Object.hasOwnProperty.call(configAttr, key)) { + const element = configAttr[key]; + item[key] = item[element]; + } + } + return item; + }); + return optionList; + } else { + return []; + } + }, + // 鍙傜収缁勪欢鏁版嵁鍙樻洿 + referConfigDataUpdate(data) { + const { field } = data; + this.localSecVOList = this.localSecVOList.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.localSecVOList); + }, + } +} -- Gitblit v1.9.3