diff --git a/.env.development b/.env.development index 7edd98a2396a70361ec9b1bc654c55a3aae9ad69..e1f7af614c853e13e110f6adf94d08e44dca9d31 100644 --- a/.env.development +++ b/.env.development @@ -13,11 +13,13 @@ VITE_APP_CONTEXT_PATH = '/' # 监控地址 VITE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications' -# powerjob 控制台地址 -VITE_APP_POWERJOB_ADMIN = 'http://localhost:7700/' +# SnailJob 控制台地址 +VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job' VITE_APP_PORT = 80 +# 接口加密功能开关(如需关闭 后端也必须对应关闭) +VITE_APP_ENCRYPT = true # 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换 VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' # 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换 @@ -26,5 +28,5 @@ VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3C # 客户端id VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' -# websocket 开关(开发环境默认关闭ws 因vite的bug导致如ws无法连接则会崩溃) -VITE_APP_WEBSOCKET = false +# websocket 开关 +VITE_APP_WEBSOCKET = true diff --git a/.env.production b/.env.production index 0e3b9fc5282a6c242948fa75356ec1b942e07901..2700ee0ddd0ccab7af61255695ecb8ce405dcb2f 100644 --- a/.env.production +++ b/.env.production @@ -10,8 +10,8 @@ VITE_APP_CONTEXT_PATH = '/' # 监控地址 VITE_APP_MONITRO_ADMIN = '/admin/applications' -# powerjob 控制台地址 -VITE_APP_POWERJOB_ADMIN = '/powerjob' +# SnailJob 控制台地址 +VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job' # 生产环境 VITE_APP_BASE_API = '/prod-api' @@ -21,6 +21,8 @@ VITE_BUILD_COMPRESS = gzip VITE_APP_PORT = 80 +# 接口加密功能开关(如需关闭 后端也必须对应关闭) +VITE_APP_ENCRYPT = true # 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换 VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' # 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换 diff --git a/.eslintignore b/.eslintignore index c4d771a13f37a416c0ca5a57778945e5802d7b08..e74db40bfcd94e703617d0de83d00b004ab7132a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -11,7 +11,7 @@ dist .husky .local /bin -.eslintrc.js +.eslintrc.cjs prettier.config.js src/assets -tailwind.config.js \ No newline at end of file +tailwind.config.js diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 65% rename from .eslintrc.js rename to .eslintrc.cjs index a1b32e3987b7595620506444b2204e11ee1b72a5..6042c39be0864a75105eabc787224abee03a6e41 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -1,28 +1,37 @@ module.exports = { env: { browser: true, - es2021: true, - node: true + node: true, + es6: true }, parser: 'vue-eslint-parser', extends: [ - 'eslint:recommended', - 'plugin:vue/vue3-essential', - 'plugin:@typescript-eslint/recommended', + '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'], + plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'], rules: { - 'vue/multi-word-component-names': 'off', '@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', { diff --git a/.gitignore b/.gitignore index 40df4749927f06e2a6a0422c0c1f979730f85a80..1fd56f08a1c72b287819f25e55e661b4ebac3c32 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ selenium-debug.log package-lock.json yarn.lock +pnpm-lock.yaml # 编译生成的文件 auto-imports.d.ts diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000000000000000000000000000000000..6ca3ce50e67c2ad83f8152f280c5b5bc974e3d56 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,20 @@ +{ + "printWidth": 150, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "quoteProps": "preserve", + "jsxSingleQuote": false, + "bracketSameLine": false, + "trailingComma": "none", + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "arrowParens": "always", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "endOfLine": "auto" +} diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index 61d2d92a7b5c417a0d69cc5ada18f18ef907b595..0000000000000000000000000000000000000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 代码格式化配置 - */ -module.exports = { - // 一行最多多少个字符 - printWidth: 150, - // 指定每个缩进级别的空格数 - tabWidth: 2, - // 使用制表符而不是空格缩进行 - useTabs: false, - // 在语句末尾是否需要分号 - semi: true, - // 是否使用单引号 - singleQuote: true, - // 更改引用对象属性的时间 可选值"" - quoteProps: 'as-needed', - // 在JSX中使用单引号而不是双引号 - jsxSingleQuote: false, - // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"",默认none - trailingComma: 'none', - // 在对象文字中的括号之间打印空格 - bracketSpacing: true, - // jsx 标签的反尖括号需要换行 - jsxBracketSameLine: false, - embeddedLanguageFormatting: 'off', - // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x - arrowParens: 'always', - // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 - rangeStart: 0, - rangeEnd: Infinity, - // 指定要使用的解析器,不需要写文件开头的 @prettier - requirePragma: false, - // 不需要自动在文件开头插入 @prettier - insertPragma: false, - // 使用默认的折行标准 always\never\preserve - proseWrap: 'preserve', - // 指定HTML文件的全局空格敏感度 css\strict\ignore - htmlWhitespaceSensitivity: 'css', - // Vue文件脚本和样式标签缩进 - vueIndentScriptAndStyle: false, - // 在 windows 操作系统中换行符通常是回车 (CR) 加换行分隔符 (LF),也就是回车换行(CRLF), - // 然而在 Linux 和 Unix 中只使用简单的换行分隔符 (LF)。 - // 对应的控制字符为 "\n" (LF) 和 "\r\n"(CRLF)。auto意为保持现有的行尾 - // 换行符使用 lf 结尾是 可选值"" - endOfLine: 'auto' -}; diff --git a/README.md b/README.md index 27424637da781085de7881fd92c5537a4cebc7c9..010adb9724595c5a5166080bf281322b4498925d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ ## 平台简介 -* 本仓库为前端技术栈 [Vue3](https://v3.cn.vuejs.org) + [TS](https://www.typescriptlang.org/) + [Element Plus](https://element-plus.org/zh-CN) + [Vite](https://cn.vitejs.dev) 版本。 -* 配套后端代码仓库地址 -* [RuoYi-Vue-Plus 5.X(注意版本号)](https://gitee.com/dromara/RuoYi-Vue-Plus) -* [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus) +- 本仓库为前端技术栈 [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) +- 配套后端代码仓库地址 +- [RuoYi-Vue-Plus 5.X(注意版本号)](https://gitee.com/dromara/RuoYi-Vue-Plus) +- [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus) ## 前端运行 @@ -17,7 +18,7 @@ npm install --registry=https://registry.npmmirror.com # 启动服务 npm run dev -# 构建生产环境 +# 构建生产环境 npm run build:prod # 前端访问地址 http://localhost:80 @@ -25,51 +26,51 @@ npm run build:prod ## 本框架与RuoYi的业务差异 -| 业务 | 功能说明 | 本框架 | RuoYi | -|--------|-----------------------------------------|-----|------------------| -| 租户管理 | 系统内租户的管理 如:租户套餐、过期时间、用户数量、企业信息等 | 支持 | 无 | -| 租户套餐管理 | 系统内租户所能使用的套餐管理 如:套餐内所包含的菜单等 | 支持 | 无 | -| 用户管理 | 用户的管理配置 如:新增用户、分配用户所属部门、角色、岗位等 | 支持 | 支持 | -| 部门管理 | 配置系统组织机构(公司、部门、小组) 树结构展现支持数据权限 | 支持 | 支持 | -| 岗位管理 | 配置系统用户所属担任职务 | 支持 | 支持 | -| 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等 | 支持 | 支持 | -| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | 支持 | 支持 | -| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | 支持 | 支持 | -| 参数管理 | 对系统动态配置常用参数 | 支持 | 支持 | -| 通知公告 | 系统通知公告信息发布维护 | 支持 | 支持 | -| 操作日志 | 系统正常操作日志记录和查询 系统异常信息日志记录和查询 | 支持 | 支持 | -| 登录日志 | 系统登录日志记录查询包含登录异常 | 支持 | 支持 | -| 文件管理 | 系统文件展示、上传、下载、删除等管理 | 支持 | 无 | -| 文件配置管理 | 系统文件上传、下载所需要的配置信息动态添加、修改、删除等管理 | 支持 | 无 | -| 在线用户管理 | 已登录系统的在线用户信息监控与强制踢出操作 | 支持 | 支持 | -| 定时任务 | 运行报表、任务管理(添加、修改、删除)、日志管理、执行器管理等 | 支持 | 仅支持任务与日志管理 | -| 代码生成 | 多数据源前后端代码的生成(java、html、xml、sql)支持CRUD下载 | 支持 | 仅支持单数据源 | -| 系统接口 | 根据业务代码自动生成相关的api接口文档 | 支持 | 支持 | -| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等 | 支持 | 仅支持单机CPU、内存、磁盘监控 | -| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | 支持 | 支持 | -| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | 支持 | 支持 | -| 使用案例 | 系统的一些功能案例 | 支持 | 不支持 | +| 业务 | 功能说明 | 本框架 | RuoYi | +| ------------ | ------------------------------------------------------------- | ------ | ----------------------------- | +| 租户管理 | 系统内租户的管理 如:租户套餐、过期时间、用户数量、企业信息等 | 支持 | 无 | +| 租户套餐管理 | 系统内租户所能使用的套餐管理 如:套餐内所包含的菜单等 | 支持 | 无 | +| 用户管理 | 用户的管理配置 如:新增用户、分配用户所属部门、角色、岗位等 | 支持 | 支持 | +| 部门管理 | 配置系统组织机构(公司、部门、小组) 树结构展现支持数据权限 | 支持 | 支持 | +| 岗位管理 | 配置系统用户所属担任职务 | 支持 | 支持 | +| 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等 | 支持 | 支持 | +| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | 支持 | 支持 | +| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | 支持 | 支持 | +| 参数管理 | 对系统动态配置常用参数 | 支持 | 支持 | +| 通知公告 | 系统通知公告信息发布维护 | 支持 | 支持 | +| 操作日志 | 系统正常操作日志记录和查询 系统异常信息日志记录和查询 | 支持 | 支持 | +| 登录日志 | 系统登录日志记录查询包含登录异常 | 支持 | 支持 | +| 文件管理 | 系统文件展示、上传、下载、删除等管理 | 支持 | 无 | +| 文件配置管理 | 系统文件上传、下载所需要的配置信息动态添加、修改、删除等管理 | 支持 | 无 | +| 在线用户管理 | 已登录系统的在线用户信息监控与强制踢出操作 | 支持 | 支持 | +| 定时任务 | 运行报表、任务管理(添加、修改、删除)、日志管理、执行器管理等 | 支持 | 仅支持任务与日志管理 | +| 代码生成 | 多数据源前后端代码的生成(java、html、xml、sql)支持CRUD下载 | 支持 | 仅支持单数据源 | +| 系统接口 | 根据业务代码自动生成相关的api接口文档 | 支持 | 支持 | +| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等 | 支持 | 仅支持单机CPU、内存、磁盘监控 | +| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | 支持 | 支持 | +| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | 支持 | 支持 | +| 使用案例 | 系统的一些功能案例 | 支持 | 不支持 | ## 演示图例 -| | | -|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| -| ![输入图片说明](https://foruda.gitee.com/images/1680077524361362822/270bb429_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680077619939771291/989bf9b6_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680077681751513929/1c27c5bd_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680077721559267315/74d63e23_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680077765638904515/1b75d4a6_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078026375951297/eded7a4b_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078237104531207/0eb1b6a7_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078254306078709/5931e22f_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078287971528493/0b9af60a_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078308138770249/8d3b6696_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078352553634393/db5ef880_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078378238393374/601e4357_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078414983206024/2aae27c1_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078446738419874/ecce7d59_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078475971341775/149e8634_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078491666717143/3fadece7_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078558863188826/fb8ced2a_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078574561685461/ae68a0b2_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078594932772013/9d8bfec6_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078626493093532/fcfe4ff6_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078643608812515/0295bd4f_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078685196286463/d7612c81_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078703877318597/56fce0bc_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078716586545643/b6dbd68f_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078734103217688/eb1e6aa6_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078759131415480/73c525d8_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078779416197879/75e3ed02_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078802329118061/77e10915_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078893627848351/34a1c342_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078928175016986/f126ec4a_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078941718318363/b68a0f72_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680078963175518631/3bb769a1_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680078982294090567/b31c343d_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680079000642440444/77ca82a9_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680079020995074177/03b7d52e_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680079039367822173/76811806_1766278.png "屏幕截图") | -| ![输入图片说明](https://foruda.gitee.com/images/1680079274333484664/4dfdc7c0_1766278.png "屏幕截图") | ![输入图片说明](https://foruda.gitee.com/images/1680079290467458224/d6715fcf_1766278.png "屏幕截图") | +| | | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| ![输入图片说明](https://foruda.gitee.com/images/1680077524361362822/270bb429_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680077619939771291/989bf9b6_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680077681751513929/1c27c5bd_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680077721559267315/74d63e23_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680077765638904515/1b75d4a6_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078026375951297/eded7a4b_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078237104531207/0eb1b6a7_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078254306078709/5931e22f_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078287971528493/0b9af60a_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078308138770249/8d3b6696_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078352553634393/db5ef880_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078378238393374/601e4357_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078414983206024/2aae27c1_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078446738419874/ecce7d59_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078475971341775/149e8634_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078491666717143/3fadece7_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078558863188826/fb8ced2a_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078574561685461/ae68a0b2_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078594932772013/9d8bfec6_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078626493093532/fcfe4ff6_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078643608812515/0295bd4f_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078685196286463/d7612c81_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078703877318597/56fce0bc_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078716586545643/b6dbd68f_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078734103217688/eb1e6aa6_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078759131415480/73c525d8_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078779416197879/75e3ed02_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078802329118061/77e10915_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078893627848351/34a1c342_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078928175016986/f126ec4a_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078941718318363/b68a0f72_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078963175518631/3bb769a1_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680078982294090567/b31c343d_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680079000642440444/77ca82a9_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680079020995074177/03b7d52e_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680079039367822173/76811806_1766278.png '屏幕截图') | +| ![输入图片说明](https://foruda.gitee.com/images/1680079274333484664/4dfdc7c0_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680079290467458224/d6715fcf_1766278.png '屏幕截图') | diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 3b75ed533c34463f00dadd072d03372e618f3a69..0000000000000000000000000000000000000000 --- a/commitlint.config.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - extends: ['@commitlint/config-conventional'], - rules: { - 'type-enum': [ - 2, - 'always', - [ - 'feat', // 新功能 feature - 'fix', // 修复 bug - 'docs', // 文档注释 - 'style', // 代码格式 - 'refactor', // 重构 - 'perf', // 性能优化 - 'test', // 增加测试 - 'chore', // 构建过程或辅助工具的变动 - 'revert', // 回退 - 'build' // 打包 - ] - ], - 'subject-case': [0] - } -}; diff --git a/html/ie.html b/html/ie.html index 87d262d42e038ea85ce572055e033db055b677fa..4d2773d1101d041660a09b1c9beca0cfe8f2f38c 100644 --- a/html/ie.html +++ b/html/ie.html @@ -1,4 +1,4 @@ - + @@ -7,24 +7,206 @@ - +

