From 50e9d8274f0b89b92f7716802da00112ebef72b5 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 16 Jan 2023 15:20:49 +0800 Subject: [PATCH 1/6] fix: types error --- yudao-ui-admin-vue3/package.json | 2 +- .../src/components/Descriptions/src/Descriptions.vue | 2 +- yudao-ui-admin-vue3/src/views/Home/echarts-data.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 088fd8adc..81cdf7ae9 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -1,6 +1,6 @@ { "name": "yudao-ui-admin-vue3", - "version": "1.6.6-snapshot.1912", + "version": "1.6.6-snapshot.1921", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, diff --git a/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue b/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue index ac395de47..a14fca3d1 100644 --- a/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue +++ b/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue @@ -25,7 +25,7 @@ const props = defineProps({ default: () => [] }, data: { - type: Object as PropType, + type: Object as PropType, default: () => ({}) } }) diff --git a/yudao-ui-admin-vue3/src/views/Home/echarts-data.ts b/yudao-ui-admin-vue3/src/views/Home/echarts-data.ts index 38694ac82..00a195eb8 100644 --- a/yudao-ui-admin-vue3/src/views/Home/echarts-data.ts +++ b/yudao-ui-admin-vue3/src/views/Home/echarts-data.ts @@ -1,6 +1,5 @@ import { EChartsOption } from 'echarts' import { useI18n } from '@/hooks/web/useI18n' -import { EChartsOption as EChartsWordOption } from 'echarts-wordcloud' const { t } = useI18n() @@ -185,7 +184,7 @@ export const radarOption: EChartsOption = { ] } -export const wordOptions: EChartsWordOption = { +export const wordOptions = { series: [ { type: 'wordCloud', From 5311f57977e1f6b65fa6c76600d143e9964b1510 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 16 Jan 2023 16:46:49 +0800 Subject: [PATCH 2/6] fix: xTable isList --- yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue b/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue index 72d83d6fe..a3941e01b 100644 --- a/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue +++ b/yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue @@ -120,7 +120,7 @@ const getColumnsConfig = (options: XTableProps) => { const getProxyConfig = (options: XTableProps) => { const { getListApi, proxyConfig, data, isList } = options if (proxyConfig || data) return - if (getListApi && isFunction(getListApi) && !isList) { + if (getListApi && isFunction(getListApi)) { if (!isList) { options.proxyConfig = { seq: true, // 启用动态序号代理(分页之后索引自动计算为当前页的起始序号) @@ -194,7 +194,8 @@ const getProxyConfig = (options: XTableProps) => { // 分页 const getPageConfig = (options: XTableProps) => { - const { pagination, pagerConfig, treeConfig } = options + const { pagination, pagerConfig, treeConfig, isList } = options + if (isList) return if (treeConfig) { options.treeConfig = options.treeConfig return From 5450534a80076e8ae8a7242b645e2ce41ab55841 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 16 Jan 2023 16:53:13 +0800 Subject: [PATCH 3/6] fix: uploadFile filelist --- .../src/components/UploadFile/src/UploadFile.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue b/yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue index ac97a7e30..4706cac93 100644 --- a/yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue +++ b/yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue @@ -99,6 +99,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { // 文件上传成功 const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { message.success('上传成功') + const fileListNew = fileList.value + fileListNew.pop() + fileList.value = fileListNew uploadList.value.push({ name: res.data, url: res.data }) if (uploadList.value.length == uploadNumber.value) { fileList.value = fileList.value.concat(uploadList.value) From cccf8d8197a675b10fab0442f56b9456eb9dd98c Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 16 Jan 2023 17:00:48 +0800 Subject: [PATCH 4/6] fix: loginOut api --- yudao-ui-admin-vue3/src/api/login/index.ts | 2 +- .../src/layout/components/UserInfo/src/UserInfo.vue | 2 +- yudao-ui-admin-vue3/src/store/modules/user.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/yudao-ui-admin-vue3/src/api/login/index.ts b/yudao-ui-admin-vue3/src/api/login/index.ts index 6ff93e428..0c895663d 100644 --- a/yudao-ui-admin-vue3/src/api/login/index.ts +++ b/yudao-ui-admin-vue3/src/api/login/index.ts @@ -33,7 +33,7 @@ export const getTenantIdByNameApi = (name: string) => { // 登出 export const loginOutApi = () => { - return request.delete({ url: '/system/auth/logout' }) + return request.post({ url: '/system/auth/logout' }) } // 获取用户权限信息 diff --git a/yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue b/yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue index cdce9ddf5..2259d693f 100644 --- a/yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue +++ b/yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue @@ -35,7 +35,7 @@ const loginOut = () => { type: 'warning' }) .then(async () => { - userStore.loginOut() + await userStore.loginOut() tagsViewStore.delAllViews() replace('/login?redirect=/index') }) diff --git a/yudao-ui-admin-vue3/src/store/modules/user.ts b/yudao-ui-admin-vue3/src/store/modules/user.ts index 2621e2dff..16ff39023 100644 --- a/yudao-ui-admin-vue3/src/store/modules/user.ts +++ b/yudao-ui-admin-vue3/src/store/modules/user.ts @@ -2,7 +2,7 @@ import { store } from '../index' import { defineStore } from 'pinia' import { getAccessToken, removeToken } from '@/utils/auth' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -import { getInfoApi } from '@/api/login' +import { getInfoApi, loginOutApi } from '@/api/login' const { wsCache } = useCache() @@ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', { this.isSetUser = true wsCache.set(CACHE_KEY.USER, userInfo) }, - loginOut() { + async loginOut() { + await loginOutApi() removeToken() wsCache.clear() this.resetState() From 6e49b19952f00694729736153bc97f52c0ff2582 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 16 Jan 2023 17:54:20 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=E5=AD=97=E5=85=B8=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=20=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/DictTag/src/DictTag.vue | 21 ++++------------- yudao-ui-admin-vue3/src/store/modules/dict.ts | 23 +++++++++++++++++++ yudao-ui-admin-vue3/src/utils/dict.ts | 2 +- .../src/views/system/dict/dict.data.ts | 11 +++++---- .../src/views/system/dict/dict.type.ts | 7 +++--- 5 files changed, 39 insertions(+), 25 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue index 321107695..fb166019d 100644 --- a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue +++ b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue @@ -17,6 +17,9 @@ const getDictObj = (dictType: string, value: string) => { const dictOptions = getDictOptions(dictType) dictOptions.forEach((dict: DictDataType) => { if (dict.value === value) { + if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') { + dict.colorType = '' + } dictData.value = dict } }) @@ -31,25 +34,11 @@ onUpdated(() => { })