From d5804ee4200da0144bdcc5aae4a082e622e56c59 Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Wed, 5 Jan 2022 13:41:27 +0800 Subject: [PATCH] fix: revert antdv version --- package.json | 2 +- src/components/core/dynamic-table/props.ts | 5 +- src/views/demos/tables/wzry-table/index.vue | 51 ++++++++++++++------- yarn.lock | 8 ++-- 4 files changed, 42 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index f896159fb..02a181d6b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@vueuse/core": "^7.5.1", - "ant-design-vue": "3.0.0-beta.5", + "ant-design-vue": "3.0.0-beta.4", "axios": "^0.24.0", "core-js": "^3.20.2", "dayjs": "^1.10.7", diff --git a/src/components/core/dynamic-table/props.ts b/src/components/core/dynamic-table/props.ts index 2c4074f52..955055f3c 100644 --- a/src/components/core/dynamic-table/props.ts +++ b/src/components/core/dynamic-table/props.ts @@ -60,7 +60,6 @@ export const props = { /** 导出的文件名 */ exportFileName: { type: String as PropType, - default: '导出数据', }, /** xlsx的booktype */ exportBookType: { @@ -74,7 +73,9 @@ export const props = { }, /** 自定义数据导出格式函数 */ exportFormatter: { - type: Function, + type: Function as PropType< + (columns: TableColumn[], tableData: any[]) => { header: Recordable; data: any[] } + >, default: null, }, }; diff --git a/src/views/demos/tables/wzry-table/index.vue b/src/views/demos/tables/wzry-table/index.vue index 7206bba90..794061438 100644 --- a/src/views/demos/tables/wzry-table/index.vue +++ b/src/views/demos/tables/wzry-table/index.vue @@ -65,23 +65,23 @@ // 展开搜索表单时更新英雄皮肤选项值 const toggleAdvanced = (e) => { if (e) { - dynamicTableRef.value?.getQueryFormRef().updateSchema([ - { - field: 'skin_name', - componentProps: { - options: [ - { - label: '皮肤1', - value: 'aa', - }, - { - label: '皮肤2', - value: 'bb', - }, - ], - }, - }, - ]); + // dynamicTableRef.value?.getQueryFormRef().updateSchema([ + // { + // field: 'skin_name', + // componentProps: { + // options: [ + // { + // label: '皮肤1', + // value: 'aa', + // }, + // { + // label: '皮肤2', + // value: 'bb', + // }, + // ], + // }, + // }, + // ]); } }; @@ -89,6 +89,23 @@ const { data } = await getWzryHeroList(params); tableData = data.list; + dynamicTableRef.value?.getQueryFormRef().updateSchema([ + { + field: 'skin_name', + componentProps: { + options: [ + { + label: '皮肤1', + value: 'aa', + }, + { + label: '皮肤2', + value: 'bb', + }, + ], + }, + }, + ]); return data; }; diff --git a/yarn.lock b/yarn.lock index fc31193a3..3f18ec216 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2412,10 +2412,10 @@ ansi-styles@^6.0.0: resolved "https://registry.nlark.com/ansi-styles/download/ansi-styles-6.1.0.tgz#87313c102b8118abd57371afab34618bf7350ed3" integrity sha1-hzE8ECuBGKvVc3GvqzRhi/c1DtM= -ant-design-vue@3.0.0-beta.5: - version "3.0.0-beta.5" - resolved "https://registry.npmmirror.com/ant-design-vue/download/ant-design-vue-3.0.0-beta.5.tgz#9994ecedc7ad29600d85e73a754199d948869bb1" - integrity sha512-yX+JGkPlzXav56hHCg0aa1LAB9GQEEQ8Xfy0o7tc49zFH2v0Q8ekiWVXsvsiracLZgl7GcLm5HnEPp9tAy0BZQ== +ant-design-vue@3.0.0-beta.4: + version "3.0.0-beta.4" + resolved "https://registry.npmmirror.com/ant-design-vue/download/ant-design-vue-3.0.0-beta.4.tgz#e6f7861682875d77220d02ffe561b2b2022cd15b" + integrity sha512-WUkA8LyXw35vi1OOHTzvtcet0lEhNGCQNF85zEOHpPlA1Xf8KWCricFeiA38fgg2AHWvE1mrVw/wqB1kXBJM1Q== dependencies: "@ant-design/colors" "^6.0.0" "@ant-design/icons-vue" "^6.0.0"