From f3e1fc4f9b9fb13db52ba8ebd4458ab17356ae67 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 29 Jul 2022 07:57:48 +0000 Subject: [PATCH] =?UTF-8?q?!238=20=E6=96=B0=E5=A2=9E=20todo=20done=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BC=98=E5=8C=96redis=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20*=20chore:=20update=20deps=20*=20feat:=20add=20todo?= =?UTF-8?q?=20done=20pages=20*=20chore:=20update=20deps=20*=20docs:=20upda?= =?UTF-8?q?te=20*=20feat:=20redis=20dialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- yudao-ui-admin-vue3/README.md | 36 ++++--- yudao-ui-admin-vue3/package.json | 7 +- yudao-ui-admin-vue3/src/api/bpm/task/types.ts | 30 ++++++ .../src/api/infra/redis/index.ts | 6 +- .../src/views/bpm/task/done/done.data.ts | 94 +++++++++++++++++++ .../src/views/bpm/task/done/index.vue | 68 +++++++++++++- .../src/views/bpm/task/todo/done.data.ts | 76 +++++++++++++++ .../src/views/bpm/task/todo/index.vue | 58 +++++++++++- .../src/views/infra/redis/index.vue | 92 +++++++++++++++++- .../src/views/system/role/index.vue | 48 +++++----- yudao-ui-admin-vue3/windi.config.ts | 17 +--- 12 files changed, 466 insertions(+), 68 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts create mode 100644 yudao-ui-admin-vue3/src/views/bpm/task/todo/done.data.ts diff --git a/README.md b/README.md index 891fa10da..bb15ae0f9 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ ps:核心功能已经实现,正在对接微信小程序中... |----------------------------------------------------------------------|------------------|--------| | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.37 | | [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.3 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.9 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.11 | | [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.7.4 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.17 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.1.10 | diff --git a/yudao-ui-admin-vue3/README.md b/yudao-ui-admin-vue3/README.md index 519c98e7c..a80a764f3 100644 --- a/yudao-ui-admin-vue3/README.md +++ b/yudao-ui-admin-vue3/README.md @@ -1,5 +1,17 @@

🌈 yudao-ui-admin-vue3

- +

+ + + + + + + + Prettier + Less + Taiwind + +

## 介绍 - 基于 vue3.2+ ,TypeScript ,Element Plus 2.2.0+ ,Vite3 ,Pinia ,Windicss 等开发的后台管理系统 @@ -12,19 +24,19 @@ ### 前端依赖 -| 框架 | 说明 | 版本 | -| --- | --- | --- | +| 框架 | 说明 | 版本 | +| --- | --- |--------| | [Vue](https://staging-cn.vuejs.org/) | vue 框架 | 3.2.37 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.2 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.9 | -| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.7.4 | -| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.16 | -| [vueuse](https://vueuse.org//) | 常用工具集 | 8.9.4 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.3 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.11 | +| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.7.4 | +| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.17 | +| [vueuse](https://vueuse.org//) | 常用工具集 | 9.0.0 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.1.10 | -| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.2 | -| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | -| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | -| [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.10 | +| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.3 | +| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | +| [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.14 | ### 推荐 VScode 开发,插件如下 diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 271e154fe..667a2f1a1 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -56,12 +56,12 @@ "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@iconify/json": "^2.1.84", + "@iconify/json": "^2.1.85", "@intlify/vite-plugin-vue-i18n": "^5.0.1", "@purge-icons/generated": "^0.8.1", "@types/intro.js": "^5.1.0", "@types/lodash-es": "^4.17.6", - "@types/node": "^18.6.1", + "@types/node": "^18.6.2", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.4.2", "@types/qs": "^6.9.7", @@ -101,8 +101,7 @@ "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-windicss": "^1.8.7", "vue-tsc": "^0.39.2", - "windicss": "^3.5.6", - "windicss-analysis": "^0.3.5" + "windicss": "^3.5.6" }, "engines": { "node": ">= 14.18.0" diff --git a/yudao-ui-admin-vue3/src/api/bpm/task/types.ts b/yudao-ui-admin-vue3/src/api/bpm/task/types.ts index 2bc8b6912..8f7722529 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/task/types.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/task/types.ts @@ -7,3 +7,33 @@ export type FormVO = { remark: string createTime: string } + +export type TaskProcessVO = { + id: string + name: string + startUserId: number + startUserNickname: string + processDefinitionId: string +} + +export type TaskTodoVO = { + id: string + name: string + claimTime: string + createTime: string + suspensionState: number + processInstance: TaskProcessVO +} + +export type TaskDoneVO = { + id: string + name: string + claimTime: string + createTime: string + endTime: string + durationInMillis: number + suspensionState: number + result: number + reason: string + processInstance: TaskProcessVO +} diff --git a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts index e9265bd78..d22779aae 100644 --- a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts +++ b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts @@ -24,16 +24,16 @@ export const getKeyListApi = (keyTemplate: string) => { }) } // 获取缓存内容 -export const getKeyValue = (key: string) => { +export const getKeyValueApi = (key: string) => { return request.get({ url: '/infra/redis/get-key-value?key=' + key }) } // 根据键名删除缓存 -export const deleteKey = (key: string) => { +export const deleteKeyApi = (key: string) => { return request.delete({ url: '/infra/redis/delete-key?key=' + key }) } -export const deleteKeys = (keyTemplate: string) => { +export const deleteKeysApi = (keyTemplate: string) => { return request.delete({ url: '/infra/redis/delete-keys?', params: { diff --git a/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts b/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts new file mode 100644 index 000000000..773395ff4 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts @@ -0,0 +1,94 @@ +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' +const { t } = useI18n() // 国际化 + +// CrudSchema +const crudSchemas = reactive([ + { + label: t('common.index'), + field: 'id', + type: 'index' + }, + { + label: '任务名称', + field: 'name', + search: { + show: true + } + }, + { + label: '所属流程', + field: 'processInstance.name' + }, + { + label: '流程发起人', + field: 'processInstance.startUserNickname' + }, + { + label: '结果', + field: 'result', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT + }, + { + label: '审批意见', + field: 'reason' + }, + { + label: t('common.createTime'), + field: 'createTime', + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)], + shortcuts: [ + { + text: '近一周', + value: () => { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + return [start, end] + } + }, + { + text: '近一个月', + value: () => { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) + return [start, end] + } + }, + { + text: '近三个月', + value: () => { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) + return [start, end] + } + } + ] + } + } + }, + { + label: '审批时间', + field: 'endTime' + }, + { + label: '耗时', + field: 'durationInMillis' + }, + { + label: t('table.action'), + field: 'action', + width: '100px' + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue b/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue index b03cb75c8..97d78b7bd 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue @@ -1,7 +1,67 @@ - + - - diff --git a/yudao-ui-admin-vue3/src/views/bpm/task/todo/done.data.ts b/yudao-ui-admin-vue3/src/views/bpm/task/todo/done.data.ts new file mode 100644 index 000000000..f1105943f --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/task/todo/done.data.ts @@ -0,0 +1,76 @@ +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +const { t } = useI18n() // 国际化 + +// CrudSchema +const crudSchemas = reactive([ + { + label: t('common.index'), + field: 'id', + type: 'index' + }, + { + label: '任务名称', + field: 'name', + search: { + show: true + } + }, + { + label: '所属流程', + field: 'processInstance.name' + }, + { + label: '流程发起人', + field: 'processInstance.startUserNickname' + }, + { + label: t('common.createTime'), + field: 'createTime', + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)], + shortcuts: [ + { + text: '近一周', + value: () => { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + return [start, end] + } + }, + { + text: '近一个月', + value: () => { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) + return [start, end] + } + }, + { + text: '近三个月', + value: () => { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) + return [start, end] + } + } + ] + } + } + }, + { + label: t('table.action'), + field: 'action', + width: '100px' + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/task/todo/index.vue b/yudao-ui-admin-vue3/src/views/bpm/task/todo/index.vue index b03cb75c8..348b07ca2 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/task/todo/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/task/todo/index.vue @@ -1,7 +1,57 @@ - + - - diff --git a/yudao-ui-admin-vue3/src/views/infra/redis/index.vue b/yudao-ui-admin-vue3/src/views/infra/redis/index.vue index b7989d6d1..4fc4c8dff 100644 --- a/yudao-ui-admin-vue3/src/views/infra/redis/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/redis/index.vue @@ -13,7 +13,8 @@ import { ElTableColumn, ElScrollbar, ElDescriptions, - ElDescriptionsItem + ElDescriptionsItem, + ElMessage } from 'element-plus' const cache = ref() const keyListLoad = ref(true) @@ -121,7 +122,33 @@ const loadEchartOptions = (stats) => { ] }) } - +const dialogVisible = ref(false) +const keyTemplate = ref('') +const cacheKeys = ref() +const cacheForm = ref<{ + key: string + value: string +}>({ + key: '', + value: '' +}) +const openKeyTemplate = async (row: RedisKeyInfo) => { + keyTemplate.value = row.keyTemplate + cacheKeys.value = await RedisApi.getKeyListApi(row.keyTemplate) + dialogVisible.value = true +} +const handleDeleteKey = async (row) => { + RedisApi.deleteKeyApi(row) + ElMessage.success('删除成功') +} +const handleDeleteKeys = async (row) => { + RedisApi.deleteKeysApi(row) + ElMessage.success('删除成功') +} +const handleKeyValue = async (row) => { + const res = await RedisApi.getKeyValueApi(row) + cacheForm.value = res +} onBeforeMount(() => { readRedisInfo() }) @@ -186,7 +213,12 @@ onBeforeMount(() => { - + @@ -202,4 +234,58 @@ onBeforeMount(() => { + + + + + + + + + + + + + + + + + + + + {{ cacheForm.key }} + {{ cacheForm.value }} + + + + + + diff --git a/yudao-ui-admin-vue3/src/views/system/role/index.vue b/yudao-ui-admin-vue3/src/views/system/role/index.vue index 8606d21ec..12e3f0eb6 100644 --- a/yudao-ui-admin-vue3/src/views/system/role/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/role/index.vue @@ -1,5 +1,5 @@ - + @@ -289,21 +293,23 @@ getList() > `h-${i}px`) - // }, - // margin: { - // // ...range(50).map((i) => `mt-${i}px`), - // // ...range(50).map((i) => `mr-${i}px`), - // // ...range(50).map((i) => `mb-${i}px`), - // // ...range(50).map((i) => `ml-${i}px`) - // } }, plugins: [ plugin(({ addComponents }) => {