Commit 18c644580251fdeecc7d7ed23a9e9a5d762f69e3
Merge branch 'dev' into feature/springdoc
Showing
13 changed files
with
85 additions
and
64 deletions
yudao-ui-admin-vue3/package.json
yudao-ui-admin-vue3/src/api/login/index.ts
yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue
yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
| ... | ... | @@ -17,6 +17,9 @@ const getDictObj = (dictType: string, value: string) => { |
| 17 | 17 | const dictOptions = getDictOptions(dictType) |
| 18 | 18 | dictOptions.forEach((dict: DictDataType) => { |
| 19 | 19 | if (dict.value === value) { |
| 20 | + if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') { | |
| 21 | + dict.colorType = '' | |
| 22 | + } | |
| 20 | 23 | dictData.value = dict |
| 21 | 24 | } |
| 22 | 25 | }) |
| ... | ... | @@ -31,25 +34,11 @@ onUpdated(() => { |
| 31 | 34 | }) |
| 32 | 35 | </script> |
| 33 | 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 | 37 | <ElTag |
| 48 | - v-else | |
| 49 | 38 | :disable-transitions="true" |
| 50 | 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 | 43 | {{ dictData?.label }} |
| 55 | 44 | </ElTag> | ... | ... |
yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue
| ... | ... | @@ -99,6 +99,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { |
| 99 | 99 | // 文件上传成功 |
| 100 | 100 | const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { |
| 101 | 101 | message.success('上传成功') |
| 102 | + const fileListNew = fileList.value | |
| 103 | + fileListNew.pop() | |
| 104 | + fileList.value = fileListNew | |
| 102 | 105 | uploadList.value.push({ name: res.data, url: res.data }) |
| 103 | 106 | if (uploadList.value.length == uploadNumber.value) { |
| 104 | 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 | 120 | const getProxyConfig = (options: XTableProps) => { |
| 121 | 121 | const { getListApi, proxyConfig, data, isList } = options |
| 122 | 122 | if (proxyConfig || data) return |
| 123 | - if (getListApi && isFunction(getListApi) && !isList) { | |
| 123 | + if (getListApi && isFunction(getListApi)) { | |
| 124 | 124 | if (!isList) { |
| 125 | 125 | options.proxyConfig = { |
| 126 | 126 | seq: true, // 启用动态序号代理(分页之后索引自动计算为当前页的起始序号) |
| ... | ... | @@ -194,7 +194,8 @@ const getProxyConfig = (options: XTableProps) => { |
| 194 | 194 | |
| 195 | 195 | // 分页 |
| 196 | 196 | const getPageConfig = (options: XTableProps) => { |
| 197 | - const { pagination, pagerConfig, treeConfig } = options | |
| 197 | + const { pagination, pagerConfig, treeConfig, isList } = options | |
| 198 | + if (isList) return | |
| 198 | 199 | if (treeConfig) { |
| 199 | 200 | options.treeConfig = options.treeConfig |
| 200 | 201 | return | ... | ... |
yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue
yudao-ui-admin-vue3/src/store/modules/dict.ts
| ... | ... | @@ -65,6 +65,29 @@ export const useDictStore = defineStore('dict', { |
| 65 | 65 | this.isSetDict = true |
| 66 | 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 | 2 | import { defineStore } from 'pinia' |
| 3 | 3 | import { getAccessToken, removeToken } from '@/utils/auth' |
| 4 | 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 | 7 | const { wsCache } = useCache() |
| 8 | 8 | |
| ... | ... | @@ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', { |
| 59 | 59 | this.isSetUser = true |
| 60 | 60 | wsCache.set(CACHE_KEY.USER, userInfo) |
| 61 | 61 | }, |
| 62 | - loginOut() { | |
| 62 | + async loginOut() { | |
| 63 | + await loginOutApi() | |
| 63 | 64 | removeToken() |
| 64 | 65 | wsCache.clear() |
| 65 | 66 | this.resetState() | ... | ... |
yudao-ui-admin-vue3/src/utils/dict.ts
yudao-ui-admin-vue3/src/views/Home/echarts-data.ts
| 1 | 1 | import { EChartsOption } from 'echarts' |
| 2 | 2 | import { useI18n } from '@/hooks/web/useI18n' |
| 3 | -import { EChartsOption as EChartsWordOption } from 'echarts-wordcloud' | |
| 4 | 3 | |
| 5 | 4 | const { t } = useI18n() |
| 6 | 5 | |
| ... | ... | @@ -185,7 +184,7 @@ export const radarOption: EChartsOption = { |
| 185 | 184 | ] |
| 186 | 185 | } |
| 187 | 186 | |
| 188 | -export const wordOptions: EChartsWordOption = { | |
| 187 | +export const wordOptions = { | |
| 189 | 188 | series: [ |
| 190 | 189 | { |
| 191 | 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 | const { t } = useI18n() |
| 8 | 8 | // 表单校验 |
| 9 | 9 | export const dictDataRules = reactive({ |
| 10 | - title: [required], | |
| 10 | + label: [required], | |
| 11 | 11 | value: [required], |
| 12 | 12 | sort: [required] |
| 13 | 13 | }) |
| ... | ... | @@ -34,42 +34,48 @@ export const crudSchemas = reactive<VxeCrudSchema>({ |
| 34 | 34 | title: '数据键值', |
| 35 | 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 | 73 | form: { |
| 41 | - component: 'Select', | |
| 74 | + component: 'ColorPicker', | |
| 42 | 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 | 81 | title: '显示排序', | ... | ... |
yudao-ui-admin-vue3/src/views/system/dict/dict.type.ts
| ... | ... | @@ -7,7 +7,8 @@ const { t } = useI18n() // 国际化 |
| 7 | 7 | |
| 8 | 8 | // 表单校验 |
| 9 | 9 | export const dictTypeRules = reactive({ |
| 10 | - name: [required] | |
| 10 | + name: [required], | |
| 11 | + type: [required] | |
| 11 | 12 | }) |
| 12 | 13 | // 新增 + 修改 |
| 13 | 14 | const crudSchemas = reactive<VxeCrudSchema>({ |
| ... | ... | @@ -41,9 +42,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 41 | 42 | field: 'createTime', |
| 42 | 43 | formatter: 'formatDate', |
| 43 | 44 | isForm: false, |
| 44 | - table: { | |
| 45 | - width: 150 | |
| 46 | - }, | |
| 45 | + isTable: false, | |
| 47 | 46 | search: { |
| 48 | 47 | show: true, |
| 49 | 48 | itemRender: { | ... | ... |