Commit 6691c085858697e66fac47af84fe19b874b21853

Authored by 芋道源码
Committed by Gitee
2 parents 0ae9d179 1179ca1a

!222 vue3

Merge pull request !222 from xingyu/master
Showing 28 changed files with 254 additions and 216 deletions
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java
... ... @@ -94,6 +94,19 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> {
94 94 return this;
95 95 }
96 96  
  97 + public LambdaQueryWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object[] values) {
  98 + if (values!= null && values.length >0 && values[0] != null && values[1] != null) {
  99 + return (LambdaQueryWrapperX<T>) super.between(column, values[0], values[1]);
  100 + }
  101 + if (values != null && values[0] != null) {
  102 + return (LambdaQueryWrapperX<T>) ge(column, values[0]);
  103 + }
  104 + if (values != null && values[1] != null) {
  105 + return (LambdaQueryWrapperX<T>) le(column, values[2]);
  106 + }
  107 + return this;
  108 + }
  109 +
97 110 // ========== 重写父类方法,方便链式调用 ==========
98 111  
99 112 @Override
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java
... ... @@ -37,6 +37,10 @@ public class UserPageReqVO extends PageParam {
37 37 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
38 38 private Date endTime;
39 39  
  40 + @ApiModelProperty(value = "开始时间", example = "2020-10-24")
  41 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  42 + private Date[] createTime;
  43 +
40 44 @ApiModelProperty(value = "部门编号", example = "1024", notes = "同时筛选子部门")
41 45 private Long deptId;
42 46  
... ...
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java
... ... @@ -33,7 +33,8 @@ public interface AdminUserMapper extends BaseMapperX&lt;AdminUserDO&gt; {
33 33 .likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
34 34 .likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile())
35 35 .eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
36   - .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime())
  36 + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(),reqVO.getEndTime())
  37 + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
37 38 .inIfPresent(AdminUserDO::getDeptId, deptIds)
38 39 .orderByDesc(AdminUserDO::getId));
39 40  
... ...
yudao-ui-admin-vue3/package.json
1 1 {
2 2 "name": "ruoyi-vue-pro-vue3",
3   - "version": "1.0.160",
  3 + "version": "1.6.2.1601",
4 4 "description": "基于vue3、element-plus、typesScript、vite3",
5 5 "author": "xingyu",
6 6 "private": false,
... ... @@ -56,7 +56,7 @@
56 56 "devDependencies": {
57 57 "@commitlint/cli": "^17.0.3",
58 58 "@commitlint/config-conventional": "^17.0.3",
59   - "@iconify/json": "^2.1.79",
  59 + "@iconify/json": "^2.1.80",
60 60 "@intlify/vite-plugin-vue-i18n": "^5.0.0",
61 61 "@purge-icons/generated": "^0.8.1",
62 62 "@types/intro.js": "^5.1.0",
... ...
yudao-ui-admin-vue3/src/api/infra/redis/index.ts
... ... @@ -23,3 +23,21 @@ export const getKeyListApi = (keyTemplate: string) =&gt; {
23 23 }
24 24 })
25 25 }
  26 +// 获取缓存内容
  27 +export const getKeyValue = (key: string) => {
  28 + return request.get({ url: '/infra/redis/get-key-value?key=' + key })
  29 +}
  30 +
  31 +// 根据键名删除缓存
  32 +export const deleteKey = (key: string) => {
  33 + return request.delete({ url: '/infra/redis/delete-key?key=' + key })
  34 +}
  35 +
  36 +export const deleteKeys = (keyTemplate: string) => {
  37 + return request.delete({
  38 + url: '/infra/redis/delete-keys?',
  39 + params: {
  40 + keyTemplate
  41 + }
  42 + })
  43 +}
... ...
yudao-ui-admin-vue3/src/components/Form/src/helper.ts
1   -// import { useI18n } from '@/hooks/web/useI18n'
  1 +import { useI18n } from '@/hooks/web/useI18n'
