From 5ee48a22e1c661a73a48efe2b631877f3184f1c7 Mon Sep 17 00:00:00 2001 From: "X.Mo" Date: Wed, 10 Apr 2024 14:04:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=87=8D=E8=BD=BD=E5=AD=97=E5=85=B8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ma-form/js/columnService.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/ma-form/js/columnService.js b/src/components/ma-form/js/columnService.js index f2c62ae7..b385d4f3 100644 --- a/src/components/ma-form/js/columnService.js +++ b/src/components/ma-form/js/columnService.js @@ -34,8 +34,10 @@ const objectService = function (item) { * @param dictData * @constructor */ -const dictService = function (dataIndex, dictData) { - this.dict = dictData +const dictService = function (dataIndex, dictData, dicts, columns) { + this.columns = columns + this.dicts = dicts + this.dictData = dictData this.dataIndex = dataIndex /** @@ -43,7 +45,7 @@ const dictService = function (dataIndex, dictData) { * @returns {*} */ this.getRawDictData = () => { - return this.dict + return this.dictData } /** * 追加 @@ -62,8 +64,9 @@ const dictService = function (dataIndex, dictData) { * @param dictConfig * @returns {Promise} */ - this.loadDict = (dictConfig) => { - return loadDict(dictList, { formType: "select", dict: dictConfig, dataIndex: this.dataIndex }) + this.loadDict = async (dictConfig) => { + this.columns.setAttr('dict', dictConfig) + await loadDict(this.dicts, { formType: "select", dict: dictConfig, dataIndex: this.dataIndex }) } } @@ -101,7 +104,7 @@ class ColumnService { }) for (const [dataIndex, dictData] of Object.entries(this.dicts)) { - this.dictMap.set(dataIndex, new dictService(dataIndex, dictData)) + this.dictMap.set(dataIndex, new dictService(dataIndex, dictData, this.dicts, this.columnMap.get(dataIndex))) } }