From 3b3fd904b9b34e77445d749bca8c28beadcaf3db Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期三, 27 十一月 2024 14:35:50 +0800 Subject: [PATCH] 查询模板查询条件显示 --- Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue | 50 ++++++++++++++++++++++++-------------------------- 1 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue index 7d15766..3a28de4 100644 --- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue +++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue @@ -1,6 +1,6 @@ <template> <!--鍔ㄦ�佹ā鏉�--> - <avue-form ref="form" :option="option" v-model="form"> + <avue-form ref="form" :option="option" v-model="form" v-loading="loading"> <template v-for="item in allColumn" :slot="item.prop+ ''"> <vciWebRefer v-if="item.type === 'refer'" @@ -83,6 +83,7 @@ }, data() { return { + loading:false, form: this.formData, option: { menuBtn:false, @@ -98,10 +99,6 @@ text: "input", combox: "select", truefalse: "switch", - number: "number", - textarea: "textarea", - datetime: "datetime", - date: "date", refer: "refer", multiFile:"upload", richText:'richText' @@ -186,26 +183,27 @@ initItem(item){ const type=this.columnType[item.type] || item.type; item.text=item.text || item.label; - const col= { + let col= { + ...item, label: item.text, - prop: item.field, - showProp:item.showField, + prop: item.prop || item.field, + showProp:item.showProp || item.showField, type: type, - labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90), - disabled: item.readOnly || this.disabled, + labelWidth:item.labelWidth || this.labelWidth || (item.text.length >= 6 ? 115 : 90), + disabled: item.disabled || this.disabled, + readonly:item.readonly || item.readOnly, span: item.span ? item.span : item.type === "textarea" ? 24 : this.span, - value: item.defaultValue, - display: !item.hidden, - labelSuffix: item.suffix, - suffixIcon: item.prefix, - tip: item.tooltips, - dictCode: item.comboxKey, - valueFormat: item.dateFormate || "yyyy-MM-dd HH:mm:ss", - format: item.dateFormate, + value: item.value || item.defaultValue, + display: item.display || !item.hidden, + labelSuffix: item.labelSuffix || item.suffix, + tip: item.tip || item.tooltips, + dictCode: item.dictCode || item.comboxKey, + valueFormat: item.valueFormat ||item.dateFormate , + format: item.format || item.dateFormate, rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{ required: item.required || false, message: `璇烽�夋嫨${item.text}!`, @@ -223,7 +221,7 @@ message: `璇疯緭鍏�${item.text}!`, trigger: "submit" }]):[], - ...item + }; if(!this.isEdit){ col.placeholder=col.label; @@ -238,20 +236,20 @@ col.display=false } } - if (col.type === "select") { - if(col.data && col.data.length>0){ + if (col.type === "select" || col.type==='radio' || col.type==='checkbox') { + if (col.data && col.data.length > 0) { col.dicData = col.data.map((d) => { return { label: d.key, key: d.value, value: d.value, - attributes:d.attributes + attributes: d.attributes }; }); - }else if(!validatenull(col.dictCode)) { + } else if (!validatenull(col.dictCode)) { getDicts(col.dictCode).then((res) => { - if (res.data.success){ - if(res.data.data && res.data.obj == null){ + if (res.data.success) { + if (res.data.data && res.data.obj == null) { res.data.obj = res.data.data } const dic = res.data.obj; @@ -260,7 +258,7 @@ label: d.value, key: d.key, value: d.key, - attributes:d.attributes + attributes: d.attributes }; }); } -- Gitblit v1.9.3