From ee68ec1a404b8df679a8cb76ab6eab59979c0b9d Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 05 十二月 2023 23:49:21 +0800 Subject: [PATCH] 赋默认值方法修改 --- Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue index bfd0254..d583d02 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue @@ -103,9 +103,14 @@ type: String, default: "", }, + selectRow:{ + type:Array, + default:[] + } }, data() { return { + selectValue:"", //骞翠唬鍙� dataYearCode: { type: "", @@ -206,6 +211,15 @@ handler(newV) { this.$emit("dataYearCode", newV) } + }, + selectRow:{ + handler(newval){ + console.log(newval); + let ids = newval.map(item => item.id); + this.selectValue= ids.join(","); + }, + deep:true, + immediate:true } }, methods: { @@ -317,9 +331,12 @@ valueFormat: formItem.dateFormate || "yyyy-MM-dd HH:mm:ss", format: formItem.dateFormate, keyAttr: formItem.keyAttr, - value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || + value:formItem.defaultValue || (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) || - (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null), + (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) || + (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null) || + //鐖剁粍浠跺鏋滄槸鍙傜収鏁版嵁浼氬皢selectRow缃┖,selectRow涓嶄负绌哄氨璇存槑涓嶆槸鍙傜収瑕佸洖濉簮鏍囧噯鍙锋暟鎹� + (this.status === "amend" ? (this.selectRow && (formItem.field === "oldcode" ? this.selectValue : null)) : null), placeholder: formItem.inputTip, comboxKey: formItem.comboxKey, tip: formItem.tooltips, @@ -427,7 +444,8 @@ keyAttr: formItem.keyAttr, value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) || - (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null), + (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) || + (this.status === "amend" && formItem.field === "codeStandardEditType" ? "2" : null), placeholder: formItem.inputTip, comboxKey: formItem.comboxKey, tip: formItem.tooltips, -- Gitblit v1.9.3