Commit 18c644580251fdeecc7d7ed23a9e9a5d762f69e3
Merge branch 'dev' into feature/springdoc
Showing
13 changed files
with
85 additions
and
64 deletions
yudao-ui-admin-vue3/package.json
| 1 | { | 1 | { |
| 2 | "name": "yudao-ui-admin-vue3", | 2 | "name": "yudao-ui-admin-vue3", |
| 3 | - "version": "1.6.6-snapshot.1912", | 3 | + "version": "1.6.6-snapshot.1921", |
| 4 | "description": "基于vue3、vite4、element-plus、typesScript", | 4 | "description": "基于vue3、vite4、element-plus、typesScript", |
| 5 | "author": "xingyu", | 5 | "author": "xingyu", |
| 6 | "private": false, | 6 | "private": false, |
yudao-ui-admin-vue3/src/api/login/index.ts
| @@ -33,7 +33,7 @@ export const getTenantIdByNameApi = (name: string) => { | @@ -33,7 +33,7 @@ export const getTenantIdByNameApi = (name: string) => { | ||
| 33 | 33 | ||
| 34 | // 登出 | 34 | // 登出 |
| 35 | export const loginOutApi = () => { | 35 | export const loginOutApi = () => { |
| 36 | - return request.delete({ url: '/system/auth/logout' }) | 36 | + return request.post({ url: '/system/auth/logout' }) |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | // 获取用户权限信息 | 39 | // 获取用户权限信息 |
yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue
| @@ -25,7 +25,7 @@ const props = defineProps({ | @@ -25,7 +25,7 @@ const props = defineProps({ | ||
| 25 | default: () => [] | 25 | default: () => [] |
| 26 | }, | 26 | }, |
| 27 | data: { | 27 | data: { |
| 28 | - type: Object as PropType<Recordable>, | 28 | + type: Object as PropType<any>, |
| 29 | default: () => ({}) | 29 | default: () => ({}) |
| 30 | } | 30 | } |
| 31 | }) | 31 | }) |
yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
| @@ -17,6 +17,9 @@ const getDictObj = (dictType: string, value: string) => { | @@ -17,6 +17,9 @@ const getDictObj = (dictType: string, value: string) => { | ||
| 17 | const dictOptions = getDictOptions(dictType) | 17 | const dictOptions = getDictOptions(dictType) |
| 18 | dictOptions.forEach((dict: DictDataType) => { | 18 | dictOptions.forEach((dict: DictDataType) => { |
| 19 | if (dict.value === value) { | 19 | if (dict.value === value) { |
| 20 | + if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') { | ||
| 21 | + dict.colorType = '' | ||
| 22 | + } | ||
| 20 | dictData.value = dict | 23 | dictData.value = dict |
| 21 | } | 24 | } |
| 22 | }) | 25 | }) |
| @@ -31,25 +34,11 @@ onUpdated(() => { | @@ -31,25 +34,11 @@ onUpdated(() => { | ||
| 31 | }) | 34 | }) |
| 32 | </script> | 35 | </script> |
| 33 | <template> | 36 | <template> |
| 34 | - <!-- 默认样式 --> | ||
| 35 | - <span | ||
| 36 | - v-if=" | ||
| 37 | - dictData?.colorType === 'default' || | ||
| 38 | - dictData?.colorType === '' || | ||
| 39 | - dictData?.colorType === undefined | ||
| 40 | - " | ||
| 41 | - :key="dictData?.value.toString()" | ||
| 42 | - :class="dictData?.cssClass" | ||
| 43 | - > | ||
| 44 | - {{ dictData?.label }} | ||
| 45 | - </span> | ||
| 46 | - <!-- Tag 样式 --> | ||
| 47 | <ElTag | 37 | <ElTag |
| 48 | - v-else | ||
| 49 | :disable-transitions="true" | 38 | :disable-transitions="true" |
| 50 | :key="dictData?.value + ''" | 39 | :key="dictData?.value + ''" |
| 51 | - :type="dictData?.colorType === 'primary' ? 'success' : dictData?.colorType" | ||
| 52 | - :class="dictData?.cssClass" | 40 | + :type="dictData?.colorType" |
| 41 | + :color="dictData?.cssClass" | ||
| 53 | > | 42 | > |
| 54 | {{ dictData?.label }} | 43 | {{ dictData?.label }} |
| 55 | </ElTag> | 44 | </ElTag> |
yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue
| @@ -99,6 +99,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { | @@ -99,6 +99,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { | ||
| 99 | // 文件上传成功 | 99 | // 文件上传成功 |
| 100 | const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { | 100 | const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { |
| 101 | message.success('上传成功') | 101 | message.success('上传成功') |
| 102 | + const fileListNew = fileList.value | ||
| 103 | + fileListNew.pop() | ||
| 104 | + fileList.value = fileListNew | ||
| 102 | uploadList.value.push({ name: res.data, url: res.data }) | 105 | uploadList.value.push({ name: res.data, url: res.data }) |
| 103 | if (uploadList.value.length == uploadNumber.value) { | 106 | if (uploadList.value.length == uploadNumber.value) { |
| 104 | fileList.value = fileList.value.concat(uploadList.value) | 107 | fileList.value = fileList.value.concat(uploadList.value) |
yudao-ui-admin-vue3/src/components/XTable/src/XTable.vue
| @@ -120,7 +120,7 @@ const getColumnsConfig = (options: XTableProps) => { | @@ -120,7 +120,7 @@ const getColumnsConfig = (options: XTableProps) => { | ||
| 120 | const getProxyConfig = (options: XTableProps) => { | 120 | const getProxyConfig = (options: XTableProps) => { |
| 121 | const { getListApi, proxyConfig, data, isList } = options | 121 | const { getListApi, proxyConfig, data, isList } = options |
| 122 | if (proxyConfig || data) return | 122 | if (proxyConfig || data) return |
| 123 | - if (getListApi && isFunction(getListApi) && !isList) { | 123 | + if (getListApi && isFunction(getListApi)) { |
| 124 | if (!isList) { | 124 | if (!isList) { |
| 125 | options.proxyConfig = { | 125 | options.proxyConfig = { |
| 126 | seq: true, // 启用动态序号代理(分页之后索引自动计算为当前页的起始序号) | 126 | seq: true, // 启用动态序号代理(分页之后索引自动计算为当前页的起始序号) |
| @@ -194,7 +194,8 @@ const getProxyConfig = (options: XTableProps) => { | @@ -194,7 +194,8 @@ const getProxyConfig = (options: XTableProps) => { | ||
| 194 | 194 | ||
| 195 | // 分页 | 195 | // 分页 |
| 196 | const getPageConfig = (options: XTableProps) => { | 196 | const getPageConfig = (options: XTableProps) => { |
| 197 | - const { pagination, pagerConfig, treeConfig } = options | 197 | + const { pagination, pagerConfig, treeConfig, isList } = options |
| 198 | + if (isList) return | ||
| 198 | if (treeConfig) { | 199 | if (treeConfig) { |
| 199 | options.treeConfig = options.treeConfig | 200 | options.treeConfig = options.treeConfig |
| 200 | return | 201 | return |
yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue
| @@ -35,7 +35,7 @@ const loginOut = () => { | @@ -35,7 +35,7 @@ const loginOut = () => { | ||
| 35 | type: 'warning' | 35 | type: 'warning' |
| 36 | }) | 36 | }) |
| 37 | .then(async () => { | 37 | .then(async () => { |
| 38 | - userStore.loginOut() | 38 | + await userStore.loginOut() |
| 39 | tagsViewStore.delAllViews() | 39 | tagsViewStore.delAllViews() |
| 40 | replace('/login?redirect=/index') | 40 | replace('/login?redirect=/index') |
| 41 | }) | 41 | }) |
yudao-ui-admin-vue3/src/store/modules/dict.ts
| @@ -65,6 +65,29 @@ export const useDictStore = defineStore('dict', { | @@ -65,6 +65,29 @@ export const useDictStore = defineStore('dict', { | ||
| 65 | this.isSetDict = true | 65 | this.isSetDict = true |
| 66 | wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 | 66 | wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 |
| 67 | } | 67 | } |
| 68 | + }, | ||
| 69 | + async resetDict() { | ||
| 70 | + wsCache.delete(CACHE_KEY.DICT_CACHE) | ||
| 71 | + const res = await listSimpleDictDataApi() | ||
| 72 | + // 设置数据 | ||
| 73 | + const dictDataMap = new Map<string, any>() | ||
| 74 | + res.forEach((dictData: DictDataVO) => { | ||
| 75 | + // 获得 dictType 层级 | ||
| 76 | + const enumValueObj = dictDataMap[dictData.dictType] | ||
| 77 | + if (!enumValueObj) { | ||
| 78 | + dictDataMap[dictData.dictType] = [] | ||
| 79 | + } | ||
| 80 | + // 处理 dictValue 层级 | ||
| 81 | + dictDataMap[dictData.dictType].push({ | ||
| 82 | + value: dictData.value, | ||
| 83 | + label: dictData.label, | ||
| 84 | + colorType: dictData.colorType, | ||
| 85 | + cssClass: dictData.cssClass | ||
| 86 | + }) | ||
| 87 | + }) | ||
| 88 | + this.dictMap = dictDataMap | ||
| 89 | + this.isSetDict = true | ||
| 90 | + wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 | ||
| 68 | } | 91 | } |
| 69 | } | 92 | } |
| 70 | }) | 93 | }) |
yudao-ui-admin-vue3/src/store/modules/user.ts
| @@ -2,7 +2,7 @@ import { store } from '../index' | @@ -2,7 +2,7 @@ import { store } from '../index' | ||
| 2 | import { defineStore } from 'pinia' | 2 | import { defineStore } from 'pinia' |
| 3 | import { getAccessToken, removeToken } from '@/utils/auth' | 3 | import { getAccessToken, removeToken } from '@/utils/auth' |
| 4 | import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | 4 | import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
| 5 | -import { getInfoApi } from '@/api/login' | 5 | +import { getInfoApi, loginOutApi } from '@/api/login' |
| 6 | 6 | ||
| 7 | const { wsCache } = useCache() | 7 | const { wsCache } = useCache() |
| 8 | 8 | ||
| @@ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', { | @@ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', { | ||
| 59 | this.isSetUser = true | 59 | this.isSetUser = true |
| 60 | wsCache.set(CACHE_KEY.USER, userInfo) | 60 | wsCache.set(CACHE_KEY.USER, userInfo) |
| 61 | }, | 61 | }, |
| 62 | - loginOut() { | 62 | + async loginOut() { |
| 63 | + await loginOutApi() | ||
| 63 | removeToken() | 64 | removeToken() |
| 64 | wsCache.clear() | 65 | wsCache.clear() |
| 65 | this.resetState() | 66 | this.resetState() |
yudao-ui-admin-vue3/src/utils/dict.ts
| @@ -16,7 +16,7 @@ export interface DictDataType { | @@ -16,7 +16,7 @@ export interface DictDataType { | ||
| 16 | dictType: string | 16 | dictType: string |
| 17 | label: string | 17 | label: string |
| 18 | value: string | number | boolean | 18 | value: string | number | boolean |
| 19 | - colorType: ElementPlusInfoType | '' | 'default' | 'primary' | 19 | + colorType: ElementPlusInfoType | '' |
| 20 | cssClass: string | 20 | cssClass: string |
| 21 | } | 21 | } |
| 22 | 22 |
yudao-ui-admin-vue3/src/views/Home/echarts-data.ts
| 1 | import { EChartsOption } from 'echarts' | 1 | import { EChartsOption } from 'echarts' |
| 2 | import { useI18n } from '@/hooks/web/useI18n' | 2 | import { useI18n } from '@/hooks/web/useI18n' |
| 3 | -import { EChartsOption as EChartsWordOption } from 'echarts-wordcloud' | ||
| 4 | 3 | ||
| 5 | const { t } = useI18n() | 4 | const { t } = useI18n() |
| 6 | 5 | ||
| @@ -185,7 +184,7 @@ export const radarOption: EChartsOption = { | @@ -185,7 +184,7 @@ export const radarOption: EChartsOption = { | ||
| 185 | ] | 184 | ] |
| 186 | } | 185 | } |
| 187 | 186 | ||
| 188 | -export const wordOptions: EChartsWordOption = { | 187 | +export const wordOptions = { |
| 189 | series: [ | 188 | series: [ |
| 190 | { | 189 | { |
| 191 | type: 'wordCloud', | 190 | type: 'wordCloud', |
yudao-ui-admin-vue3/src/views/system/dict/dict.data.ts
| @@ -7,7 +7,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' | @@ -7,7 +7,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' | ||
| 7 | const { t } = useI18n() | 7 | const { t } = useI18n() |
| 8 | // 表单校验 | 8 | // 表单校验 |
| 9 | export const dictDataRules = reactive({ | 9 | export const dictDataRules = reactive({ |
| 10 | - title: [required], | 10 | + label: [required], |
| 11 | value: [required], | 11 | value: [required], |
| 12 | sort: [required] | 12 | sort: [required] |
| 13 | }) | 13 | }) |
| @@ -34,42 +34,48 @@ export const crudSchemas = reactive<VxeCrudSchema>({ | @@ -34,42 +34,48 @@ export const crudSchemas = reactive<VxeCrudSchema>({ | ||
| 34 | title: '数据键值', | 34 | title: '数据键值', |
| 35 | field: 'value' | 35 | field: 'value' |
| 36 | }, | 36 | }, |
| 37 | + // { | ||
| 38 | + // title: '标签类型', | ||
| 39 | + // field: 'colorType', | ||
| 40 | + // form: { | ||
| 41 | + // component: 'Select', | ||
| 42 | + // componentProps: { | ||
| 43 | + // options: [ | ||
| 44 | + // { | ||
| 45 | + // label: 'default', | ||
| 46 | + // value: '' | ||
| 47 | + // }, | ||
| 48 | + // { | ||
| 49 | + // label: 'success', | ||
| 50 | + // value: 'success' | ||
| 51 | + // }, | ||
| 52 | + // { | ||
| 53 | + // label: 'info', | ||
| 54 | + // value: 'info' | ||
| 55 | + // }, | ||
| 56 | + // { | ||
| 57 | + // label: 'warning', | ||
| 58 | + // value: 'warning' | ||
| 59 | + // }, | ||
| 60 | + // { | ||
| 61 | + // label: 'danger', | ||
| 62 | + // value: 'danger' | ||
| 63 | + // } | ||
| 64 | + // ] | ||
| 65 | + // } | ||
| 66 | + // }, | ||
| 67 | + // isTable: false | ||
| 68 | + // }, | ||
| 37 | { | 69 | { |
| 38 | - title: '颜色类型', | ||
| 39 | - field: 'colorType', | 70 | + title: '颜色', |
| 71 | + field: 'cssClass', | ||
| 72 | + isTable: false, | ||
| 40 | form: { | 73 | form: { |
| 41 | - component: 'Select', | 74 | + component: 'ColorPicker', |
| 42 | componentProps: { | 75 | componentProps: { |
| 43 | - options: [ | ||
| 44 | - { | ||
| 45 | - label: 'default', | ||
| 46 | - value: '' | ||
| 47 | - }, | ||
| 48 | - { | ||
| 49 | - label: 'success', | ||
| 50 | - value: 'success' | ||
| 51 | - }, | ||
| 52 | - { | ||
| 53 | - label: 'info', | ||
| 54 | - value: 'info' | ||
| 55 | - }, | ||
| 56 | - { | ||
| 57 | - label: 'warning', | ||
| 58 | - value: 'warning' | ||
| 59 | - }, | ||
| 60 | - { | ||
| 61 | - label: 'danger', | ||
| 62 | - value: 'danger' | ||
| 63 | - } | ||
| 64 | - ] | 76 | + predefine: ['#ffffff', '#409eff', '#67c23a', '#e6a23c', '#f56c6c', '#909399', '#c71585'] |
| 65 | } | 77 | } |
| 66 | - }, | ||
| 67 | - isTable: false | ||
| 68 | - }, | ||
| 69 | - { | ||
| 70 | - title: 'CSS Class', | ||
| 71 | - field: 'cssClass', | ||
| 72 | - isTable: false | 78 | + } |
| 73 | }, | 79 | }, |
| 74 | { | 80 | { |
| 75 | title: '显示排序', | 81 | title: '显示排序', |
yudao-ui-admin-vue3/src/views/system/dict/dict.type.ts
| @@ -7,7 +7,8 @@ const { t } = useI18n() // 国际化 | @@ -7,7 +7,8 @@ const { t } = useI18n() // 国际化 | ||
| 7 | 7 | ||
| 8 | // 表单校验 | 8 | // 表单校验 |
| 9 | export const dictTypeRules = reactive({ | 9 | export const dictTypeRules = reactive({ |
| 10 | - name: [required] | 10 | + name: [required], |
| 11 | + type: [required] | ||
| 11 | }) | 12 | }) |
| 12 | // 新增 + 修改 | 13 | // 新增 + 修改 |
| 13 | const crudSchemas = reactive<VxeCrudSchema>({ | 14 | const crudSchemas = reactive<VxeCrudSchema>({ |
| @@ -41,9 +42,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ | @@ -41,9 +42,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ | ||
| 41 | field: 'createTime', | 42 | field: 'createTime', |
| 42 | formatter: 'formatDate', | 43 | formatter: 'formatDate', |
| 43 | isForm: false, | 44 | isForm: false, |
| 44 | - table: { | ||
| 45 | - width: 150 | ||
| 46 | - }, | 45 | + isTable: false, |
| 47 | search: { | 46 | search: { |
| 48 | show: true, | 47 | show: true, |
| 49 | itemRender: { | 48 | itemRender: { |