请升级您的浏览器,以便我们更好的为您提供服务!

您正在使用 Internet Explorer 的早期版本(IE11以下版本或使用该内核的浏览器)。这意味着在升级浏览器前,您将无法访问此网站。


diff --git a/index.html b/index.html index c0dab512df3bc10d9862c1a949427c18f7f514e5..aa1c86d9de765b8e3a231ebbfc70fe10b4b92f7f 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ RuoYi-Vue-Plus多租户管理系统 diff --git a/package.json b/package.json index 6af6ba2140f6fa421281d19bbe0c17bc59d84a12..5154ed0f97d04d1bbd8ec44713a0810b4ab7ae06 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,16 @@ { "name": "ruoyi-vue-plus", - "version": "5.1.2", + "version": "5.2.0-BETA", "description": "RuoYi-Vue-Plus多租户管理系统", "author": "LionLi", "license": "MIT", + "type": "module", "scripts": { "dev": "vite serve --mode development", - "build:prod": "vite build --mode production &&vue-tsc --noEmit", + "build:prod": "vite build --mode production", + "build:dev": "vite build --mode development", "preview": "vite preview", - "lint": "eslint src/**/*.{ts,js,vue} --fix", - "prepare": "husky install", + "lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", "prettier": "prettier --write ." }, "repository": { @@ -17,68 +18,84 @@ "url": "https://gitee.com/JavaLionLi/plus-ui.git" }, "dependencies": { - "@element-plus/icons-vue": "2.1.0", + "@element-plus/icons-vue": "2.3.1", + "@highlightjs/vue-plugin": "2.1.0", + "@lezer/common": "1.2.1", "@vueup/vue-quill": "1.2.0", - "@vueuse/core": "9.5.0", + "@vueuse/core": "10.9.0", "animate.css": "4.1.1", - "await-to-js": "^3.0.0", - "axios": "^1.3.4", - "echarts": "5.4.0", - "element-plus": "2.2.27", + "await-to-js": "3.0.0", + "axios": "1.6.8", + "bpmn-js": "16.4.0", + "camunda-bpmn-js-behaviors": "1.2.2", + "camunda-bpmn-moddle": "7.0.1", + "crypto-js": "4.2.0", + "diagram-js": "12.3.0", + "didi": "9.0.2", + "echarts": "5.5.0", + "element-plus": "2.7.2", "file-saver": "2.0.5", - "fuse.js": "6.6.2", - "js-cookie": "3.0.1", - "jsencrypt": "3.3.1", - "crypto-js": "^4.1.1", + "fuse.js": "7.0.0", + "highlight.js": "11.9.0", + "image-conversion": "^2.1.1", + "js-cookie": "3.0.5", + "jsencrypt": "3.3.2", + "moddle": "6.2.3", "nprogress": "0.2.0", "path-browserify": "1.0.1", - "path-to-regexp": "6.2.0", - "pinia": "2.0.22", - "screenfull": "6.0.0", - "vform3-builds": "3.0.8", - "vue": "3.2.45", - "vue-cropper": "1.0.3", - "vue-i18n": "9.2.2", - "vue-router": "4.1.4", - "vue-types": "^5.0.3" + "path-to-regexp": "6.2.1", + "pinia": "2.1.7", + "preact": "10.19.7", + "screenfull": "6.0.2", + "vform3-builds": "3.0.10", + "vue": "3.4.25", + "vue-cropper": "1.1.1", + "vue-i18n": "9.10.2", + "vue-router": "4.3.2", + "vue-types": "5.1.1", + "vxe-table": "4.5.22", + "zeebe-bpmn-moddle": "1.0.0" }, "devDependencies": { - "@iconify/json": "^2.2.40", - "@intlify/unplugin-vue-i18n": "0.8.2", - "@types/crypto-js": "^4.1.1", - "@types/file-saver": "2.0.5", - "@types/js-cookie": "3.0.3", - "@types/node": "18.14.2", - "@types/nprogress": "0.2.0", - "@types/path-browserify": "^1.0.0", - "@typescript-eslint/eslint-plugin": "5.56.0", - "@typescript-eslint/parser": "5.56.0", - "@unocss/preset-attributify": "^0.50.6", - "@unocss/preset-icons": "^0.50.6", - "@unocss/preset-uno": "^0.50.6", - "@vitejs/plugin-vue": "4.0.0", - "@vue/compiler-sfc": "3.2.45", - "autoprefixer": "10.4.14", - "eslint": "8.36.0", - "eslint-config-prettier": "8.8.0", - "eslint-plugin-prettier": "4.2.1", - "eslint-plugin-vue": "9.9.0", - "fast-glob": "^3.2.11", - "husky": "7.0.4", - "postcss": "^8.4.21", - "prettier": "2.8.6", - "sass": "1.56.1", - "typescript": "4.9.5", - "unocss": "^0.50.6", - "unplugin-auto-import": "0.13.0", - "unplugin-icons": "0.15.1", - "unplugin-vue-components": "0.23.0", - "vite": "4.3.1", + "@iconify/json": "2.2.201", + "@intlify/unplugin-vue-i18n": "3.0.1", + "@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", + "@types/path-browserify": "1.0.2", + "@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", + "@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", + "fast-glob": "3.3.2", + "postcss": "8.4.36", + "prettier": "3.2.5", + "sass": "1.72.0", + "typescript": "5.4.5", + "unocss": "0.58.6", + "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.10", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", - "unplugin-vue-setup-extend-plus": "0.4.9", - "vitest": "^0.29.7", - "vue-eslint-parser": "9.1.0", - "vue-tsc": "0.35.0" + "vitest": "1.5.0", + "vue-eslint-parser": "9.4.2", + "vue-tsc": "2.0.13" } } diff --git a/src/App.vue b/src/App.vue index 41ffdd4d92ba5eeb196d6e28b3385c1460906b4f..66dbed6d3598d37df9438575cdb16be123a0104c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,21 +1,20 @@ diff --git a/src/api/login.ts b/src/api/login.ts index 100a5e9f7df7262ad518c11b85805544f17d81e6..b6955debe2b3e26f0eb58b9fc1c2207216676244 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -20,7 +20,8 @@ export function login(data: LoginData): AxiosPromise { url: '/auth/login', headers: { isToken: false, - isEncrypt: true + isEncrypt: true, + repeatSubmit: false }, method: 'post', data: params @@ -38,7 +39,8 @@ export function register(data: any) { url: '/auth/register', headers: { isToken: false, - isEncrypt: true + isEncrypt: true, + repeatSubmit: false }, method: 'post', data: params diff --git a/src/api/monitor/online/index.ts b/src/api/monitor/online/index.ts index 3d9034a8c004a075393481e0f84efc01529523fb..74847026f16f39a66ad870bc2f80793806e90583 100644 --- a/src/api/monitor/online/index.ts +++ b/src/api/monitor/online/index.ts @@ -18,3 +18,19 @@ export function forceLogout(tokenId: string) { method: 'delete' }); } + +// 获取当前用户登录在线设备 +export function getOnline() { + return request({ + url: '/monitor/online', + method: 'get' + }); +} + +// 删除当前在线设备 +export function delOnline(tokenId: string) { + return request({ + url: '/monitor/online/' + tokenId, + method: 'post' + }); +} diff --git a/src/api/system/client/index.ts b/src/api/system/client/index.ts index 06544dab3d5fbfd6c7af51b34f1f154f25351227..6b302b0aa1bd14e7ff6e0263f2d2ab64566c1fa9 100644 --- a/src/api/system/client/index.ts +++ b/src/api/system/client/index.ts @@ -64,12 +64,12 @@ export const delClient = (id: string | number | Array) => { /** * 状态修改 - * @param id ID + * @param clientId 客户端id * @param status 状态 */ -export function changeStatus(id: number | string, status: string) { +export function changeStatus(clientId: string, status: string) { const data = { - id, + clientId, status }; return request({ diff --git a/src/api/system/client/types.ts b/src/api/system/client/types.ts index d7cb926b6ee5e4365957f9e9165a236f76107b12..142118dac0e69f6815adc60c5d9084f1ec7ba2a2 100644 --- a/src/api/system/client/types.ts +++ b/src/api/system/client/types.ts @@ -7,7 +7,7 @@ export interface ClientVO { /** * 客户端id */ - clientId: string | number; + clientId: string; /** * 客户端key diff --git a/src/api/system/config/index.ts b/src/api/system/config/index.ts index e52a256666c96244ba7590c331cd994f9b58de32..1e4842d5bbb172aa40ebeb215553229163cd9d1f 100644 --- a/src/api/system/config/index.ts +++ b/src/api/system/config/index.ts @@ -20,7 +20,7 @@ export function getConfig(configId: string | number): AxiosPromise { } // 根据参数键名查询参数值 -export function getConfigKey(configKey: string): AxiosPromise { +export function getConfigKey(configKey: string): AxiosPromise { return request({ url: '/system/config/configKey/' + configKey, method: 'get' diff --git a/src/api/system/dept/types.ts b/src/api/system/dept/types.ts index 867dbdedda09943896a8dc33838464fe0fa94244..494745c44bba00500b1307c44cd8bc0e59b30564 100644 --- a/src/api/system/dept/types.ts +++ b/src/api/system/dept/types.ts @@ -3,6 +3,7 @@ */ export interface DeptQuery extends PageQuery { deptName?: string; + deptCategory?: string; status?: number; } @@ -16,6 +17,7 @@ export interface DeptVO extends BaseEntity { children: DeptVO[]; deptId: number | string; deptName: string; + deptCategory: string; orderNum: number; leader: string; phone: string; @@ -35,6 +37,7 @@ export interface DeptForm { children?: DeptForm[]; deptId?: number | string; deptName?: string; + deptCategory?: string; orderNum?: number; leader?: string; phone?: string; diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 3e523ab9211a26897beada432816765676cc97d2..5f6ab18b625b352f9161a45a1655f336dfad80c2 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -19,6 +19,18 @@ export function getPost(postId: string | number): AxiosPromise { }); } +// 获取岗位选择框列表 +export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise { + return request({ + url: '/system/post/optionselect', + method: 'get', + params: { + postIds: postIds, + deptId: deptId + } + }); +} + // 新增岗位 export function addPost(data: PostForm) { return request({ diff --git a/src/api/system/post/types.ts b/src/api/system/post/types.ts index 84e6786cdeb2d56666a5841dfe798427a66aa1ee..45a0540c95f1578ff8253053a6a76afc1747bf7f 100644 --- a/src/api/system/post/types.ts +++ b/src/api/system/post/types.ts @@ -1,7 +1,10 @@ export interface PostVO extends BaseEntity { postId: number | string; + deptId: number | string; postCode: string; postName: string; + postCategory: string; + deptName: string; postSort: number; status: string; remark: string; @@ -9,15 +12,20 @@ export interface PostVO extends BaseEntity { export interface PostForm { postId: number | string | undefined; + deptId: number | string | undefined; postCode: string; postName: string; + postCategory: string; postSort: number; status: string; remark: string; } export interface PostQuery extends PageQuery { + deptId: number | string; + belongDeptId: number | string; postCode: string; postName: string; + postCategory: string; status: string; } diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts index 4e8b6127975d6aac3aa00d0f8d507059a65f3a05..fb0fcabcf1090d9286b88b0da90e27a375451c02 100644 --- a/src/api/system/role/index.ts +++ b/src/api/system/role/index.ts @@ -12,6 +12,17 @@ export const listRole = (query: RoleQuery): AxiosPromise => { }); }; +/** + * 通过roleIds查询角色 + * @param roleIds + */ +export const optionSelect = (roleIds: (number | string)[]): AxiosPromise => { + return request({ + url: '/system/role/optionselect?roleIds=' + roleIds, + method: 'get' + }); +}; + /** * 查询角色详细 */ @@ -142,3 +153,8 @@ export const deptTreeSelect = (roleId: string | number): AxiosPromise => { }); }; +/** + * 通过用户ids查询用户 + * @param userIds + */ +export const optionSelect = (userIds: (number | string)[]): AxiosPromise => { + return request({ + url: '/system/user/optionselect?userIds=' + userIds, + method: 'get' + }); +}; + /** * 获取用户详情 * @param userId @@ -75,7 +86,8 @@ export const resetUserPwd = (userId: string | number, password: string) => { url: '/system/user/resetPwd', method: 'put', headers: { - isEncrypt: true + isEncrypt: true, + repeatSubmit: false }, data: data }); @@ -134,7 +146,8 @@ export const updateUserPwd = (oldPassword: string, newPassword: string) => { url: '/system/user/profile/updatePwd', method: 'put', headers: { - isEncrypt: true + isEncrypt: true, + repeatSubmit: false }, data: data }); @@ -199,6 +212,7 @@ export const deptTreeSelect = (): AxiosPromise => { export default { listUser, getUser, + optionSelect, addUser, updateUser, delUser, diff --git a/src/api/system/user/types.ts b/src/api/system/user/types.ts index 77e9c320b564b8e5717ee58d7968171ac3223629..3488e9f1175071109929731985419af22b33ba72 100644 --- a/src/api/system/user/types.ts +++ b/src/api/system/user/types.ts @@ -1,4 +1,3 @@ -import { DeptVO } from './../dept/types'; import { RoleVO } from '@/api/system/role/types'; import { PostVO } from '@/api/system/post/types'; @@ -40,7 +39,7 @@ export interface UserVO extends BaseEntity { loginIp: string; loginDate: string; remark: string; - dept: DeptVO; + deptName: string; roles: RoleVO[]; roleIds: any; postIds: any; diff --git a/src/api/tool/gen/index.ts b/src/api/tool/gen/index.ts index b91df6ace4cce7566c90820a4f8d58b3392da519..efe079cf0c2bbb01866b55c37984f75db472c26c 100644 --- a/src/api/tool/gen/index.ts +++ b/src/api/tool/gen/index.ts @@ -28,7 +28,7 @@ export const getGenTable = (tableId: string | number): AxiosPromise }; // 修改代码生成信息 -export const updateGenTable = (data: DbTableForm) => { +export const updateGenTable = (data: DbTableForm): AxiosPromise => { return request({ url: '/tool/gen', method: 'put', @@ -37,7 +37,7 @@ export const updateGenTable = (data: DbTableForm) => { }; // 导入表 -export const importTable = (data: { tables: string; dataName: string }) => { +export const importTable = (data: { tables: string; dataName: string }): AxiosPromise => { return request({ url: '/tool/gen/importTable', method: 'post', diff --git a/src/api/workflow/category/index.ts b/src/api/workflow/category/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9723b05d4cfde93d1c071171ba6c3bc06af80fc --- /dev/null +++ b/src/api/workflow/category/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { CategoryVO, CategoryForm, CategoryQuery } from '@/api/workflow/category/types'; + +/** + * 查询流程分类列表 + * @param query + * @returns {*} + */ + +export const listCategory = (query?: CategoryQuery): AxiosPromise => { + return request({ + url: '/workflow/category/list', + method: 'get', + params: query + }); +}; + +/** + * 查询流程分类详细 + * @param id + */ +export const getCategory = (id: string | number): AxiosPromise => { + return request({ + url: '/workflow/category/' + id, + method: 'get' + }); +}; + +/** + * 新增流程分类 + * @param data + */ +export const addCategory = (data: CategoryForm) => { + return request({ + url: '/workflow/category', + method: 'post', + data: data + }); +}; + +/** + * 修改流程分类 + * @param data + */ +export const updateCategory = (data: CategoryForm) => { + return request({ + url: '/workflow/category', + method: 'put', + data: data + }); +}; + +/** + * 删除流程分类 + * @param id + */ +export const delCategory = (id: string | number | Array) => { + return request({ + url: '/workflow/category/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/category/types.ts b/src/api/workflow/category/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..414fa55ed8da5f8bbc6ac72eb36d04bc12361966 --- /dev/null +++ b/src/api/workflow/category/types.ts @@ -0,0 +1,67 @@ +export interface CategoryVO { + /** + * 主键 + */ + id: string; + + /** + * 分类名称 + */ + categoryName: string; + + /** + * 分类编码 + */ + categoryCode: string; + + /** + * 父级id + */ + parentId: string | number; + + /** + * 排序 + */ + sortNum: number; + + children?: CategoryVO[]; +} + +export interface CategoryForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 分类名称 + */ + categoryName?: string; + + /** + * 分类编码 + */ + categoryCode?: string; + + /** + * 父级id + */ + parentId?: string | number; + + /** + * 排序 + */ + sortNum?: number; +} + +export interface CategoryQuery extends PageQuery { + /** + * 分类名称 + */ + categoryName?: string; + + /** + * 分类编码 + */ + categoryCode?: string; +} diff --git a/src/api/workflow/definitionConfig/index.ts b/src/api/workflow/definitionConfig/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..d34bf05c14e4b7edcc424e082e63dca35bbbecb6 --- /dev/null +++ b/src/api/workflow/definitionConfig/index.ts @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..7627403d513874812c53ebb7e1028e3841fe3844 --- /dev/null +++ b/src/api/workflow/definitionConfig/types.ts @@ -0,0 +1,102 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..c2930cfec1d41e5d00a47f064651a2d66844a323 --- /dev/null +++ b/src/api/workflow/formManage/index.ts @@ -0,0 +1,76 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..6554f5529798483f7ad0860672951fe25ab92ac4 --- /dev/null +++ b/src/api/workflow/formManage/types.ts @@ -0,0 +1,69 @@ +export interface FormManageVO { + /** + * 主键 + */ + id: string | number; + + /** + * 表单名称 + */ + formName: string; + + /** + * 表单类型 + */ + formType: string; + /** + * 表单类型名称 + */ + formTypeName: string; + + /** + * 路由地址/表单ID + */ + router: string; + + /** + * 备注 + */ + remork: string; +} + +export interface FormManageForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 表单名称 + */ + formName?: string; + + /** + * 表单类型 + */ + formType?: string; + + /** + * 路由地址/表单ID + */ + router?: string; + + /** + * 备注 + */ + remork?: string; +} + +export interface FormManageQuery extends PageQuery { + /** + * 表单名称 + */ + formName?: string; + + /** + * 表单类型 + */ + formType?: string; +} diff --git a/src/api/workflow/leave/index.ts b/src/api/workflow/leave/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..36c6fdfca60d862139911e2a97b03e0d4df6ce91 --- /dev/null +++ b/src/api/workflow/leave/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { LeaveVO, LeaveQuery, LeaveForm } from '@/api/workflow/leave/types'; + +/** + * 查询请假列表 + * @param query + * @returns {*} + */ + +export const listLeave = (query?: LeaveQuery): AxiosPromise => { + return request({ + url: '/demo/leave/list', + method: 'get', + params: query + }); +}; + +/** + * 查询请假详细 + * @param id + */ +export const getLeave = (id: string | number): AxiosPromise => { + return request({ + url: '/demo/leave/' + id, + method: 'get' + }); +}; + +/** + * 新增请假 + * @param data + */ +export const addLeave = (data: LeaveForm): AxiosPromise => { + return request({ + url: '/demo/leave', + method: 'post', + data: data + }); +}; + +/** + * 修改请假 + * @param data + */ +export const updateLeave = (data: LeaveForm): AxiosPromise => { + return request({ + url: '/demo/leave', + method: 'put', + data: data + }); +}; + +/** + * 删除请假 + * @param id + */ +export const delLeave = (id: string | number | Array) => { + return request({ + url: '/demo/leave/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/leave/types.ts b/src/api/workflow/leave/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..b093546df9caea7a6740fe186d8bd6e292596379 --- /dev/null +++ b/src/api/workflow/leave/types.ts @@ -0,0 +1,24 @@ +export interface LeaveVO { + id: string | number; + leaveType: string; + startDate: string; + endDate: string; + leaveDays: number; + remark: string; + processInstanceVo: any; +} + +export interface LeaveForm extends BaseEntity { + id?: string | number; + leaveType?: string; + startDate?: string; + endDate?: string; + leaveDays?: number; + remark?: string; + processInstanceVo?: any; +} + +export interface LeaveQuery extends PageQuery { + startLeaveDays?: number; + endLeaveDays?: number; +} diff --git a/src/api/workflow/model/index.ts b/src/api/workflow/model/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..56f7fedbc5a324274915b50546b1bc99c505fc57 --- /dev/null +++ b/src/api/workflow/model/index.ts @@ -0,0 +1,104 @@ +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 + }); +}; \ No newline at end of file diff --git a/src/api/workflow/model/types.ts b/src/api/workflow/model/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..40a0faa1fe461f8675815eba9eae723c0cfa0f51 --- /dev/null +++ b/src/api/workflow/model/types.ts @@ -0,0 +1,66 @@ +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/index.ts b/src/api/workflow/nodeConfig/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3270c17e55398cfe314506301a226479aeafb430 --- /dev/null +++ b/src/api/workflow/nodeConfig/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { NodeConfigVO, NodeConfigForm, NodeConfigQuery } from '@/api/workflow/nodeConfig/types'; + +/** + * 查询节点配置列表 + * @param query + * @returns {*} + */ + +export const listNodeConfig = (query?: NodeConfigQuery): AxiosPromise => { + return request({ + url: '/workflow/nodeConfig/list', + method: 'get', + params: query + }); +}; + +/** + * 查询节点配置详细 + * @param id + */ +export const getNodeConfig = (id: string | number): AxiosPromise => { + return request({ + url: '/workflow/nodeConfig/' + id, + method: 'get' + }); +}; + +/** + * 新增节点配置 + * @param data + */ +export const addNodeConfig = (data: NodeConfigForm) => { + return request({ + url: '/workflow/nodeConfig', + method: 'post', + data: data + }); +}; + +/** + * 修改节点配置 + * @param data + */ +export const updateNodeConfig = (data: NodeConfigForm) => { + return request({ + url: '/workflow/nodeConfig', + method: 'put', + data: data + }); +}; + +/** + * 删除节点配置 + * @param id + */ +export const delNodeConfig = (id: string | number | Array) => { + return request({ + url: '/workflow/nodeConfig/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/nodeConfig/types.ts b/src/api/workflow/nodeConfig/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e3a60b33d3bc5da962a1c28e1a5fafdb5b7886c --- /dev/null +++ b/src/api/workflow/nodeConfig/types.ts @@ -0,0 +1,43 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..c06312017140e7f7cd6a127422f99a7731c3c211 --- /dev/null +++ b/src/api/workflow/processDefinition/index.ts @@ -0,0 +1,114 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..979ec253aebdce3e7c9e94974192ec77ad6b15a4 --- /dev/null +++ b/src/api/workflow/processDefinition/types.ts @@ -0,0 +1,24 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..80f122f19d16578d9bf9b39162f70d5c10161c84 --- /dev/null +++ b/src/api/workflow/processInstance/index.ts @@ -0,0 +1,136 @@ +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 = (processInstanceId: string) => { + return request({ + url: `/workflow/processInstance/getHistoryImage/${processInstanceId}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 通过流程实例id获取历史流程图运行中,历史等节点 + */ +export const getHistoryList = (instanceId: string): AxiosPromise> => { + return request({ + url: `/workflow/processInstance/getHistoryList/${instanceId}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 获取审批记录 + * @param processInstanceId 流程实例id + * @returns + */ +export const getHistoryRecord = (processInstanceId: string) => { + return request({ + url: `/workflow/processInstance/getHistoryRecord/${processInstanceId}`, + method: 'get' + }); +}; + +/** + * 作废 + * @param data 参数 + * @returns + */ +export const deleteRunInstance = (data: object) => { + return request({ + url: `/workflow/processInstance/deleteRunInstance`, + method: 'post', + data: data + }); +}; + +/** + * 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息 + * @param processInstanceId 流程实例id + * @returns + */ +export const deleteRunAndHisInstance = (processInstanceId: string | string[]) => { + return request({ + url: `/workflow/processInstance/deleteRunAndHisInstance/${processInstanceId}`, + method: 'delete' + }); +}; + +/** + * 已完成的实例 删除程实例,删除历史记录,删除业务与流程关联信息 + * @param processInstanceId 流程实例id + * @returns + */ +export const deleteFinishAndHisInstance = (processInstanceId: string | string[]) => { + return request({ + url: `/workflow/processInstance/deleteFinishAndHisInstance/${processInstanceId}`, + method: 'delete' + }); +}; + +/** + * 分页查询当前登录人单据 + * @param query + * @returns {*} + */ +export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise => { + return request({ + url: '/workflow/processInstance/getPageByCurrent', + method: 'get', + params: query + }); +}; + +/** + * 撤销流程 + * @param processInstanceId 流程实例id + * @returns + */ +export const cancelProcessApply = (processInstanceId: string) => { + return request({ + url: `/workflow/processInstance/cancelProcessApply/${processInstanceId}`, + 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 new file mode 100644 index 0000000000000000000000000000000000000000..99d0511acf039efa99f152e7167fe21c4fe7dfee --- /dev/null +++ b/src/api/workflow/processInstance/types.ts @@ -0,0 +1,27 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..d29de30dea8ff090950717f450f37e6acb7bfa0a --- /dev/null +++ b/src/api/workflow/task/index.ts @@ -0,0 +1,264 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { TaskQuery, TaskVO } from '@/api/workflow/task/types'; + +/** + * 查询待办列表 + * @param query + * @returns {*} + */ +export const getPageByTaskWait = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/getPageByTaskWait', + method: 'get', + params: query + }); +}; + +/** + * 查询已办列表 + * @param query + * @returns {*} + */ +export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/getPageByTaskFinish', + method: 'get', + params: query + }); +}; + +/** + * 查询当前用户的抄送列表 + * @param query + * @returns {*} + */ +export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/getPageByTaskCopy', + method: 'get', + params: query + }); +}; + +/** + * 当前租户所有待办任务 + * @param query + * @returns {*} + */ +export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/getPageByAllTaskWait', + method: 'get', + params: query + }); +}; + +/** + * 当前租户所有已办任务 + * @param query + * @returns {*} + */ +export const getPageByAllTaskFinish = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/getPageByAllTaskFinish', + method: 'get', + params: query + }); +}; + +/** + * 启动流程 + * @param data + * @returns {*} + */ +export const startWorkFlow = (data: object): any => { + return request({ + url: '/workflow/task/startWorkFlow', + method: 'post', + data: data + }); +}; + +/** + * 办理流程 + * @param data + * @returns {*} + */ +export const completeTask = (data: object) => { + return request({ + url: '/workflow/task/completeTask', + method: 'post', + data: data + }); +}; + +/** + * 认领任务 + * @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 + * @returns {*} + */ +export const backProcess = (data: any): any => { + return request({ + url: '/workflow/task/backProcess', + method: 'post', + data: data + }); +}; + +/** + * 获取当前任务 + * @param taskId + * @returns + */ +export const getTaskById = (taskId: string) => { + return request({ + url: '/workflow/task/getTaskById/' + 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 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) => { + return request({ + url: `/workflow/task/transferTask`, + method: 'post', + data: data + }); +}; + +/** + * 终止任务 + * @returns + */ +export const terminationTask = (data: any) => { + return request({ + url: `/workflow/task/terminationTask`, + method: 'post', + data: data + }); +}; + +/** + * 查询流程变量 + * @returns + */ +export const getInstanceVariable = (taskId: string) => { + return request({ + url: `/workflow/task/getInstanceVariable/${taskId}`, + method: 'get' + }); +}; + +/** + * 获取可驳回得任务节点 + * @returns + */ +export const getTaskNodeList = (processInstanceId: string) => { + return request({ + url: `/workflow/task/getTaskNodeList/${processInstanceId}`, + method: 'get' + }); +}; + +/** + * 委托任务 + * @returns + */ +export const delegateTask = (data: any) => { + return request({ + url: `/workflow/task/delegateTask`, + method: 'post', + data: data + }); +}; + +/** + * 查询工作流任务用户选择加签人员 + * @param taskId + * @returns {*} + */ +export const getTaskUserIdsByAddMultiInstance = (taskId: string) => { + return request({ + url: '/workflow/task/getTaskUserIdsByAddMultiInstance/' + taskId, + method: 'get' + }); +}; + +/** + * 查询工作流选择减签人员 + * @param taskId + * @returns {*} + */ +export const getListByDeleteMultiInstance = (taskId: string) => { + return request({ + url: '/workflow/task/getListByDeleteMultiInstance/' + taskId, + method: 'get' + }); +}; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..0425a1a75517620caf641bbaf99e2cb7ab1b17d0 --- /dev/null +++ b/src/api/workflow/task/types.ts @@ -0,0 +1,49 @@ +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; +} + +export interface ParticipantVo { + groupIds?: string[] | number[]; + candidate: string[] | number[]; + 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 VariableVo { + key: string; + value: string; +} diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..a90216aa696c6ecd676eebcedc6d0e4aa0d1da72 --- /dev/null +++ b/src/api/workflow/workflowCommon/index.ts @@ -0,0 +1,29 @@ +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('请到模型配置菜单!'); + } + } +} \ No newline at end of file diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f1ef1f6f0b73a0f62468690804f86d0dfff9fac --- /dev/null +++ b/src/api/workflow/workflowCommon/types.ts @@ -0,0 +1,16 @@ +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; + type: string; +} + +export interface StartProcessBo { + businessKey: string | number; + tableName: string; + variables: any; +} diff --git a/src/assets/icons/svg/caret-back.svg b/src/assets/icons/svg/caret-back.svg new file mode 100644 index 0000000000000000000000000000000000000000..9bae722337a5dd2c80391ebaaa48966c2e2e9d98 --- /dev/null +++ b/src/assets/icons/svg/caret-back.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/caret-forward.svg b/src/assets/icons/svg/caret-forward.svg new file mode 100644 index 0000000000000000000000000000000000000000..1ec3f7d0179c2a998cee507aae88b3dc03ca4901 --- /dev/null +++ b/src/assets/icons/svg/caret-forward.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/category.svg b/src/assets/icons/svg/category.svg new file mode 100644 index 0000000000000000000000000000000000000000..df92526d20e0199c53176a218fce8ba117906cb9 --- /dev/null +++ b/src/assets/icons/svg/category.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/finish.svg b/src/assets/icons/svg/finish.svg new file mode 100644 index 0000000000000000000000000000000000000000..4685c232b407777031deba62f3a47243aa1f826a --- /dev/null +++ b/src/assets/icons/svg/finish.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/model.svg b/src/assets/icons/svg/model.svg new file mode 100644 index 0000000000000000000000000000000000000000..0c57d70602055fc6cb16fdaab6ee4368e8e5e87c --- /dev/null +++ b/src/assets/icons/svg/model.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/my-copy.svg b/src/assets/icons/svg/my-copy.svg new file mode 100644 index 0000000000000000000000000000000000000000..49f69fa062bf77e27384556dfa1e19d886a10f89 --- /dev/null +++ b/src/assets/icons/svg/my-copy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/my-task.svg b/src/assets/icons/svg/my-task.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f1ea447be3d5066e1e129ecdd91a1ae0d540077 --- /dev/null +++ b/src/assets/icons/svg/my-task.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/process-definition.svg b/src/assets/icons/svg/process-definition.svg new file mode 100644 index 0000000000000000000000000000000000000000..202d20038985277596ef34c22df300e376fbb2fe --- /dev/null +++ b/src/assets/icons/svg/process-definition.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/topiam.svg b/src/assets/icons/svg/topiam.svg new file mode 100644 index 0000000000000000000000000000000000000000..e7ea0577b790fc6257cc255614d5b753713d2a5e --- /dev/null +++ b/src/assets/icons/svg/topiam.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/svg/waiting.svg b/src/assets/icons/svg/waiting.svg new file mode 100644 index 0000000000000000000000000000000000000000..2c2042d6cb15b7c69c5ceb314649919f480d1be5 --- /dev/null +++ b/src/assets/icons/svg/waiting.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/workflow.svg b/src/assets/icons/svg/workflow.svg new file mode 100644 index 0000000000000000000000000000000000000000..2f7423a53c3c37f3130b4b854d05603495862cad --- /dev/null +++ b/src/assets/icons/svg/workflow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss index 43c093c9dbe3805ab2c687bdf13dcae0a17888eb..220e4ac8f541b39466c36208222543e8e341f4b1 100644 --- a/src/assets/styles/element-ui.scss +++ b/src/assets/styles/element-ui.scss @@ -1,4 +1,15 @@ -// cover some element-ui styles + +.el-collapse { + .collapse__title { + font-weight: 600; + padding: 0 8px; + font-size: 1.2em; + line-height: 1.1em; + } + .el-collapse-item__content { + padding: 0 8px; + } +} .el-divider--horizontal { margin-bottom: 10px; @@ -68,6 +79,12 @@ .el-dialog__body { padding: 15px !important; } + .el-dialog__header { + padding: 16px 16px 8px 16px; + box-sizing: border-box; + border-bottom: 1px solid var(--brder-color); + margin-right: 0; + } } } } @@ -114,3 +131,19 @@ .el-dropdown .el-dropdown-link { color: var(--el-color-primary) !important; } + +/* 当 el-form 的 inline 属性为 true 时 */ +/* 设置 label 的宽度默认为 68px */ +.el-form--inline .el-form-item__label { + width: 68px; +} + +/* 设置 el-select 的宽度默认为 240px */ +.el-form--inline .el-select { + width: 240px; +} + +/* 设置 el-input 的宽度默认为 240px */ +.el-form--inline .el-input { + width: 240px; +} diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 48865fba7be664141e6d1ab3d2473c20a57c0edc..bdf9b03223e294c060a25942185b9ef2ab560d63 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -14,7 +14,14 @@ body { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; - font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; + font-family: + Helvetica Neue, + Helvetica, + PingFang SC, + Hiragino Sans GB, + Microsoft YaHei, + Arial, + sans-serif; } label { diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index d47a2bd5e9488cbd55b3a8107321c90587658fe2..d85da5541ce1af7746dc98d53dbc10b254b538f6 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -28,7 +28,10 @@ // reset element-ui css .horizontal-collapse-transition { - transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + transition: + 0s width ease-in-out, + 0s padding-left ease-in-out, + 0s padding-right ease-in-out; } .scrollbar-wrapper { @@ -106,7 +109,6 @@ } } - & .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title, & .theme-dark .el-sub-menu .el-menu-item { background-color: $base-sub-menu-background !important; diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index d07d3d4621bf75a2d762804c63f6ce2fdbf773df..92fc34d508d9dd70da51f216c99684e5800430be 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -13,6 +13,14 @@ --fixedHeaderBg: #ffffff; --tableHeaderBg: #f8f8f9; --tableHeaderTextColor: #515a6e; + + // 工作流 + --bpmn-panel-border: #eeeeee; + --bpmn-panel-box-shadow: #cccccc; + --bpmn-panel-bar-background-color: #f5f7fa; + + // ele + --brder-color: #e8e8e8 } html.dark { --menuBg: #1d1e1f; @@ -33,6 +41,26 @@ html.dark { .el-tree-node__content { --el-color-primary-light-9: #262727; } + // vxe-table 主题 + --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-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; + + // ele + --brder-color: #37373A } // base color diff --git a/src/bpmn/assets/defaultXML.ts b/src/bpmn/assets/defaultXML.ts new file mode 100644 index 0000000000000000000000000000000000000000..dff0349505cfb52217e269ff0a53234754106f1f --- /dev/null +++ b/src/bpmn/assets/defaultXML.ts @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..ee0c5de3c80d509bb376dda0884ee6aab36a7545 --- /dev/null +++ b/src/bpmn/assets/lang/zh.ts @@ -0,0 +1,126 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..de959a6e6270a378f0f5afd22566836a903f5ad3 --- /dev/null +++ b/src/bpmn/assets/moddle/flowable.ts @@ -0,0 +1,1250 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..9f12ff24d1cf4c2a155faada59795abf4a4cc8a3 --- /dev/null +++ b/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts @@ -0,0 +1,138 @@ +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-ignore + 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 new file mode 100644 index 0000000000000000000000000000000000000000..8556d9b94fb421a3b4014be38196ceaf2f00a16a --- /dev/null +++ b/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts @@ -0,0 +1,109 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..6a4eb1a202d394d57c8871cb8f1066a3d399791f --- /dev/null +++ b/src/bpmn/assets/module/Renderer/CustomRenderer.ts @@ -0,0 +1,56 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..6b52dae6097693dc9788bd074bff4449644fa2ac --- /dev/null +++ b/src/bpmn/assets/module/Translate/index.ts @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..55f6b9fd6aee730dc8411e845a54e2adb594cce7 --- /dev/null +++ b/src/bpmn/assets/module/index.ts @@ -0,0 +1,17 @@ +// 翻译模块 +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 new file mode 100644 index 0000000000000000000000000000000000000000..853eb3587edbaf812b9c53eb452ed195cbe6f92a --- /dev/null +++ b/src/bpmn/assets/showConfig.ts @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..3c927920f75f7f4300d8d86cdddc35364cd3ef08 --- /dev/null +++ b/src/bpmn/assets/style/index.scss @@ -0,0 +1,284 @@ +.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 new file mode 100644 index 0000000000000000000000000000000000000000..d92b7d735ae23255beb0c8fe6a3fc5ea181d221c --- /dev/null +++ b/src/bpmn/hooks/usePanel.ts @@ -0,0 +1,145 @@ +import showConfig from '../assets/showConfig'; +import { 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 new file mode 100644 index 0000000000000000000000000000000000000000..a5a255d6d776731628dc52c37627ed279cf39cc6 --- /dev/null +++ b/src/bpmn/hooks/useParseElement.ts @@ -0,0 +1,34 @@ +import { 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 new file mode 100644 index 0000000000000000000000000000000000000000..924a8380e52109728ba14834cf4c9404ab2cbaba --- /dev/null +++ b/src/bpmn/index.vue @@ -0,0 +1,496 @@ + + + + + diff --git a/src/bpmn/panel/GatewayPanel.vue b/src/bpmn/panel/GatewayPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..5931539e67502d894638b6b7af3ae0c512d0e784 --- /dev/null +++ b/src/bpmn/panel/GatewayPanel.vue @@ -0,0 +1,68 @@ + + + + diff --git a/src/bpmn/panel/ParticipantPanel.vue b/src/bpmn/panel/ParticipantPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..cca28bdc7c0f6b9b43cb5d9c3c673b2d60b9a57a --- /dev/null +++ b/src/bpmn/panel/ParticipantPanel.vue @@ -0,0 +1,68 @@ + + + + diff --git a/src/bpmn/panel/ProcessPanel.vue b/src/bpmn/panel/ProcessPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..7d9a359e2374c35284a449c4e3f91f22ded17eaa --- /dev/null +++ b/src/bpmn/panel/ProcessPanel.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/bpmn/panel/SequenceFlowPanel.vue b/src/bpmn/panel/SequenceFlowPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..fd8ad3cd75e285f588df9e38e53ca7637397ff9e --- /dev/null +++ b/src/bpmn/panel/SequenceFlowPanel.vue @@ -0,0 +1,95 @@ + + + + diff --git a/src/bpmn/panel/StartEndPanel.vue b/src/bpmn/panel/StartEndPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..d43ed80bb4b3a72903ca25243a2903b7cba54382 --- /dev/null +++ b/src/bpmn/panel/StartEndPanel.vue @@ -0,0 +1,67 @@ + + + + diff --git a/src/bpmn/panel/SubProcessPanel.vue b/src/bpmn/panel/SubProcessPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..e0cedcb846f3c7b73709b8c6a754ddeacc820801 --- /dev/null +++ b/src/bpmn/panel/SubProcessPanel.vue @@ -0,0 +1,193 @@ + + + + diff --git a/src/bpmn/panel/TaskPanel.vue b/src/bpmn/panel/TaskPanel.vue new file mode 100644 index 0000000000000000000000000000000000000000..bc037eed76dc88952c965e4e1f8b5ae4789f923e --- /dev/null +++ b/src/bpmn/panel/TaskPanel.vue @@ -0,0 +1,492 @@ + + + + diff --git a/src/bpmn/panel/index.vue b/src/bpmn/panel/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..eecb0cb5f473f74a1b413f2b07a244b10b4550bb --- /dev/null +++ b/src/bpmn/panel/index.vue @@ -0,0 +1,110 @@ + + + + diff --git a/src/bpmn/panel/property/DueDate.vue b/src/bpmn/panel/property/DueDate.vue new file mode 100644 index 0000000000000000000000000000000000000000..882766b20f09de090e081dcae0c12c462dadc394 --- /dev/null +++ b/src/bpmn/panel/property/DueDate.vue @@ -0,0 +1,252 @@ + + + diff --git a/src/bpmn/panel/property/ExecutionListener.vue b/src/bpmn/panel/property/ExecutionListener.vue new file mode 100644 index 0000000000000000000000000000000000000000..7620cf300c9372b9b466a5d3c02f3e855dc3f8c7 --- /dev/null +++ b/src/bpmn/panel/property/ExecutionListener.vue @@ -0,0 +1,308 @@ + + + + diff --git a/src/bpmn/panel/property/ListenerParam.vue b/src/bpmn/panel/property/ListenerParam.vue new file mode 100644 index 0000000000000000000000000000000000000000..334249bdb0fdc9361cfebf9dc2f56526cbb2c471 --- /dev/null +++ b/src/bpmn/panel/property/ListenerParam.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/bpmn/panel/property/TaskListener.vue b/src/bpmn/panel/property/TaskListener.vue new file mode 100644 index 0000000000000000000000000000000000000000..db774e4ace2ea6db058206a06a8c92ad4a5d26d4 --- /dev/null +++ b/src/bpmn/panel/property/TaskListener.vue @@ -0,0 +1,310 @@ + + + + diff --git a/src/components/BpmnDesign/index.vue b/src/components/BpmnDesign/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..1f845168c415ae753f8a561cfae7ff283a3325fa --- /dev/null +++ b/src/components/BpmnDesign/index.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/components/BpmnView/index.vue b/src/components/BpmnView/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..a79f08442196ede6e78f56e6608bf98ef89aeb90 --- /dev/null +++ b/src/components/BpmnView/index.vue @@ -0,0 +1,410 @@ + + + + + diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index b96829af9e95a304a51d934936a83f5b6a8505f3..9502e60fc1f51dadff40da24f404f6e72785174c 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -2,8 +2,7 @@ - {{ - item.meta?.title }} + {{ item.meta?.title }} {{ item.meta?.title }} @@ -11,42 +10,42 @@ diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index be99ac0325f1c4636125284ba031f004a183b169..aaaa45ca468b3a0fe6310a556513077d529d3a4a 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -1,6 +1,7 @@ diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue index 489ac43e738cded772ecb31118edd5bf725cf330..f9f5e6233020e0926673081470d810c65b0e687b 100644 --- a/src/components/Hamburger/index.vue +++ b/src/components/Hamburger/index.vue @@ -1,5 +1,5 @@ diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index 723ccdb208bf657c7c516ecb5e3d3ff9ed3e85d9..349f72909cce60f5ccdf45ffb7a40325f98d1930 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -15,11 +15,11 @@ const props = defineProps({ src: propTypes.string.def(''), width: { type: [Number, String], - default: "" + default: '' }, height: { type: [Number, String], - default: "" + default: '' } }); @@ -27,29 +27,28 @@ const realSrc = computed(() => { if (!props.src) { return; } - let real_src = props.src.split(",")[0]; + let real_src = props.src.split(',')[0]; return real_src; }); const realSrcList = computed(() => { if (!props.src) { - return; + return []; } - let real_src_list = props.src.split(","); + let real_src_list = props.src.split(','); let srcList: string[] = []; - real_src_list.forEach(item => { + real_src_list.forEach((item: string) => { + if(item.trim() === '') { + return; + } return srcList.push(item); }); return srcList; }); -const realWidth = computed(() => - typeof props.width == "string" ? props.width : `${props.width}px` -); +const realWidth = computed(() => (typeof props.width == 'string' ? props.width : `${props.width}px`)); -const realHeight = computed(() => - typeof props.height == "string" ? props.height : `${props.height}px` -); +const realHeight = computed(() => (typeof props.height == 'string' ? props.height : `${props.height}px`)); diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index a30a2f698ab7155b7e656ab9854d1f5141d1a668..b5fafd33656786ffa79890c21761571524208128 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -14,22 +14,21 @@ diff --git a/src/components/Process/multiInstanceUser.vue b/src/components/Process/multiInstanceUser.vue new file mode 100644 index 0000000000000000000000000000000000000000..b2039b9836eec7856568a2ca520ea008b2e48899 --- /dev/null +++ b/src/components/Process/multiInstanceUser.vue @@ -0,0 +1,368 @@ + + + diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue new file mode 100644 index 0000000000000000000000000000000000000000..d71b8558eed8ce50fac9e70461717ac9620fb24a --- /dev/null +++ b/src/components/Process/submitVerify.vue @@ -0,0 +1,353 @@ + + + diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue index 6be382f7a2b21cb40f904d1f9822c53b4112df86..e8c9d6505fcd7311fe8990cdde7721859681c5e7 100644 --- a/src/components/RightToolbar/index.vue +++ b/src/components/RightToolbar/index.vue @@ -1,13 +1,13 @@