From f0fe3f493ff97b6dcb9ab0219bc25a3ac0c8ac40 Mon Sep 17 00:00:00 2001 From: xiangheng <11675084@qq.com> Date: Tue, 6 Aug 2024 02:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/.vscode/settings.json | 1 + admin/package.json | 42 +++++----- admin/src/api/flow/flow_apply.ts | 75 +++++++++++++++--- admin/src/api/flow/flow_history.ts | 79 ++++++++++++++++--- admin/src/api/flow/flow_template.ts | 63 ++++++++++++--- admin/src/views/flow/flow_apply/edit.vue | 3 +- admin/src/views/flow/flow_apply/finish.vue | 5 +- admin/src/views/flow/flow_apply/index.vue | 11 ++- admin/src/views/flow/flow_history/done.vue | 6 +- admin/src/views/flow/flow_history/todo.vue | 3 +- admin/src/views/flow/flow_template/edit.vue | 4 +- admin/src/views/flow/flow_template/index.vue | 2 +- admin/src/views/monitor_web/index.vue | 6 +- server.code-workspace | 13 ++- .../tpl_utils/templates/vue/api.ts.tpl | 2 +- server/admin/system/role/perm_service.go | 3 +- 16 files changed, 240 insertions(+), 78 deletions(-) diff --git a/admin/.vscode/settings.json b/admin/.vscode/settings.json index a4a0874..3542a5c 100644 --- a/admin/.vscode/settings.json +++ b/admin/.vscode/settings.json @@ -10,6 +10,7 @@ "scss.validate": false, "cSpell.words": [ "brotli", + "btns", "datetimerange", "echarts", "execa", diff --git a/admin/package.json b/admin/package.json index bf066e0..395e81e 100644 --- a/admin/package.json +++ b/admin/package.json @@ -15,28 +15,28 @@ "dependencies": { "@element-plus/icons-vue": "^2.3.1", "@highlightjs/vue-plugin": "^2.1.0", - "@logicflow/core": "^1.2.27", - "@logicflow/extension": "^1.2.27", - "@vue/shared": "^3.4.27", - "@vueuse/core": "^10.10.0", + "@logicflow/core": "^1.2.28", + "@logicflow/extension": "^1.2.28", + "@vue/shared": "^3.4.35", + "@vueuse/core": "^10.11.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.12", "axios": "^1.7.2", "crypto-js": "^4.2.0", "css-color-function": "^1.3.3", - "dayjs": "^1.11.11", - "echarts": "^5.5.0", - "element-plus": "^2.7.5", - "highlight.js": "^11.9.0", + "dayjs": "^1.11.12", + "echarts": "^5.5.1", + "element-plus": "^2.7.8", + "highlight.js": "^11.10.0", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", - "pinia": "^2.1.7", - "query-string": "^9.0.0", + "pinia": "^2.2.0", + "query-string": "^9.1.0", "vform3-builds": "^3.0.10", - "vue": "^3.4.27", + "vue": "^3.4.35", "vue-clipboard3": "^2.0.0", "vue-echarts": "^6.7.3", - "vue-router": "^4.3.3", + "vue-router": "^4.4.2", "vue3-video-play": "^1.3.2", "vuedraggable": "^4.1.0" }, @@ -45,7 +45,7 @@ "@types/lodash-es": "^4.17.12", "@types/node": "^20.14.2", "@types/nprogress": "^0.2.3", - "@vitejs/plugin-vue": "^5.0.5", + "@vitejs/plugin-vue": "^5.1.2", "@vitejs/plugin-vue-jsx": "^4.0.0", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", @@ -56,17 +56,17 @@ "execa": "^9.2.0", "fs-extra": "^11.2.0", "postcss": "^8.4.38", - "prettier": "^3.3.1", + "prettier": "^3.3.3", "rollup-plugin-visualizer": "^5.12.0", - "sass": "^1.77.4", - "tailwindcss": "^3.4.4", - "typescript": "~5.4.5", - "unplugin-auto-import": "^0.17.6", - "unplugin-vue-components": "^0.27.0", - "vite": "^5.2.13", + "sass": "^1.77.8", + "tailwindcss": "^3.4.7", + "typescript": "~5.5.4", + "unplugin-auto-import": "^0.17.8", + "unplugin-vue-components": "^0.27.3", + "vite": "^5.3.5", "vite-plugin-compression": "^0.5.1", "vite-plugin-style-import": "^2.0.0", "vite-plugin-svg-icons": "^2.0.1", - "vue-tsc": "^2.0.21" + "vue-tsc": "^2.0.29" } } diff --git a/admin/src/api/flow/flow_apply.ts b/admin/src/api/flow/flow_apply.ts index 04b1977..131ecbc 100644 --- a/admin/src/api/flow/flow_apply.ts +++ b/admin/src/api/flow/flow_apply.ts @@ -1,26 +1,83 @@ import request from '@/utils/request' +import type { Pages } from '@/utils/request' + +export type type_flow_apply = { + id?: number + templateId?: number + applyUserId?: number + applyUserNickname?: string + flowName?: string + flowGroup?: number + flowRemark?: string + flowFormData?: string + flowProcessData?: string + flowProcessDataList?: string + formValue?: string + status?: number + isDelete?: number + createTime?: string + updateTime?: string + deleteTime?: string +} +// 查询 +export type type_flow_apply_query = { + templateId?: number + applyUserId?: number + applyUserNickname?: string + flowName?: string + flowGroup?: number + flowRemark?: string + flowFormData?: string + flowProcessData?: string + flowProcessDataList?: string + formValue?: string + status?: number + createTimeStart?: string + createTimeEnd?: string + updateTimeStart?: string + updateTimeEnd?: string +} +// 添加编辑 +export type type_flow_apply_edit = { + id?: number + templateId?: number + applyUserId?: number + applyUserNickname?: string + flowName?: string + flowGroup?: number + flowRemark?: string + flowFormData?: string + flowProcessData?: string + flowProcessDataList?: string + formValue?: string + status?: number +} // 申请流程列表 -export function flow_apply_lists(params?: Record) { - return request.get({ url: '/flow/flow_apply/list', params }) +export function flow_apply_lists(params?: type_flow_apply_query) { + return request.get>({ url: '/flow/flow_apply/list', params }) +} +// 申请流程列表-所有 +export function flow_apply_list_all(params?: type_flow_apply_query) { + return request.get>({ url: '/flow/flow_apply/listAll', params }) } // 申请流程详情 export function flow_apply_detail(params: Record) { - return request.get({ url: '/flow/flow_apply/detail', params }) + return request.get({ url: '/flow/flow_apply/detail', params: params }) } // 申请流程新增 -export function flow_apply_add(data: Record) { - return request.post({ url: '/flow/flow_apply/add', data }) +export function flow_apply_add(data: type_flow_apply_edit) { + return request.post({ url: '/flow/flow_apply/add', data }) } // 申请流程编辑 -export function flow_apply_edit(data: Record) { - return request.post({ url: '/flow/flow_apply/edit', data }) +export function flow_apply_edit(data: type_flow_apply_edit) { + return request.post({ url: '/flow/flow_apply/edit', data }) } // 申请流程删除 -export function flow_apply_delete(data: Record) { - return request.post({ url: '/flow/flow_apply/del', data }) +export function flow_apply_delete(id: number | string) { + return request.post({ url: '/flow/flow_apply/del', data: { id } }) } diff --git a/admin/src/api/flow/flow_history.ts b/admin/src/api/flow/flow_history.ts index 9f72df0..01c34ab 100644 --- a/admin/src/api/flow/flow_history.ts +++ b/admin/src/api/flow/flow_history.ts @@ -1,32 +1,87 @@ import request from '@/utils/request/index' +import type { Pages } from '@/utils/request' + +export type type_flow_history = { + id?: number + applyId?: number + templateId?: number + applyUserId?: number + applyUserNickname?: string + approverId?: number + approverNickname?: string + nodeId?: string + nodeType?: string + nodeLabel?: string + formValue?: string + passStatus?: number + passRemark?: string + createTime?: string + updateTime?: string + deleteTime?: string +} +// 查询 +export type type_flow_history_query = { + applyId?: number + templateId?: number + applyUserId?: number + applyUserNickname?: string + approverId?: number + approverNickname?: string + nodeId?: string + nodeType?: string + nodeLabel?: string + formValue?: string + passStatus?: number + passRemark?: string + createTimeStart?: string + createTimeEnd?: string + updateTimeStart?: string + updateTimeEnd?: string +} +// 添加编辑 +export type type_flow_history_edit = { + id?: number + applyId?: number + templateId?: number + applyUserId?: number + applyUserNickname?: string + approverId?: number + approverNickname?: string + nodeId?: string + nodeType?: string + nodeLabel?: string + formValue?: string + passStatus?: number + passRemark?: string +} // 流程历史列表 -export function flow_history_list(params?: Record) { - return request.get({ url: '/flow/flow_history/list', params }) +export function flow_history_list(params?: type_flow_history_query) { + return request.get>({ url: '/flow/flow_history/list', params }) } // 流程历史列表-所有 -export function flow_history_list_all(params?: Record) { - return request.get({ url: '/flow/flow_history/listAll', params }) +export function flow_history_list_all(params?: type_flow_history_query) { + return request.get>({ url: '/flow/flow_history/listAll', params }) } // 流程历史详情 -export function flow_history_detail(params: Record) { - return request.get({ url: '/flow/flow_history/detail', params }) +export function flow_history_detail(id: number | string) { + return request.get({ url: '/flow/flow_history/detail', params: { id } }) } // 流程历史新增 -export function flow_history_add(data: Record) { - return request.post({ url: '/flow/flow_history/add', data }) +export function flow_history_add(data: type_flow_history_edit) { + return request.post({ url: '/flow/flow_history/add', data }) } // 流程历史编辑 -export function flow_history_edit(data: Record) { - return request.post({ url: '/flow/flow_history/edit', data }) +export function flow_history_edit(data: type_flow_history_edit) { + return request.post({ url: '/flow/flow_history/edit', data }) } // 流程历史删除 -export function flow_history_delete(data: Record) { - return request.post({ url: '/flow/flow_history/del', data }) +export function flow_history_delete(id: number | string) { + return request.post({ url: '/flow/flow_history/del', data: { id } }) } // 获取下一个审批节点,中间可能有系统任务和结束节点被跳过 diff --git a/admin/src/api/flow/flow_template.ts b/admin/src/api/flow/flow_template.ts index 6be3532..6af2be8 100644 --- a/admin/src/api/flow/flow_template.ts +++ b/admin/src/api/flow/flow_template.ts @@ -1,31 +1,68 @@ import request from '@/utils/request' +import type { Pages } from '@/utils/request' -// 流程模板列表 -export function flow_template_lists(params?: Record) { - return request.get({ url: '/flow/flow_template/list', params }) +export type type_flow_template = { + id?: number + flowName?: string + flowGroup?: number + flowRemark?: string + flowFormData?: string + flowProcessData?: string + flowProcessDataList?: string + isDelete?: number + createTime?: string + updateTime?: string + deleteTime?: string +} +// 查询 +export type type_flow_template_query = { + flowName?: string + flowGroup?: number + flowRemark?: string + flowFormData?: string + flowProcessData?: string + flowProcessDataList?: string + createTimeStart?: string + createTimeEnd?: string + updateTimeStart?: string + updateTimeEnd?: string +} +// 添加编辑 +export type type_flow_template_edit = { + id?: number + flowName?: string + flowGroup?: number + flowRemark?: string + flowFormData?: string + flowProcessData?: string + flowProcessDataList?: string } +// 流程模板列表 +export function flow_template_lists(params?: type_flow_template_query) { + return request.get>({ url: '/flow/flow_template/list', params }) +} // 流程模板列表-所有 -export function flow_template_lists_all(params?: Record) { - return request.get({ url: '/flow/flow_template/listAll', params }) +export function flow_template_lists_all(params?: type_flow_template_query) { + return request.get({ url: '/flow/flow_template/listAll', params }) } // 流程模板详情 -export function flow_template_detail(params: Record) { - return request.get({ url: '/flow/flow_template/detail', params }) +export function flow_template_detail(id: number | string) { + return request.get({ url: '/flow/flow_template/detail', params: { id } }) } // 流程模板新增 -export function flow_template_add(data: Record) { - return request.post({ url: '/flow/flow_template/add', data }) +export function flow_template_add(data: type_flow_template_edit) { + return request.post({ url: '/flow/flow_template/add', data }) } // 流程模板编辑 -export function flow_template_edit(data: Record) { - return request.post({ url: '/flow/flow_template/edit', data }) +export function flow_template_edit(data: type_flow_template_edit) { + return request.post({ url: '/flow/flow_template/edit', data }) } // 流程模板删除 -export function flow_template_delete(data: Record) { - return request.post({ url: '/flow/flow_template/del', data }) +export function flow_template_delete(id: number | string) { + return request.post({ url: '/flow/flow_template/del', data: { id } }) } diff --git a/admin/src/views/flow/flow_apply/edit.vue b/admin/src/views/flow/flow_apply/edit.vue index b4792b5..6210293 100644 --- a/admin/src/views/flow/flow_apply/edit.vue +++ b/admin/src/views/flow/flow_apply/edit.vue @@ -38,6 +38,7 @@ import type { FormInstance } from 'element-plus' import { flow_apply_edit, flow_apply_add, flow_apply_detail } from '@/api/flow/flow_apply' import { flow_template_lists_all } from '@/api/flow/flow_template' +import type { type_flow_template } from '@/api/flow/flow_template' import Popup from '@/components/popup/index.vue' import feedback from '@/utils/feedback' @@ -143,7 +144,7 @@ const formRules = { } ] } -const flow_template = ref([]) +const flow_template = ref([]) const get_flow_template = async () => { flow_template.value = await flow_template_lists_all() } diff --git a/admin/src/views/flow/flow_apply/finish.vue b/admin/src/views/flow/flow_apply/finish.vue index 1101919..6224d1e 100644 --- a/admin/src/views/flow/flow_apply/finish.vue +++ b/admin/src/views/flow/flow_apply/finish.vue @@ -107,6 +107,7 @@ import { flow_apply_edit, flow_apply_detail } from '@/api/flow/flow_apply' +import type { type_flow_apply } from '@/api/flow/flow_apply' import { useDictData } from '@/hooks/useDictOptions' import { usePaging } from '@/hooks/usePaging' @@ -131,7 +132,7 @@ const queryParams = reactive({ status: '3' }) -const { pager, getLists, resetPage, resetParams } = usePaging({ +const { pager, getLists, resetPage, resetParams } = usePaging({ fetchFun: flow_apply_lists, params: queryParams }) @@ -142,7 +143,7 @@ const { dictData } = useDictData<{ const handleDelete = async (id: number) => { await feedback.confirm('确定要删除?') - await flow_apply_delete({ id }) + await flow_apply_delete(id) feedback.msgSuccess('删除成功') getLists() } diff --git a/admin/src/views/flow/flow_apply/index.vue b/admin/src/views/flow/flow_apply/index.vue index 4e41b9a..fc13713 100644 --- a/admin/src/views/flow/flow_apply/index.vue +++ b/admin/src/views/flow/flow_apply/index.vue @@ -143,7 +143,10 @@ import { flow_apply_detail } from '@/api/flow/flow_apply' +import type { type_flow_apply } from '@/api/flow/flow_apply' + import { useDictData } from '@/hooks/useDictOptions' +import type { type_dict } from '@/hooks/useDictOptions' import { usePaging } from '@/hooks/usePaging' import feedback from '@/utils/feedback' import EditPopup from './edit.vue' @@ -174,13 +177,13 @@ const queryParams = reactive({ status: '' }) -const { pager, getLists, resetPage, resetParams } = usePaging({ +const { pager, getLists, resetPage, resetParams } = usePaging({ fetchFun: flow_apply_lists, params: queryParams }) const { dictData } = useDictData<{ - flow_apply_status: any[] - flow_group: any[] + flow_apply_status: type_dict[] + flow_group: type_dict[] }>(['flow_apply_status', 'flow_group']) const handleAdd = async () => { @@ -198,7 +201,7 @@ const handleAdd = async () => { const handleDelete = async (id: number) => { await feedback.confirm('确定要删除?') - await flow_apply_delete({ id }) + await flow_apply_delete(id) feedback.msgSuccess('删除成功') getLists() } diff --git a/admin/src/views/flow/flow_history/done.vue b/admin/src/views/flow/flow_history/done.vue index 242ba66..46cf0aa 100644 --- a/admin/src/views/flow/flow_history/done.vue +++ b/admin/src/views/flow/flow_history/done.vue @@ -73,6 +73,8 @@