2 2 import type { Slots } from 'vue'
3 3 import { getSlot } from '@/utils/tsxHelper'
4 4 import { PlaceholderMoel } from './types'
5 5  
6   -// const { t } = useI18n()
7   -
8 6 /**
9 7 *
10 8 * @param schema 对应组件数据
... ... @@ -12,12 +10,12 @@ import { PlaceholderMoel } from &#39;./types&#39;
12 10 * @description 用于自动设置placeholder
13 11 */
14 12 export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => {
  13 + const { t } = useI18n()
15 14 const textMap = ['Input', 'Autocomplete', 'InputNumber', 'InputPassword']
16 15 const selectMap = ['Select', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect']
17 16 if (textMap.includes(schema?.component as string)) {
18 17 return {
19   - // placeholder: t('common.inputText')
20   - placeholder: '请输入'
  18 + placeholder: t('common.inputText')
21 19 }
22 20 }
23 21 if (selectMap.includes(schema?.component as string)) {
... ... @@ -29,16 +27,13 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel =&gt; {
29 27 )
30 28 ) {
31 29 return {
32   - // startPlaceholder: t('common.startTimeText'),
33   - // endPlaceholder: t('common.endTimeText'),
34   - startPlaceholder: '开始时间',
35   - endPlaceholder: '结束时间',
  30 + startPlaceholder: t('common.startTimeText'),
  31 + endPlaceholder: t('common.endTimeText'),
36 32 rangeSeparator: '-'
37 33 }
38 34 } else {
39 35 return {
40   - // placeholder: t('common.selectText')
41   - placeholder: '请选择'
  36 + placeholder: t('common.selectText')
42 37 }
43 38 }
44 39 }
... ...
yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue
... ... @@ -59,7 +59,7 @@ watch(
59 59 :class="[
60 60 prefixCls,
61 61 layout !== 'classic' ? `${prefixCls}__Top` : '',
62   - 'flex !h-[var(--logo-height)] items-center cursor-pointer pl-8px relative',
  62 + 'flex !h-[var(--logo-height)] items-center cursor-pointer justify-center relative',
63 63 'dark:bg-[var(--el-bg-color)]'
64 64 ]"
65 65 to="/"
... ...
yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue
... ... @@ -43,7 +43,7 @@ const loginOut = () =&gt; {
43 43 .catch(() => {})
44 44 }
45 45 const toProfile = async () => {
46   - push('/user/profile')
  46 + push('/userinfo/profile')
47 47 }
48 48 const toDocument = () => {
49 49 window.open('https://doc.iocoder.cn/')
... ...
yudao-ui-admin-vue3/src/config/axios/index.ts
... ... @@ -5,7 +5,6 @@ import { config } from &#39;@/config/axios/config&#39;
5 5 import { getAccessToken, getRefreshToken, getTenantId } from '@/utils/auth'
6 6 import errorCode from './errorCode'
7 7 import { useI18n } from '@/hooks/web/useI18n'
8   -const { t } = useI18n()
9 8  
10 9 const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE
11 10 const BASE_URL = import.meta.env.VITE_BASE_URL
... ... @@ -46,25 +45,27 @@ service.interceptors.request.use(
46 45 const tenantId = getTenantId()
47 46 if (tenantId) (config as Recordable).headers.common['tenant-id'] = tenantId
48 47 }
  48 + const params = config.params || {}
  49 + const data = config.data || false
49 50 if (
50   - config.method === 'post' &&
  51 + config.method?.toUpperCase() === 'POST' &&
51 52 config!.headers!['Content-Type'] === 'application/x-www-form-urlencoded'
52 53 ) {
53   - config.data = qs.stringify(config.data)
  54 + config.data = qs.stringify(data)
54 55 }
55 56 // get参数编码
56   - if (config.method === 'get' && config.params) {
  57 + if (config.method?.toUpperCase() === 'GET' && config.params) {
57 58 let url = config.url as string
  59 + // 给 get 请求加上时间戳参数,避免从缓存中拿数据
  60 + // const now = new Date().getTime()
  61 + // params = params.substring(0, url.length - 1) + `?_t=${now}`
58 62 url += '?'
59   - const keys = Object.keys(config.params)
  63 + const keys = Object.keys(params)
60 64 for (const key of keys) {
61   - if (config.params[key] !== void 0 && config.params[key] !== null) {
62   - url += `${key}=${encodeURIComponent(config.params[key])}&`
  65 + if (params[key] !== void 0 && params[key] !== null) {
  66 + url += `${key}=${encodeURIComponent(params[key])}&`
63 67 }
64 68 }
65   - // 给 get 请求加上时间戳参数,避免从缓存中拿数据
66   - // const now = new Date().getTime()
67   - // url = url.substring(0, url.length - 1) + `?_t=${now}`
68 69 config.params = {}
69 70 config.url = url
70 71 }
... ... @@ -85,6 +86,7 @@ service.interceptors.response.use(
85 86 // 返回“[HTTP]请求没有返回值”;
86 87 throw new Error()
87 88 }
  89 + const { t } = useI18n()
88 90 // 未设置状态码则默认成功状态
89 91 const code = data.code || result_code
90 92 // 获取错误信息
... ... @@ -134,6 +136,7 @@ service.interceptors.response.use(
134 136 (error: AxiosError) => {
135 137 console.log('err' + error) // for debug
136 138 let { message } = error
  139 + const { t } = useI18n()
137 140 if (message === 'Network Error') {
138 141 message = t('sys.api.errorMessage')
139 142 } else if (message.includes('timeout')) {
... ... @@ -146,6 +149,7 @@ service.interceptors.response.use(
146 149 }
147 150 )
148 151 function handleAuthorized() {
  152 + const { t } = useI18n()
149 153 if (!isRelogin.show) {
150 154 isRelogin.show = true
151 155 ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), {
... ...
yudao-ui-admin-vue3/src/hooks/web/useMessage.ts 0 → 100644
  1 +import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
  2 +import { useI18n } from './useI18n'
  3 +export const useMessage = () => {
  4 + const { t } = useI18n()
  5 + return {
  6 + // 消息提示
  7 + info(content: string) {
  8 + ElMessage.info(content)
  9 + },
  10 + // 错误消息
  11 + error(content: string) {
  12 + ElMessage.error(content)
  13 + },
  14 + // 成功消息
  15 + success(content: string) {
  16 + ElMessage.success(content)
  17 + },
  18 + // 警告消息
  19 + warning(content: string) {
  20 + ElMessage.warning(content)
  21 + },
  22 + // 弹出提示
  23 + alert(content: string) {
  24 + ElMessageBox.alert(content, t('common.confirmTitle'))
  25 + },
  26 + // 错误提示
  27 + alertError(content: string) {
  28 + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'error' })
  29 + },
  30 + // 成功提示
  31 + alertSuccess(content: string) {
  32 + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'success' })
  33 + },
  34 + // 警告提示
  35 + alertWarning(content: string) {
  36 + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'warning' })
  37 + },
  38 + // 通知提示
  39 + notify(content: string) {
  40 + ElNotification.info(content)
  41 + },
  42 + // 错误通知
  43 + notifyError(content: string) {
  44 + ElNotification.error(content)
  45 + },
  46 + // 成功通知
  47 + notifySuccess(content: string) {
  48 + ElNotification.success(content)
  49 + },
  50 + // 警告通知
  51 + notifyWarning(content: string) {
  52 + ElNotification.warning(content)
  53 + },
  54 + // 确认窗体
  55 + confirm(content: string, tip: string) {
  56 + return ElMessageBox.confirm(content, tip, {
  57 + confirmButtonText: t('common.ok'),
  58 + cancelButtonText: t('common.cancel'),
  59 + type: 'warning'
  60 + })
  61 + },
  62 + // 提交内容
  63 + prompt(content: string, tip: string) {
  64 + return ElMessageBox.prompt(content, tip, {
  65 + confirmButtonText: t('common.ok'),
  66 + cancelButtonText: t('common.cancel'),
  67 + type: 'warning'
  68 + })
  69 + }
  70 + }
  71 +}
... ...
yudao-ui-admin-vue3/src/router/modules/remaining.ts
... ... @@ -41,7 +41,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
41 41 ]
42 42 },
43 43 {
44   - path: '/user',
  44 + path: '/userinfo',
45 45 component: Layout,
46 46 name: 'UserInfo',
47 47 meta: {
... ...
yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue
... ... @@ -8,7 +8,8 @@ import type { ApiErrorLogVO } from &#39;@/api/infra/apiErrorLog/types&#39;
8 8 import { allSchemas } from './apiErrorLog.data'
9 9 import * as ApiErrorLogApi from '@/api/infra/apiErrorLog'
10 10 import { InfraApiErrorLogProcessStatusEnum } from '@/utils/constants'
11   -import { ElMessage, ElMessageBox } from 'element-plus'
  11 +import { useMessage } from '@/hooks/web/useMessage'
  12 +const message = useMessage()
12 13 const { t } = useI18n() // 国际化
13 14  
14 15 // ========== 列表相关 ==========
... ... @@ -36,14 +37,11 @@ const handleDetail = (row: ApiErrorLogVO) =&gt; {
36 37 }
37 38 // 异常处理操作
38 39 const handleProcessClick = (row: ApiErrorLogVO, processSttatus: number, type: string) => {
39   - ElMessageBox.confirm('确认标记为' + type + '?', t('common.reminder'), {
40   - confirmButtonText: t('common.ok'),
41   - cancelButtonText: t('common.cancel'),
42   - type: 'warning'
43   - })
  40 + message
  41 + .confirm('确认标记为' + type + '?', t('common.reminder'))
44 42 .then(async () => {
45 43 ApiErrorLogApi.updateApiErrorLogPageApi(row.id, processSttatus).then(() => {
46   - ElMessage.success(t('common.updateSuccess'))
  44 + message.success(t('common.updateSuccess'))
47 45 getList()
48 46 })
49 47 })
... ...
yudao-ui-admin-vue3/src/views/infra/codegen/index.vue
... ... @@ -10,7 +10,8 @@ import ImportTable from &#39;./components/ImportTable.vue&#39;
10 10 import Preview from './components/Preview.vue'
11 11 import download from '@/utils/download'
12 12 import { useRouter } from 'vue-router'
13   -import { ElMessage, ElMessageBox } from 'element-plus'
  13 +import { useMessage } from '@/hooks/web/useMessage'
  14 +const message = useMessage()
14 15 const { t } = useI18n() // 国际化
15 16 const { push } = useRouter()
16 17 // ========== 列表相关 ==========
... ... @@ -37,14 +38,12 @@ const handleEditTable = (row: CodegenTableVO) =&gt; {
37 38 const handleSynchDb = (row: CodegenTableVO) => {
38 39 // 基于 DB 同步
39 40 const tableName = row.tableName
40   - ElMessageBox.confirm('确认要强制同步' + tableName + '表结构吗?', t('common.reminder'), {
41   - confirmButtonText: t('common.ok'),
42   - cancelButtonText: t('common.cancel'),
43   - type: 'warning'
44   - }).then(async () => {
45   - await CodegenApi.syncCodegenFromDBApi(row.id)
46   - ElMessage.success('同步成功')
47   - })
  41 + message
  42 + .confirm('确认要强制同步' + tableName + '表结构吗?', t('common.reminder'))
  43 + .then(async () => {
  44 + await CodegenApi.syncCodegenFromDBApi(row.id)
  45 + message.success('同步成功')
  46 + })
48 47 }
49 48 // 生成代码操作
50 49 const handleGenTable = (row: CodegenTableVO) => {
... ...
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
1 1 <script setup lang="ts">
2 2 import { ref, unref } from 'vue'
3 3 import dayjs from 'dayjs'
4   -import { ElMessage, ElMessageBox } from 'element-plus'
5 4 import { DICT_TYPE } from '@/utils/dict'
6 5 import { useTable } from '@/hooks/web/useTable'
7 6 import { useI18n } from '@/hooks/web/useI18n'
... ... @@ -9,6 +8,8 @@ import { FormExpose } from &#39;@/components/Form&#39;
9 8 import type { FileConfigVO } from '@/api/infra/fileConfig/types'
10 9 import { rules, allSchemas } from './fileConfig.data'
11 10 import * as FileConfigApi from '@/api/infra/fileConfig'
  11 +import { useMessage } from '@/hooks/web/useMessage'
  12 +const message = useMessage()
12 13 const { t } = useI18n() // 国际化
13 14  
14 15 // ========== 列表相关 ==========
... ... @@ -49,16 +50,12 @@ const handleUpdate = async (row: FileConfigVO) =&gt; {
49 50  
50 51 // 主配置操作
51 52 const handleMaster = (row: FileConfigVO) => {
52   - ElMessageBox.confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder'), {
53   - confirmButtonText: t('common.ok'),
54   - cancelButtonText: t('common.cancel'),
55   - type: 'warning'
56   - })
  53 + message
  54 + .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder'))
57 55 .then(async () => {
58 56 await FileConfigApi.updateFileConfigMasterApi(row.id)
59 57 await getList()
60 58 })
61   - .catch(() => {})
62 59 }
63 60  
64 61 // 提交按钮
... ... @@ -69,10 +66,10 @@ const submitForm = async () =&gt; {
69 66 const data = unref(formRef)?.formModel as FileConfigVO
70 67 if (actionType.value === 'create') {
71 68 await FileConfigApi.createFileConfigApi(data)
72   - ElMessage.success(t('common.createSuccess'))
  69 + message.success(t('common.createSuccess'))
73 70 } else {
74 71 await FileConfigApi.updateFileConfigApi(data)
75   - ElMessage.success(t('common.updateSuccess'))
  72 + message.success(t('common.updateSuccess'))
76 73 }
77 74 // 操作成功,重新加载列表
78 75 dialogVisible.value = false
... ...
yudao-ui-admin-vue3/src/views/infra/job/index.vue
... ... @@ -9,8 +9,9 @@ import { useTable } from &#39;@/hooks/web/useTable&#39;
9 9 import { useI18n } from '@/hooks/web/useI18n'
10 10 import { FormExpose } from '@/components/Form'
11 11 import { rules, allSchemas } from './job.data'
12   -import { ElMessage, ElMessageBox } from 'element-plus'
13 12 import { useRouter } from 'vue-router'
  13 +import { useMessage } from '@/hooks/web/useMessage'
  14 +const message = useMessage()
14 15 const { t } = useI18n() // 国际化
15 16 const { push } = useRouter()
16 17 // ========== 列表相关 ==========
... ... @@ -64,18 +65,11 @@ const handleJobLog = (row: JobVO) =&gt; {
64 65 }
65 66 // 执行一次
66 67 const handleRun = (row: JobVO) => {
67   - ElMessageBox.confirm('确认要立即执行一次' + row.name + '?', t('common.reminder'), {
68   - confirmButtonText: t('common.ok'),
69   - cancelButtonText: t('common.cancel'),
70   - type: 'warning'
  68 + message.confirm('确认要立即执行一次' + row.name + '?', t('common.reminder')).then(async () => {
  69 + await JobApi.runJobApi(row.id)
  70 + message.success('执行成功')
  71 + getList()
71 72 })
72   - .then(async () => {
73   - JobApi.runJobApi(row.id).then(() => {
74   - ElMessage.success('执行成功')
75   - getList()
76   - })
77   - })
78   - .catch(() => {})
79 73 }
80 74 // 提交按钮
81 75 const submitForm = async () => {
... ... @@ -85,10 +79,10 @@ const submitForm = async () =&gt; {
85 79 const data = unref(formRef)?.formModel as JobVO
86 80 if (actionType.value === 'create') {
87 81 await JobApi.createJobApi(data)
88   - ElMessage.success(t('common.createSuccess'))
  82 + message.success(t('common.createSuccess'))
89 83 } else {
90 84 await JobApi.updateJobApi(data)
91   - ElMessage.success(t('common.updateSuccess'))
  85 + message.success(t('common.updateSuccess'))
92 86 }
93 87 // 操作成功,重新加载列表
94 88 dialogVisible.value = false
... ...
yudao-ui-admin-vue3/src/views/system/dept/index.vue
1 1 <script setup lang="ts">
2 2 import { useI18n } from '@/hooks/web/useI18n'
3   -import { ElInput, ElCard, ElTree, ElTreeSelect, ElMessage, ElMessageBox } from 'element-plus'
  3 +import { ElInput, ElCard, ElTree, ElTreeSelect } from 'element-plus'
4 4 import { handleTree } from '@/utils/tree'
5 5 import { onMounted, ref, unref, watch } from 'vue'
6 6 import * as DeptApi from '@/api/system/dept'
7 7 import { Form, FormExpose } from '@/components/Form'
8 8 import { modelSchema } from './dept.data'
9 9 import { DeptVO } from '@/api/system/dept/types'
  10 +import { useMessage } from '@/hooks/web/useMessage'
  11 +const message = useMessage()
10 12 interface Tree {
11 13 id: number
12 14 name: string
... ... @@ -29,10 +31,10 @@ const formRef = ref&lt;FormExpose&gt;()
29 31  
30 32 // ========== 创建部门树结构 ==========
31 33 const filterText = ref('')
32   -const deptOptions = ref([]) // 树形结构
  34 +const deptOptions = ref() // 树形结构
33 35 const treeRef = ref<InstanceType<typeof ElTree>>()
34 36 const getTree = async () => {
35   - const res = await DeptApi.listSimpleDeptApi()
  37 + const res = await DeptApi.getDeptPageApi(null)
36 38 deptOptions.value = handleTree(res)
37 39 }
38 40 const filterNode = (value: string, data: Tree) => {
... ... @@ -60,14 +62,11 @@ const handleUpdate = async (data: { id: number }) =&gt; {
60 62 }
61 63 // 删除
62 64 const handleDelete = async (data: { id: number }) => {
63   - ElMessageBox.confirm(t('common.delDataMessage'), t('common.confirmTitle'), {
64   - confirmButtonText: t('common.ok'),
65   - cancelButtonText: t('common.cancel'),
66   - type: 'warning'
67   - })
  65 + message
  66 + .confirm(t('common.delDataMessage'), t('common.confirmTitle'))
68 67 .then(async () => {
69 68 await DeptApi.deleteDeptApi(data.id)
70   - ElMessage.success(t('common.delSuccess'))
  69 + message.success(t('common.delSuccess'))
71 70 })
72 71 .catch(() => {})
73 72 await getTree()
... ... @@ -118,6 +117,7 @@ onMounted(async () =&gt; {
118 117 :highlight-current="true"
119 118 default-expand-all
120 119 :filter-node-method="filterNode"
  120 + :expand-on-click-node="false"
121 121 >
122 122 <template #default="{ node, data }">
123 123 <span class="custom-tree-node">
... ...
yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts
... ... @@ -56,26 +56,13 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
56 56 field: 'createTime',
57 57 form: {
58 58 show: false
59   - }
60   - },
61   - {
62   - label: t('common.createTime'),
63   - field: 'daterange',
64   - table: {
65   - show: false
66   - },
67   - form: {
68   - show: false
69   - },
70   - detail: {
71   - show: false
72 59 },
73 60 search: {
74 61 show: true,
75 62 component: 'DatePicker',
76 63 componentProps: {
77   - type: 'daterange',
78   - valueFormat: 'YYYY-MM-DD'
  64 + type: 'datetimerange',
  65 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
79 66 }
80 67 }
81 68 },
... ...
yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts
... ... @@ -54,26 +54,13 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
54 54 field: 'createTime',
55 55 form: {
56 56 show: false
57   - }
58   - },
59   - {
60   - label: t('common.createTime'),
61   - field: 'daterange',
62   - table: {
63   - show: false
64   - },
65   - form: {
66   - show: false
67   - },
68   - detail: {
69   - show: false
70 57 },
71 58 search: {
72 59 show: true,
73 60 component: 'DatePicker',
74 61 componentProps: {
75   - type: 'daterange',
76   - valueFormat: 'YYYY-MM-DD'
  62 + type: 'datetimerange',
  63 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
77 64 }
78 65 }
79 66 },
... ...
yudao-ui-admin-vue3/src/views/system/menu/index.vue
... ... @@ -16,16 +16,16 @@ import {
16 16 ElInput,
17 17 ElInputNumber,
18 18 ElSelect,
  19 + ElTreeSelect,
19 20 ElOption,
20   - ElMessageBox,
21   - ElMessage,
22   - ElCascader,
23 21 ElRadioGroup,
24 22 ElRadioButton
25 23 } from 'element-plus'
26 24 import { MenuVO } from '@/api/system/menu/types'
27 25 import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants'
28 26 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
  27 +import { useMessage } from '@/hooks/web/useMessage'
  28 +const message = useMessage()
29 29 const { t } = useI18n() // 国际化
30 30 // ========== 创建菜单树结构 ==========
31 31 const loading = ref(true)
... ... @@ -41,10 +41,13 @@ const menuProps = {
41 41 label: 'name',
42 42 value: 'id'
43 43 }
44   -const menuOptions = ref([]) // 树形结构
  44 +const menuOptions = ref() // 树形结构
45 45 const getTree = async () => {
46 46 const res = await MenuApi.listSimpleMenusApi()
47   - menuOptions.value = handleTree(res)
  47 + const menu = { id: 0, name: '主类目', children: [] }
  48 + menu.children = handleTree(res)
  49 + console.info(menu)
  50 + menuOptions.value = menu
48 51 }
49 52 // ========== 查询 ==========
50 53 const queryParams = reactive({
... ... @@ -108,14 +111,11 @@ const handleUpdate = async (row: MenuVO) =&gt; {
108 111 }
109 112 // 删除操作
110 113 const handleDelete = async (row: MenuVO) => {
111   - ElMessageBox.confirm(t('common.delDataMessage'), t('common.confirmTitle'), {
112   - confirmButtonText: t('common.ok'),
113   - cancelButtonText: t('common.cancel'),
114   - type: 'warning'
115   - })
  114 + message
  115 + .confirm(t('common.delDataMessage'), t('common.confirmTitle'))
116 116 .then(async () => {
117 117 await MenuApi.deleteMenuApi(row.id)
118   - ElMessage.success(t('common.delSuccess'))
  118 + message.success(t('common.delSuccess'))
119 119 })
120 120 .catch(() => {})
121 121 await getList()
... ... @@ -134,20 +134,20 @@ const submitForm = async () =&gt; {
134 134 ) {
135 135 if (!isExternal(menuForm.value.path)) {
136 136 if (menuForm.value.parentId === 0 && menuForm.value.path.charAt(0) !== '/') {
137   - ElMessage.error('路径必须以 / 开头')
  137 + message.error('路径必须以 / 开头')
138 138 return
139 139 } else if (menuForm.value.parentId !== 0 && menuForm.value.path.charAt(0) === '/') {
140   - ElMessage.error('路径不能以 / 开头')
  140 + message.error('路径不能以 / 开头')
141 141 return
142 142 }
143 143 }
144 144 }
145 145 if (actionType.value === 'create') {
146 146 await MenuApi.createMenuApi(menuForm.value)
147   - ElMessage.success(t('common.createSuccess'))
  147 + message.success(t('common.createSuccess'))
148 148 } else {
149 149 await MenuApi.updateMenuApi(menuForm.value)
150   - ElMessage.success(t('common.updateSuccess'))
  150 + message.success(t('common.updateSuccess'))
151 151 }
152 152 // 操作成功,重新加载列表
153 153 dialogVisible.value = false
... ... @@ -264,13 +264,12 @@ onMounted(async () =&gt; {
264 264 <el-row :gutter="24">
265 265 <el-col :span="24">
266 266 <el-form-item label="上级菜单">
267   - <el-cascader
268   - :options="menuData"
269   - :props="menuProps"
270   - placeholder="请选择上级菜单"
  267 + <el-tree-select
  268 + node-key="id"
271 269 v-model="menuForm.parentId"
272   - class="w-100"
273   - clearable
  270 + :props="menuProps"
  271 + :data="menuData"
  272 + check-strictly
274 273 />
275 274 </el-form-item>
276 275 </el-col>
... ...
yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue
1 1 <script setup lang="ts">
2 2 import { ref, unref } from 'vue'
3 3 import dayjs from 'dayjs'
4   -import { ElMessage, ElImage } from 'element-plus'
  4 +import { ElMessage, ElImage, ElTag } from 'element-plus'
5 5 import { DICT_TYPE } from '@/utils/dict'
6 6 import { useTable } from '@/hooks/web/useTable'
7 7 import { useI18n } from '@/hooks/web/useI18n'
... ... @@ -118,6 +118,16 @@ getList()
118 118 <template #status="{ row }">
119 119 <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
120 120 </template>
  121 + <template #authorizedGrantTypes="{ row }">
  122 + <el-tag
  123 + :disable-transitions="true"
  124 + :key="index"
  125 + v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
  126 + :index="index"
  127 + >
  128 + {{ authorizedGrantType }}
  129 + </el-tag>
  130 + </template>
121 131 <template #createTime="{ row }">
122 132 <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
123 133 </template>
... ...
yudao-ui-admin-vue3/src/views/system/operatelog/index.vue
... ... @@ -68,7 +68,7 @@ getList()
68 68 <span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span>
69 69 </template>
70 70 <template #startTime="{ row }">
71   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  71 + <span>{{ dayjs(row.startTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
72 72 </template>
73 73 <template #action="{ row }">
74 74 <el-button link type="primary" @click="handleDetail(row)">
... ...
yudao-ui-admin-vue3/src/views/system/operatelog/operatelog.data.ts
... ... @@ -41,7 +41,10 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
41 41 },
42 42 {
43 43 label: '操作人员',
44   - field: 'userNickname'
  44 + field: 'userNickname',
  45 + search: {
  46 + show: true
  47 + }
45 48 },
46 49 {
47 50 label: '操作明细',
... ... @@ -63,41 +66,38 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
63 66 },
64 67 {
65 68 label: '操作结果',
66   - field: 'resultCode'
67   - },
68   - {
69   - label: '操作日期',
70   - field: 'startTime',
71   - form: {
72   - show: false
  69 + field: 'resultCode',
  70 + search: {
  71 + show: true,
  72 + component: 'Select',
  73 + componentProps: {
  74 + options: [
  75 + { label: '成功', value: true },
  76 + { label: '失败', value: false }
  77 + ]
  78 + }
73 79 }
74 80 },
75 81 {
76   - label: '执行时长',
77   - field: 'duration'
78   - },
79   - {
80 82 label: '操作日期',
81   - field: 'daterange',
82   - table: {
83   - show: false
84   - },
  83 + field: 'startTime',
85 84 form: {
86 85 show: false
87 86 },
88   - detail: {
89   - show: false
90   - },
91 87 search: {
92 88 show: true,
93 89 component: 'DatePicker',
94 90 componentProps: {
95   - type: 'daterange',
96   - valueFormat: 'YYYY-MM-DD'
  91 + type: 'datetimerange',
  92 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
97 93 }
98 94 }
99 95 },
100 96 {
  97 + label: '执行时长',
  98 + field: 'duration'
  99 + },
  100 + {
101 101 label: t('table.action'),
102 102 field: 'action',
103 103 width: '120px',
... ...
yudao-ui-admin-vue3/src/views/system/role/role.data.ts
... ... @@ -65,12 +65,15 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
65 65 form: {
66 66 show: false
67 67 },
  68 + detail: {
  69 + show: false
  70 + },
68 71 search: {
69 72 show: true,
70 73 component: 'DatePicker',
71 74 componentProps: {
72   - type: 'daterange',
73   - valueFormat: 'YYYY-MM-DD'
  75 + type: 'datetimerange',
  76 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
74 77 }
75 78 }
76 79 },
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsChannel/sms.channel.data.ts
... ... @@ -66,26 +66,13 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
66 66 field: 'createTime',
67 67 form: {
68 68 show: false
69   - }
70   - },
71   - {
72   - label: t('common.createTime'),
73   - field: 'daterange',
74   - table: {
75   - show: false
76   - },
77   - form: {
78   - show: false
79   - },
80   - detail: {
81   - show: false
82 69 },
83 70 search: {
84 71 show: true,
85 72 component: 'DatePicker',
86 73 componentProps: {
87   - type: 'daterange',
88   - valueFormat: 'YYYY-MM-DD'
  74 + type: 'datetimerange',
  75 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
89 76 }
90 77 }
91 78 },
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsLog/sms.log.data.ts
... ... @@ -79,23 +79,13 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
79 79 field: 'createTime',
80 80 form: {
81 81 show: false
82   - }
83   - },
84   - {
85   - label: '接收时间',
86   - field: 'daterange',
87   - table: {
88   - show: false
89   - },
90   - form: {
91   - show: false
92 82 },
93 83 search: {
94 84 show: true,
95 85 component: 'DatePicker',
96 86 componentProps: {
97   - type: 'daterange',
98   - valueFormat: 'YYYY-MM-DD'
  87 + type: 'datetimerange',
  88 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
99 89 }
100 90 }
101 91 },
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/sms.template.data.ts
... ... @@ -77,26 +77,13 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
77 77 field: 'createTime',
78 78 form: {
79 79 show: false
80   - }
81   - },
82   - {
83   - label: t('common.createTime'),
84   - field: 'daterange',
85   - table: {
86   - show: false
87   - },
88   - form: {
89   - show: false
90   - },
91   - detail: {
92   - show: false
93 80 },
94 81 search: {
95 82 show: true,
96 83 component: 'DatePicker',
97 84 componentProps: {
98   - type: 'daterange',
99   - valueFormat: 'YYYY-MM-DD'
  85 + type: 'datetimerange',
  86 + valueFormat: 'YYYY-MM-DD HH:mm:ss'
100 87 }
101 88 }
102 89 },
... ...
yudao-ui-admin-vue3/src/views/system/user/index.vue
... ... @@ -3,7 +3,6 @@ import { onMounted, ref, unref, watch } from &#39;vue&#39;
3 3 import dayjs from 'dayjs'
4 4 import {
5 5 ElInput,
6   - ElMessage,
7 6 ElCard,
8 7 ElTree,
9 8 ElTreeSelect,
... ... @@ -14,7 +13,6 @@ import {
14 13 ElUpload,
15 14 ElSwitch,
16 15 ElCheckbox,
17   - ElMessageBox,
18 16 UploadInstance,
19 17 UploadRawFile
20 18 } from 'element-plus'
... ... @@ -32,6 +30,8 @@ import * as UserApi from &#39;@/api/system/user&#39;
32 30 import download from '@/utils/download'
33 31 import { CommonStatusEnum } from '@/utils/constants'
34 32 import { getAccessToken, getTenantId } from '@/utils/auth'
  33 +import { useMessage } from '@/hooks/web/useMessage'
  34 +const message = useMessage()
35 35 interface Tree {
36 36 id: number
37 37 name: string
... ... @@ -127,10 +127,10 @@ const submitForm = async () =&gt; {
127 127 data.postIds = postIds.value
128 128 if (actionType.value === 'create') {
129 129 await UserApi.createUserApi(data)
130   - ElMessage.success(t('common.createSuccess'))
  130 + message.success(t('common.createSuccess'))
131 131 } else {
132 132 await UserApi.updateUserApi(data)
133   - ElMessage.success(t('common.updateSuccess'))
  133 + message.success(t('common.updateSuccess'))
134 134 }
135 135 // 操作成功,重新加载列表
136 136 dialogVisible.value = false
... ... @@ -142,16 +142,13 @@ const submitForm = async () =&gt; {
142 142 // 改变用户状态操作
143 143 const handleStatusChange = async (row: UserVO) => {
144 144 const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
145   - ElMessageBox.confirm('确认要"' + text + '""' + row.username + '"用户吗?', t('common.reminder'), {
146   - confirmButtonText: t('common.ok'),
147   - cancelButtonText: t('common.cancel'),
148   - type: 'warning'
149   - })
  145 + message
  146 + .confirm('确认要"' + text + '""' + row.username + '"用户吗?', t('common.reminder'))
150 147 .then(async () => {
151 148 row.status =
152 149 row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.ENABLE : CommonStatusEnum.DISABLE
153 150 await UserApi.updateUserStatusApi(row.id, row.status)
154   - ElMessage.success(text + '成功')
  151 + message.success(text + '成功')
155 152 await getList()
156 153 })
157 154 .catch(() => {
... ... @@ -161,12 +158,9 @@ const handleStatusChange = async (row: UserVO) =&gt; {
161 158 }
162 159 // 重置密码
163 160 const handleResetPwd = (row: UserVO) => {
164   - ElMessageBox.prompt('请输入"' + row.username + '"的新密码', t('common.reminder'), {
165   - confirmButtonText: t('common.ok'),
166   - cancelButtonText: t('common.cancel')
167   - }).then(({ value }) => {
  161 + message.prompt('请输入"' + row.username + '"的新密码', t('common.reminder')).then(({ value }) => {
168 162 UserApi.resetUserPwdApi(row.id, value).then(() => {
169   - ElMessage.success('修改成功,新密码是:' + value)
  163 + message.success('修改成功,新密码是:' + value)
170 164 })
171 165 })
172 166 }
... ... @@ -207,8 +201,8 @@ const beforeExcelUpload = (file: UploadRawFile) =&gt; {
207 201 file.type === 'application/vnd.ms-excel' ||
208 202 file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
209 203 const isLt5M = file.size / 1024 / 1024 < 5
210   - if (!isExcel) ElMessage.error('上传文件只能是 xls / xlsx 格式!')
211   - if (!isLt5M) ElMessage.error('上传文件大小不能超过 5MB!')
  204 + if (!isExcel) message.error('上传文件只能是 xls / xlsx 格式!')
  205 + if (!isLt5M) message.error('上传文件大小不能超过 5MB!')
212 206 return isExcel && isLt5M
213 207 }
214 208 // 文件上传
... ... @@ -224,7 +218,7 @@ const submitFileForm = () =&gt; {
224 218 // 文件上传成功
225 219 const handleFileSuccess = (response: any): void => {
226 220 if (response.code !== 0) {
227   - ElMessage.error(response.msg)
  221 + message.error(response.msg)
228 222 return
229 223 }
230 224 importDialogVisible.value = false
... ... @@ -242,15 +236,15 @@ const handleFileSuccess = (response: any): void =&gt; {
242 236 for (const username in data.failureUsernames) {
243 237 text += '< ' + username + ': ' + data.failureUsernames[username] + ' >'
244 238 }
245   - ElMessageBox.alert(text)
  239 + message.alert(text)
246 240 }
247 241 // 文件数超出提示
248 242 const handleExceed = (): void => {
249   - ElMessage.error('最多只能上传一个文件!')
  243 + message.error('最多只能上传一个文件!')
250 244 }
251 245 // 上传错误提示
252 246 const excelUploadError = (): void => {
253   - ElMessage.error('导入数据失败,请您重新上传!')
  247 + message.error('导入数据失败,请您重新上传!')
254 248 }
255 249 // ========== 初始化 ==========
256 250 onMounted(async () => {
... ...
yudao-ui-admin-vue3/src/views/system/user/user.data.ts
... ... @@ -101,7 +101,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
101 101 },
102 102 {
103 103 label: t('common.createTime'),
104   - field: 'daterange',
  104 + field: 'createTime',
105 105 table: {
106 106 show: false
107 107 },
... ... @@ -115,7 +115,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
115 115 show: true,
116 116 component: 'DatePicker',
117 117 componentProps: {
118   - type: 'daterange',
  118 + type: 'datetimerange',
119 119 valueFormat: 'YYYY-MM-DD HH:mm:ss'
120 120 }
121 121 }
... ...