diff --git a/.env.development b/.env.development index 14e13358631fd33bcd06157e05d685dfb50d4f11..fa845e76ba5030fecbceb8bb2383cf681163bd06 100644 --- a/.env.development +++ b/.env.development @@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api' VITE_APP_CONTEXT_PATH = '/' # 监控地址 -VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications' +VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/applications' # SnailJob 控制台地址 VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job' diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e74db40bfcd94e703617d0de83d00b004ab7132a..0000000000000000000000000000000000000000 --- a/.eslintignore +++ /dev/null @@ -1,17 +0,0 @@ -*.sh -node_modules -*.md -*.woff -*.ttf -.vscode -.idea -dist -/public -/docs -.husky -.local -/bin -.eslintrc.cjs -prettier.config.js -src/assets -tailwind.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 6042c39be0864a75105eabc787224abee03a6e41..0000000000000000000000000000000000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = { - env: { - browser: true, - node: true, - es6: true - }, - parser: 'vue-eslint-parser', - extends: [ - 'plugin:vue/vue3-recommended', - './.eslintrc-auto-import.json', - 'plugin:@typescript-eslint/recommended', - 'prettier', - 'plugin:prettier/recommended' - ], - parserOptions: { - ecmaVersion: '2020', - sourceType: 'module', - project: './tsconfig.*?.json', - parser: '@typescript-eslint/parser' - }, - plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'], - rules: { - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-this-alias': 'off', - - // vue - 'vue/multi-word-component-names': 'off', - 'vue/valid-define-props': 'off', - 'vue/no-v-model-argument': 'off', - 'prefer-rest-params': 'off', - // prettier - 'prettier/prettier': 'error', - '@typescript-eslint/ban-types': [ - 'error', - { - // 关闭空类型检查 {} - extendDefaults: true, - types: { - '{}': false, - Function: false - } - } - ] - }, - globals: { - DialogOption: 'readonly', - OptionType: 'readonly' - } -}; diff --git a/README.md b/README.md index 010adb9724595c5a5166080bf281322b4498925d..531f64b96b6eab984259c5cc1f21942c867b8ebf 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ - 本仓库为前端技术栈 [Vue3](https://v3.cn.vuejs.org) + [TS](https://www.typescriptlang.org/) + [Element Plus](https://element-plus.org/zh-CN) + [Vite](https://cn.vitejs.dev) 版本。 - 成员项目: 基于 vben(ant-design-vue) 的前端项目 [ruoyi-plus-vben](https://gitee.com/dapppp/ruoyi-plus-vben) +- 成员项目: 基于 vben5(ant-design-vue) 的前端项目 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5) - 配套后端代码仓库地址 - [RuoYi-Vue-Plus 5.X(注意版本号)](https://gitee.com/dromara/RuoYi-Vue-Plus) - [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus) diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..8b67e9edbaaf71149c57fab255b66622105bb108 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,86 @@ +import globals from 'globals'; +import pluginJs from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import pluginVue from 'eslint-plugin-vue'; +import { readFile } from 'node:fs/promises'; +import prettier from 'eslint-plugin-prettier'; + +/** + * https://blog.csdn.net/sayUonly/article/details/123482912 + * 自动导入的配置 + */ +const autoImportFile = new URL('./.eslintrc-auto-import.json', import.meta.url); +const autoImportGlobals = JSON.parse(await readFile(autoImportFile, 'utf8')); + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { + /** + * 不需要.eslintignore文件 而是在这里配置 + */ + ignores: [ + '*.sh', + 'node_modules', + '*.md', + '*.woff', + '*.ttf', + '.vscode', + '.idea', + 'dist', + '/public', + '/docs', + '.husky', + '.local', + '/bin', + '.eslintrc.cjs', + 'prettier.config.js', + 'src/assets', + 'tailwind.config.js' + ] + }, + { files: ['**/*.{js,mjs,cjs,ts,vue}'] }, + { + languageOptions: { + globals: globals.browser + } + }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + ...pluginVue.configs['flat/essential'], + { + files: ['**/*.vue'], + languageOptions: { + parserOptions: { + parser: tseslint.parser + } + } + }, + { + languageOptions: { + globals: { + // 自动导入的配置 undef + ...autoImportGlobals.globals, + DialogOption: 'readonly', + LayoutSetting: 'readonly' + } + }, + plugins: { prettier }, + rules: { + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-this-alias': 'off', + + // vue + 'vue/multi-word-component-names': 'off', + 'vue/valid-define-props': 'off', + 'vue/no-v-model-argument': 'off', + 'prefer-rest-params': 'off', + // prettier + 'prettier/prettier': 'error', + // 允许使用空Object类型 {} + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-unused-expressions': 'off' + } + } +]; diff --git a/package.json b/package.json index e67d60f26cc6cf159ae2ef79d53b0c32f1707b19..caac7c0d6bd29542617884cf882eaf23e3124dc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { + "$schema": "https://json.schemastore.org/tsconfig", "name": "ruoyi-vue-plus", - "version": "5.2.3", + "version": "5.3.0-BETA", "description": "RuoYi-Vue-Plus多租户管理系统", "author": "LionLi", "license": "MIT", @@ -10,7 +11,8 @@ "build:prod": "vite build --mode production", "build:dev": "vite build --mode development", "preview": "vite preview", - "lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", + "lint:eslint": "eslint", + "lint:eslint:fix": "eslint --fix", "prettier": "prettier --write ." }, "repository": { @@ -21,71 +23,65 @@ "@element-plus/icons-vue": "2.3.1", "@highlightjs/vue-plugin": "2.1.0", "@vueup/vue-quill": "1.2.0", - "@vueuse/core": "10.9.0", + "@vueuse/core": "11.3.0", "animate.css": "4.1.1", "await-to-js": "3.0.0", - "axios": "1.6.8", - "bpmn-js": "16.4.0", + "axios": "1.7.8", "crypto-js": "4.2.0", "diagram-js": "12.3.0", "didi": "9.0.2", "echarts": "5.5.0", - "element-plus": "2.7.8", + "element-plus": "2.8.8", "file-saver": "2.0.5", "fuse.js": "7.0.0", "highlight.js": "11.9.0", - "image-conversion": "^2.1.1", + "image-conversion": "2.1.1", "js-cookie": "3.0.5", "jsencrypt": "3.3.2", "nprogress": "0.2.0", - "pinia": "2.1.7", + "pinia": "2.2.6", "screenfull": "6.0.2", - "vue": "3.4.34", + "vue": "3.5.13", "vue-cropper": "1.1.1", - "vue-i18n": "9.10.2", - "vue-router": "4.3.2", - "vue-types": "5.1.1", + "vue-i18n": "10.0.5", + "vue-json-pretty": "2.4.0", + "vue-router": "4.4.5", + "vue-types": "5.1.3", "vxe-table": "4.5.22" }, "devDependencies": { - "@iconify/json": "2.2.201", - "@intlify/unplugin-vue-i18n": "3.0.1", + "@eslint/js": "9.15.0", + "@iconify/json": "2.2.276", "@types/crypto-js": "4.2.2", "@types/file-saver": "2.0.7", "@types/js-cookie": "3.0.6", "@types/node": "18.18.2", "@types/nprogress": "0.2.3", - "@typescript-eslint/eslint-plugin": "7.3.1", - "@typescript-eslint/parser": "7.3.1", - "@unocss/preset-attributify": "0.58.6", - "@unocss/preset-icons": "0.58.6", - "@unocss/preset-uno": "0.58.6", + "@unocss/preset-attributify": "0.64.1", + "@unocss/preset-icons": "0.64.1", + "@unocss/preset-uno": "0.64.1", "@vitejs/plugin-vue": "5.0.4", "@vue/compiler-sfc": "3.4.23", "autoprefixer": "10.4.18", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-define-config": "2.1.0", - "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-promise": "6.1.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-vue": "9.23.0", + "eslint": "9.15.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-vue": "9.31.0", "fast-glob": "3.3.2", + "globals": "15.12.0", "postcss": "8.4.36", "prettier": "3.2.5", "sass": "1.72.0", - "typescript": "5.4.5", - "unocss": "0.58.6", + "typescript": "5.7.2", + "typescript-eslint": "8.16.0", + "unocss": "0.64.1", "unplugin-auto-import": "0.17.5", "unplugin-icons": "0.18.5", "unplugin-vue-components": "0.26.0", "unplugin-vue-setup-extend-plus": "1.0.1", - "vite": "5.2.12", + "vite": "5.4.11", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", "vitest": "1.5.0", - "vue-eslint-parser": "9.4.2", "vue-tsc": "2.0.13" } } diff --git a/src/api/login.ts b/src/api/login.ts index c7c291e58f20ed2ffbc35a67ea53d2d26114ffea..35e6a4ea0284a64ad71ba83ebd6209a584539e3b 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -51,10 +51,12 @@ export function register(data: any) { * 注销 */ export function logout() { - request({ - url: '/resource/sse/close', - method: 'get' - }); + if (import.meta.env.VITE_APP_SSE === 'true') { + request({ + url: '/resource/sse/close', + method: 'get' + }); + } return request({ url: '/auth/logout', method: 'post' @@ -100,11 +102,11 @@ export function getInfo(): AxiosPromise { } // 获取租户列表 -export function getTenantList(): AxiosPromise { +export function getTenantList(isToken: boolean): AxiosPromise { return request({ url: '/auth/tenant/list', headers: { - isToken: false + isToken: isToken }, method: 'get' }); diff --git a/src/api/monitor/online/index.ts b/src/api/monitor/online/index.ts index 74847026f16f39a66ad870bc2f80793806e90583..5b3221c173884fb078b33c9e131f4f607417fe5d 100644 --- a/src/api/monitor/online/index.ts +++ b/src/api/monitor/online/index.ts @@ -30,7 +30,7 @@ export function getOnline() { // 删除当前在线设备 export function delOnline(tokenId: string) { return request({ - url: '/monitor/online/' + tokenId, - method: 'post' + url: '/monitor/online/myself/' + tokenId, + method: 'delete' }); } diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts index 7e097fdaa2228baac7dbf37d5e49ec3f4f95d7ca..f16cb2ca4f9851446ceda45f26fd4f99718f9c7f 100644 --- a/src/api/system/dept/index.ts +++ b/src/api/system/dept/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { DeptForm, DeptQuery, DeptVO } from './types'; +import {DeptForm, DeptQuery, DeptTreeVO, DeptVO} from './types'; // 查询部门列表 export const listDept = (query?: DeptQuery) => { @@ -11,6 +11,17 @@ export const listDept = (query?: DeptQuery) => { }); }; +/** + * 通过deptIds查询部门 + * @param deptIds + */ +export const optionSelect = (deptIds: (number | string)[]): AxiosPromise => { + return request({ + url: '/system/dept/optionselect?deptIds=' + deptIds, + method: 'get' + }); +}; + // 查询部门列表(排除节点) export const listDeptExcludeChild = (deptId: string | number): AxiosPromise => { return request({ @@ -28,7 +39,7 @@ export const getDept = (deptId: string | number): AxiosPromise => { }; // 查询部门下拉树结构 -export const treeselect = (): AxiosPromise => { +export const treeselect = (): AxiosPromise => { return request({ url: '/system/dept/treeselect', method: 'get' diff --git a/src/api/system/dept/types.ts b/src/api/system/dept/types.ts index 494745c44bba00500b1307c44cd8bc0e59b30564..adaefd26b1172f14d68fef9ea91bf9e4ef9c1a14 100644 --- a/src/api/system/dept/types.ts +++ b/src/api/system/dept/types.ts @@ -28,6 +28,18 @@ export interface DeptVO extends BaseEntity { menuId: string | number; } +/** + * 部门类型 + */ +export interface DeptTreeVO extends BaseEntity { + id: number | string; + label: string; + parentId: number | string; + weight: number; + children: DeptTreeVO[]; + disabled: boolean; +} + /** * 部门表单类型 */ diff --git a/src/api/system/tenant/index.ts b/src/api/system/tenant/index.ts index 7b7b93f0b7461f9f7149092573542c3122aeceb0..d1d8ff82e389bd55eea2526bd1999dd074f643ae 100644 --- a/src/api/system/tenant/index.ts +++ b/src/api/system/tenant/index.ts @@ -96,6 +96,6 @@ export function syncTenantPackage(tenantId: string | number, packageId: string | export function syncTenantDict() { return request({ url: '/system/tenant/syncTenantDict', - method: 'get', + method: 'get' }); } diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 25c78848a2c7509ca425dc6bd3404b60dd7571d2..0867c48f7c35a7f6601a2def764532e884d81340 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -1,4 +1,4 @@ -import { DeptVO } from './../dept/types'; +import {DeptTreeVO, DeptVO} from './../dept/types'; import { RoleVO } from '@/api/system/role/types'; import request from '@/utils/request'; import { AxiosPromise } from 'axios'; @@ -202,7 +202,7 @@ export const listUserByDeptId = (deptId: string | number): AxiosPromise => { +export const deptTreeSelect = (): AxiosPromise => { return request({ url: '/system/user/deptTree', method: 'get' diff --git a/src/api/workflow/category/index.ts b/src/api/workflow/category/index.ts index e9723b05d4cfde93d1c071171ba6c3bc06af80fc..b6a83ea6ebacc1bb7db95e15558bee3e972cfdd6 100644 --- a/src/api/workflow/category/index.ts +++ b/src/api/workflow/category/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { CategoryVO, CategoryForm, CategoryQuery } from '@/api/workflow/category/types'; +import { CategoryVO, CategoryForm, CategoryQuery, CategoryTreeVO } from '@/api/workflow/category/types'; /** * 查询流程分类列表 @@ -18,11 +18,11 @@ export const listCategory = (query?: CategoryQuery): AxiosPromise /** * 查询流程分类详细 - * @param id + * @param categoryId */ -export const getCategory = (id: string | number): AxiosPromise => { +export const getCategory = (categoryId: string | number): AxiosPromise => { return request({ - url: '/workflow/category/' + id, + url: '/workflow/category/' + categoryId, method: 'get' }); }; @@ -53,11 +53,24 @@ export const updateCategory = (data: CategoryForm) => { /** * 删除流程分类 - * @param id + * @param categoryId */ -export const delCategory = (id: string | number | Array) => { +export const delCategory = (categoryId: string | number | Array) => { return request({ - url: '/workflow/category/' + id, + url: '/workflow/category/' + categoryId, method: 'delete' }); }; + +/** + * 获取流程分类树列表 + * @param query 流程实例id + * @returns + */ +export const categoryTree = (query?: CategoryForm): AxiosPromise => { + return request({ + url: `/workflow/category/categoryTree`, + method: 'get', + params: query + }); +}; diff --git a/src/api/workflow/category/types.ts b/src/api/workflow/category/types.ts index 414fa55ed8da5f8bbc6ac72eb36d04bc12361966..a09307376e3e0c89ee033840062326c8d6c094c2 100644 --- a/src/api/workflow/category/types.ts +++ b/src/api/workflow/category/types.ts @@ -1,67 +1,72 @@ +export interface CategoryTreeVO { + id: number | string; + label: string; + parentId: number | string; + weight: number; + children: CategoryTreeVO[]; +} export interface CategoryVO { + /** - * 主键 + * 流程分类ID */ - id: string; + categoryId: string | number; /** - * 分类名称 + * 父级id */ - categoryName: string; + parentId: string | number; /** - * 分类编码 + * 流程分类名称 */ - categoryCode: string; + categoryName: string; /** - * 父级id + * 显示顺序 */ - parentId: string | number; + orderNum: number; /** - * 排序 + * 创建时间 */ - sortNum: number; + createTime: string; - children?: CategoryVO[]; + /** + * 子对象 + */ + children: CategoryVO[]; } export interface CategoryForm extends BaseEntity { - /** - * 主键 - */ - id?: string | number; /** - * 分类名称 + * 流程分类ID */ - categoryName?: string; + categoryId?: string | number; /** - * 分类编码 + * 流程分类名称 */ - categoryCode?: string; + categoryName?: string; /** - * 父级id + * 父流程分类id */ parentId?: string | number; /** - * 排序 + * 显示顺序 */ - sortNum?: number; + orderNum?: number; + } -export interface CategoryQuery extends PageQuery { +export interface CategoryQuery { + /** - * 分类名称 + * 流程分类名称 */ categoryName?: string; - /** - * 分类编码 - */ - categoryCode?: string; } diff --git a/src/api/workflow/definition/index.ts b/src/api/workflow/definition/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..49e6ee8f74dbfcc4ff1685cc002c317918bae1c5 --- /dev/null +++ b/src/api/workflow/definition/index.ts @@ -0,0 +1,170 @@ +import request from '@/utils/request'; +import { FlowDefinitionQuery, definitionXmlVO, FlowDefinitionForm, FlowDefinitionVo } from '@/api/workflow/definition/types'; +import { AxiosPromise } from 'axios'; + +/** + * 获取流程定义列表 + * @param query 流程实例id + * @returns + */ +export const listDefinition = (query: FlowDefinitionQuery): AxiosPromise => { + return request({ + url: `/workflow/definition/list`, + method: 'get', + params: query + }); +}; + +/** + * 查询未发布的流程定义列表 + * @param query 流程实例id + * @returns + */ +export const unPublishList = (query: FlowDefinitionQuery): AxiosPromise => { + return request({ + url: `/workflow/definition/unPublishList`, + method: 'get', + params: query + }); +}; + +/** + * 通过流程定义id获取xml + * @param definitionId 流程定义id + * @returns + */ +export const definitionXml = (definitionId: string): AxiosPromise => { + return request({ + url: `/workflow/definition/definitionXml/${definitionId}`, + method: 'get' + }); +}; + +/** + * 删除流程定义 + * @param id 流程定义id + * @returns + */ +export const deleteDefinition = (id: string | string[]) => { + return request({ + url: `/workflow/definition/${id}`, + method: 'delete' + }); +}; + +/** + * 挂起/激活 + * @param definitionId 流程定义id + * @param activityStatus 状态 + * @returns + */ +export const active = (definitionId: string, activityStatus: boolean) => { + return request({ + url: `/workflow/definition/active/${definitionId}`, + method: 'put', + params: { + active: activityStatus + } + }); +}; + +/** + * 通过zip或xml部署流程定义 + * @returns + */ +export function importDef(data: any) { + return request({ + url: '/workflow/definition/importDef', + method: 'post', + data: data, + headers: { + repeatSubmit: false + } + }); +} + +/** + * 发布流程定义 + * @param id 流程定义id + * @returns + */ +export const publish = (id: string) => { + return request({ + url: `/workflow/definition/publish/${id}`, + method: 'put' + }); +}; + +/** + * 取消发布流程定义 + * @param id 流程定义id + * @returns + */ +export const unPublish = (id: string) => { + return request({ + url: `/workflow/definition/unPublish/${id}`, + method: 'put' + }); +}; + +/** + * 获取流程定义xml字符串 + * @param id 流程定义id + * @returns + */ +export const xmlString = (id: string) => { + return request({ + url: `/workflow/definition/xmlString/${id}`, + method: 'get' + }); +}; + +/** + * 新增 + * @param data 参数 + * @returns + */ +export const add = (data: FlowDefinitionForm) => { + return request({ + url: `/workflow/definition`, + method: 'post', + data: data + }); +}; + +/** + * 修改 + * @param data 参数 + * @returns + */ +export const edit = (data: FlowDefinitionForm) => { + return request({ + url: `/workflow/definition`, + method: 'put', + data: data + }); +}; + +/** + * 查询详情 + * @param id 参数 + * @returns + */ +export const getInfo = (id: number | string) => { + return request({ + url: `/workflow/definition/${id}`, + method: 'get' + }); +}; + +/** + * 复制流程定义 + * @param id 流程定义id + * @returns + */ +export const copy = (id: string) => { + return request({ + url: `/workflow/definition/copy/${id}`, + method: 'post' + }); +}; diff --git a/src/api/workflow/definition/types.ts b/src/api/workflow/definition/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..5de7f77e4270300d81108649c2b0f1e2d3381609 --- /dev/null +++ b/src/api/workflow/definition/types.ts @@ -0,0 +1,31 @@ +export interface FlowDefinitionQuery extends PageQuery { + flowCode?: string; + flowName?: string; + category: string | number; + isPublish?: number; +} + +export interface FlowDefinitionVo { + id: string; + flowName: string; + flowCode: string; + formPath: string; + version: string; + isPublish: number; + activityStatus: number; + createTime: Date; + updateTime: Date; +} + +export interface FlowDefinitionForm { + id: string; + flowName: string; + flowCode: string; + category: string; + formPath: string; +} + +export interface definitionXmlVO { + xml: string[]; + xmlStr: string; +} diff --git a/src/api/workflow/definitionConfig/index.ts b/src/api/workflow/definitionConfig/index.ts deleted file mode 100644 index d34bf05c14e4b7edcc424e082e63dca35bbbecb6..0000000000000000000000000000000000000000 --- a/src/api/workflow/definitionConfig/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definitionConfig/types'; - -/** - * 查询表单配置详细 - * @param definitionId - */ -export const getByDefId = (definitionId: string | number): AxiosPromise => { - return request({ - url: '/workflow/definitionConfig/getByDefId/' + definitionId, - method: 'get' - }); -}; - -/** - * 新增表单配置 - * @param data - */ -export const saveOrUpdate = (data: DefinitionConfigForm) => { - return request({ - url: '/workflow/definitionConfig/saveOrUpdate', - method: 'post', - data: data - }); -}; - -/** - * 删除表单配置 - * @param id - */ -export const deldefinitionConfig = (id: string | number | Array) => { - return request({ - url: '/workflow/definitionConfig/' + id, - method: 'delete' - }); -}; - -/** - * 查询流程定义配置排除当前查询的流程定义 - * @param tableName - * @param definitionId - */ -export const getByTableNameNotDefId = (tableName: string, definitionId: string | number) => { - return request({ - url: `/workflow/definitionConfig/getByTableNameNotDefId/${tableName}/${definitionId}`, - method: 'get' - }); -}; diff --git a/src/api/workflow/definitionConfig/types.ts b/src/api/workflow/definitionConfig/types.ts deleted file mode 100644 index 7627403d513874812c53ebb7e1028e3841fe3844..0000000000000000000000000000000000000000 --- a/src/api/workflow/definitionConfig/types.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { FormManageVO } from '@/api/workflow/formManage/types'; - -export interface DefinitionConfigVO { - /** - * 主键 - */ - id: string | number; - - /** - * 表名 - */ - tableName?: string; - - /** - * 流程定义ID - */ - definitionId: string | number; - - /** - * 流程KEY - */ - processKey: string; - - /** - * 流程版本 - */ - version?: string | number; - - /** - * 备注 - */ - remark: string; - - /** - * 表单管理 - */ - wfFormManageVo: FormManageVO; -} - -export interface DefinitionConfigForm extends BaseEntity { - /** - * 主键 - */ - id?: string | number; - - /** - * 表名 - */ - tableName?: string; - - /** - * 流程定义ID - */ - definitionId?: string | number; - - /** - * 流程KEY - */ - processKey?: string; - - /** - * 流程版本 - */ - version?: string | number; - - /** - * 备注 - */ - remark?: string; - - /** - * 表单管理 - */ - wfFormManageVo?: FormManageVO; -} - -export interface DefinitionConfigQuery extends PageQuery { - /** - * 表名 - */ - tableName?: string; - - /** - * 流程定义ID - */ - definitionId?: string | number; - - /** - * 流程KEY - */ - processKey?: string; - - /** - * 流程版本 - */ - version?: string | number; - - /** - * 表单管理 - */ - wfFormManageVo: FormManageVO; -} diff --git a/src/api/workflow/formManage/index.ts b/src/api/workflow/formManage/index.ts deleted file mode 100644 index 6c5ec60a7365ed3383860df65451192f2245931a..0000000000000000000000000000000000000000 --- a/src/api/workflow/formManage/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { FormManageVO, FormManageForm, FormManageQuery } from '@/api/workflow/formManage/types'; - -/** - * 查询表单管理列表 - * @param query - * @returns {*} - */ - -export const listFormManage = (query?: FormManageQuery): AxiosPromise => { - return request({ - url: '/workflow/formManage/list', - method: 'get', - params: query - }); -}; - -/** - * 查询表单管理列表 - * @param query - * @returns {*} - */ - -export const selectListFormManage = (): AxiosPromise => { - return request({ - url: '/workflow/formManage/list/selectList', - method: 'get' - }); -}; - -/** - * 查询表单管理详细 - * @param id - */ -export const getFormManage = (id: string | number): AxiosPromise => { - return request({ - url: '/workflow/formManage/' + id, - method: 'get' - }); -}; - -/** - * 新增表单管理 - * @param data - */ -export const addFormManage = (data: FormManageForm) => { - return request({ - url: '/workflow/formManage', - method: 'post', - data: data - }); -}; - -/** - * 修改表单管理 - * @param data - */ -export const updateFormManage = (data: FormManageForm) => { - return request({ - url: '/workflow/formManage', - method: 'put', - data: data - }); -}; - -/** - * 删除表单管理 - * @param id - */ -export const delFormManage = (id: string | number | Array) => { - return request({ - url: '/workflow/formManage/' + id, - method: 'delete' - }); -}; diff --git a/src/api/workflow/formManage/types.ts b/src/api/workflow/formManage/types.ts deleted file mode 100644 index b9dc1d874cfdf108f31a8e4c1e9d55ff5d5caf4b..0000000000000000000000000000000000000000 --- a/src/api/workflow/formManage/types.ts +++ /dev/null @@ -1,69 +0,0 @@ -export interface FormManageVO { - /** - * 主键 - */ - id: string | number; - - /** - * 表单名称 - */ - formName: string; - - /** - * 表单类型 - */ - formType: string; - /** - * 表单类型名称 - */ - formTypeName: string; - - /** - * 路由地址/表单ID - */ - router: string; - - /** - * 备注 - */ - remark: string; -} - -export interface FormManageForm extends BaseEntity { - /** - * 主键 - */ - id?: string | number; - - /** - * 表单名称 - */ - formName?: string; - - /** - * 表单类型 - */ - formType?: string; - - /** - * 路由地址/表单ID - */ - router?: string; - - /** - * 备注 - */ - remark?: string; -} - -export interface FormManageQuery extends PageQuery { - /** - * 表单名称 - */ - formName?: string; - - /** - * 表单类型 - */ - formType?: string; -} diff --git a/src/api/workflow/instance/index.ts b/src/api/workflow/instance/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..42d748d4c4caa53bf1f791897a8ad7e02b88bf33 --- /dev/null +++ b/src/api/workflow/instance/index.ts @@ -0,0 +1,101 @@ +import request from '@/utils/request'; +import { FlowInstanceQuery, FlowInstanceVO } from '@/api/workflow/instance/types'; +import { AxiosPromise } from 'axios'; + +/** + * 查询运行中实例列表 + * @param query + * @returns {*} + */ +export const pageByRunning = (query: FlowInstanceQuery): AxiosPromise => { + return request({ + url: '/workflow/instance/pageByRunning', + method: 'get', + params: query + }); +}; + +/** + * 查询已完成实例列表 + * @param query + * @returns {*} + */ +export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise => { + return request({ + url: '/workflow/instance/pageByFinish', + method: 'get', + params: query + }); +}; + +/** + * 通过业务id获取历史流程图 + */ +export const flowImage = (businessId: string | number) => { + return request({ + url: `/workflow/instance/flowImage/${businessId}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 分页查询当前登录人单据 + * @param query + * @returns {*} + */ +export const pageByCurrent = (query: FlowInstanceQuery): AxiosPromise => { + return request({ + url: '/workflow/instance/pageByCurrent', + method: 'get', + params: query + }); +}; + +/** + * 撤销流程 + * @param data 参数 + * @returns + */ +export const cancelProcessApply = (data: any) => { + return request({ + url: `/workflow/instance/cancelProcessApply`, + method: 'put', + data: data + }); +}; + +/** + * 获取流程变量 + * @param instanceId 实例id + * @returns + */ +export const instanceVariable = (instanceId: string | number) => { + return request({ + url: `/workflow/instance/instanceVariable/${instanceId}`, + method: 'get' + }); +}; + +/** + * 删除 + * @param instanceIds 流程实例id + * @returns + */ +export const deleteByInstanceIds = (instanceIds: Array | string | number) => { + return request({ + url: `/workflow/instance/deleteByInstanceIds/${instanceIds}`, + method: 'delete' + }); +}; +/** + * 作废流程 + * @param data 参数 + * @returns + */ +export const invalid = (data: any) => { + return request({ + url: `/workflow/instance/invalid`, + method: 'post', + data: data + }); +}; diff --git a/src/api/workflow/instance/types.ts b/src/api/workflow/instance/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..a12dab3724369bf637cd6a53d319b15abed50dfa --- /dev/null +++ b/src/api/workflow/instance/types.ts @@ -0,0 +1,26 @@ +import { FlowTaskVO } from '@/api/workflow/task/types'; + +export interface FlowInstanceQuery extends PageQuery { + category?: string | number; + nodeName?: string; + flowCode?: string; + flowName?: string; + createByIds?: string[] | number[]; + businessId?: string; +} + +export interface FlowInstanceVO extends BaseEntity { + id: string | number; + definitionId: string; + flowName: string; + flowCode: string; + version: string; + businessId: string; + activityStatus: number; + tenantId: string; + createTime: string; + createBy: string; + flowStatus: string; + flowStatusName: string; + flowTaskList: FlowTaskVO[]; +} diff --git a/src/api/workflow/model/index.ts b/src/api/workflow/model/index.ts deleted file mode 100644 index 1ca8b19c9156ad5097b2773b012b4bc5560f1866..0000000000000000000000000000000000000000 --- a/src/api/workflow/model/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { ModelForm, ModelQuery, ModelVO } from '@/api/workflow/model/types'; - -/** - * 查询模型列表 - * @param query - * @returns {*} - */ -export const listModel = (query: ModelQuery): AxiosPromise => { - return request({ - url: '/workflow/model/list', - method: 'get', - params: query - }); -}; - -/** - * 查询模型信息 - * @param query - * @returns {*} - */ -export const getInfo = (id: string): AxiosPromise => { - return request({ - url: '/workflow/model/getInfo/' + id, - method: 'get' - }); -}; - -/** - * 新增模型 - * @param data - * @returns {*} - */ -export const addModel = (data: ModelForm): AxiosPromise => { - return request({ - url: '/workflow/model/save', - method: 'post', - data: data - }); -}; - -/** - * 修改模型信息 - * @param data - * @returns {*} - */ -export function update(data: ModelForm): AxiosPromise { - return request({ - url: '/workflow/model/update', - method: 'put', - data: data - }); -} - -/** - * 修改模型信息 - * @param data - * @returns {*} - */ -export function editModelXml(data: ModelForm): AxiosPromise { - return request({ - url: '/workflow/model/editModelXml', - method: 'put', - data: data - }); -} - -/** - * 按id删除模型 - * @returns {*} - * @param id 模型id - */ -export function delModel(id: string | string[]): AxiosPromise { - return request({ - url: '/workflow/model/' + id, - method: 'delete' - }); -} - -/** - * 模型部署 - * @returns {*} - * @param id 模型id - */ -export const modelDeploy = (id: string): AxiosPromise => { - return request({ - url: `/workflow/model/modelDeploy/${id}`, - method: 'post' - }); -}; - -/** - * 复制模型 - * @param data - * @returns {*} - */ -export const copyModel = (data: ModelForm): AxiosPromise => { - return request({ - url: '/workflow/model/copyModel', - method: 'post', - data: data - }); -}; diff --git a/src/api/workflow/model/types.ts b/src/api/workflow/model/types.ts deleted file mode 100644 index 77f947d4b476240d180c538ce9e04f746ae72e93..0000000000000000000000000000000000000000 --- a/src/api/workflow/model/types.ts +++ /dev/null @@ -1,66 +0,0 @@ -export interface ModelForm { - id: string; - name: string; - key: string; - categoryCode: string; - xml: string; - svg: string; - description: string; -} - -export interface ModelQuery extends PageQuery { - name?: string; - key?: string; - categoryCode?: string; -} - -export interface OriginalPersistentState { - metaInfo: string; - editorSourceValueId: string; - createTime: string; - deploymentId?: string; - name: string; - tenantId: string; - category?: string; - version: number; - editorSourceExtraValueId?: string; - key: string; - lastUpdateTime: string; -} - -export interface PersistentState { - metaInfo: string; - editorSourceValueId: string; - createTime: string; - deploymentId?: string; - name: string; - tenantId: string; - category?: string; - version: number; - editorSourceExtraValueId?: string; - key: string; - lastUpdateTime: string; -} - -export interface ModelVO { - id: string; - revision: number; - originalPersistentState: OriginalPersistentState; - name: string; - key: string; - category?: string; - createTime: string; - lastUpdateTime: string; - version: number; - metaInfo: string; - deploymentId?: string; - editorSourceValueId: string; - editorSourceExtraValueId?: string; - tenantId: string; - persistentState: PersistentState; - revisionNext: number; - idPrefix: string; - inserted: boolean; - updated: boolean; - deleted: boolean; -} diff --git a/src/api/workflow/nodeConfig/types.ts b/src/api/workflow/nodeConfig/types.ts deleted file mode 100644 index a55fc914097b1959aa31147558b6952476cb26f3..0000000000000000000000000000000000000000 --- a/src/api/workflow/nodeConfig/types.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { FormManageVO } from '@/api/workflow/formManage/types'; - -export interface NodeConfigVO { - /** - * 主键 - */ - id: string | number; - - /** - * 表单id - */ - formId: string | number; - - /** - * 表单类型 - */ - formType: string; - - /** - * 节点名称 - */ - nodeName: string; - - /** - * 节点id - */ - nodeId: string | number; - - /** - * 流程定义id - */ - definitionId: string | number; - - /** - * 表单管理 - */ - wfFormManageVo: FormManageVO; -} diff --git a/src/api/workflow/processDefinition/index.ts b/src/api/workflow/processDefinition/index.ts deleted file mode 100644 index c06312017140e7f7cd6a127422f99a7731c3c211..0000000000000000000000000000000000000000 --- a/src/api/workflow/processDefinition/index.ts +++ /dev/null @@ -1,114 +0,0 @@ -import request from '@/utils/request'; -import { ProcessDefinitionQuery, ProcessDefinitionVO, definitionXmlVO } from '@/api/workflow/processDefinition/types'; -import { AxiosPromise } from 'axios'; - -/** - * 获取流程定义列表 - * @param query 流程实例id - * @returns - */ -export const listProcessDefinition = (query: ProcessDefinitionQuery): AxiosPromise => { - return request({ - url: `/workflow/processDefinition/list`, - method: 'get', - params: query - }); -}; -/** - * 按照流程定义key获取流程定义 - * @param processInstanceId 流程实例id - * @returns - */ -export const getListByKey = (key: string) => { - return request({ - url: `/workflow/processDefinition/getListByKey/${key}`, - method: 'get' - }); -}; - -/** - * 通过流程定义id获取流程图 - */ -export const definitionImage = (processDefinitionId: string): AxiosPromise => { - return request({ - url: `/workflow/processDefinition/definitionImage/${processDefinitionId}` + '?t' + Math.random(), - method: 'get' - }); -}; - -/** - * 通过流程定义id获取xml - * @param processDefinitionId 流程定义id - * @returns - */ -export const definitionXml = (processDefinitionId: string): AxiosPromise => { - return request({ - url: `/workflow/processDefinition/definitionXml/${processDefinitionId}`, - method: 'get' - }); -}; - -/** - * 删除流程定义 - * @param deploymentId 部署id - * @param processDefinitionId 流程定义id - * @returns - */ -export const deleteProcessDefinition = (deploymentId: string | string[], processDefinitionId: string | string[]) => { - return request({ - url: `/workflow/processDefinition/${deploymentId}/${processDefinitionId}`, - method: 'delete' - }); -}; - -/** - * 挂起/激活 - * @param processDefinitionId 流程定义id - * @returns - */ -export const updateDefinitionState = (processDefinitionId: string) => { - return request({ - url: `/workflow/processDefinition/updateDefinitionState/${processDefinitionId}`, - method: 'put' - }); -}; - -/** - * 流程定义转换为模型 - * @param processDefinitionId 流程定义id - * @returns - */ -export const convertToModel = (processDefinitionId: string) => { - return request({ - url: `/workflow/processDefinition/convertToModel/${processDefinitionId}`, - method: 'put' - }); -}; - -/** - * 通过zip或xml部署流程定义 - * @returns - */ -export function deployProcessFile(data: any) { - return request({ - url: '/workflow/processDefinition/deployByFile', - method: 'post', - data: data, - headers: { - repeatSubmit: false - } - }); -} - -/** - * 迁移流程 - * @param currentProcessDefinitionId - * @param fromProcessDefinitionId - * @returns - */ -export const migrationDefinition = (currentProcessDefinitionId: string, fromProcessDefinitionId: string) => { - return request({ - url: `/workflow/processDefinition/migrationDefinition/${currentProcessDefinitionId}/${fromProcessDefinitionId}`, - method: 'put' - }); -}; diff --git a/src/api/workflow/processDefinition/types.ts b/src/api/workflow/processDefinition/types.ts deleted file mode 100644 index 979ec253aebdce3e7c9e94974192ec77ad6b15a4..0000000000000000000000000000000000000000 --- a/src/api/workflow/processDefinition/types.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; -export interface ProcessDefinitionQuery extends PageQuery { - key?: string; - name?: string; - categoryCode?: string; -} - -export interface ProcessDefinitionVO extends BaseEntity { - id: string; - name: string; - key: string; - version: number; - suspensionState: number; - resourceName: string; - diagramResourceName: string; - deploymentId: string; - deploymentTime: string; - wfDefinitionConfigVo: DefinitionConfigVO; -} - -export interface definitionXmlVO { - xml: string[]; - xmlStr: string; -} diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts deleted file mode 100644 index 6d5e53be5249b81ec0b1fd4293ef5498e062172b..0000000000000000000000000000000000000000 --- a/src/api/workflow/processInstance/index.ts +++ /dev/null @@ -1,136 +0,0 @@ -import request from '@/utils/request'; -import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types'; -import { AxiosPromise } from 'axios'; - -/** - * 查询运行中实例列表 - * @param query - * @returns {*} - */ -export const getPageByRunning = (query: ProcessInstanceQuery): AxiosPromise => { - return request({ - url: '/workflow/processInstance/getPageByRunning', - method: 'get', - params: query - }); -}; - -/** - * 查询已完成实例列表 - * @param query - * @returns {*} - */ -export const getPageByFinish = (query: ProcessInstanceQuery): AxiosPromise => { - return request({ - url: '/workflow/processInstance/getPageByFinish', - method: 'get', - params: query - }); -}; - -/** - * 通过业务id获取历史流程图 - */ -export const getHistoryImage = (businessKey: string) => { - return request({ - url: `/workflow/processInstance/getHistoryImage/${businessKey}` + '?t' + Math.random(), - method: 'get' - }); -}; - -/** - * 通过业务id获取历史流程图运行中,历史等节点 - */ -export const getHistoryList = (businessKey: string): AxiosPromise> => { - return request({ - url: `/workflow/processInstance/getHistoryList/${businessKey}` + '?t' + Math.random(), - method: 'get' - }); -}; - -/** - * 获取审批记录 - * @param businessKey 业务id - * @returns - */ -export const getHistoryRecord = (businessKey: string | number) => { - return request({ - url: `/workflow/processInstance/getHistoryRecord/${businessKey}`, - method: 'get' - }); -}; - -/** - * 作废 - * @param data 参数 - * @returns - */ -export const deleteRunInstance = (data: object) => { - return request({ - url: `/workflow/processInstance/deleteRunInstance`, - method: 'post', - data: data - }); -}; - -/** - * 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息 - * @param businessKey 业务id - * @returns - */ -export const deleteRunAndHisInstance = (businessKey: string | string[]) => { - return request({ - url: `/workflow/processInstance/deleteRunAndHisInstance/${businessKey}`, - method: 'delete' - }); -}; - -/** - * 已完成的实例 删除程实例,删除历史记录,删除业务与流程关联信息 - * @param businessKey 业务id - * @returns - */ -export const deleteFinishAndHisInstance = (businessKey: string | string[]) => { - return request({ - url: `/workflow/processInstance/deleteFinishAndHisInstance/${businessKey}`, - method: 'delete' - }); -}; - -/** - * 分页查询当前登录人单据 - * @param query - * @returns {*} - */ -export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise => { - return request({ - url: '/workflow/processInstance/getPageByCurrent', - method: 'get', - params: query - }); -}; - -/** - * 撤销流程 - * @param businessKey 业务id - * @returns - */ -export const cancelProcessApply = (businessKey: string) => { - return request({ - url: `/workflow/processInstance/cancelProcessApply/${businessKey}`, - method: 'post' - }); -}; - -export default { - getPageByRunning, - getPageByFinish, - getHistoryImage, - getHistoryList, - getHistoryRecord, - deleteRunInstance, - deleteRunAndHisInstance, - deleteFinishAndHisInstance, - getPageByCurrent, - cancelProcessApply -}; diff --git a/src/api/workflow/processInstance/types.ts b/src/api/workflow/processInstance/types.ts deleted file mode 100644 index 99d0511acf039efa99f152e7167fe21c4fe7dfee..0000000000000000000000000000000000000000 --- a/src/api/workflow/processInstance/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TaskVO } from '@/api/workflow/task/types'; - -export interface ProcessInstanceQuery extends PageQuery { - categoryCode?: string; - name?: string; - key?: string; - startUserId?: string; - businessKey?: string; -} - -export interface ProcessInstanceVO extends BaseEntity { - id: string; - processDefinitionId: string; - processDefinitionName: string; - processDefinitionKey: string; - processDefinitionVersion: string; - deploymentId: string; - businessKey: string; - isSuspended?: any; - tenantId: string; - startTime: string; - endTime?: string; - startUserId: string; - businessStatus: string; - businessStatusName: string; - taskVoList: TaskVO[]; -} diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index d29de30dea8ff090950717f450f37e6acb7bfa0a..55ede45f2b3735cc3b9589737ba372c75b2bb374 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -1,15 +1,15 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { TaskQuery, TaskVO } from '@/api/workflow/task/types'; +import { TaskQuery, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types'; /** * 查询待办列表 * @param query * @returns {*} */ -export const getPageByTaskWait = (query: TaskQuery): AxiosPromise => { +export const pageByTaskWait = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskWait', + url: '/workflow/task/pageByTaskWait', method: 'get', params: query }); @@ -20,9 +20,9 @@ export const getPageByTaskWait = (query: TaskQuery): AxiosPromise => { * @param query * @returns {*} */ -export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise => { +export const pageByTaskFinish = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskFinish', + url: '/workflow/task/pageByTaskFinish', method: 'get', params: query }); @@ -33,9 +33,9 @@ export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise => * @param query * @returns {*} */ -export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise => { +export const pageByTaskCopy = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskCopy', + url: '/workflow/task/pageByTaskCopy', method: 'get', params: query }); @@ -46,9 +46,9 @@ export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise => { * @param query * @returns {*} */ -export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise => { +export const pageByAllTaskWait = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByAllTaskWait', + url: '/workflow/task/pageByAllTaskWait', method: 'get', params: query }); @@ -59,9 +59,9 @@ export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise = * @param query * @returns {*} */ -export const getPageByAllTaskFinish = (query: TaskQuery): AxiosPromise => { +export const pageByAllTaskFinish = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByAllTaskFinish', + url: '/workflow/task/pageByAllTaskFinish', method: 'get', params: query }); @@ -93,30 +93,6 @@ export const completeTask = (data: object) => { }); }; -/** - * 认领任务 - * @param taskId - * @returns {*} - */ -export const claim = (taskId: string): any => { - return request({ - url: '/workflow/task/claim/' + taskId, - method: 'post' - }); -}; - -/** - * 归还任务 - * @param taskId - * @returns {*} - */ -export const returnTask = (taskId: string): any => { - return request({ - url: '/workflow/task/returnTask/' + taskId, - method: 'post' - }); -}; - /** * 任务驳回 * @param data @@ -135,61 +111,24 @@ export const backProcess = (data: any): any => { * @param taskId * @returns */ -export const getTaskById = (taskId: string) => { +export const getTask = (taskId: string) => { return request({ - url: '/workflow/task/getTaskById/' + taskId, + url: '/workflow/task/getTask/' + taskId, method: 'get' }); }; -/** - * 加签 - * @param data - * @returns - */ -export const addMultiInstanceExecution = (data: any) => { - return request({ - url: '/workflow/task/addMultiInstanceExecution', - method: 'post', - data: data - }); -}; - -/** - * 减签 - * @param data - * @returns - */ -export const deleteMultiInstanceExecution = (data: any) => { - return request({ - url: '/workflow/task/deleteMultiInstanceExecution', - method: 'post', - data: data - }); -}; - /** * 修改任务办理人 - * @param taskIds + * @param taskIdList * @param userId * @returns */ -export const updateAssignee = (taskIds: Array, userId: string) => { - return request({ - url: `/workflow/task/updateAssignee/${taskIds}/${userId}`, - method: 'put' - }); -}; - -/** - * 转办任务 - * @returns - */ -export const transferTask = (data: any) => { +export const updateAssignee = (taskIdList: Array, userId: string) => { return request({ - url: `/workflow/task/transferTask`, - method: 'post', - data: data + url: `/workflow/task/updateAssignee/${userId}`, + method: 'put', + data: taskIdList }); }; @@ -205,60 +144,37 @@ export const terminationTask = (data: any) => { }); }; -/** - * 查询流程变量 - * @returns - */ -export const getInstanceVariable = (taskId: string) => { - return request({ - url: `/workflow/task/getInstanceVariable/${taskId}`, - method: 'get' - }); -}; - /** * 获取可驳回得任务节点 * @returns */ -export const getTaskNodeList = (processInstanceId: string) => { +export const getBackTaskNode = (definitionId: string, nodeCode: string) => { return request({ - url: `/workflow/task/getTaskNodeList/${processInstanceId}`, + url: `/workflow/task/getBackTaskNode/${definitionId}/${nodeCode}`, method: 'get' }); }; /** - * 委托任务 + * 任务操作 操作类型,委派 delegateTask、转办 transferTask、加签 addSignature、减签 reductionSignature * @returns */ -export const delegateTask = (data: any) => { +export const taskOperation = (data: TaskOperationBo, operation: string) => { return request({ - url: `/workflow/task/delegateTask`, + url: `/workflow/task/taskOperation/${operation}`, method: 'post', data: data }); }; /** - * 查询工作流任务用户选择加签人员 - * @param taskId - * @returns {*} - */ -export const getTaskUserIdsByAddMultiInstance = (taskId: string) => { - return request({ - url: '/workflow/task/getTaskUserIdsByAddMultiInstance/' + taskId, - method: 'get' - }); -}; - -/** - * 查询工作流选择减签人员 - * @param taskId - * @returns {*} + * 获取当前任务办理人 + * @param taskId 任务id + * @returns */ -export const getListByDeleteMultiInstance = (taskId: string) => { +export const currentTaskAllUser = (taskId: string | number) => { return request({ - url: '/workflow/task/getListByDeleteMultiInstance/' + taskId, + url: `/workflow/task/currentTaskAllUser/${taskId}`, method: 'get' }); }; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 0425a1a75517620caf641bbaf99e2cb7ab1b17d0..8ea803bfc21fb64dce3eddc3476a6fd140dafa48 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -1,9 +1,8 @@ -import { NodeConfigVO } from '@/api/workflow/nodeConfig/types'; -import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; export interface TaskQuery extends PageQuery { - name?: string; - processDefinitionKey?: string; - processDefinitionName?: string; + nodeName?: string; + flowCode?: string; + flowName?: string; + createByIds?: string[] | number[]; } export interface ParticipantVo { @@ -12,38 +11,38 @@ export interface ParticipantVo { candidateName: string[]; claim: boolean; } - -export interface TaskVO extends BaseEntity { - id: string; - name: string; - description?: string; - priority: number; - owner?: string; - assignee?: string | number; - assigneeName?: string; - processInstanceId: string; - executionId: string; - taskDefinitionId?: any; - processDefinitionId: string; - endTime?: string; - taskDefinitionKey: string; - dueDate?: string; - category?: any; - parentTaskId?: any; - tenantId: string; - claimTime?: string; - businessStatus?: string; - businessStatusName?: string; - processDefinitionName?: string; - processDefinitionKey?: string; - participantVo?: ParticipantVo; - multiInstance?: boolean; - businessKey?: string; - wfNodeConfigVo?: NodeConfigVO; - wfDefinitionConfigVo?: DefinitionConfigVO; +export interface FlowTaskVO { + id: string | number; + createTime?: Date; + updateTime?: Date; + tenantId?: string; + definitionId?: string; + instanceId: string; + flowName: string; + businessId: string; + nodeCode: string; + nodeName: string; + flowCode: string; + flowStatus: string; + formCustom: string; + formPath: string; + nodeType: number; + nodeRatio: string | number; + version?: string; } export interface VariableVo { key: string; value: string; } + +export interface TaskOperationBo { + //委派/转办人的用户ID(必填,准对委派/转办人操作) + userId?: string; + //加签/减签人的用户ID列表(必填,针对加签/减签操作) + userIds?: string[]; + //任务ID(必填) + taskId: string | number; + //意见或备注信息(可选) + message?: string; +} diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts index 63ce31836400cb95ec30f0e1a03b03285233af23..0f5ce1b24b944d5e53d9253d38c8fd5d7004358b 100644 --- a/src/api/workflow/workflowCommon/index.ts +++ b/src/api/workflow/workflowCommon/index.ts @@ -2,28 +2,14 @@ import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; export default { routerJump(routerJumpVo: RouterJumpVo, proxy) { - if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'static' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, - query: { - id: routerJumpVo.businessKey, - type: routerJumpVo.type, - taskId: routerJumpVo.taskId - } - }); - } else if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'dynamic' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, - query: { - id: routerJumpVo.businessKey, - type: routerJumpVo.type, - taskId: routerJumpVo.taskId - } - }); - } else { - proxy?.$modal.msgError('请到模型配置菜单!'); - } + proxy.$tab.closePage(proxy.$route); + proxy.$router.push({ + path: routerJumpVo.formPath, + query: { + id: routerJumpVo.businessId, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); } }; diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts index 0f1ef1f6f0b73a0f62468690804f86d0dfff9fac..3e7a71d5654898799697661dac8142728d4f7312 100644 --- a/src/api/workflow/workflowCommon/types.ts +++ b/src/api/workflow/workflowCommon/types.ts @@ -1,16 +1,13 @@ -import { NodeConfigVO } from '@/api/workflow/nodeConfig/types'; -import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; - export interface RouterJumpVo { - wfNodeConfigVo: NodeConfigVO; - wfDefinitionConfigVo: DefinitionConfigVO; - businessKey: string; - taskId: string; + businessId: string; + taskId: string | number; type: string; + formCustom: string; + formPath: string; } export interface StartProcessBo { - businessKey: string | number; - tableName: string; + businessId: string | number; + flowCode: string; variables: any; } diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss index 220e4ac8f541b39466c36208222543e8e341f4b1..5dd573dd680ede01beaa01ff239e5c3528cf3c6e 100644 --- a/src/assets/styles/element-ui.scss +++ b/src/assets/styles/element-ui.scss @@ -1,4 +1,3 @@ - .el-collapse { .collapse__title { font-weight: 600; diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index 92fc34d508d9dd70da51f216c99684e5800430be..3aa871b9c721478fed5b87c61bf0c23ad640f84b 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -14,14 +14,14 @@ --tableHeaderBg: #f8f8f9; --tableHeaderTextColor: #515a6e; - // 工作流 - --bpmn-panel-border: #eeeeee; - --bpmn-panel-box-shadow: #cccccc; - --bpmn-panel-bar-background-color: #f5f7fa; - // ele - --brder-color: #e8e8e8 + --brder-color: #e8e8e8; + + // 添加 tag 相关变量 + --tags-view-active-bg: var(--el-color-primary); + --tags-view-active-border-color: var(--el-color-primary); } + html.dark { --menuBg: #1d1e1f; --menuColor: #bfcbd9; @@ -41,26 +41,40 @@ html.dark { .el-tree-node__content { --el-color-primary-light-9: #262727; } + + .el-button--primary { + --el-button-bg-color: var(--el-color-primary-dark-6); + --el-button-border-color: var(--el-color-primary-light-2); + } + + .el-switch { + --el-switch-on-color: var(--el-color-primary-dark-6); + --el-switch-border-color: var(--el-color-primary-light-2); + } + + .el-tag--primary { + --el-tag-bg-color: var(--el-color-primary-dark-6); + --el-tag-border-color: var(--el-color-primary-light-2); + } + + // 在深色模式下使用更深的颜色 + --tags-view-active-bg: var(--el-color-primary-dark-6); + --tags-view-active-border-color: var(--el-color-primary-light-2); // vxe-table 主题 - --vxe-font-color: #98989E; - --vxe-primary-color: #2C7ECF; - --vxe-icon-background-color: #98989E; - --vxe-table-font-color: #98989E; + --vxe-font-color: #98989e; + --vxe-primary-color: #2c7ecf; + --vxe-icon-background-color: #98989e; + --vxe-table-font-color: #98989e; --vxe-table-resizable-color: #95969a; - --vxe-table-header-background-color: #28282A; + --vxe-table-header-background-color: #28282a; --vxe-table-body-background-color: #151518; --vxe-table-background-color: #4a5663; --vxe-table-border-width: 1px; - --vxe-table-border-color: #37373A; - --vxe-toolbar-background-color: #37373A; - - // 工作流 - --bpmn-panel-border: #37373A; - --bpmn-panel-box-shadow: #37373A; - --bpmn-panel-bar-background-color: #37373A; + --vxe-table-border-color: #37373a; + --vxe-toolbar-background-color: #37373a; // ele - --brder-color: #37373A + --brder-color: #37373a; } // base color @@ -118,4 +132,4 @@ $base-sidebar-width: 200px; dangerColor: $--color-danger; infoColor: $--color-info; warningColor: $--color-warning; -} +} \ No newline at end of file diff --git a/src/bpmn/assets/defaultXML.ts b/src/bpmn/assets/defaultXML.ts deleted file mode 100644 index dff0349505cfb52217e269ff0a53234754106f1f..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/defaultXML.ts +++ /dev/null @@ -1,23 +0,0 @@ -function generateRandomValue() { - // 生成一个随机数 - const randomValue = Math.random().toString(36).slice(2, 12); - return `Process_${randomValue}`; -} - -const cartage: string = 'default'; -export default ` - - - - - - - - - - - - - - -`; diff --git a/src/bpmn/assets/lang/zh.ts b/src/bpmn/assets/lang/zh.ts deleted file mode 100644 index ee0c5de3c80d509bb376dda0884ee6aab36a7545..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/lang/zh.ts +++ /dev/null @@ -1,126 +0,0 @@ -export const NodeName = { - 'bpmn:Process': '流程', - 'bpmn:StartEvent': '开始事件', - 'bpmn:IntermediateThrowEvent': '中间事件', - 'bpmn:Task': '任务', - 'bpmn:SendTask': '发送任务', - 'bpmn:ReceiveTask': '接收任务', - 'bpmn:UserTask': '用户任务', - 'bpmn:ManualTask': '手工任务', - 'bpmn:BusinessRuleTask': '业务规则任务', - 'bpmn:ServiceTask': '服务任务', - 'bpmn:ScriptTask': '脚本任务', - 'bpmn:EndEvent': '结束事件', - 'bpmn:SequenceFlow': '流程线', - 'bpmn:ExclusiveGateway': '互斥网关', - 'bpmn:ParallelGateway': '并行网关', - 'bpmn:InclusiveGateway': '相容网关', - 'bpmn:ComplexGateway': '复杂网关', - 'bpmn:EventBasedGateway': '事件网关', - 'bpmn:Participant': '池/参与者', - 'bpmn:SubProcess': '子流程', - 'bpmn:DataObjectReference': '数据对象引用', - 'bpmn:DataStoreReference': '数据存储引用', - 'bpmn:Group': '组' -}; - -export default { - 'Activate hand tool': '启动手动工具', - 'Activate lasso tool': '启动 Lasso 工具', - 'Activate create/remove space tool': '启动创建/删除空间工具', - 'Activate global connect tool': '启动全局连接工具', - 'Ad-hoc': 'Ad-hoc', - 'Add lane above': '在上方添加泳道', - 'Add lane below': '在下方添加泳道', - 'Business rule task': '规则任务', - 'Call activity': '引用流程', - 'Compensation end event': '结束补偿事件', - 'Compensation intermediate throw event': '中间补偿抛出事件', - 'Complex gateway': '复杂网关', - 'Conditional intermediate catch event': '中间条件捕获事件', - 'Conditional start event (non-interrupting)': '条件启动事件 (非中断)', - 'Conditional start event': '条件启动事件', - 'Connect using association': '文本关联', - 'Connect using sequence/message flow or association': '消息关联', - 'Change element': '更改元素', - 'Change type': '更改类型', - 'Create data object reference': '创建数据对象引用', - 'Create data store reference': '创建数据存储引用', - 'Create expanded sub-process': '创建可折叠子流程', - 'Create pool/participant': '创建池/参与者', - 'Collection': '集合', - 'Connect using data input association': '数据输入关联', - 'Data store reference': '数据存储引用', - 'Data object reference': '数据对象引用', - 'Divide into two lanes': '分成两个泳道', - 'Divide into three lanes': '分成三个泳道', - 'End event': '结束事件', - 'Error end event': '结束错误事件', - 'Escalation end event': '结束升级事件', - 'Escalation intermediate throw event': '中间升级抛出事件', - 'Event sub-process': '事件子流程', - 'Event-based gateway': '事件网关', - 'Exclusive gateway': '互斥网关', - 'Empty pool/participant (removes content)': '清空池/参与者 (删除内容)', - 'Empty pool/participant': '清空池/参与者', - 'Expanded pool/participant': '展开池/参与者', - 'Inclusive gateway': '相容网关', - 'Intermediate throw event': '中间抛出事件', - 'Loop': '循环', - 'Link intermediate catch event': '中间链接捕获事件', - 'Link intermediate throw event': '中间链接抛出事件', - 'Manual task': '手动任务', - 'Message end event': '结束消息事件', - 'Message intermediate catch event': '中间消息捕获事件', - 'Message intermediate throw event': '中间消息抛出事件', - 'Message start event': '消息启动事件', - 'Parallel gateway': '并行网关', - 'Parallel multi-instance': '并行多实例', - 'Participant multiplicity': '参与者多重性', - 'Receive task': '接受任务', - 'Remove': '移除', - 'Script task': '脚本任务', - 'Send task': '发送任务', - 'Sequential multi-instance': '串行多实例', - 'Service task': '服务任务', - 'Signal end event': '结束信号事件', - 'Signal intermediate catch event': '中间信号捕获事件', - 'Signal intermediate throw event': '中间信号抛出事件', - 'Signal start event (non-interrupting)': '信号启动事件 (非中断)', - 'Signal start event': '信号启动事件', - 'Start event': '开始事件', - 'Sub-process (collapsed)': '可折叠子流程', - 'Sub-process (expanded)': '可展开子流程', - 'Sub rocess': '子流程', - 'Task': '任务', - 'Transaction': '事务', - 'Terminate end event': '终止边界事件', - 'Timer intermediate catch event': '中间定时捕获事件', - 'Timer start event (non-interrupting)': '定时启动事件 (非中断)', - 'Timer start event': '定时启动事件', - 'User task': '用户任务', - 'Create start event': '创建开始事件', - 'Create gateway': '创建网关', - 'Create intermediate/boundary event': '创建中间/边界事件', - 'Create end event': '创建结束事件', - 'Create group': '创建组', - 'Create startEvent': '开始节点', - 'Create endEvent': '结束节点', - 'Create exclusiveGateway': '互斥网关', - 'Create parallelGateway': '并行网关', - 'Create task': '任务节点', - 'Create userTask': '用户任务节点', - 'Condition type': '条件类型', - 'Append end event': '追加结束事件节点', - 'Append gateway': '追加网关节点', - 'Append task': '追加任务', - 'Append user task': '追加用户任务节点', - 'Append text annotation': '追加文本注释', - 'Append intermediate/boundary event': '追加中间或边界事件', - 'Append receive task': '追加接收任务节点', - 'Append message intermediate catch event': '追加中间消息捕获事件', - 'Append timer intermediate catch event': '追加中间定时捕获事件', - 'Append conditional intermediate catch event': '追加中间条件捕获事件', - 'Append signal intermediate catch event': '追加中间信号捕获事件', - 'flow elements must be children of pools/participants': '流程元素必须是池/参与者的子元素' -}; diff --git a/src/bpmn/assets/moddle/flowable.ts b/src/bpmn/assets/moddle/flowable.ts deleted file mode 100644 index de959a6e6270a378f0f5afd22566836a903f5ad3..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/moddle/flowable.ts +++ /dev/null @@ -1,1250 +0,0 @@ -export default { - 'name': 'Flowable', - 'uri': 'http://flowable.org/bpmn', - 'prefix': 'flowable', - 'xml': { - 'tagAlias': 'lowerCase' - }, - 'associations': [], - 'types': [ - { - 'name': 'flowable:extCandidateUsers', - 'isAbstract': true, - 'extends': [], - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'body', - 'type': 'String', - 'isBody': true - } - ] - }, - { - 'name': 'flowable:extAssignee', - 'isAbstract': true, - 'extends': [], - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'body', - 'type': 'String', - 'isBody': true - } - ] - }, - { - 'name': 'flowable:property', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'id', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'flowable:properties', - 'isAbstract': true, - 'extends': [], - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'values', - 'type': 'flowable:property', - 'isMany': true - } - ] - }, - { - 'name': 'InOutBinding', - 'superClass': ['Element'], - 'isAbstract': true, - 'properties': [ - { - 'name': 'source', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'sourceExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'target', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'businessKey', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'local', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'variables', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'In', - 'superClass': ['InOutBinding'], - 'meta': { - 'allowedIn': ['bpmn:CallActivity'] - } - }, - { - 'name': 'Out', - 'superClass': ['InOutBinding'], - 'meta': { - 'allowedIn': ['bpmn:CallActivity'] - } - }, - { - 'name': 'AsyncCapable', - 'isAbstract': true, - 'extends': ['bpmn:Activity', 'bpmn:Gateway', 'bpmn:Event'], - 'properties': [ - { - 'name': 'async', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'asyncBefore', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'asyncAfter', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'exclusive', - 'isAttr': true, - 'type': 'Boolean', - 'default': true - } - ] - }, - { - 'name': 'flowable:in', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'source', - 'type': 'string', - 'isAttr': true - }, - { - 'name': 'target', - 'type': 'string', - 'isAttr': true - } - ] - }, - { - 'name': 'flowable:out', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'source', - 'type': 'string', - 'isAttr': true - }, - { - 'name': 'target', - 'type': 'string', - 'isAttr': true - } - ] - }, - { - 'name': 'BoundaryEvent', - 'superClass': ['CatchEvent'], - 'properties': [ - { - 'name': 'cancelActivity', - 'default': true, - 'isAttr': true, - 'type': 'Boolean' - }, - { - 'name': 'attachedToRef', - 'type': 'Activity', - 'isAttr': true, - 'isReference': true - } - ] - }, - { - 'name': 'JobPriorized', - 'isAbstract': true, - 'extends': ['bpmn:Process', 'flowable:AsyncCapable'], - 'properties': [ - { - 'name': 'jobPriority', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'SignalEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:SignalEventDefinition'], - 'properties': [ - { - 'name': 'async', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - } - ] - }, - { - 'name': 'ErrorEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:ErrorEventDefinition'], - 'properties': [ - { - 'name': 'errorCodeVariable', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'errorMessageVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Error', - 'isAbstract': true, - 'extends': ['bpmn:Error'], - 'properties': [ - { - 'name': 'flowable:errorMessage', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'PotentialStarter', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'resourceAssignmentExpression', - 'type': 'bpmn:ResourceAssignmentExpression' - } - ] - }, - { - 'name': 'UserTask', - 'isAbstract': true, - 'extends': ['bpmn:UserTask'], - 'properties': [ - { - 'name': 'timerEventDefinition', - 'type': 'Expression' - }, - { - 'name': 'multiInstanceLoopCharacteristics', - 'type': 'MultiInstanceLoopCharacteristics' - } - ] - }, - { - 'name': 'StartEvent', - 'isAbstract': true, - 'extends': ['bpmn:StartEvent'], - 'properties': [ - { - 'name': 'timerEventDefinition', - 'type': 'Expression' - } - ] - }, - { - 'name': 'FormSupported', - 'isAbstract': true, - 'extends': ['bpmn:StartEvent', 'bpmn:UserTask'], - 'properties': [ - { - 'name': 'formHandlerClass', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'formKey', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'TemplateSupported', - 'isAbstract': true, - 'extends': ['bpmn:Process', 'bpmn:FlowElement'], - 'properties': [ - { - 'name': 'modelerTemplate', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Initiator', - 'isAbstract': true, - 'extends': ['bpmn:StartEvent'], - 'properties': [ - { - 'name': 'initiator', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ScriptTask', - 'isAbstract': true, - 'extends': ['bpmn:ScriptTask'], - 'properties': [ - { - 'name': 'resultVariable', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'resource', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Process', - 'isAbstract': true, - 'extends': ['bpmn:Process'], - 'properties': [ - { - 'name': 'candidateStarterGroups', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'candidateStarterUsers', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'versionTag', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'historyTimeToLive', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'isStartableInTasklist', - 'isAttr': true, - 'type': 'Boolean', - 'default': true - } - ] - }, - { - 'name': 'EscalationEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:EscalationEventDefinition'], - 'properties': [ - { - 'name': 'escalationCodeVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'FormalExpression', - 'isAbstract': true, - 'extends': ['bpmn:FormalExpression'], - 'properties': [ - { - 'name': 'resource', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Assignable', - 'extends': ['bpmn:UserTask'], - 'properties': [ - { - 'name': 'candidateGroups', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'dueDate', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'followUpDate', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'priority', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'CallActivity', - 'extends': ['bpmn:CallActivity'], - 'properties': [ - { - 'name': 'calledElementBinding', - 'isAttr': true, - 'type': 'String', - 'default': 'latest' - }, - { - 'name': 'calledElementVersion', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'calledElementVersionTag', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'calledElementTenantId', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'caseRef', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'caseBinding', - 'isAttr': true, - 'type': 'String', - 'default': 'latest' - }, - { - 'name': 'caseVersion', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'caseTenantId', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'variableMappingClass', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'variableMappingDelegateExpression', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ServiceTaskLike', - 'extends': ['bpmn:ServiceTask', 'bpmn:BusinessRuleTask', 'bpmn:SendTask', 'bpmn:MessageEventDefinition'], - 'properties': [ - { - 'name': 'expression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'class', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'delegateExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'resultVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ExclusiveGateway', - 'isAbstract': true, - 'extends': ['bpmn:ExclusiveGateway'], - 'properties': [ - { - 'name': 'serviceClass', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'DmnCapable', - 'extends': ['bpmn:BusinessRuleTask'], - 'properties': [ - { - 'name': 'decisionRef', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'decisionRefBinding', - 'isAttr': true, - 'type': 'String', - 'default': 'latest' - }, - { - 'name': 'decisionRefVersion', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'mapDecisionResult', - 'isAttr': true, - 'type': 'String', - 'default': 'resultList' - }, - { - 'name': 'decisionRefTenantId', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ExternalCapable', - 'extends': ['flowable:ServiceTaskLike'], - 'properties': [ - { - 'name': 'type', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'topic', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'TaskPriorized', - 'extends': ['bpmn:Process', 'flowable:ExternalCapable'], - 'properties': [ - { - 'name': 'taskPriority', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Properties', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'values', - 'type': 'Property', - 'isMany': true - } - ] - }, - { - 'name': 'Property', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'id', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'name', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'value', - 'type': 'String', - 'isAttr': true - } - ] - }, - { - 'name': 'Connector', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:ServiceTaskLike'] - }, - 'properties': [ - { - 'name': 'inputOutput', - 'type': 'InputOutput' - }, - { - 'name': 'connectorId', - 'type': 'String' - } - ] - }, - { - 'name': 'InputOutput', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:FlowNode', 'flowable:Connector'] - }, - 'properties': [ - { - 'name': 'inputOutput', - 'type': 'InputOutput' - }, - { - 'name': 'connectorId', - 'type': 'String' - }, - { - 'name': 'inputParameters', - 'isMany': true, - 'type': 'InputParameter' - }, - { - 'name': 'outputParameters', - 'isMany': true, - 'type': 'OutputParameter' - } - ] - }, - { - 'name': 'InputOutputParameter', - 'properties': [ - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - }, - { - 'name': 'definition', - 'type': 'InputOutputParameterDefinition' - } - ] - }, - { - 'name': 'InputOutputParameterDefinition', - 'isAbstract': true - }, - { - 'name': 'List', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'items', - 'isMany': true, - 'type': 'InputOutputParameterDefinition' - } - ] - }, - { - 'name': 'Map', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'entries', - 'isMany': true, - 'type': 'Entry' - } - ] - }, - { - 'name': 'Entry', - 'properties': [ - { - 'name': 'key', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - }, - { - 'name': 'definition', - 'type': 'InputOutputParameterDefinition' - } - ] - }, - { - 'name': 'Value', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'id', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Script', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'scriptFormat', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'resource', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Field', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:ServiceTaskLike', 'flowable:ExecutionListener', 'flowable:TaskListener'] - }, - 'properties': [ - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'expression', - 'isAttr': true, - 'type': 'expression' - }, - { - 'name': 'string', - 'type': 'string' - }, - { - 'name': 'stringValue', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'string', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:Field'] - }, - 'properties': [ - { - 'name': 'body', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'expression', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:Field'] - }, - 'properties': [ - { - 'name': 'body', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'InputParameter', - 'superClass': ['InputOutputParameter'] - }, - { - 'name': 'OutputParameter', - 'superClass': ['InputOutputParameter'] - }, - { - 'name': 'Collectable', - 'isAbstract': true, - 'extends': ['bpmn:MultiInstanceLoopCharacteristics'], - 'superClass': ['flowable:AsyncCapable'], - 'properties': [ - { - 'name': 'collection', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'elementVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'SequenceFlow', - 'superClass': ['FlowElement'], - 'properties': [ - { - 'name': 'isImmediate', - 'isAttr': true, - 'type': 'Boolean' - }, - { - 'name': 'conditionExpression', - 'type': 'Expression' - }, - { - 'name': 'sourceRef', - 'type': 'FlowNode', - 'isAttr': true, - 'isReference': true - }, - { - 'name': 'targetRef', - 'type': 'FlowNode', - 'isAttr': true, - 'isReference': true - } - ] - }, - { - 'name': 'MultiInstanceLoopCharacteristics', - 'superClass': ['LoopCharacteristics'], - 'properties': [ - { - 'name': 'isSequential', - 'default': false, - 'isAttr': true, - 'type': 'Boolean' - }, - { - 'name': 'behavior', - 'type': 'MultiInstanceBehavior', - 'default': 'All', - 'isAttr': true - }, - { - 'name': 'loopCardinality', - 'type': 'Expression', - 'xml': { - 'serialize': 'xsi:type' - } - }, - { - 'name': 'loopDataInputRef', - 'type': 'ItemAwareElement', - 'isReference': true - }, - { - 'name': 'loopDataOutputRef', - 'type': 'ItemAwareElement', - 'isReference': true - }, - { - 'name': 'inputDataItem', - 'type': 'DataInput', - 'xml': { - 'serialize': 'property' - } - }, - { - 'name': 'outputDataItem', - 'type': 'DataOutput', - 'xml': { - 'serialize': 'property' - } - }, - { - 'name': 'complexBehaviorDefinition', - 'type': 'ComplexBehaviorDefinition', - 'isMany': true - }, - { - 'name': 'completionCondition', - 'type': 'Expression', - 'xml': { - 'serialize': 'xsi:type' - } - }, - { - 'name': 'oneBehaviorEventRef', - 'type': 'EventDefinition', - 'isAttr': true, - 'isReference': true - }, - { - 'name': 'noneBehaviorEventRef', - 'type': 'EventDefinition', - 'isAttr': true, - 'isReference': true - } - ] - }, - { - 'name': 'FailedJobRetryTimeCycle', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:AsyncCapable', 'bpmn:MultiInstanceLoopCharacteristics'] - }, - 'properties': [ - { - 'name': 'body', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ExecutionListener', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': [ - 'bpmn:Task', - 'bpmn:ServiceTask', - 'bpmn:UserTask', - 'bpmn:BusinessRuleTask', - 'bpmn:ScriptTask', - 'bpmn:ReceiveTask', - 'bpmn:ManualTask', - 'bpmn:ExclusiveGateway', - 'bpmn:SequenceFlow', - 'bpmn:ParallelGateway', - 'bpmn:InclusiveGateway', - 'bpmn:EventBasedGateway', - 'bpmn:StartEvent', - 'bpmn:IntermediateCatchEvent', - 'bpmn:IntermediateThrowEvent', - 'bpmn:EndEvent', - 'bpmn:BoundaryEvent', - 'bpmn:CallActivity', - 'bpmn:SubProcess', - 'bpmn:Process' - ] - }, - 'properties': [ - { - 'name': 'expression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'class', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'delegateExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'event', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'script', - 'type': 'Script' - }, - { - 'name': 'fields', - 'type': 'Field', - 'isMany': true - } - ] - }, - { - 'name': 'TaskListener', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:UserTask'] - }, - 'properties': [ - { - 'name': 'expression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'class', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'delegateExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'event', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'script', - 'type': 'Script' - }, - { - 'name': 'fields', - 'type': 'Field', - 'isMany': true - } - ] - }, - { - 'name': 'FormProperty', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:StartEvent', 'bpmn:UserTask'] - }, - 'properties': [ - { - 'name': 'id', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'name', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'type', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'required', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'readable', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'writable', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'variable', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'expression', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'datePattern', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'default', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'values', - 'type': 'Value', - 'isMany': true - } - ] - }, - { - 'name': 'FormData', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:StartEvent', 'bpmn:UserTask'] - }, - 'properties': [ - { - 'name': 'fields', - 'type': 'FormField', - 'isMany': true - }, - { - 'name': 'businessKey', - 'type': 'String', - 'isAttr': true - } - ] - }, - { - 'name': 'FormField', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'id', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'label', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'type', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'datePattern', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'defaultValue', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'properties', - 'type': 'Properties' - }, - { - 'name': 'validation', - 'type': 'Validation' - }, - { - 'name': 'values', - 'type': 'Value', - 'isMany': true - } - ] - }, - { - 'name': 'Validation', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'constraints', - 'type': 'Constraint', - 'isMany': true - } - ] - }, - { - 'name': 'Constraint', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'name', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'config', - 'type': 'String', - 'isAttr': true - } - ] - }, - { - 'name': 'ConditionalEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:ConditionalEventDefinition'], - 'properties': [ - { - 'name': 'variableName', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'variableEvent', - 'isAttr': true, - 'type': 'String' - } - ] - } - ], - 'emumerations': [] -}; diff --git a/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts b/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts deleted file mode 100644 index 13ccf50df6c29275ff8c677850b7c26d8e096672..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts +++ /dev/null @@ -1,138 +0,0 @@ -import ContextPadProvider from 'bpmn-js/lib/features/context-pad/ContextPadProvider'; -import { Injector } from 'didi'; -import EventBus from 'diagram-js/lib/core/EventBus'; -import ContextPad from 'diagram-js/lib/features/context-pad/ContextPad'; -import Modeling from 'bpmn-js/lib/features/modeling/Modeling.js'; -import ElementFactory from 'bpmn-js/lib/features/modeling/ElementFactory'; -import Connect from 'diagram-js/lib/features/connect/Connect'; -import Create from 'diagram-js/lib/features/create/Create'; -import PopupMenu from 'diagram-js/lib/features/popup-menu/PopupMenu'; -import Canvas from 'diagram-js/lib/core/Canvas'; -import Rules from 'diagram-js/lib/features/rules/Rules'; -import { Element, Shape } from 'diagram-js/lib/model/Types'; -import BpmnFactory from 'bpmn-js/lib/features/modeling/BpmnFactory'; -import modeler from '@/store/modules/modeler'; - -// @Description: 增强元素连线事件 - -class CustomContextPadProvider extends ContextPadProvider { - private _contextPad: ContextPad; - private _modeling: Modeling; - private _elementFactory: ElementFactory; - private _autoPlace: any; - private _connect: Connect; - private _create: Create; - private _popupMenu: PopupMenu; - private _canvas: Canvas; - private _rules: Rules; - - constructor( - config: any, - injector: Injector, - eventBus: EventBus, - contextPad: ContextPad, - modeling: Modeling, - elementFactory: ElementFactory, - connect: Connect, - create: Create, - popupMenu: PopupMenu, - canvas: Canvas, - rules: Rules, - translate - ) { - // @ts-expect-error 忽略异常 - super(config, injector, eventBus, contextPad, modeling, elementFactory, connect, create, popupMenu, canvas, rules, translate); - - this._contextPad = contextPad; - this._modeling = modeling; - this._elementFactory = elementFactory; - this._connect = connect; - this._create = create; - this._popupMenu = popupMenu; - this._canvas = canvas; - this._rules = rules; - - this._autoPlace = injector.get('autoPlace', false); - } - - getContextPadEntries(element: Element) { - const actions: Record = {}; - - const appendUserTask = (event: Event, element: Shape) => { - const shape = this._elementFactory.createShape({ type: 'bpmn:UserTask' }); - this._create.start(event, shape, { - source: element - }); - }; - - const appendMultiInstanceUserTask = (event: Event, element: Shape) => { - const store = modeler(); - const bpmnFactory = store.getModeler().get('bpmnFactory') as BpmnFactory; - const businessObject = bpmnFactory.create('bpmn:UserTask', { - // name: '多实例用户任务', - isForCompensation: false - }); - businessObject.loopCharacteristics = bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics'); - // 创建 Shape - const shape = this._elementFactory.createShape({ - type: 'bpmn:UserTask', - businessObject: businessObject - }); - this._create.start(event, shape, { source: element }); - }; - - const appendTask = this._autoPlace - ? (event, element) => { - const bpmnFactory: BpmnFactory | undefined = modeler().getModeler().get('bpmnFactory'); - const businessObject = bpmnFactory.create('bpmn:UserTask', { - // name: '多实例用户任务',// 右键创建显示 - isForCompensation: false - }); - - // 创建多实例属性并分配给用户任务的 loopCharacteristics - businessObject.loopCharacteristics = bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics'); - - // 创建 Shape - const shape = this._elementFactory.createShape({ - type: 'bpmn:UserTask', - businessObject: businessObject - }); - - this._autoPlace.append(element, shape); - } - : appendMultiInstanceUserTask; - - const append = this._autoPlace - ? (event: Event, element: Shape) => { - const shape = this._elementFactory.createShape({ type: 'bpmn:UserTask' }); - this._autoPlace.append(element, shape); - } - : appendUserTask; - - // // 添加创建用户任务按钮 - actions['append.append-user-task'] = { - group: 'model', - className: 'bpmn-icon-user-task', - title: '用户任务', - action: { - dragstart: appendUserTask, - click: append - } - }; - - // 添加创建多实例用户任务按钮 - actions['append.append-multi-instance-user-task'] = { - group: 'model', - className: 'bpmn-icon-user', // 你可以使用多实例用户任务的图标 bpmn-icon-user bpmn-icon-user-task - title: '多实例用户任务', - action: { - dragstart: appendMultiInstanceUserTask, - click: appendTask - } - }; - - return actions; - } -} - -export default CustomContextPadProvider; diff --git a/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts b/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts deleted file mode 100644 index 8556d9b94fb421a3b4014be38196ceaf2f00a16a..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { assign } from 'min-dash'; -import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider'; -import ElementFactory from 'bpmn-js/lib/features/modeling/ElementFactory'; -import Create from 'diagram-js/lib/features/create/Create'; -import SpaceTool from 'diagram-js/lib/features/space-tool/SpaceTool'; -import LassoTool from 'diagram-js/lib/features/lasso-tool/LassoTool'; -import HandTool from 'diagram-js/lib/features/hand-tool/HandTool'; -import GlobalConnect from 'diagram-js/lib/features/global-connect/GlobalConnect'; -import Palette from 'diagram-js/lib/features/palette/Palette'; -import modeler from '@/store/modules/modeler'; -import BpmnFactory from 'bpmn-js/lib/features/modeling/BpmnFactory'; - -// @Description: 增强左侧面板 -class CustomPaletteProvider extends PaletteProvider { - private readonly _palette: Palette; - private readonly _create: Create; - private readonly _elementFactory: ElementFactory; - private readonly _spaceTool: SpaceTool; - private readonly _lassoTool: LassoTool; - private readonly _handTool: HandTool; - private readonly _globalConnect: GlobalConnect; - private readonly _translate: any; - - constructor(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) { - super(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate); - this._palette = palette; - this._create = create; - this._elementFactory = elementFactory; - this._spaceTool = spaceTool; - this._lassoTool = lassoTool; - this._handTool = handTool; - this._globalConnect = globalConnect; - this._translate = translate; - } - - getPaletteEntries() { - const actions = {}, - create = this._create, - elementFactory = this._elementFactory, - translate = this._translate; - - function createAction(type: string, group: string, className: string, title: string, options?: object) { - function createListener(event) { - const shape = elementFactory.createShape(assign({ type: type }, options)); - if (options) { - !shape.businessObject.di && (shape.businessObject.di = {}); - shape.businessObject.di.isExpanded = (options as { [key: string]: any }).isExpanded; - } - create.start(event, shape, null); - } - const shortType = type.replace(/^bpmn:/, ''); - return { - group: group, - className: className, - title: title || translate('Create {type}', { type: shortType }), - action: { - dragstart: createListener, - click: createListener - } - }; - } - - function createMultiInstanceUserTask(event) { - const bpmnFactory: BpmnFactory | undefined = modeler().getBpmnFactory(); - // 创建一个 bpmn:UserTask - const userTask = bpmnFactory.create('bpmn:UserTask', { - // name: '多实例用户任务', // 在画板中显示字段 - isForCompensation: false - }); - // 将多实例属性分配给 bpmn:UserTask 的 loopCharacteristics - userTask.loopCharacteristics = bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics'); - const customUserTask = elementFactory.createShape({ - type: 'bpmn:UserTask', - businessObject: userTask // 分配创建的 userTask 到 businessObject - }); - create.start(event, customUserTask, {}); - } - - assign(actions, { - 'create.parallel-gateway': createAction('bpmn:ParallelGateway', 'gateway', 'bpmn-icon-gateway-parallel', '并行网关'), - 'create.event-base-gateway': createAction('bpmn:EventBasedGateway', 'gateway', 'bpmn-icon-gateway-eventbased', '事件网关'), - // 分组线 - 'gateway-separator': { - group: 'gateway', - separator: true - }, - 'create.user-task': createAction('bpmn:UserTask', 'activity', 'bpmn-icon-user-task', '创建用户任务'), - 'create.multi-instance-user-task': { - group: 'activity', - type: 'bpmn:UserTask', - className: 'bpmn-icon-user task-multi-instance', - title: '创建多实例用户任务', - action: { - click: createMultiInstanceUserTask, - dragstart: createMultiInstanceUserTask - } - }, - 'task-separator': { - group: 'activity', - separator: true - } - }); - return actions; - } -} - -CustomPaletteProvider['$inject'] = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool', 'handTool', 'globalConnect', 'translate']; - -export default CustomPaletteProvider; diff --git a/src/bpmn/assets/module/Renderer/CustomRenderer.ts b/src/bpmn/assets/module/Renderer/CustomRenderer.ts deleted file mode 100644 index 6a4eb1a202d394d57c8871cb8f1066a3d399791f..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/module/Renderer/CustomRenderer.ts +++ /dev/null @@ -1,56 +0,0 @@ -import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer'; -import { - append as svgAppend, - attr as svgAttr, - create as svgCreate, - select as svgSelect, - selectAll as svgSelectAll, - clone as svgClone, - clear as svgClear, - remove as svgRemove -} from 'tiny-svg'; - -const HIGH_PRIORITY = 1500; -export default class CustomRenderer extends BaseRenderer { - bpmnRenderer: BaseRenderer; - modeling: any; - constructor(eventBus, bpmnRenderer, modeling) { - super(eventBus, HIGH_PRIORITY); - this.bpmnRenderer = bpmnRenderer; - this.modeling = modeling; - } - canRender(element) { - // ignore labels - return !element.labelTarget; - } - - /** - * 自定义节点图形 - * @param {*} parentNode 当前元素的svgNode - * @param {*} element - * @returns - */ - drawShape(parentNode, element) { - const shape = this.bpmnRenderer.drawShape(parentNode, element); - const { type, width, height } = element; - // 开始 填充绿色 - if (type === 'bpmn:StartEvent') { - svgAttr(shape, { fill: '#77DF6D' }); - return shape; - } - if (type === 'bpmn:EndEvent') { - svgAttr(shape, { fill: '#EE7B77' }); - return shape; - } - if (type === 'bpmn:UserTask') { - svgAttr(shape, { fill: '#A9C4F8' }); - return shape; - } - return shape; - } - - getShapePath(shape) { - return this.bpmnRenderer.getShapePath(shape); - } -} -CustomRenderer['$inject'] = ['eventBus', 'bpmnRenderer']; diff --git a/src/bpmn/assets/module/Translate/index.ts b/src/bpmn/assets/module/Translate/index.ts deleted file mode 100644 index 6b52dae6097693dc9788bd074bff4449644fa2ac..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/module/Translate/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import zh from '../../lang/zh'; - -const customTranslate = (template: any, replacements: any) => { - replacements = replacements || {}; - template = zh[template] || template; - return template.replace(/{([^}]+)}/g, function (_: any, key: any) { - return replacements[key] || '{' + key + '}'; - }); -}; - -export const translateModule = { - translate: ['value', customTranslate] -}; - -export default translateModule; diff --git a/src/bpmn/assets/module/index.ts b/src/bpmn/assets/module/index.ts deleted file mode 100644 index 55f6b9fd6aee730dc8411e845a54e2adb594cce7..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/module/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -// 翻译模块 -import TranslationModule from './Translate'; -import { ModuleDeclaration } from 'didi'; -import CustomPaletteProvider from './Palette/CustomPaletteProvider'; -import CustomRenderer from './Renderer/CustomRenderer'; -import CustomContextPadProvider from './ContextPad/CustomContextPadProvider'; - -const Module: ModuleDeclaration[] = [ - { - __init__: ['customPaletteProvider', 'customContextPadProvider', 'customRenderer'], - customPaletteProvider: ['type', CustomPaletteProvider], - customRenderer: ['type', CustomRenderer], - customContextPadProvider: ['type', CustomContextPadProvider] - }, - TranslationModule -]; -export default Module; diff --git a/src/bpmn/assets/showConfig.ts b/src/bpmn/assets/showConfig.ts deleted file mode 100644 index 853eb3587edbaf812b9c53eb452ed195cbe6f92a..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/showConfig.ts +++ /dev/null @@ -1,50 +0,0 @@ -export default { - 'bpmn:EndEvent': {}, - 'bpmn:StartEvent': { - initiator: true, - formKey: true - }, - 'bpmn:UserTask': { - allocationType: true, - specifyDesc: true, - multipleUserAuditType: true, - async: true, - priority: true, - skipExpression: true, - dueDate: true, - taskListener: true, - executionListener: true - }, - 'bpmn:ServiceTask': { - async: true, - skipExpression: true, - isForCompensation: true, - triggerable: true, - class: true - }, - 'bpmn:ScriptTask': { - async: true, - isForCompensation: true, - autoStoreVariables: true - }, - 'bpmn:ManualTask': { - async: true, - isForCompensation: true - }, - 'bpmn:ReceiveTask': { - async: true, - isForCompensation: true - }, - 'bpmn:SendTask': { - async: true, - isForCompensation: true - }, - 'bpmn:BusinessRuleTask': { - async: true, - isForCompensation: true, - ruleVariablesInput: true, - rules: true, - resultVariable: true, - exclude: true - } -}; diff --git a/src/bpmn/assets/style/index.scss b/src/bpmn/assets/style/index.scss deleted file mode 100644 index 3c927920f75f7f4300d8d86cdddc35364cd3ef08..0000000000000000000000000000000000000000 --- a/src/bpmn/assets/style/index.scss +++ /dev/null @@ -1,284 +0,0 @@ -.djs-palette { - width: 300px; - - .bpmn-icon-hand-tool:hover { - &:after { - content: '启动手动工具'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-lasso-tool:hover { - &:after { - content: '启动套索工具'; - position: absolute; - left: 100px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-space-tool:hover { - &:after { - content: '启动创建/删除空间工具'; - position: absolute; - left: 45px; - width: 170px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-connection-multi:hover { - &:after { - content: '启动全局连接工具'; - position: absolute; - left: 100px; - width: 140px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-start-event-none:hover { - &:after { - content: '创建开始事件'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-intermediate-event-none:hover { - &:after { - content: '创建中间/边界事件'; - position: absolute; - left: 100px; - width: 140px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-end-event-none:hover { - &:after { - content: '创建结束事件'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-gateway-none:hover { - &:after { - content: '创建网关'; - position: absolute; - left: 100px; - width: 90px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-gateway-parallel:hover { - &:after { - content: '创建并行网关'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-gateway-eventbased:hover { - &:after { - content: '创建事件网关'; - position: absolute; - left: 100px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-task:hover { - &:after { - content: '创建任务'; - position: absolute; - left: 45px; - width: 80px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-subprocess-expanded:hover { - &:after { - content: '创建可折叠子流程'; - position: absolute; - left: 100px; - width: 140px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-user-task:hover { - &:after { - content: '创建用户任务'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - - .task-multi-instance:hover { - &:after { - content: '创建多实例用户任务'; - position: absolute; - left: 100px; - width: 160px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-participant:hover { - &:after { - content: '创建泳池/泳道'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-data-object { - display: none; - &:hover { - &:after { - content: '创建数据对象'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - } - .bpmn-icon-data-store { - display: none; - &:hover { - &:after { - content: '创建数据存储'; - position: absolute; - left: 100px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - } - .bpmn-icon-group { - display: none; - &:hover { - &:after { - content: '创建分组'; - position: absolute; - left: 100px; - width: 100px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - } -} diff --git a/src/bpmn/hooks/usePanel.ts b/src/bpmn/hooks/usePanel.ts deleted file mode 100644 index ace579bf54b368d12ae00a2c486f737c6775b15d..0000000000000000000000000000000000000000 --- a/src/bpmn/hooks/usePanel.ts +++ /dev/null @@ -1,145 +0,0 @@ -import showConfig from '../assets/showConfig'; -import type { ModdleElement } from 'bpmn'; -import useModelerStore from '@/store/modules/modeler'; -import { MultiInstanceTypeEnum } from '@/enums/bpmn/IndexEnums'; -interface Options { - element: ModdleElement; -} - -export default (ops: Options) => { - const { element } = ops; - const { getModeling, getModdle } = useModelerStore(); - const modeling = getModeling(); - const moddle = getModdle(); - - /** - * 当前节点类型 - */ - const elementType = computed(() => { - const bizObj = element.businessObject; - return bizObj.eventDefinitions ? bizObj.eventDefinitions[0].$type : bizObj.$type; - }); - - /** - * 用于控制面板字段显示与隐藏的配置 - */ - const config = computed(() => showConfig[elementType.value] || {}); - - /** - * 创建一个节点 - * @param elementType 节点类型 - * @param properties 属性 - * @param parent 父节点 - */ - const createModdleElement = (elementType: string, properties: any, parent: ModdleElement) => { - const element = moddle.create(elementType, properties); - parent && (element.$parent = parent); - return element; - }; - - /** - * 获取扩展属性,如果不存在会自动创建 - */ - const getExtensionElements = (create = true) => { - let extensionElements = element.businessObject.get('extensionElements'); - if (!extensionElements && create) { - extensionElements = createModdleElement('bpmn:ExtensionElements', { values: [] }, element.businessObject); - modeling.updateModdleProperties(element, element.businessObject, { extensionElements }); - } - return extensionElements; - }; - - /** - * 获取extensionElements下的properties - * @param extensionElements 可选参数,默认获取当前Element下的extensionElements下的Properties - */ - const getPropertiesElements = (extensionElements?: ModdleElement) => { - if (!extensionElements) { - extensionElements = getExtensionElements(); - } - let propertiesElements = extensionElements.values.find((item) => item.$type === 'flowable:properties'); - if (!propertiesElements) { - propertiesElements = createModdleElement('flowable:properties', { values: [] }, extensionElements); - modeling.updateModdleProperties(element, extensionElements, { - values: [...extensionElements.get<[]>('values'), propertiesElements] - }); - } - return propertiesElements; - }; - - /** - * 更新节点属性 - * @param properties 属性值 - */ - const updateProperties = (properties: any) => { - modeling.updateProperties(element, properties); - }; - - /** - * 更新节点信息 - * @param updateElement 需要更新的节点 - * @param properties 属性 - */ - const updateModdleProperties = (updateElement, properties: any) => { - modeling.updateModdleProperties(element, updateElement, properties); - }; - - /** - * 更新Property属性 - * @param name key值 - * @param value 值 - */ - const updateProperty = (name: string, value: string) => { - const propertiesElements = getPropertiesElements(); - - let propertyElements = propertiesElements.values.find((item) => item.name === name); - if (!propertyElements) { - propertyElements = createModdleElement('flowable:property', { name: name, value: value }, propertiesElements); - modeling.updateModdleProperties(element, propertiesElements, { - values: [...propertiesElements.get('values'), propertyElements] - }); - } else { - propertyElements.name = name; - propertyElements.value = value; - } - return propertyElements; - }; - - const idChange = (newVal: string) => { - if (newVal) { - updateProperties({ id: newVal }); - } - }; - const nameChange = (newVal: string) => { - if (newVal) { - updateProperties({ name: newVal }); - } - }; - const formKeyChange = (newVal: string) => { - updateProperties({ formKey: newVal }); - }; - const constant = { - MultiInstanceType: [ - { id: '373d4b81-a0d1-4eb8-8685-0d2fb1b468e2', label: '无', value: MultiInstanceTypeEnum.NONE }, - { id: 'b5acea7c-b7e5-46b0-8778-390db091bdab', label: '串行', value: MultiInstanceTypeEnum.SERIAL }, - { id: 'b4f0c683-1ccc-43c4-8380-e1b998986caf', label: '并行', value: MultiInstanceTypeEnum.PARALLEL } - ] - }; - - return { - elementType, - constant, - showConfig: config, - - updateProperties, - updateProperty, - updateModdleProperties, - - createModdleElement, - idChange, - nameChange, - formKeyChange, - getExtensionElements, - getPropertiesElements - }; -}; diff --git a/src/bpmn/hooks/useParseElement.ts b/src/bpmn/hooks/useParseElement.ts deleted file mode 100644 index e1a6054eec7dda91033a3df53f6bd9603096ad9f..0000000000000000000000000000000000000000 --- a/src/bpmn/hooks/useParseElement.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { ModdleElement } from 'bpmn'; - -interface Options { - element: ModdleElement; -} - -interface Data { - id: string; -} - -export default (ops: Options) => { - const { element } = ops; - - const parseData = (): T => { - const result = { - ...element.businessObject, - ...element.businessObject.$attrs - }; - - // 移除flowable前缀,格式化数组 - for (const key in result) { - if (key.indexOf('flowable:') === 0) { - const newKey = key.replace('flowable:', ''); - result[newKey] = result[key]; - delete result[key]; - } - } - return { ...result } as T; - }; - - return { - parseData - }; -}; diff --git a/src/bpmn/index.vue b/src/bpmn/index.vue deleted file mode 100644 index 15437c892d0ac823e5780514174ea85e33d1cee7..0000000000000000000000000000000000000000 --- a/src/bpmn/index.vue +++ /dev/null @@ -1,496 +0,0 @@ - - - - - diff --git a/src/bpmn/panel/GatewayPanel.vue b/src/bpmn/panel/GatewayPanel.vue deleted file mode 100644 index 20cc1343c3439624ed6be533a2fd2a03d6079057..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/GatewayPanel.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - diff --git a/src/bpmn/panel/ParticipantPanel.vue b/src/bpmn/panel/ParticipantPanel.vue deleted file mode 100644 index b1d42e6179cbd5ed05d19f6ea9ef246bdbb6f5de..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/ParticipantPanel.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - diff --git a/src/bpmn/panel/ProcessPanel.vue b/src/bpmn/panel/ProcessPanel.vue deleted file mode 100644 index 9e118e2db71797e6cb8015faadccdaf8ada5dd3e..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/ProcessPanel.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/bpmn/panel/SequenceFlowPanel.vue b/src/bpmn/panel/SequenceFlowPanel.vue deleted file mode 100644 index eac8227919e5a5f538f0a9d3ed5be26aae5a8d02..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/SequenceFlowPanel.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - diff --git a/src/bpmn/panel/StartEndPanel.vue b/src/bpmn/panel/StartEndPanel.vue deleted file mode 100644 index bde1212e4fb286d9061ebd66bf60e1427fe94f02..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/StartEndPanel.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - diff --git a/src/bpmn/panel/SubProcessPanel.vue b/src/bpmn/panel/SubProcessPanel.vue deleted file mode 100644 index 3490fff5a7a0c4266d889366db9137f4ba74d11e..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/SubProcessPanel.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - - diff --git a/src/bpmn/panel/TaskPanel.vue b/src/bpmn/panel/TaskPanel.vue deleted file mode 100644 index a42de8ab3111d752f52892f2dcf224b5f973263c..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/TaskPanel.vue +++ /dev/null @@ -1,491 +0,0 @@ - - - - diff --git a/src/bpmn/panel/index.vue b/src/bpmn/panel/index.vue deleted file mode 100644 index 445571a3477386b47e48585f1f5aca3732ad1f11..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/index.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - diff --git a/src/bpmn/panel/property/DueDate.vue b/src/bpmn/panel/property/DueDate.vue deleted file mode 100644 index 882766b20f09de090e081dcae0c12c462dadc394..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/property/DueDate.vue +++ /dev/null @@ -1,252 +0,0 @@ - - - diff --git a/src/bpmn/panel/property/ExecutionListener.vue b/src/bpmn/panel/property/ExecutionListener.vue deleted file mode 100644 index 3c584cb033e6838993660da8ad2440f48ee2f6e3..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/property/ExecutionListener.vue +++ /dev/null @@ -1,308 +0,0 @@ - - - - diff --git a/src/bpmn/panel/property/ListenerParam.vue b/src/bpmn/panel/property/ListenerParam.vue deleted file mode 100644 index 21c6de1383b5bcf3ff5bf18d28e655995cdb1201..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/property/ListenerParam.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - diff --git a/src/bpmn/panel/property/TaskListener.vue b/src/bpmn/panel/property/TaskListener.vue deleted file mode 100644 index 9a32c47b03eecf6a61acebf41e64ee1610f43970..0000000000000000000000000000000000000000 --- a/src/bpmn/panel/property/TaskListener.vue +++ /dev/null @@ -1,310 +0,0 @@ - - - - diff --git a/src/components/BpmnDesign/index.vue b/src/components/BpmnDesign/index.vue deleted file mode 100644 index 1f845168c415ae753f8a561cfae7ff283a3325fa..0000000000000000000000000000000000000000 --- a/src/components/BpmnDesign/index.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/components/BpmnView/index.vue b/src/components/BpmnView/index.vue deleted file mode 100644 index c5e0c7baa86fc5f50a6c305320a4a24d3a80c07e..0000000000000000000000000000000000000000 --- a/src/components/BpmnView/index.vue +++ /dev/null @@ -1,411 +0,0 @@ - - - - - diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 9502e60fc1f51dadff40da24f404f6e72785174c..a8b2f68ca77cc0b8c8936adeb1a6bcabf35b4538 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -11,21 +11,53 @@ diff --git a/src/components/Process/processMeddle.vue b/src/components/Process/processMeddle.vue new file mode 100644 index 0000000000000000000000000000000000000000..72247550402a7b20f3fef8291de0c51611d4eef5 --- /dev/null +++ b/src/components/Process/processMeddle.vue @@ -0,0 +1,207 @@ + + diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 09fc82e4a2a10860d1e8873a85284b2edadc7b6b..4c2ea884fb2476bddf8b8ff2d42528ea0c83c12a 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -3,47 +3,47 @@ - 站内信 - 邮件 - 短信 + 站内信 + 邮件 + 短信 - - + + - {{ user.userName }} + {{ user.nickName }} - + @@ -54,14 +54,14 @@ - + - + - - + + @@ -83,6 +83,19 @@ + +
+ + + + + + + +
+
@@ -90,18 +103,17 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTaskById, transferTask, terminationTask, getTaskNodeList, delegateTask } from '@/api/workflow/task'; +import { completeTask, backProcess, getTask, taskOperation, terminationTask, getBackTaskNode, currentTaskAllUser } from '@/api/workflow/task'; import UserSelect from '@/components/UserSelect'; -import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; + const { proxy } = getCurrentInstance() as ComponentInternalInstance; import { UserVO } from '@/api/system/user/types'; -import { TaskVO } from '@/api/workflow/task/types'; +import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types'; + const userSelectCopyRef = ref>(); const transferTaskRef = ref>(); const delegateTaskRef = ref>(); - -//加签组件 -const multiInstanceUserRef = ref>(); +const multiInstanceUserRef = ref>(); const props = defineProps({ taskVariables: { @@ -119,65 +131,53 @@ const taskId = ref(''); const selectCopyUserList = ref([]); //抄送人id const selectCopyUserIds = ref(undefined); -// 驳回是否显示 +//可减签的人员 +const deleteUserList = ref([]); +//驳回是否显示 const backVisible = ref(false); const backLoading = ref(true); const backButtonDisabled = ref(true); // 可驳回得任务节点 const taskNodeList = ref([]); //任务 -const task = ref({ +const task = ref({ id: undefined, - name: undefined, - description: undefined, - priority: undefined, - owner: undefined, - assignee: undefined, - assigneeName: undefined, - processInstanceId: undefined, - executionId: undefined, - taskDefinitionId: undefined, - processDefinitionId: undefined, - endTime: undefined, - taskDefinitionKey: undefined, - dueDate: undefined, - category: undefined, - parentTaskId: undefined, + createTime: undefined, + updateTime: undefined, tenantId: undefined, - claimTime: undefined, - businessStatus: undefined, - businessStatusName: undefined, - processDefinitionName: undefined, - processDefinitionKey: undefined, - participantVo: undefined, - multiInstance: undefined, - businessKey: undefined, - wfNodeConfigVo: undefined + definitionId: undefined, + instanceId: undefined, + flowName: undefined, + businessId: undefined, + nodeCode: undefined, + nodeName: undefined, + flowCode: undefined, + flowStatus: undefined, + formCustom: undefined, + formPath: undefined, + nodeType: undefined, + nodeRatio: undefined }); -//加签 减签标题 -const title = ref(''); const dialog = reactive({ visible: false, title: '提示' }); - +//减签弹窗 +const deleteSignatureVisible = ref(false); const form = ref>({ taskId: undefined, message: undefined, variables: {}, messageType: ['1'], - wfCopyList: [] + flowCopyList: [] }); const backForm = ref>({ taskId: undefined, - targetActivityId: undefined, + nodeCode: undefined, message: undefined, variables: {}, messageType: ['1'] }); -const closeDialog = () => { - dialog.visible = false; -}; //打开弹窗 const openDialog = (id?: string) => { selectCopyUserIds.value = undefined; @@ -189,7 +189,7 @@ const openDialog = (id?: string) => { loading.value = true; buttonDisabled.value = true; nextTick(() => { - getTaskById(taskId.value).then((response) => { + getTask(taskId.value).then((response) => { task.value = response.data; loading.value = false; buttonDisabled.value = false; @@ -205,15 +205,15 @@ const handleCompleteTask = async () => { form.value.taskId = taskId.value; form.value.taskVariables = props.taskVariables; if (selectCopyUserList.value && selectCopyUserList.value.length > 0) { - let wfCopyList = []; + let flowCopyList = []; selectCopyUserList.value.forEach((e) => { let copyUser = { userId: e.userId, userName: e.nickName }; - wfCopyList.push(copyUser); + flowCopyList.push(copyUser); }); - form.value.wfCopyList = wfCopyList; + form.value.flowCopyList = flowCopyList; } await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; @@ -236,11 +236,11 @@ const handleBackProcessOpen = async () => { backVisible.value = true; backLoading.value = true; backButtonDisabled.value = true; - let data = await getTaskNodeList(task.value.processInstanceId); + let data = await getBackTaskNode(task.value.definitionId, task.value.nodeCode); taskNodeList.value = data.data; backLoading.value = false; backButtonDisabled.value = false; - backForm.value.targetActivityId = taskNodeList.value[0].nodeId; + backForm.value.nodeCode = taskNodeList.value[0].nodeCode; }; /** 驳回流程 */ const handleBackProcess = async () => { @@ -249,7 +249,10 @@ const handleBackProcess = async () => { loading.value = true; backLoading.value = true; backButtonDisabled.value = true; - await backProcess(backForm.value).finally(() => (loading.value = false)); + await backProcess(backForm.value).finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; backLoading.value = false; backButtonDisabled.value = false; @@ -282,18 +285,48 @@ const handleCopyCloseTag = (user: UserVO) => { selectCopyUserIds.value = selectCopyUserList.value.map((item) => item.userId).join(','); }; //加签 -const addMultiInstanceUser = () => { - if (multiInstanceUserRef.value) { - title.value = '加签人员'; - multiInstanceUserRef.value.getAddMultiInstanceList(taskId.value, []); +const openMultiInstanceUser = async () => { + multiInstanceUserRef.value.open(); +}; +//加签 +const addMultiInstanceUser = async (data) => { + if (data && data.length > 0) { + const taskOperationBo = reactive({ + userIds: data.map((e) => e.userId), + taskId: taskId.value, + message: form.value.message + }); + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonDisabled.value = true; + await taskOperation(taskOperationBo, 'addSignature').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + } else { + proxy?.$modal.msgWarning('请选择用户!'); } }; //减签 -const deleteMultiInstanceUser = () => { - if (multiInstanceUserRef.value) { - title.value = '减签人员'; - multiInstanceUserRef.value.getDeleteMultiInstanceList(taskId.value); - } +const deleteMultiInstanceUser = async (row) => { + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonDisabled.value = true; + const taskOperationBo = reactive({ + userIds: [row.userId], + taskId: taskId.value, + message: form.value.message + }); + await taskOperation(taskOperationBo, 'reductionSignature').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); }; //打开转办 const openTransferTask = () => { @@ -302,15 +335,18 @@ const openTransferTask = () => { //转办 const handleTransferTask = async (data) => { if (data && data.length > 0) { - let params = { - taskId: taskId.value, + const taskOperationBo = reactive({ userId: data[0].userId, - comment: form.value.message - }; + taskId: taskId.value, + message: form.value.message + }); await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; buttonDisabled.value = true; - await transferTask(params).finally(() => (loading.value = false)); + await taskOperation(taskOperationBo, 'transferTask').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); @@ -326,15 +362,18 @@ const openDelegateTask = () => { //委托 const handleDelegateTask = async (data) => { if (data && data.length > 0) { - let params = { - taskId: taskId.value, + const taskOperationBo = reactive({ userId: data[0].userId, - nickName: data[0].nickName - }; + taskId: taskId.value, + message: form.value.message + }); await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; buttonDisabled.value = true; - await delegateTask(params).finally(() => (loading.value = false)); + await taskOperation(taskOperationBo, 'delegateTask').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); @@ -343,7 +382,7 @@ const handleDelegateTask = async (data) => { } }; //终止任务 -const handleTerminationTask = async (data) => { +const handleTerminationTask = async () => { let params = { taskId: taskId.value, comment: form.value.message @@ -351,11 +390,24 @@ const handleTerminationTask = async (data) => { await proxy?.$modal.confirm('是否确认终止?'); loading.value = true; buttonDisabled.value = true; - await terminationTask(params).finally(() => (loading.value = false)); + await terminationTask(params).finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); }; +const handleTaskUser = async () => { + let data = await currentTaskAllUser(taskId.value); + deleteUserList.value = data.data; + if (deleteUserList.value && deleteUserList.value.length > 0) { + deleteUserList.value.forEach((e) => { + e.nodeName = task.value.nodeName; + }); + } + deleteSignatureVisible.value = true; +}; /** * 对外暴露子组件方法 diff --git a/src/components/RoleSelect/index.vue b/src/components/RoleSelect/index.vue index 6ba207627bb699b55032ffdb050976a43809a5d1..56a784b04cec2dc15517509cf7cb39fc480691bb 100644 --- a/src/components/RoleSelect/index.vue +++ b/src/components/RoleSelect/index.vue @@ -53,7 +53,7 @@ diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index e93e0059c2088b326ab829a7525db991397cdcf5..cfe2cd747d743f33396a8b294be49ae810515708 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -91,8 +91,8 @@ const activeMenu = computed(() => { let activePath = path; if (path !== undefined && path.lastIndexOf('/') > 0 && hideList.indexOf(path) === -1) { const tmpPath = path.substring(1, path.length); - activePath = '/' + tmpPath.substring(0, tmpPath.indexOf('/')); if (!route.meta.link) { + activePath = '/' + tmpPath.substring(0, tmpPath.indexOf('/')); appStore.toggleSideBarHide(false); } } else if (!route.children) { diff --git a/src/components/UserSelect/index.vue b/src/components/UserSelect/index.vue index e9865e577bf8de7e3b2da842e135f26039ced139..937a3954f6812128da194a23bab61d682c817c52 100644 --- a/src/components/UserSelect/index.vue +++ b/src/components/UserSelect/index.vue @@ -43,7 +43,7 @@ @@ -100,14 +100,14 @@ diff --git a/src/views/register.vue b/src/views/register.vue index c3d19301c54f5f0ef4c686a2ac548401eb7a5f9a..f1d1e5a7d1363dfcbcaa47cec004ead11f89fcf5 100644 --- a/src/views/register.vue +++ b/src/views/register.vue @@ -1,20 +1,30 @@ diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 1b67d4849aff641dc8ba201c3cbfec9f6d2af575..ddc07537fddd20cc0ab82c667ea7a3bea1a3650d 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -56,7 +56,7 @@ 刷新缓存 - + @@ -74,7 +74,7 @@ @@ -101,7 +101,7 @@ - + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 199a99777d745601dbe1b6a861e17dea13c11dde..1f5facb98d6500299492ea90ee7d695867a194e6 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -33,7 +33,7 @@ 展开/折叠 - + @@ -55,7 +55,7 @@ diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 33c7fc8cb9878d6b5e540f5e4cd15ed9069bd649..3e9b0a1c26864a485f3ad561f6cff94f89abd5f5 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -40,7 +40,7 @@ 关闭 - + @@ -66,7 +66,7 @@ diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 4ad70d098374494fbe45639b95d0ab0751dab4e1..d30ad5485d181f10cb9493cefee7840d35a6aec1 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -49,10 +49,7 @@ 刷新缓存 - - 同步租户字典 - - + @@ -70,7 +67,7 @@ @@ -112,15 +109,11 @@ diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue index f413136b034d16731442da9ab0d0cbd66973da52..2c8da0ecf59ec8ecebe30a5e632ffac5bd2275cc 100644 --- a/src/views/workflow/leave/index.vue +++ b/src/views/workflow/leave/index.vue @@ -27,11 +27,11 @@ 导出 - + - + @@ -41,12 +41,12 @@ @@ -56,38 +56,28 @@ - + @@ -99,7 +89,7 @@ diff --git a/src/views/workflow/processDefinition/components/processPreview.vue b/src/views/workflow/processDefinition/components/processPreview.vue deleted file mode 100644 index 19a95df36ae1495bae9e1e6ef3af463e5e399e96..0000000000000000000000000000000000000000 --- a/src/views/workflow/processDefinition/components/processPreview.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/src/views/workflow/processDefinition/design.vue b/src/views/workflow/processDefinition/design.vue new file mode 100644 index 0000000000000000000000000000000000000000..3ec44f767f55a15b68df5d9846f59a0586bf9fd0 --- /dev/null +++ b/src/views/workflow/processDefinition/design.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 1dacb8032d694f5c7924f3db04e658caa10f26cf..a45e4843878097601559c2d2c77956b13ec4fe5b 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -10,7 +10,7 @@ class="mt-2" node-key="id" :data="categoryOptions" - :props="{ label: 'categoryName', children: 'children' }" + :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" highlight-current @@ -24,11 +24,11 @@
- - + + - - + + 搜索 @@ -41,94 +41,87 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - @@ -138,9 +131,9 @@ -
点击上传,选择BPMN流程文件
-
仅支持 .zip、.bpmn20.xml、bpmn 格式文件
+
点击上传,选择JSON流程文件
+
仅支持json格式文件
PS:如若部署请部署从本项目模型管理导出的数据
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -251,53 +191,32 @@ diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 7c60880bb4b31c0d1b6c8b20e7692328090a8cf2..b58b1892c83180b80e62e92d875147e41dafccc6 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -10,7 +10,7 @@ class="mt-2" node-key="id" :data="categoryOptions" - :props="{ label: 'categoryName', children: 'children' }" + :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" highlight-current @@ -20,23 +20,31 @@
-
- - - 运行中 - 已完成 - - -
+
- - - + + + + 选择申请人 + + + + + + + - - + + 搜索 @@ -52,69 +60,77 @@ 删除 - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -122,6 +138,7 @@ + @@ -133,42 +150,55 @@ - - - + + + + +
+ +
+
+
+ + + +
diff --git a/tsconfig.json b/tsconfig.json index bb287e9d79ccda002f044079edd9dfa5dff6f9e9..6315891fb5d671311f3a313e2d2bf42aa77cf715 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "esnext", "module": "esnext", -// "useDefineForClassFields": true, + // "useDefineForClassFields": true, "moduleResolution": "bundler", "strict": true, "jsx": "preserve", diff --git a/vite.config.ts b/vite.config.ts index 97c8d9d33d4c4bbd9abc25513853aa3dcd750df8..e125e36801e86cd0c69dfd157cca8c8be55824b7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -64,16 +64,6 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => { 'echarts', 'vue-i18n', '@vueup/vue-quill', - 'bpmn-js/lib/Viewer', - 'bpmn-js/lib/Modeler.js', - 'bpmn-js-properties-panel', - 'min-dash', - 'diagram-js/lib/navigation/movecanvas', - 'diagram-js/lib/navigation/zoomscroll', - 'bpmn-js/lib/features/palette/PaletteProvider', - 'bpmn-js/lib/features/context-pad/ContextPadProvider', - 'diagram-js/lib/draw/BaseRenderer', - 'tiny-svg', 'image-conversion', 'element-plus/es/components/**/css' ] diff --git a/vite/plugins/i18n.ts b/vite/plugins/i18n.ts deleted file mode 100644 index 8777d1aeeca2475620456f7e9ceec66bef075901..0000000000000000000000000000000000000000 --- a/vite/plugins/i18n.ts +++ /dev/null @@ -1,6 +0,0 @@ -import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; -export default (path: any) => { - return VueI18nPlugin({ - include: [path.resolve(__dirname, '../../src/lang/**.json')] - }); -}; diff --git a/vite/plugins/index.ts b/vite/plugins/index.ts index 0ec5b8d7907803d66f87355b557bce378c84a840..30b2835a439ac740be4be641f929f88645f9cf4d 100644 --- a/vite/plugins/index.ts +++ b/vite/plugins/index.ts @@ -6,7 +6,6 @@ import createIcons from './icons'; import createSvgIconsPlugin from './svg-icon'; import createCompression from './compression'; import createSetupExtend from './setup-extend'; -import createI18n from './i18n'; import path from 'path'; export default (viteEnv: any, isBuild = false): [] => { @@ -19,6 +18,5 @@ export default (viteEnv: any, isBuild = false): [] => { vitePlugins.push(createIcons()); vitePlugins.push(createSvgIconsPlugin(path, isBuild)); vitePlugins.push(createSetupExtend()); - vitePlugins.push(createI18n(path)); return vitePlugins; };