From 004051562e94537eecb3ea9a83cfb7d1c6ea55a3 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Mon, 30 Jun 2025 23:24:35 +0800 Subject: [PATCH] 优化代码 --- src/api/oa/oaWorkflowManageApi.js | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/oa/addOaWorkflow.vue | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/oa/deleteOaWorkflow.vue | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/oa/editOaWorkflow.vue | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/i18n/oaI18n.js | 3 +++ src/router/oaRouter.js | 5 +++++ src/views/oa/oaWorkflowManageLang.js | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/oa/oaWorkflowManageList.vue | 317 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 801 insertions(+), 0 deletions(-) create mode 100644 src/api/oa/oaWorkflowManageApi.js create mode 100644 src/components/oa/addOaWorkflow.vue create mode 100644 src/components/oa/deleteOaWorkflow.vue create mode 100644 src/components/oa/editOaWorkflow.vue create mode 100644 src/views/oa/oaWorkflowManageLang.js create mode 100644 src/views/oa/oaWorkflowManageList.vue diff --git a/src/api/oa/oaWorkflowManageApi.js b/src/api/oa/oaWorkflowManageApi.js new file mode 100644 index 0000000..3deff66 --- /dev/null +++ b/src/api/oa/oaWorkflowManageApi.js @@ -0,0 +1,81 @@ +import request from '@/utils/request' + +// 查询流程列表 +export function getOaWorkflowList(params) { + return new Promise((resolve, reject) => { + request({ + url: '/oaWorkflow/queryOaWorkflow', + method: 'get', + params + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 新增流程 +export function saveOaWorkflow(data) { + return new Promise((resolve, reject) => { + request({ + url: '/oaWorkflow/saveOaWorkflow', + method: 'post', + data + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 修改流程 +export function updateOaWorkflow(data) { + return new Promise((resolve, reject) => { + request({ + url: '/oaWorkflow/updateOaWorkflow', + method: 'post', + data + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 删除流程 +export function deleteOaWorkflow(data) { + return new Promise((resolve, reject) => { + request({ + url: '/oaWorkflow/deleteOaWorkflow', + method: 'post', + data + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 发布流程 +export function deployModel(data) { + return new Promise((resolve, reject) => { + request({ + url: '/workflow/deployModel', + method: 'post', + data + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/components/oa/addOaWorkflow.vue b/src/components/oa/addOaWorkflow.vue new file mode 100644 index 0000000..fc81603 --- /dev/null +++ b/src/components/oa/addOaWorkflow.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + {{ $t('common.cancel') }} + + + {{ $t('common.confirm') }} + + + + + + \ No newline at end of file diff --git a/src/components/oa/deleteOaWorkflow.vue b/src/components/oa/deleteOaWorkflow.vue new file mode 100644 index 0000000..96457b9 --- /dev/null +++ b/src/components/oa/deleteOaWorkflow.vue @@ -0,0 +1,53 @@ + + + + {{ $t('oaWorkflowManage.delete.confirmText') }} + + + + {{ $t('common.cancel') }} + + + {{ $t('common.confirm') }} + + + + + + \ No newline at end of file diff --git a/src/components/oa/editOaWorkflow.vue b/src/components/oa/editOaWorkflow.vue new file mode 100644 index 0000000..16118c2 --- /dev/null +++ b/src/components/oa/editOaWorkflow.vue @@ -0,0 +1,95 @@ + + + + + + + + + + + + + {{ $t('common.cancel') }} + + + {{ $t('common.confirm') }} + + + + + + \ No newline at end of file diff --git a/src/i18n/oaI18n.js b/src/i18n/oaI18n.js index e4a242f..1337f88 100644 --- a/src/i18n/oaI18n.js +++ b/src/i18n/oaI18n.js @@ -26,6 +26,7 @@ import { messages as examineStaffManageMessages } from '../views/oa/examineStaff import { messages as addExamineStaffMessages } from '../views/oa/addExamineStaffLang' import { messages as editExamineStaffMessages } from '../views/oa/editExamineStaffLang' import { messages as examineStaffValueMessages } from '../views/oa/examineStaffValueLang' +import { messages as oaWorkflowManageMessages } from '../views/oa/oaWorkflowManageLang' export const messages ={ en:{ @@ -57,6 +58,7 @@ export const messages ={ ...addExamineStaffMessages.en, ...editExamineStaffMessages.en, ...examineStaffValueMessages.en, + ...oaWorkflowManageMessages.en, }, zh:{ ...activitiesTypeManageMessages.zh, @@ -87,5 +89,6 @@ export const messages ={ ...addExamineStaffMessages.zh, ...editExamineStaffMessages.zh, ...examineStaffValueMessages.zh, + ...oaWorkflowManageMessages.zh, } } \ No newline at end of file diff --git a/src/router/oaRouter.js b/src/router/oaRouter.js index de1f73a..b549205 100644 --- a/src/router/oaRouter.js +++ b/src/router/oaRouter.js @@ -124,4 +124,9 @@ export default [ name: '/pages/examine/examineStaffValue', component: () => import('@/views/oa/examineStaffValueList.vue') }, + { + path:'/pages/property/oaWorkflowManage', + name:'/pages/property/oaWorkflowManage', + component: () => import('@/views/oa/oaWorkflowManageList.vue') + }, ] \ No newline at end of file diff --git a/src/views/oa/oaWorkflowManageLang.js b/src/views/oa/oaWorkflowManageLang.js new file mode 100644 index 0000000..59fbcab --- /dev/null +++ b/src/views/oa/oaWorkflowManageLang.js @@ -0,0 +1,130 @@ +export const messages = { + en: { + oaWorkflowManage: { + search: { + title: 'Search Conditions', + flowNamePlaceholder: 'Please enter workflow name', + flowTypePlaceholder: 'Please select workflow type', + selectAll: 'All' + }, + list: { + title: 'Workflow Instances', + addWorkflow: 'New Workflow' + }, + table: { + flowId: 'Workflow ID', + flowName: 'Workflow Name', + flowType: 'Workflow Type', + normalFlow: 'Normal Workflow', + unknown: 'Unknown', + modelId: 'Model ID', + state: 'Status', + deployed: 'Deployed', + pendingDeploy: 'Pending Deploy', + describle: 'Description', + createTime: 'Create Time', + workflow: 'Workflow', + designForm: 'Design Form', + deploy: 'Deploy' + }, + add: { + title: 'New Workflow', + flowName: 'Workflow Name', + flowNamePlaceholder: 'Required, please enter workflow name', + flowType: 'Workflow Type', + flowTypePlaceholder: 'Required, please select workflow type', + describle: 'Remark', + describlePlaceholder: 'Optional, please enter remark', + success: 'Add successfully', + error: 'Add failed' + }, + edit: { + title: 'Edit Workflow', + flowName: 'Workflow Name', + flowNamePlaceholder: 'Required, please enter workflow name', + describle: 'Remark', + describlePlaceholder: 'Optional, please enter remark', + success: 'Edit successfully', + error: 'Edit failed' + }, + delete: { + title: 'Confirm Operation', + confirmText: 'Are you sure to delete this workflow instance?', + success: 'Delete successfully', + error: 'Delete failed' + }, + validate: { + flowNameRequired: 'Workflow name is required', + flowNameMaxLength: 'Workflow name cannot exceed 64 characters', + flowTypeRequired: 'Workflow type is required', + flowIdRequired: 'Workflow ID is required' + }, + fetchError: 'Failed to get workflow list', + deployError: 'Failed to deploy workflow' + } + }, + zh: { + oaWorkflowManage: { + search: { + title: '查询条件', + flowNamePlaceholder: '请输入流程名称', + flowTypePlaceholder: '请选择流程类型', + selectAll: '全部' + }, + list: { + title: '流程实例', + addWorkflow: '新建流程' + }, + table: { + flowId: '工作流ID', + flowName: '流程名称', + flowType: '流程类型', + normalFlow: '普通流程', + unknown: '未知', + modelId: '模型ID', + state: '状态', + deployed: '已部署', + pendingDeploy: '待部署', + describle: '描述', + createTime: '创建时间', + workflow: '流程', + designForm: '设计表单', + deploy: '发布' + }, + add: { + title: '新建流程', + flowName: '流程名称', + flowNamePlaceholder: '必填,请填写流程名称', + flowType: '流程类型', + flowTypePlaceholder: '必填,请选择流程类型', + describle: '备注', + describlePlaceholder: '选填,请填写备注', + success: '添加成功', + error: '添加失败' + }, + edit: { + title: '修改流程', + flowName: '流程名称', + flowNamePlaceholder: '必填,请填写流程名称', + describle: '备注', + describlePlaceholder: '选填,请填写备注', + success: '修改成功', + error: '修改失败' + }, + delete: { + title: '请确认您的操作', + confirmText: '确定删除流程实例', + success: '删除成功', + error: '删除失败' + }, + validate: { + flowNameRequired: '流程名称不能为空', + flowNameMaxLength: '流程名称超过64位', + flowTypeRequired: '流程类型不能为空', + flowIdRequired: '工作流ID不能为空' + }, + fetchError: '获取流程列表失败', + deployError: '发布流程失败' + } + } +} \ No newline at end of file diff --git a/src/views/oa/oaWorkflowManageList.vue b/src/views/oa/oaWorkflowManageList.vue new file mode 100644 index 0000000..183d1c6 --- /dev/null +++ b/src/views/oa/oaWorkflowManageList.vue @@ -0,0 +1,317 @@ + + + + + + {{ $t('oaWorkflowManage.search.title') }} + + + + + + + + + + + + + + + {{ $t('common.search') }} + + + + {{ $t('common.reset') }} + + + + + + + + + {{ $t('oaWorkflowManage.list.title') }} + + + {{ $t('oaWorkflowManage.list.addWorkflow') }} + + + + + + + + + {{ scope.row.flowType === '1001' ? $t('oaWorkflowManage.table.normalFlow') : $t('oaWorkflowManage.table.unknown') }} + + + + + + + {{ scope.row.state === 'C' ? $t('oaWorkflowManage.table.deployed') : $t('oaWorkflowManage.table.pendingDeploy') }} + + + + + + + + {{ $t('oaWorkflowManage.table.workflow') }} + + + {{ $t('oaWorkflowManage.table.designForm') }} + + + {{ $t('oaWorkflowManage.table.deploy') }} + + + {{ $t('common.edit') }} + + + {{ $t('common.delete') }} + + + + + + + + + + + + + + + + + + \ No newline at end of file -- libgit2 0.21.4
{{ $t('oaWorkflowManage.delete.confirmText') }}