mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 18:49:06 +08:00 
			
		
		
		
	Merge branch 'dev' into feature/springdoc
This commit is contained in:
		| @ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "yudao-ui-admin-vue3", |   "name": "yudao-ui-admin-vue3", | ||||||
|   "version": "1.6.6-snapshot.1912", |   "version": "1.6.6-snapshot.1921", | ||||||
|   "description": "基于vue3、vite4、element-plus、typesScript", |   "description": "基于vue3、vite4、element-plus、typesScript", | ||||||
|   "author": "xingyu", |   "author": "xingyu", | ||||||
|   "private": false, |   "private": false, | ||||||
|  | |||||||
| @ -33,7 +33,7 @@ export const getTenantIdByNameApi = (name: string) => { | |||||||
|  |  | ||||||
| // 登出 | // 登出 | ||||||
| export const loginOutApi = () => { | export const loginOutApi = () => { | ||||||
|   return request.delete({ url: '/system/auth/logout' }) |   return request.post({ url: '/system/auth/logout' }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获取用户权限信息 | // 获取用户权限信息 | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ const props = defineProps({ | |||||||
|     default: () => [] |     default: () => [] | ||||||
|   }, |   }, | ||||||
|   data: { |   data: { | ||||||
|     type: Object as PropType<Recordable>, |     type: Object as PropType<any>, | ||||||
|     default: () => ({}) |     default: () => ({}) | ||||||
|   } |   } | ||||||
| }) | }) | ||||||
|  | |||||||
| @ -17,6 +17,9 @@ const getDictObj = (dictType: string, value: string) => { | |||||||
|   const dictOptions = getDictOptions(dictType) |   const dictOptions = getDictOptions(dictType) | ||||||
|   dictOptions.forEach((dict: DictDataType) => { |   dictOptions.forEach((dict: DictDataType) => { | ||||||
|     if (dict.value === value) { |     if (dict.value === value) { | ||||||
|  |       if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') { | ||||||
|  |         dict.colorType = '' | ||||||
|  |       } | ||||||
|       dictData.value = dict |       dictData.value = dict | ||||||
|     } |     } | ||||||
|   }) |   }) | ||||||
| @ -31,25 +34,11 @@ onUpdated(() => { | |||||||
| }) | }) | ||||||
| </script> | </script> | ||||||
| <template> | <template> | ||||||
|   <!-- 默认样式 --> |  | ||||||
|   <span |  | ||||||
|     v-if=" |  | ||||||
|       dictData?.colorType === 'default' || |  | ||||||
|       dictData?.colorType === '' || |  | ||||||
|       dictData?.colorType === undefined |  | ||||||
|     " |  | ||||||
|     :key="dictData?.value.toString()" |  | ||||||
|     :class="dictData?.cssClass" |  | ||||||
|   > |  | ||||||
|     {{ dictData?.label }} |  | ||||||
|   </span> |  | ||||||
|   <!-- Tag 样式 --> |  | ||||||
|   <ElTag |   <ElTag | ||||||
|     v-else |  | ||||||
|     :disable-transitions="true" |     :disable-transitions="true" | ||||||
|     :key="dictData?.value + ''" |     :key="dictData?.value + ''" | ||||||
|     :type="dictData?.colorType === 'primary' ? 'success' : dictData?.colorType" |     :type="dictData?.colorType" | ||||||
|     :class="dictData?.cssClass" |     :color="dictData?.cssClass" | ||||||
|   > |   > | ||||||
|     {{ dictData?.label }} |     {{ dictData?.label }} | ||||||
|   </ElTag> |   </ElTag> | ||||||
|  | |||||||
| @ -99,6 +99,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { | |||||||
| // 文件上传成功 | // 文件上传成功 | ||||||
| const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { | const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { | ||||||
|   message.success('上传成功') |   message.success('上传成功') | ||||||
|  |   const fileListNew = fileList.value | ||||||
|  |   fileListNew.pop() | ||||||
|  |   fileList.value = fileListNew | ||||||
|   uploadList.value.push({ name: res.data, url: res.data }) |   uploadList.value.push({ name: res.data, url: res.data }) | ||||||
|   if (uploadList.value.length == uploadNumber.value) { |   if (uploadList.value.length == uploadNumber.value) { | ||||||
|     fileList.value = fileList.value.concat(uploadList.value) |     fileList.value = fileList.value.concat(uploadList.value) | ||||||
|  | |||||||
| @ -120,7 +120,7 @@ const getColumnsConfig = (options: XTableProps) => { | |||||||
| const getProxyConfig = (options: XTableProps) => { | const getProxyConfig = (options: XTableProps) => { | ||||||
|   const { getListApi, proxyConfig, data, isList } = options |   const { getListApi, proxyConfig, data, isList } = options | ||||||
|   if (proxyConfig || data) return |   if (proxyConfig || data) return | ||||||
|   if (getListApi && isFunction(getListApi) && !isList) { |   if (getListApi && isFunction(getListApi)) { | ||||||
|     if (!isList) { |     if (!isList) { | ||||||
|       options.proxyConfig = { |       options.proxyConfig = { | ||||||
|         seq: true, // 启用动态序号代理(分页之后索引自动计算为当前页的起始序号) |         seq: true, // 启用动态序号代理(分页之后索引自动计算为当前页的起始序号) | ||||||
| @ -194,7 +194,8 @@ const getProxyConfig = (options: XTableProps) => { | |||||||
|  |  | ||||||
| // 分页 | // 分页 | ||||||
| const getPageConfig = (options: XTableProps) => { | const getPageConfig = (options: XTableProps) => { | ||||||
|   const { pagination, pagerConfig, treeConfig } = options |   const { pagination, pagerConfig, treeConfig, isList } = options | ||||||
|  |   if (isList) return | ||||||
|   if (treeConfig) { |   if (treeConfig) { | ||||||
|     options.treeConfig = options.treeConfig |     options.treeConfig = options.treeConfig | ||||||
|     return |     return | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ const loginOut = () => { | |||||||
|     type: 'warning' |     type: 'warning' | ||||||
|   }) |   }) | ||||||
|     .then(async () => { |     .then(async () => { | ||||||
|       userStore.loginOut() |       await userStore.loginOut() | ||||||
|       tagsViewStore.delAllViews() |       tagsViewStore.delAllViews() | ||||||
|       replace('/login?redirect=/index') |       replace('/login?redirect=/index') | ||||||
|     }) |     }) | ||||||
|  | |||||||
| @ -65,6 +65,29 @@ export const useDictStore = defineStore('dict', { | |||||||
|         this.isSetDict = true |         this.isSetDict = true | ||||||
|         wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 |         wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 | ||||||
|       } |       } | ||||||
|  |     }, | ||||||
|  |     async resetDict() { | ||||||
|  |       wsCache.delete(CACHE_KEY.DICT_CACHE) | ||||||
|  |       const res = await listSimpleDictDataApi() | ||||||
|  |       // 设置数据 | ||||||
|  |       const dictDataMap = new Map<string, any>() | ||||||
|  |       res.forEach((dictData: DictDataVO) => { | ||||||
|  |         // 获得 dictType 层级 | ||||||
|  |         const enumValueObj = dictDataMap[dictData.dictType] | ||||||
|  |         if (!enumValueObj) { | ||||||
|  |           dictDataMap[dictData.dictType] = [] | ||||||
|  |         } | ||||||
|  |         // 处理 dictValue 层级 | ||||||
|  |         dictDataMap[dictData.dictType].push({ | ||||||
|  |           value: dictData.value, | ||||||
|  |           label: dictData.label, | ||||||
|  |           colorType: dictData.colorType, | ||||||
|  |           cssClass: dictData.cssClass | ||||||
|  |         }) | ||||||
|  |       }) | ||||||
|  |       this.dictMap = dictDataMap | ||||||
|  |       this.isSetDict = true | ||||||
|  |       wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期 | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| }) | }) | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ import { store } from '../index' | |||||||
| import { defineStore } from 'pinia' | import { defineStore } from 'pinia' | ||||||
| import { getAccessToken, removeToken } from '@/utils/auth' | import { getAccessToken, removeToken } from '@/utils/auth' | ||||||
| import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | import { CACHE_KEY, useCache } from '@/hooks/web/useCache' | ||||||
| import { getInfoApi } from '@/api/login' | import { getInfoApi, loginOutApi } from '@/api/login' | ||||||
|  |  | ||||||
| const { wsCache } = useCache() | const { wsCache } = useCache() | ||||||
|  |  | ||||||
| @ -59,7 +59,8 @@ export const useUserStore = defineStore('admin-user', { | |||||||
|       this.isSetUser = true |       this.isSetUser = true | ||||||
|       wsCache.set(CACHE_KEY.USER, userInfo) |       wsCache.set(CACHE_KEY.USER, userInfo) | ||||||
|     }, |     }, | ||||||
|     loginOut() { |     async loginOut() { | ||||||
|  |       await loginOutApi() | ||||||
|       removeToken() |       removeToken() | ||||||
|       wsCache.clear() |       wsCache.clear() | ||||||
|       this.resetState() |       this.resetState() | ||||||
|  | |||||||
| @ -16,7 +16,7 @@ export interface DictDataType { | |||||||
|   dictType: string |   dictType: string | ||||||
|   label: string |   label: string | ||||||
|   value: string | number | boolean |   value: string | number | boolean | ||||||
|   colorType: ElementPlusInfoType | '' | 'default' | 'primary' |   colorType: ElementPlusInfoType | '' | ||||||
|   cssClass: string |   cssClass: string | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| import { EChartsOption } from 'echarts' | import { EChartsOption } from 'echarts' | ||||||
| import { useI18n } from '@/hooks/web/useI18n' | import { useI18n } from '@/hooks/web/useI18n' | ||||||
| import { EChartsOption as EChartsWordOption } from 'echarts-wordcloud' |  | ||||||
|  |  | ||||||
| const { t } = useI18n() | const { t } = useI18n() | ||||||
|  |  | ||||||
| @ -185,7 +184,7 @@ export const radarOption: EChartsOption = { | |||||||
|   ] |   ] | ||||||
| } | } | ||||||
|  |  | ||||||
| export const wordOptions: EChartsWordOption = { | export const wordOptions = { | ||||||
|   series: [ |   series: [ | ||||||
|     { |     { | ||||||
|       type: 'wordCloud', |       type: 'wordCloud', | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' | |||||||
| const { t } = useI18n() | const { t } = useI18n() | ||||||
| // 表单校验 | // 表单校验 | ||||||
| export const dictDataRules = reactive({ | export const dictDataRules = reactive({ | ||||||
|   title: [required], |   label: [required], | ||||||
|   value: [required], |   value: [required], | ||||||
|   sort: [required] |   sort: [required] | ||||||
| }) | }) | ||||||
| @ -34,42 +34,48 @@ export const crudSchemas = reactive<VxeCrudSchema>({ | |||||||
|       title: '数据键值', |       title: '数据键值', | ||||||
|       field: 'value' |       field: 'value' | ||||||
|     }, |     }, | ||||||
|  |     // { | ||||||
|  |     //   title: '标签类型', | ||||||
|  |     //   field: 'colorType', | ||||||
|  |     //   form: { | ||||||
|  |     //     component: 'Select', | ||||||
|  |     //     componentProps: { | ||||||
|  |     //       options: [ | ||||||
|  |     //         { | ||||||
|  |     //           label: 'default', | ||||||
|  |     //           value: '' | ||||||
|  |     //         }, | ||||||
|  |     //         { | ||||||
|  |     //           label: 'success', | ||||||
|  |     //           value: 'success' | ||||||
|  |     //         }, | ||||||
|  |     //         { | ||||||
|  |     //           label: 'info', | ||||||
|  |     //           value: 'info' | ||||||
|  |     //         }, | ||||||
|  |     //         { | ||||||
|  |     //           label: 'warning', | ||||||
|  |     //           value: 'warning' | ||||||
|  |     //         }, | ||||||
|  |     //         { | ||||||
|  |     //           label: 'danger', | ||||||
|  |     //           value: 'danger' | ||||||
|  |     //         } | ||||||
|  |     //       ] | ||||||
|  |     //     } | ||||||
|  |     //   }, | ||||||
|  |     //   isTable: false | ||||||
|  |     // }, | ||||||
|     { |     { | ||||||
|       title: '颜色类型', |       title: '颜色', | ||||||
|       field: 'colorType', |  | ||||||
|       form: { |  | ||||||
|         component: 'Select', |  | ||||||
|         componentProps: { |  | ||||||
|           options: [ |  | ||||||
|             { |  | ||||||
|               label: 'default', |  | ||||||
|               value: '' |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               label: 'success', |  | ||||||
|               value: 'success' |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               label: 'info', |  | ||||||
|               value: 'info' |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               label: 'warning', |  | ||||||
|               value: 'warning' |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               label: 'danger', |  | ||||||
|               value: 'danger' |  | ||||||
|             } |  | ||||||
|           ] |  | ||||||
|         } |  | ||||||
|       }, |  | ||||||
|       isTable: false |  | ||||||
|     }, |  | ||||||
|     { |  | ||||||
|       title: 'CSS Class', |  | ||||||
|       field: 'cssClass', |       field: 'cssClass', | ||||||
|       isTable: false |       isTable: false, | ||||||
|  |       form: { | ||||||
|  |         component: 'ColorPicker', | ||||||
|  |         componentProps: { | ||||||
|  |           predefine: ['#ffffff', '#409eff', '#67c23a', '#e6a23c', '#f56c6c', '#909399', '#c71585'] | ||||||
|  |         } | ||||||
|  |       } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       title: '显示排序', |       title: '显示排序', | ||||||
|  | |||||||
| @ -7,7 +7,8 @@ const { t } = useI18n() // 国际化 | |||||||
|  |  | ||||||
| // 表单校验 | // 表单校验 | ||||||
| export const dictTypeRules = reactive({ | export const dictTypeRules = reactive({ | ||||||
|   name: [required] |   name: [required], | ||||||
|  |   type: [required] | ||||||
| }) | }) | ||||||
| // 新增 + 修改 | // 新增 + 修改 | ||||||
| const crudSchemas = reactive<VxeCrudSchema>({ | const crudSchemas = reactive<VxeCrudSchema>({ | ||||||
| @ -41,9 +42,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ | |||||||
|       field: 'createTime', |       field: 'createTime', | ||||||
|       formatter: 'formatDate', |       formatter: 'formatDate', | ||||||
|       isForm: false, |       isForm: false, | ||||||
|       table: { |       isTable: false, | ||||||
|         width: 150 |  | ||||||
|       }, |  | ||||||
|       search: { |       search: { | ||||||
|         show: true, |         show: true, | ||||||
|         itemRender: { |         itemRender: { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu
					xingyu