372 Commits

Author SHA1 Message Date
疯狂的狮子Li
9a02598c00 !151 发布 vue 版本 5.2.3 与 cloud 版本 2.2.2
Merge pull request !151 from 疯狂的狮子Li/dev
2024-10-25 03:13:13 +00:00
疯狂的狮子Li
28a81f2e44 🎀发布 vue 版本 5.2.3 与 cloud 版本 2.2.2 2024-10-25 11:04:05 +08:00
疯狂的狮子Li
6f4891d677 update 优化 流程提交用户id使用字符串提交避免雪花id失真问题 2024-10-17 18:15:18 +08:00
疯狂的狮子Li
a62a3de23c fix 修复 pr!150 sse开关缺少变量问题 2024-10-15 13:49:32 +08:00
疯狂的狮子Li
1d852da351 !150 增加SEE开关
Merge pull request !150 from iqitao/ss
2024-10-15 05:47:39 +00:00
陈西瓜i
f0895e9419 add 增加注解 2024-10-14 20:50:20 +08:00
陈西瓜i
1644070e97 add SSE开关 2024-10-14 20:33:16 +08:00
疯狂的狮子Li
4918552492 fix 修复 请假日期选择格式不对问题 2024-10-12 10:58:32 +08:00
疯狂的狮子Li
364dfb969d update 优化代码 2024-10-07 10:45:25 +08:00
疯狂的狮子Li
9726df3966 fix 修复 登录日志excel导出名称错误 2024-09-18 09:42:24 +08:00
疯狂的狮子Li
483af13741 fix 修复 重新登录无法跳转到过期前页面问题 2024-09-06 18:06:16 +08:00
疯狂的狮子Li
25848ea99e fix 修复 重新登录无法跳转到过期前页面问题 2024-09-06 17:58:28 +08:00
疯狂的狮子Li
9f13c29cd7 update 优化 代码生成菜单id匹配写法 2024-09-04 16:16:46 +08:00
疯狂的狮子Li
e1860a30fc fix 修复 租户套餐导出路径编写错误
Signed-off-by: 疯狂的狮子Li <15040126243@163.com>
2024-08-26 12:29:29 +00:00
疯狂的狮子Li
34b929d352 add 增加 同步租户字典功能 2024-08-26 17:56:35 +08:00
疯狂的狮子Li
1606dbd76f !141 发布 vue 版本 5.2.2 与 cloud 版本 2.2.1
Merge pull request !141 from 疯狂的狮子Li/dev
2024-08-26 03:45:16 +00:00
疯狂的狮子Li
3c2d9100b5 😴发布 vue 版本 5.2.2 与 cloud 版本 2.2.1 2024-08-26 11:40:53 +08:00
疯狂的狮子Li
2c8873402f update 优化 使用匹配模式简化预编译配置 2024-08-16 13:01:54 +08:00
疯狂的狮子Li
e5727893bb update 优化 时间搜索组件统一 2024-08-15 20:42:29 +08:00
疯狂的狮子Li
335a1e6019 update 优化 oss 配置按钮 使用ossConfig权限标识符与oss权限分离 2024-08-08 18:19:58 +08:00
疯狂的狮子Li
c0ee3182e1 fix 修复 租户套餐导出路径错误问题 2024-08-08 18:19:18 +08:00
疯狂的狮子Li
9eb7b433b4 update 优化 类型报错问题 2024-08-02 13:53:48 +08:00
疯狂的狮子Li
9193f0b84a update 优化 切换租户后刷新首页 2024-08-02 09:59:14 +08:00
疯狂的狮子Li
076fc5deb1 update 优化 实现表格行选中切换 2024-08-02 09:55:51 +08:00
疯狂的狮子Li
58412035ad update 优化 使用 vueuse 重构 websocket 实现 2024-07-29 15:02:59 +08:00
疯狂的狮子Li
964db2dfce update 优化 使用 vueuse 重构 websocket 实现 2024-07-29 15:02:41 +08:00
疯狂的狮子Li
d58a75996e fix 修复 登出后重新登录 sse推送报错问题 2024-07-29 12:34:32 +08:00
疯狂的狮子Li
f5a5aaa255 reset 回滚 代码修改 采用其他方案 2024-07-29 12:32:05 +08:00
疯狂的狮子Li
1465a27a6e fix 修复 登出后重新登录 sse推送报错问题 2024-07-29 12:29:25 +08:00
疯狂的狮子Li
e5e43fe024 update 优化 删除无用代码 2024-07-27 22:10:22 +08:00
疯狂的狮子Li
6c49b47344 update element-plus 2.7.5 => 2.7.8
update vue 3.4.25 => 3.4.34
update vite 5.2.10 => 5.2.12
2024-07-27 15:08:13 +08:00
疯狂的狮子Li
358f11a0a3 reset 回滚 错误修复 2024-07-27 15:07:33 +08:00
疯狂的狮子Li
6a83ed2aad update 优化 代码生成器编辑页禁用缓存 防止同步后页面不更新问题 2024-07-27 14:15:19 +08:00
疯狂的狮子Li
e07c0b2b3a fix 修复 代码生成同步点击取消报错问题 2024-07-27 14:08:07 +08:00
疯狂的狮子Li
adadfcf8cb update 优化 调整默认推送使用SSE 2024-07-26 16:24:40 +08:00
疯狂的狮子Li
425386f6f4 add 增加 sse 推送功能 2024-07-26 16:06:17 +08:00
疯狂的狮子Li
ba24afce52 !131 ♥️发布 vue 版本 5.2.1 与 cloud 版本 2.2.0
Merge pull request !131 from 疯狂的狮子Li/dev
2024-07-09 03:02:34 +00:00
疯狂的狮子Li
93d3371768 ♥️发布 vue 版本 5.2.1 与 cloud 版本 2.2.0 2024-07-09 10:53:49 +08:00
疯狂的狮子Li
3f08ae6ac4 fix 修复 富文本编辑器 添加之后内容未清理问题 2024-07-02 16:51:03 +08:00
疯狂的狮子Li
cc6284d3ac fix 修复 字段命名错误 2024-07-01 12:52:19 +08:00
疯狂的狮子Li
142effd4f2 !130 feat: 动态创建组件实例时, 设置路由name为组件名 解决缓存问题
Merge pull request !130 from 玲娜贝er/dev
2024-06-30 08:13:16 +00:00
dap
e657a507e3 feat: 动态创建组件实例时, 设置路由name为组件名 解决缓存问题 2024-06-30 10:50:04 +08:00
疯狂的狮子Li
ebaec24213 update 优化 eslint 2024-06-28 10:44:13 +08:00
疯狂的狮子Li
7637582437 update 优化 eslint 2024-06-28 10:18:26 +08:00
疯狂的狮子Li
27d36f7970 !129 feat: 路由name重复检查
Merge pull request !129 from 玲娜贝er/dev
2024-06-26 04:02:28 +00:00
dap
762ebd4ede chore: 增加提示 2024-06-26 11:59:41 +08:00
dap
ad991e248a feat: 路由name重复检查 2024-06-26 11:34:40 +08:00
疯狂的狮子Li
d1b58f0aaa fix 修复 单词拼写错误 2024-06-24 14:59:46 +08:00
疯狂的狮子Li
1be1eaf7b4 !128 fix: 选人无法回显
Merge pull request !128 from 玲娜贝er/dev
2024-06-24 00:37:32 +00:00
dap
fbcc967b14 fix: 由于没有await 导致执行顺序不可控 2024-06-24 08:21:19 +08:00
疯狂的狮子Li
817c65f7e2 !126 fix: 进入审批页面会多次加载用户列表和部门等接口 进入点击取消之后也会重新加载接口
Merge pull request !126 from 玲娜贝er/dev
2024-06-21 04:31:25 +00:00
张代鹏
b6dcc62f9c refactor: 改为懒加载窗口 2024-06-21 12:07:19 +08:00
疯狂的狮子Li
abb4f543b9 !125 ♥️发布 vue 版本 5.2.0 与 cloud 版本 2.2.0
Merge pull request !125 from 疯狂的狮子Li/dev
2024-06-20 02:15:41 +00:00
疯狂的狮子Li
71f4d36c21 ♥️发布 vue 版本 5.2.0 与 cloud 版本 2.2.0 2024-06-20 10:15:08 +08:00
gssong
d1be442c6e fix 修复选着人员错误问题 2024-06-19 21:13:58 +08:00
疯狂的狮子Li
9ef7fd3844 !123 "types": ["element-plus/global"]层级错误,且element-plus按需引入不用配置tsconfig.json
Merge pull request !123 from zl/修复tsconfig.json
2024-06-19 06:41:11 +00:00
疯狂的狮子Li
fec61f9650 update 优化 clientid写死问题 2024-06-19 14:30:19 +08:00
疯狂的狮子Li
c206ab5b4a update 优化 三方登录不同域名问题 采用新方案 2024-06-19 14:29:44 +08:00
疯狂的狮子Li
fe1942c247 update 更换三方回调方案 2024-06-19 10:16:21 +08:00
疯狂的狮子Li
1f2add4b6b update 更换三方回调方案 2024-06-19 10:11:32 +08:00
疯狂的狮子Li
3b254cc16b update 增加 用户信息缓存增加租户id 2024-06-18 23:05:40 +08:00
疯狂的狮子Li
3e7c2f26fa update 增加 用户信息缓存增加租户id 2024-06-18 22:54:30 +08:00
疯狂的狮子Li
4143285ec6 fix 修复 缺少协议头问题 2024-06-18 19:08:51 +08:00
疯狂的狮子Li
72610ab194 update 优化 三方登录不同域名获取不到租户id问题 2024-06-18 18:44:27 +08:00
疯狂的狮子Li
3c713c9258 update element 2.7.2 => 2.7.5 2024-06-15 15:53:02 +08:00
gssong
f95f6e8390 update 优化审批按钮判断 2024-06-07 21:38:17 +08:00
疯狂的狮子Li
2c9c837c1b update 优化 请假天数计算不精确问题 2024-06-06 17:27:50 +08:00
zl
7904496df1 层级错误,且element-plus按需引入不用配置tsconfig.json
Signed-off-by: zl <11656279+xbbzjsj@user.noreply.gitee.com>
2024-06-06 08:53:59 +00:00
疯狂的狮子Li
15c3d84ca2 !122 修复单词拼写错误
Merge pull request !122 from LiYaoheng/dev
2024-06-06 06:27:36 +00:00
LiYaoheng
e8a641f3a3 fix 修复单词拼写错误 2024-06-06 14:19:55 +08:00
疯狂的狮子Li
e354db74a7 !121 ♥️发布 2.2.0-BETA 公测版本
Merge pull request !121 from 疯狂的狮子Li/dev
2024-06-06 03:00:23 +00:00
疯狂的狮子Li
61df97c4b9 update 优化 标识符错误 2024-06-06 10:59:20 +08:00
疯狂的狮子Li
75ecc4dd68 update 更改 关于mq说明 2024-06-04 15:00:40 +08:00
songgaoshuai
c467d95703 https://gitee.com/dromara/RuoYi-Cloud-Plus/issues/I9US1Q fix修复我的单据撤销,删除参数错误 2024-06-04 11:26:38 +08:00
gssong
3fead37924 add 添加流程记录版本信息 2024-06-03 21:33:12 +08:00
gssong
c8626b6893 remove 删除无用参数 2024-06-03 21:23:32 +08:00
gssong
38df345078 update 调整流程图预览校验 2024-06-03 21:04:42 +08:00
疯狂的狮子Li
212361dc94 update 优化 去除请假案例状态字段 2024-06-03 17:53:49 +08:00
疯狂的狮子Li
f237ee145a update 优化 去除请假案例状态字段 2024-06-03 15:47:51 +08:00
疯狂的狮子Li
291d4b0040 !120 update 调整注释错误
Merge pull request !120 from lu_ming/dev
2024-06-02 11:52:43 +00:00
can
64c56e9dd9 update 调整注释错误 2024-06-02 19:44:38 +08:00
gssong
57d87df589 update 调整驳回按钮加载 2024-06-02 00:21:47 +08:00
gssong
9de3f25f6a update 调整审批按钮加载 2024-06-01 22:05:45 +08:00
gssong
d98c2822d5 update 调整路由 2024-06-01 22:00:22 +08:00
gssong
58e6fdef78 update 优化流程实例接口全部按照业务id操作 2024-05-31 22:11:25 +08:00
疯狂的狮子Li
2c9daae153 update 更改 工作流 测试用例接口路径 2024-05-31 11:25:03 +08:00
疯狂的狮子Li
c2fdbc66b2 update 移除 表单构建菜单(没有可用组件 用处不大以后再考虑) 2024-05-29 18:36:46 +08:00
dap
57fd309907 fix: 类型报错 2024-05-29 09:32:49 +08:00
疯狂的狮子Li
7a335b3438 update 优化 删除未使用依赖 2024-05-21 10:01:25 +08:00
dap
83bbac303e fix: bpmn相关type第一次安装依赖&运行报错 2024-05-21 09:37:28 +08:00
疯狂的狮子Li
eb1b614eb1 fix 修复 部署路径错误 2024-05-20 11:45:08 +08:00
疯狂的狮子Li
a63543a5c7 !118 ♥️发布 5.2.0-BETA 公测版本
Merge pull request !118 from 疯狂的狮子Li/dev
2024-05-20 02:26:46 +00:00
疯狂的狮子Li
3585761b81 Merge branch 'ts' of gitee.com:JavaLionLi/plus-ui into dev
Signed-off-by: 疯狂的狮子Li <15040126243@163.com>
2024-05-20 02:26:24 +00:00
疯狂的狮子Li
34290d8cad ♥️发布 5.2.0-BETA 公测版本 2024-05-20 10:21:35 +08:00
LiuHao
f367b49dd6 update 优化代码格式 2024-05-19 17:31:05 +08:00
LiuHao
7df347c1d4 remove 移除commit check 2024-05-18 23:02:45 +08:00
gssong
ea106e44be add 添加工作流菜单图标 2024-05-18 12:40:37 +08:00
gssong
b2e47f3938 update 优化模型保存位置,审批记录,请假申请按钮 2024-05-17 20:59:47 +08:00
疯狂的狮子Li
b8e0f018f0 update 优化 更改 首页关于调度中心说明 2024-05-17 17:17:53 +08:00
疯狂的狮子Li
4ee46819c1 !117 修复登录失效,重新登录丢失参数问题
Merge pull request !117 from 爱宇阳/dev
2024-05-17 03:50:38 +00:00
deary
0c620ef5b4 修复登录失效,再次登录丢失参数 2024-05-17 11:44:33 +08:00
疯狂的狮子Li
9b00aaff93 update 优化 删除无用页面 2024-05-17 10:00:25 +08:00
疯狂的狮子Li
b829867a5b !115 feat: powerjob,easyretry => snailjob
Merge pull request !115 from dhb52/dev
2024-05-17 01:39:39 +00:00
dhb52
736225fbfe feat: powerjob,easyretry => snailjob 2024-05-17 01:04:13 +08:00
dap
3062c46b49 fix: 流程定义xml预览问题 & 重构代码 2024-05-16 08:18:54 +08:00
dap
ed66231d19 Merge branch 'dev' of https://gitee.com/JavaLionLi/plus-ui into dev 2024-05-15 11:35:02 +08:00
dap
3b8ecadc78 refactor: 流程定义-流程图片改为bpmn组件预览 2024-05-15 11:34:58 +08:00
疯狂的狮子Li
322e88d8e1 update 优化 调整字体大小 2024-05-11 20:00:53 +08:00
gssong
526ca728e1 update 修复模型选人参数异常,调整加签请求路径 2024-05-09 21:39:47 +08:00
疯狂的狮子Li
26c0cdaef6 update 重构 workflow 模块与 system 模块解耦 2024-05-09 15:10:15 +08:00
疯狂的狮子Li
e7dc8e94c7 update 优化 跟密码相关的默认前端关闭防重功能 2024-05-08 15:33:31 +08:00
疯狂的狮子Li
72ca7a1aae !111 解决点击菜单时页面空白或者重新刷新整个页面的问题
Merge pull request !111 from 周旭湘/dev
2024-05-07 09:47:18 +00:00
周旭湘
907dc4efb4 update src/layout/components/AppMain.vue.
解决点击左边菜单时页面空白或者刷新整个页面的问题

Signed-off-by: 周旭湘 <3423729430@qq.com>
2024-05-07 09:39:43 +00:00
gssong
935a199f71 update 优化审批记录 2024-05-06 22:19:42 +08:00
gssong
a19ac2d4ca update 调整会签人员参数 2024-05-06 20:59:41 +08:00
dap
437bc936fd refactor: 部门选择和岗位逻辑 2024-05-06 13:23:27 +08:00
dap
0b8f48fb61 fix: 更新时有岗位会被赋值为空的bug 2024-04-30 22:46:10 +08:00
dap
5d641e5de4 fix: 用户管理-部门变化后需要重新选择岗位 2024-04-30 22:09:53 +08:00
dap
0d196e47e2 fix: 重置时清空左边部门树选中值 2024-04-30 22:04:55 +08:00
疯狂的狮子Li
012e70c7e4 update element-plus 2.7.2 2024-04-30 17:33:09 +08:00
疯狂的狮子Li
9243eee3c3 remove 删除 husky(没人用) 2024-04-26 15:49:20 +08:00
疯狂的狮子Li
c449fb60a5 update vite 5.2.10
update vue 3.4.25
2024-04-25 13:48:28 +08:00
疯狂的狮子Li
4660aa6e95 !108 update src/components/ImagePreview/index.vue.
Merge pull request !108 from 落叶橘橙/N/A
2024-04-25 02:16:33 +00:00
落叶橘橙
9968d14c39 update src/components/ImagePreview/index.vue.
图片预览功能 let real_src_list = props.src.split(',');会多出一个''对象,会导致图片浏览时多一个空白预览。增加一个判空。

Signed-off-by: 落叶橘橙 <wzsdch@qq.com>
2024-04-25 02:15:20 +00:00
疯狂的狮子Li
e2254651ca fix 修复 !pr107 遗留问题
update 优化 岗位下拉框样式问题
2024-04-24 23:46:05 +08:00
AprilWind
7ed5f33e7b !107 add 新增岗位编码与部门编码 并将岗位放到部门下
* add 新增获取岗位选择框列表
* update 岗位查询树表和单表相互undefined
* update 岗位查询增加单部门查询
* update 优化类别编码与后台一致性
* add 新增岗位部门树以及类别编码
* add 部门增加类别代码
2024-04-24 14:30:52 +00:00
LiuHao
175c4a48ce update 优化代码缩进 2024-04-23 13:14:02 +08:00
追梦稻草人Li
9bcc4d631b !106 [轻量级pr] add 新增用户选择角色时 可搜索功能
* update src/views/system/user/index.vue.
* add 新增角色可搜索
2024-04-23 01:50:07 +00:00
疯狂的狮子Li
861dc9fb16 update 优化 替换过期属性 2024-04-23 09:47:11 +08:00
gssong
8633a23d28 fix 修改设计器到期时间没有值问题 2024-04-21 16:58:01 +08:00
gssong
d67bd493c1 Merge branch 'dev' of https://gitee.com/JavaLionLi/plus-ui into dev 2024-04-21 16:50:01 +08:00
gssong
2d532d636a update 调整设计器选人 2024-04-21 16:49:47 +08:00
疯狂的狮子Li
e2bdae5bf2 update element-plus 升级 2.7.1 并适配代码 2024-04-20 19:13:35 +08:00
gssong
2df121072b fix 修改默认没有候选人与候选组时点击选择出现tag标签选中全部问题 2024-04-19 22:13:26 +08:00
gssong
7016888d5a remove 删除无用代码 2024-04-19 21:59:43 +08:00
gssong
3c34421bd2 update 删除认领可直接办理,格式化代码 2024-04-19 21:58:05 +08:00
疯狂的狮子Li
187ae83731 !105 update 当el-form的inline属性为true时,统一样式写法
Merge pull request !105 from Bleachtred/dev
2024-04-19 09:13:44 +00:00
疯狂的狮子Li
c4c9905a91 update 调整 select 宽度 2024-04-19 17:13:15 +08:00
bleachtred
219f3a7d6f update 设置el-select 的宽度默认为 240px 2024-04-19 16:52:40 +08:00
bleachtred
44837e975c update 当el-form的inline属性为true时,统一样式写法 2024-04-19 15:26:56 +08:00
AprilWind
8c6cf5bc43 !104 add 新增在线登录设备管理
* update 在线登录设备管理删除权限
* add 新增在线登录设备管理
2024-04-19 05:02:14 +00:00
疯狂的狮子Li
c21f0d7d77 update vue-router 升级 4.3.2 2024-04-18 18:16:53 +08:00
疯狂的狮子Li
8b6b624f6c fix 修复 全局替换样式重复问题 2024-04-18 17:10:44 +08:00
疯狂的狮子Li
03c736af82 fix 修复 全局替换样式重复问题 2024-04-18 17:06:30 +08:00
疯狂的狮子Li
7386e69033 fix 修复 全局样式导致组件全覆盖问题 依旧采用单组件声明 2024-04-18 14:02:43 +08:00
疯狂的狮子Li
2f60c96fbf fix 修复 全局样式导致组件全覆盖问题 依旧采用单组件声明 2024-04-18 14:01:58 +08:00
疯狂的狮子Li
45e1c46ce4 !103 update 更新一些内容
Merge pull request !103 from Bleachtred/dev
2024-04-18 05:45:12 +00:00
bleachtred
d7d3105c5c update 设置input固定宽度后,导致菜单图标组件IconSelect显示异常 2024-04-18 12:59:03 +08:00
bleachtred
4aa42f5c20 fix 角色必填*号 2024-04-18 11:29:57 +08:00
疯狂的狮子Li
c089f2497c update 升级前端依赖(定稿) 2024-04-18 10:45:21 +08:00
疯狂的狮子Li
e18dcbd86b !102 [BUG]修复用户表单,角色为必填,却未标注*号
Merge pull request !102 from dzk/fix-userform
2024-04-18 02:13:25 +00:00
dzk
a541d61c0c 修复用户表单角色为非必填项的BUG 2024-04-17 23:49:07 +08:00
疯狂的狮子Li
4b19f55bce update 优化 el-select 与 el-input 全局样式 2024-04-17 19:40:34 +08:00
疯狂的狮子Li
b5042d13d2 !101 fix: 临时修复elementui新版本下拉框宽度问题
Merge pull request !101 from NicholasLD/N/A
2024-04-17 11:34:09 +00:00
NicholasLD
b444f2b8e2 fix: 临时修复elementui新版本下拉框宽度问题
Signed-off-by: NicholasLD <nicholasld505@gmail.com>
2024-04-17 11:24:58 +00:00
疯狂的狮子Li
6b982984ac fix 修复 el-select 展示不全问题 2024-04-17 19:01:49 +08:00
LiuHao
30f271359a fix 修复字典el-tag警告 2024-04-16 17:56:36 +08:00
LiuHao
9967a72e24 fix 修复el-tag标签类型不一致问题 2024-04-16 17:52:04 +08:00
LiuHao
efeff40f2e update 白屏问题待检测 2024-04-16 17:42:54 +08:00
LiuHao
2e299b58e2 update 增加预编译 2024-04-16 17:41:30 +08:00
LiuHao
1d7c3da86b update 回滚解决路由失效问题 2024-04-16 17:41:21 +08:00
LiuHao
5057976ad2 update 优化缩进 2024-04-16 16:05:43 +08:00
LiuHao
41f3d37db1 update 优化首页打开topNav不展开菜单问题 2024-04-15 14:00:39 +08:00
LiuHao
1fbc5afe75 update 优化暗黑模式,增加vxe的暗黑模式 2024-04-15 13:33:11 +08:00
LiuHao
b0541be0b8 fix 修复菜单搜索下方出现白色区域 2024-04-15 13:04:15 +08:00
LiuHao
d6803783ae update 固定值 也可输入表达式 2024-04-15 12:52:04 +08:00
LiuHao
945eec5418 update 优化bpmn位置 2024-04-15 12:02:40 +08:00
LiuHao
73db6deec3 fix 修复类型缺失 2024-04-15 10:40:47 +08:00
LiuHao
40a75dae31 fix 修复代码缩进. 2024-04-15 10:40:33 +08:00
LiuHao
64fb2899c9 fix 修复代码缩进,类型名称错误 2024-04-15 10:22:44 +08:00
LiuHao
9da3f1f2d7 update 增加类型 2024-04-15 09:42:46 +08:00
疯狂的狮子Li
70120a8f2f !97 解决页面偶尔出现的白屏问题
Merge pull request !97 from 吴均/dev
2024-04-09 03:27:51 +00:00
wujun
6b4d756a9d 解决页面偶尔出现的白屏问题 2024-04-09 11:19:04 +08:00
gssong
905426ad45 update 修改流程定义删除 2024-04-08 22:43:37 +08:00
gssong
b4b0eba228 update 调整流程定义配置逻辑 2024-04-06 21:06:59 +08:00
gssong
9f73ea2d32 update 优化表单绑定逻辑,移除流程定义配置表单,添加模型复制 2024-04-06 11:21:17 +08:00
LiuHao
2d804c7ce0 Merge remote-tracking branch 'origin/dev' into dev 2024-04-05 14:16:38 +08:00
LiuHao
11e8e9d19a fix 修复代码缩进 2024-04-05 14:16:29 +08:00
dap
3e44c14286 Merge branch 'dev' of https://gitee.com/JavaLionLi/plus-ui into dev 2024-04-05 14:09:53 +08:00
dap
04f1347ddd update: bpmn设计器夜间模式适配 2024-04-05 14:09:50 +08:00
LiuHao
0442bd638d fix 修复代码缩进 2024-04-05 14:08:02 +08:00
dap
aeac77b90f chore: 拖动元素时的背景图 2024-04-04 20:41:58 +08:00
dap
b117a6f198 update: 流程预览 进行中动画效果 2024-04-04 14:19:49 +08:00
dap
e1b03258e8 fix: 租户选择框宽度和升级前保持一致 2024-04-04 13:55:45 +08:00
疯狂的狮子Li
c71eb21416 update 更新成员项目 2024-04-03 23:12:46 +08:00
gssong
c922ea3b9c add 添加委托 2024-04-03 20:42:05 +08:00
gssong
d76f2b857d add 添加流程版本 2024-04-02 20:53:29 +08:00
gssong
eec050a2dd update 调整监听新增label错误 2024-04-01 21:23:31 +08:00
gssong
b0087d1a50 #I96DTG update 类型下拉框和java类名下拉框没有联动 2024-04-01 20:59:52 +08:00
gssong
4752b4eb01 update 调整流程状态 2024-03-31 19:30:31 +08:00
gssong
2ea1807f34 add 添加表单配置 2024-03-31 15:34:54 +08:00
疯狂的狮子Li
5dfc25a493 !95 add 工作流挂节点路由表单
Merge pull request !95 from ken.wang/dev
2024-03-29 13:15:10 +00:00
wangzk
c5b3c121c9 add 工作流挂节点路由表单 2024-03-29 17:26:56 +08:00
疯狂的狮子Li
c417c6debe update 升级 element vite 版本 最低nodejs版本提升到18.18.0 2024-03-26 18:43:45 +08:00
LiuHao
f6727d80b8 update 升级依赖 2024-03-26 18:20:13 +08:00
gssong
ceb6243cd0 update 调整示例key 2024-03-24 15:16:44 +08:00
gssong
cd129aa949 update 路由跳转 2024-03-24 15:13:05 +08:00
gssong
d186c800f0 add 添加流程实例,全部待办表单查看 2024-03-22 23:42:30 +08:00
songgaoshuai
31f4219f3d fix修复已办参数传错 2024-03-22 11:32:58 +08:00
gssong
ad8565d29a update 调整我的发起,流程定义按钮 2024-03-21 21:49:34 +08:00
gssong
66a31b620b add 添加已办查看 2024-03-21 21:20:42 +08:00
gssong
e26f6423aa add 添加抄送查看 2024-03-21 21:19:02 +08:00
gssong
12461f4106 update 固定顶部按钮 2024-03-21 21:14:01 +08:00
gssong
58422616e2 remove 还原代码 2024-03-21 21:06:58 +08:00
gssong
f6abd4cf59 update 调整状态判断 2024-03-21 21:06:18 +08:00
gssong
f50ed6b2c5 add 添加流程表单配置 2024-03-21 21:02:41 +08:00
LiuHao
3dba22c47c fix 修复移动端下 无法展开菜单问题 2024-03-19 17:41:47 +08:00
LiuHao
e1289d0abb fix 修复面板因为min width原因收缩不全 2024-03-19 16:14:38 +08:00
LiuHao
9ea8b710ff update 预览流程图高度自适应 2024-03-19 16:02:42 +08:00
LiuHao
e889348562 update 面板宽度百分比 2024-03-18 14:27:43 +08:00
LiuHao
02daeead57 update 隐藏不用工具栏 2024-03-18 14:21:35 +08:00
LiuHao
4253b2afbb update 增加子流程多实例 2024-03-18 14:19:30 +08:00
LiuHao
0c39b593ce update 优化面板类型 2024-03-18 14:18:30 +08:00
LiuHao
8761392c85 update 优化任务面板 2024-03-18 14:18:04 +08:00
LiuHao
30cf3a2caa update 增加多实例常量 2024-03-18 14:17:48 +08:00
LiuHao
12458177be update 更新开始面板和泳道面板样式 2024-03-18 13:56:16 +08:00
LiuHao
b6415c21be update 新增子流程面板 2024-03-18 13:55:57 +08:00
LiuHao
bc4358f4eb update 流程部署支持多选 2024-03-18 12:19:52 +08:00
LiuHao
5dcfee4c07 update 流程部署支持多选 2024-03-18 11:52:44 +08:00
LiuHao
a9cd5684b2 update 新增预编译和翻译 2024-03-18 10:56:12 +08:00
LiuHao
1c0e614d7d update 新增池/参与者面板 2024-03-18 10:44:21 +08:00
gssong
00a7a8ce23 add 添加流程自由驳回节点 2024-03-17 18:26:22 +08:00
gssong
ade0b3e29e update 调整模型导出按钮位置 2024-03-16 22:02:45 +08:00
gssong
3a3f873834 update 调整模型zip导出 2024-03-16 22:01:35 +08:00
gssong
1edc953765 fix 修改已完成任务查看流程变量错误 2024-03-16 19:35:13 +08:00
疯狂的狮子Li
1383f5a7eb !93 fix: if(captchaEnabled) => if(captchaEnabled.value)
Merge pull request !93 from dhb52/N/A
2024-03-15 01:36:21 +00:00
dhb52
e4f18452c7 fix: if(captchaEnabled) => if(captchaEnabled.value)
Signed-off-by: dhb52 <dhb52@126.com>
2024-03-14 16:42:00 +00:00
疯狂的狮子Li
fdf64a6f08 !90 feat: EasyRetry Server 扩展模块
Merge pull request !90 from dhb52/dev
2024-03-14 06:46:34 +00:00
疯狂的狮子Li
f46a333778 !89 【轻量级 PR】:update 调整导入模型选择流程类别方式(改为表单内下拉框)
Merge pull request !89 from 愿丶/N/A
2024-03-13 13:29:31 +00:00
dhb52
eb364873d2 EasyRetry Server 扩展模块 2024-03-13 01:18:49 +08:00
愿丶
7666f724df update 调整导入模型选择流程类别方式(改为表单内下拉框)
Signed-off-by: 愿丶 <1319542051@qq.com>
2024-03-12 15:48:42 +00:00
gssong
f9b8922bed update 调整全部已办开始时间 2024-03-11 21:14:22 +08:00
gssong
fb94a4d79c update 调整已办列表,添加审批记录加载 2024-03-11 21:03:00 +08:00
疯狂的狮子Li
71047fdbfd update copyright 2024 2024-03-11 10:58:51 +08:00
疯狂的狮子Li
2cb9b3ea47 update 优化 事件标签改为中文 2024-03-11 10:45:08 +08:00
gssong
3c27c18889 add 添加查看流程变量 2024-03-09 13:41:20 +08:00
gssong
9defb9a669 remove 删除无用组件 调整修改办理人,已完成单据可查看审批记录等 2024-03-09 11:22:28 +08:00
gssong
8833eb205b add 添加终止任务 2024-03-09 11:10:19 +08:00
gssong
15129079d4 remove 删除无用代码 2024-03-08 22:49:47 +08:00
LiuHao
d1c199d4bf update 优化流程预览 2024-03-08 18:22:28 +08:00
LiuHao
97b4eef342 update 使用bpmnjs流程预览 2024-03-08 16:02:08 +08:00
LiuHao
1dd9983f0f update 流程图和审批信息分开展示 2024-03-08 15:59:27 +08:00
LiuHao
b8eb2dcb40 update 增加默认导出 2024-03-08 15:00:01 +08:00
LiuHao
3b4f171d9f update 优化类型 2024-03-08 14:56:44 +08:00
LiuHao
de33d4aaee update 保存增加loading、增加预编译 2024-03-08 14:16:27 +08:00
gssong
803d44cac0 add 添加转办 2024-03-07 22:16:42 +08:00
gssong
cc293536e2 add 添加审批加签 减签 2024-03-07 21:54:47 +08:00
gssong
5f6057253f remove 删除无用打印 2024-03-07 21:19:04 +08:00
gssong
d50c90afd1 fix 修复设计器无法选人问题,修复抄送打开弹出选中全部人员问题 2024-03-07 21:18:08 +08:00
songgaoshuai
6f9851a4e5 fix 修复无法编辑设计器问题 功能未完成先注释掉 2024-03-07 16:16:28 +08:00
疯狂的狮子Li
e7ff829502 update 优化 工作流代码与接口命名 2024-03-07 14:23:24 +08:00
疯狂的狮子Li
0108df1334 !88 合并flowable工作流功能
* merge 合并dev
* add 添加抄送查询
* add 添加我的已办
* add 添加抄送
* add 添加附件下载
* update 优化类型
* Merge remote-tracking branch 'origin/future/flowable' into future/flowable
* fix 修复 流程设计器打包部署报错问题
* add 添加审批附件上传
* update 修复固定值未在xml显示问题
* update 修复跳转条件回显Object问题
* update 优化面板文件名称
* update 调整key
* remove 移除旧设计器,添加xml保存
* update 增加任务面板提示
* update 优化xml预览和svg预览
* update 优化xml预览和svg预览
* update 优化模型设计
* update 优化设计器
* update 优化设计器
* update 优化设计器
* update 删除旧设计器
* update 删除console.log
* add 添加模型接口
* update 优化预览xml和svg样式被修改问题
* update 优化属性面板,增加展开动画
* update 去除开发模式
* update 优化任务栏样式
* update 优化图标渲染样式
* update 增加BpmnFactory类型
* update 增加BpmnFactory
* update 移除users和group
* update 移除无用类型
* update 优化页面类型
* update 去除多余属性
* update 完善流程线
* update 增加复杂网关
* update 完善流程
* update 完善网关
* update 优化网关汉化
* update 优化过期时间选择
* update 支持多实例
* update 增加类容提示
* update 支持选择组
* update 新增角色api
* update 优化roleSelect 选中未确定,再次打开还保留选中的问题
* update 优化userSelect 选中未确定,再次打开还保留选中的问题
* update 优化userSelect 选中未确定,再次打开还保留选中的问题
* update 去掉modeler store多余属性 bpmnModel
* update 优化属性面板,当面板未选中时默认展示流程面板
* update 优化TaskPanel类型,去掉roles属性
* update 优化用户api
* update 优化用户选择器
* update 优化执行监听器
* update 优化任务监听器
* update 优化usePanel方法
* update 选人优化
* update 增加扩展节点信息
* update 增加usePanel默认方法
* update 去除处理事件
* update 扩展flowable  userinfo属性
* update 全局modeler 改为非响应式
* update 增加hooks方法
* update 修改命名
* update 修改面板formData来源
* update 重写用户任务面板选择逻辑
* update 重写用户任务面板选择逻辑
* update 修改用户选择组件获取数据逻辑
* update 修改枚举类型
* update 修改默认配置列
* update 增加修改节点方法
* update 调整预览窗口大小
* update 优化用户选择组件 返回值
* update 优化用户选择组件
* update 新增通过ids 获取用户信息
* update 重写task面板选人 未完成
* update 升级用户选择 支持多选配置
* update 升级bpmnjs依赖版本
* update 增加useDialog类型
* update 调整全局样式
* update 代码高亮设置
* update 优化领用,归还加载
* update 增加选择角色
* update  新增角色选择组件
* update 新增过期时间选择组件
* update 调整任务面板样式
* update  调整全局dialog header 增加分割线
* update 代码高亮设置
* update  调整面板位置
* update 封装用户选择组件
* update 移除所有的节点描述
* update 删除分类
* update  调整面板位置
* update  修改命名,增加自定义渲染
* update  修改命名,增加自定义渲染
* update 增加 Element类型定义
* update 调整样式
* update 移除bpmn panel依赖,升级bpmn.js依赖到最新,修改汉化包
* update 调整类型声明文件
* update 调整类型声明文件
* update 优化面板工具
* update 优化面板工具
* Merge remote-tracking branch 'origin/future/flowable' into future/flowable
* update 优化面板工具
* Merge branch 'future/flowable' of https://gitee.com/JavaLionLi/plus-ui…
* add 添加修改办理人
* update 优化面板工具
* update 初始化流程数据
* Merge remote-tracking branch 'origin/future/flowable' into future/flowable
* add 流程设计面板
* update 调整初始化xml
* add 任务面板
* add 新增bpmn.js
* update 优化request请求类判断请求头方式
* update 流程定义预览 优化
* update 流程定义预览 优化
* update 去掉console.log
* update 优化工作流代码
* fix 修复待办任务 重置查询条件失效问题
* add 增加待办任务 接口类型,优化页面
* add 增加vite 启动预编译css
* fix 修复i18n无感刷新问题
* Merge branch 'dev' into future/flowable
* update 调整选择请假事件
* Merge branch 'dev' into future/flowable
* 同步dev代码
* Merge branch 'dev' into future/flowable
* 合并dev
* remove 设计器无用代码 调整请假查询
* update 调整请假申请
* update 移动请假表单包结构,调整设计器选择引用表单请求错误
* remove 移除动态表单
* update 调整流程办理
* Merge branch 'dev' into future/flowable
* Merge branch 'dev' into future/flowable
* Merge branch 'dev' into future/flowable
* Merge branch 'dev' into future/flowable
* 合并
* update 调整请假申请流程提交
* update 修改业务单据流程提交
* update 调整业务单据流程提交
* 优化代码
* 优化工作流代码缩进
* 项目格式化配置修改
* 调整代码缩进
* Merge branch 'ts' into future/flowable
* add 添加动态表单提交流程
* add 添加动态表单单据
* add 新增流程定义与表单关联
* update 调整点击左侧部门查询人员,部门刷新问题
* update 调整按钮图标
* 调整错别字
* update 调整流程定义图片预览
* add 添加流程实例迁移版本
* fix 修复我的单据无法提交问题
* Merge branch 'ts' into future/flowable
* remove 还原代码后端解决
* update 流程设计器中分配发起人变量错误,先移除
* fix 修复设计器无法编辑问题
* update 调整设计器请求头
* Merge branch 'ts' into future/flowable
* Merge branch 'ts' into future/flowable
* add 添加流程定义历史列表
* update 审批记录v2改为v3
* update 调整请假必填项
* add 添加请假申请示例,添加流程定义文件部署
* update 移除流程表单 formConfig 属性,表单配置信息都放一起便于使用。
* add 添加任务加签,减签
* update 调整流程作废
* update 优化流程状态
* add 添加任务驳回
* add 添加查询当前租户所有待办,已办任务
* add 增加审批意见
* add 添加流程办理弹窗确认组件
* add 添加任务作废理由
* update 调整流程实例,流程定义检索
* add 添加我的单据页面
* add 添加任务归还认领
* add 添加流程实例,流程定义分类查询
* add 添加模型分类查询
* add 添加流程分类
* Merge remote-tracking branch 'origin/future/flowable' into future/flowable
* add 添加流程表单管理页面
* add 集成vForm动态表单组件
* update xml调整超出滚动
* add 添加已办列表
* add 添加单据状态
* update 优化流程实例删除
* fix 修复流程实例查询挂起状态错误
* update 调整流程实例挂起激活状态
* add 添加流程实例列表
* update 调整流程定义弹窗提示
* add 添加流程定义列表,添加流程图,xml预览,添加简单流程启动,办理
* 调整审批记录悬浮逻辑
* 删除无用代码
* add 添加节点悬浮信息
* 调整流程预览
* 调整流程追踪
* add 添加审批记录
* add 模型设计的types
* update 修改排版
* add lang=ts
* update 修改ele的废弃api
* fix调整审批记录图片不显示问题
* add 添加任务待办,流程图
* 调整设计器关闭
* add 添加待办
* remove 删除无用代码
* update types
* 添加模型token验证
* 隐藏设计器验证按钮,隐藏表单,案例,应用程序等
* 添加模型部署
* 添加画图接口token,优化画图接口
* 添加工作流模型新增,修改,查询,删除,画图工具
2024-03-05 14:57:51 +00:00
疯狂的狮子Li
542f73f0e6 update 优化 支持全局开启或关闭接口加密功能 2024-03-04 14:18:21 +08:00
疯狂的狮子Li
5cb40abe18 update 优化 密码校验策略增加非法字符限制 2024-03-04 10:05:47 +08:00
疯狂的狮子Li
26cfa7afc4 !84 图片上传组件增加压缩支持
Merge pull request !84 from 缝合怪/dev
2024-02-23 07:24:31 +00:00
疯狂的狮子Li
df1a84d5ae !86 bugfix: 修复文件预览大写后缀预览时效的问题
Merge pull request !86 from 北桥/dev
2024-02-23 07:23:49 +00:00
这夏天依然平凡
5b991be4c2 !87 修改 el-dialog 默认点击遮照为不关闭
* update 修改 el-dialog 默认点击遮照为不关闭
2024-02-23 07:23:20 +00:00
北桥
34c0d2d277 bugfix: 修复文件预览大写后缀不展示的问题 2024-02-02 13:43:16 +08:00
LiuHao
b2f00c4b71 add 增加全局角色选择组件 2024-01-26 09:59:32 +08:00
LiuHao
63ba90cc10 add 增加全局用户选择组件 2024-01-26 09:59:23 +08:00
LiuHao
3b18a476b7 add hooks - useDialog 2024-01-26 09:59:05 +08:00
LiuHao
15243ab713 Merge remote-tracking branch 'origin/dev' into dev 2024-01-26 09:58:09 +08:00
LiuHao
b4cc7b3de0 add 引入vxe-table依赖支持 2024-01-26 09:58:00 +08:00
fengheguai
fe3874396d 图片上传组件增加压缩功能支持,可自行开关 2024-01-25 12:50:45 +08:00
疯狂的狮子Li
fdf885c261 !82 修复 DictTag组件,当未找到匹配的数据时,不会显示value
Merge pull request !82 from lee/bugfix/DictTag_Unmatch
2024-01-18 09:39:29 +00:00
LiuHao
7b7377fa1b update 优化request请求类判断请求头方式 2024-01-16 09:51:51 +08:00
文兵 李
0c56f87e06 foreach中return并不会使其跳出循环,导致这个计算属性一直都会是false 2024-01-15 22:59:22 +08:00
疯狂的狮子Li
b783b8d991 update 全依赖版本升级 2024-01-14 22:30:00 +08:00
LiuHao
4ea7376dbc fix 修复i18n无感刷新问题 2024-01-11 15:26:37 +08:00
LiuHao
5910032908 Merge remote-tracking branch 'origin/dev' into dev 2024-01-11 14:27:58 +08:00
LiuHao
024783588e update 升级@intlify/unplugin-vue-i18n版本依赖
update i18n使用方法。
add 新增i18n vite插件。
2024-01-11 14:27:46 +08:00
疯狂的狮子Li
acba493c94 !80 JustAuth 整合 TopIam 单点登录
Merge pull request !80 from 马铃薯头/dev
2024-01-08 16:05:47 +00:00
xlsea
7073acb3ef 社交登录整合 TopIam 2024-01-08 11:48:56 +08:00
疯狂的狮子Li
075c02b8c3 update 优化 使用翻译注解简化用户查询 调整用户查询逻辑 2024-01-06 20:58:54 +08:00
ahao
31da01bdd1 fix https://gitee.com/dromara/RuoYi-Vue-Plus/issues/I8TMAI 2024-01-06 17:27:01 +08:00
疯狂的狮子Li
dfdcee9b95 !79 update 富文本组件,修复两个组件上传图片位置错乱问题
Merge pull request !79 from 抓蛙师/N/A
2024-01-05 14:51:03 +00:00
抓蛙师
d3b630076a update 富文本组件,修复两个组件上传图片位置错乱问题
Signed-off-by: 抓蛙师 <770492966@qq.com>
2024-01-05 14:50:27 +00:00
疯狂的狮子Li
173c723c7c fix 修复 富文本编辑器 单页面多实例图片胡乱问题 2024-01-05 18:39:32 +08:00
ahao
595a521a3c update issues -> https://gitee.com/dromara/RuoYi-Vue-Plus/issues/I8LXAX 2024-01-05 17:15:45 +08:00
ahao
d08f14d86d update 修改对Volar支持 2024-01-05 14:37:22 +08:00
ahao
b112b793d5 fix 修复eslint 警告 2024-01-05 14:14:32 +08:00
ahao
6432d165c7 update 修复启动弹出cjs废弃警告 2024-01-05 12:06:10 +08:00
ahao
e5772cb63c update 移除cjs 2024-01-05 11:42:55 +08:00
ahao
bb696b300f update 升级依赖 2024-01-05 11:42:36 +08:00
疯狂的狮子Li
14f6a214f2 !75 fix: 修复vscode全局属性ts爆红问题
Merge pull request !75 from dhb52/N/A
2024-01-03 03:41:05 +00:00
dhb52
bbcedd02ba fix: 修复vscode全局属性ts爆红问题
参照vuejs官方文档,[扩展全局属性](https://cn.vuejs.org/guide/typescript/options-api.html#augmenting-global-properties),

```ts
declare module 'vue' {
  interface ComponentCustomProperties {
    $http: typeof axios
    $translate: (key: string) => string
  }
}
```

Signed-off-by: dhb52 <dhb52@126.com>
2024-01-03 03:40:39 +00:00
ahao
abf2777b2e fix 修复 页面警告 2023-12-27 14:28:04 +08:00
ahao
3922c16601 fix 修复 vue 类型识别问题 2023-12-27 12:12:51 +08:00
ahaos
321f21c498 !73 修复全局属性找不到的问题
* Merge remote-tracking branch 'origin/dev' into dev
* fix 修复全局属性找不到的问题
* fix 修复变量问题
* fix 修复变量问题
* Merge remote-tracking branch 'origin/dev' into dev
* update 依赖升级
* update 依赖升级
* Merge remote-tracking branch 'origin/dev' into dev
* 升级依赖
* Merge remote-tracking branch 'origin/ts' into ts
* 升级依赖
* Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts
* 升级依赖
* !61 fix: 删除重复环境变量ElUploadInstance
* fix: 删除重复环境变量ElUploadInstance
2023-12-26 10:04:35 +00:00
疯狂的狮子Li
085ce4cf43 update 优化 更改客户端状态接口 使用clientId传参 2023-12-26 00:47:59 +08:00
疯狂的狮子Li
c5daf629d9 update 优化 通知公告提交提示 2023-12-23 23:13:34 +08:00
疯狂的狮子Li
20b7819f11 update 优化 ts检查改为非严格 提高友好型降低开发难度 2023-12-23 20:43:58 +08:00
疯狂的狮子Li
8b36cac09d update 升级前端依赖版本 2023-12-23 20:35:55 +08:00
疯狂的狮子Li
0e99163f0c update 升级前端依赖版本 2023-12-23 20:30:28 +08:00
疯狂的狮子Li
772885de35 update 优化 websocket 代码实现 2023-12-23 19:49:17 +08:00
疯狂的狮子Li
1d557a24f9 update 优化 ws开关改为常开(vite5修复了崩溃bug) 2023-12-23 19:45:47 +08:00
疯狂的狮子Li
597f2b4461 fix 修复 websocket 非index页面刷新无法重连问题 2023-12-23 19:38:34 +08:00
疯狂的狮子Li
cc9b67d467 !72 发布 vue 版本 5.1.2 与 cloud 版本 2.1.2
Merge pull request !72 from 疯狂的狮子Li/temp
2023-12-22 05:26:26 +00:00
疯狂的狮子Li
70a3348954 🧨发布 vue 版本 5.1.2 与 cloud 版本 2.1.2 2023-12-22 13:21:04 +08:00
疯狂的狮子Li
2c95f86963 🧨发布 vue 版本 5.1.2 与 cloud 版本 2.1.2 2023-12-22 13:20:44 +08:00
疯狂的狮子Li
1272e8fe7d fix 修复 append-to-body 编写错误 2023-12-20 14:44:50 +08:00
疯狂的狮子Li
3204aa8461 !71 update src/views/system/dept/index.vue.
Merge pull request !71 from Ai3_刘小龙/N/A
2023-12-20 06:28:20 +00:00
Ai3_刘小龙
5d44f9e231 update src/views/system/dept/index.vue.
append-to-body

Signed-off-by: Ai3_刘小龙 <wisty0317@163.com>
2023-12-20 06:26:49 +00:00
ahaos
1d5133b695 !69 修复升级依赖带来的类型问题
* fix 修复变量问题
* Merge remote-tracking branch 'origin/dev' into dev
* update 依赖升级
* update 依赖升级
* Merge remote-tracking branch 'origin/dev' into dev
* 升级依赖
* Merge remote-tracking branch 'origin/ts' into ts
* 升级依赖
* Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts
* 升级依赖
* !61 fix: 删除重复环境变量ElUploadInstance
* fix: 删除重复环境变量ElUploadInstance
2023-12-14 08:17:12 +00:00
疯狂的狮子Li
031d83828a update 代码规范化 2023-12-14 00:44:12 +08:00
疯狂的狮子Li
0541af5abb fix 修复 部分问题 2023-12-14 00:35:00 +08:00
疯狂的狮子Li
1f71044cff fix 修复 部分问题 2023-12-14 00:25:54 +08:00
ahaos
f32a7105c3 !68 修复升级依赖带来的问题
* Merge remote-tracking branch 'origin/dev' into dev
* 升级依赖
* Merge remote-tracking branch 'origin/ts' into ts
* 升级依赖
* Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts
* 升级依赖
* !61 fix: 删除重复环境变量ElUploadInstance
* fix: 删除重复环境变量ElUploadInstance
2023-12-13 10:35:55 +00:00
ahaos
b06f6a316b !64 版本升级
* Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts
* 升级依赖
* !61 fix: 删除重复环境变量ElUploadInstance
* fix: 删除重复环境变量ElUploadInstance
2023-12-13 01:01:52 +00:00
NickLuo
58d7e50de3 !63 关闭动态路由tab页签时不清理组件缓存
* 动态路由页面关闭时不清理组件缓存,避免清理已打开的多个路由页面缓存
2023-12-13 00:55:46 +00:00
疯狂的狮子Li
c045276a7c update 优化 明确打包命令 2023-12-08 18:04:02 +08:00
棉花
6a7ec81168 fix: 删除重复环境变量ElUploadInstance
Signed-off-by: 棉花 <12559203+radish-hi_0@user.noreply.gitee.com>
2023-12-08 17:55:11 +08:00
疯狂的狮子Li
183e0e9212 !61 fix: 删除重复环境变量ElUploadInstance
Merge pull request !61 from 棉花/N/A
2023-12-08 09:53:55 +00:00
疯狂的狮子Li
c020c1affc update 优化 用户头像 img 变量无确定类型问题 2023-12-08 17:01:19 +08:00
疯狂的狮子Li
9673380f60 update 优化 细化oss配置管理权限控制 2023-12-07 14:52:33 +08:00
疯狂的狮子Li
9b28d14bc3 fix 修复 在线用户 强推按钮点击取消控制台警告问题 2023-12-06 00:18:31 +08:00
棉花
01a4dd0b45 fix: 删除重复环境变量ElUploadInstance
Signed-off-by: 棉花 <12559203+radish-hi_0@user.noreply.gitee.com>
2023-12-05 12:57:44 +00:00
疯狂的狮子Li
e1023bb331 update 优化 代码中存在的警告 2023-11-30 11:13:29 +08:00
疯狂的狮子Li
5c701801db update 优化 前端白名单页面放行逻辑 2023-11-29 16:02:37 +08:00
疯狂的狮子Li
9b4692b625 !59 响应加密功能
Merge pull request !59 from MichelleChung/dev
2023-11-27 02:59:00 +00:00
疯狂的狮子Li
aaec0f7bfe fix 修复 字典使用 default 样式报警告问题 2023-11-27 10:34:42 +08:00
疯狂的狮子Li
25e2e0e018 update 优化 页面关于权限标识符说明 2023-11-23 16:50:31 +08:00
疯狂的狮子Li
5165541780 update 优化 开发环境默认关闭ws 因vite的bug导致如ws无法连接则会崩溃 2023-11-22 16:22:15 +08:00
Michelle.Chung
b3c1b95437 add 新增响应解密私钥 ;
add 新增 crypto#decryptBase64 Base64解码方法 ;
update 更新响应拦截器增加响应解密逻辑 ;
2023-11-20 19:27:03 +08:00
疯狂的狮子Li
d84fee9319 !58 修复vite环境变量类型原因导致websocket关闭失效问题
Merge pull request !58 from Lau/N/A
2023-11-16 04:24:52 +00:00
Lau
d034236ce3 fix: 修改环境变量类型原因导致websocket无法关闭问题
Signed-off-by: Lau <1807121535@qq.com>
2023-11-16 03:25:35 +00:00
疯狂的狮子Li
9e89ab5bae !57 发布 vue 版本 5.1.1 与 cloud 版本2.1.1
Merge pull request !57 from 疯狂的狮子Li/dev
2023-11-14 03:11:07 +00:00
疯狂的狮子Li
6e6062e824 😴发布 vue 版本 5.1.1 与 cloud 版本2.1.1 2023-11-14 10:51:12 +08:00
疯狂的狮子Li
35bebf403c update 适配 websocket在https下的连接方式 2023-11-13 13:02:09 +08:00
疯狂的狮子Li
0a8c33c3cb fix 修复 五级路由缓存无效问题 2023-11-10 15:59:09 +08:00
疯狂的狮子Li
8a7de17b58 fix 修复 内链iframe没有传递参数问题 2023-11-10 11:35:40 +08:00
疯狂的狮子Li
f65eb2aee5 !55 绑定第三方帐号参数“wechar”更正为“wechat”
Merge pull request !55 from scmiot/dev
2023-11-07 01:30:47 +00:00
scmiot
efb53d4bcb !1 绑定第三方帐号参数“wechar”更正为“wechat”
Merge pull request !1 from scmiot/N/A
2023-11-04 22:51:31 +00:00
scmiot
ad2134f07d 绑定第三方帐号参数“wechar”更正为“wechat”
Signed-off-by: scmiot <10322731+scmiot@user.noreply.gitee.com>
2023-11-04 08:46:06 +00:00
疯狂的狮子Li
caa9d0fcdc fix 修复 环境变量书写错误 2023-11-03 22:40:18 +08:00
疯狂的狮子Li
b829ba4aa0 fix 修复 websocket 初始化无法连接进程死掉问题(vue代理问题) 2023-11-03 18:36:11 +08:00
疯狂的狮子Li
a232437abc update 优化 !pr50 bug与代码实现 2023-11-02 14:00:48 +08:00
疯狂的狮子Li
f2372d3243 update 优化 !pr50 bug与代码实现 2023-11-02 13:53:44 +08:00
三个三
a8a334b3c3 !50 add 新增 前端接入websocket接收消息
*  add 新增 前端接入websocket接收消息
2023-11-02 04:36:31 +00:00
疯狂的狮子Li
1e3f18ce22 !54 update 优化表格列的显示与隐藏小组件
Merge pull request !54 from bestrevens/dev
2023-11-01 04:09:35 +00:00
疯狂的狮子Li
631f338be2 fix 修复 用户注册缺失 clientid 问题 2023-11-01 10:46:42 +08:00
bestrevens
bf977fe00a update 优化表格列的显示与隐藏小组件
优化表格列的显示与隐藏小组件,解决小组件之间距离间隔不一样的问题

Signed-off-by: bestrevens <201840026@qq.com>
2023-10-31 08:54:22 +00:00
疯狂的狮子Li
5bc7044032 update 优化 补全操作日志部门数据 2023-10-27 22:44:05 +08:00
疯狂的狮子Li
6ad0ed5316 update 优化 去掉多余的参数 2023-10-26 17:02:12 +08:00
疯狂的狮子Li
ccb2ecc5ee update 更新 表单构建不能使用说明 2023-10-26 17:01:38 +08:00
疯狂的狮子Li
ec0cb472df update 优化 去掉多余的参数 2023-10-25 23:05:32 +08:00
疯狂的狮子Li
cd0a459c2b update 更新 表单构建不能使用说明 2023-10-25 16:21:21 +08:00
疯狂的狮子Li
18fea86a2c !53 更新登录日志以及在线用户展示信息
Merge pull request !53 from MichelleChung/dev
2023-10-23 12:46:48 +00:00
Michelle.Chung
66bfff450c update 更新 logininfor/index, online/index 字段显示 (客户端, 设备类型) ; 2023-10-23 20:32:38 +08:00
疯狂的狮子Li
ec34c759ec !52 fix 优化表格列的显示与隐藏小组件不显示tip和浏览器告警
Merge pull request !52 from bestrevens/ts
2023-10-16 07:36:23 +00:00
bestrevens
c1c5ea5e9d fix 优化表格列的显示与隐藏小组件不显示字段和告警
fix 优化表格列的显示与隐藏小组件不显示字段和告警

Signed-off-by: bestrevens <201840026@qq.com>
2023-10-16 07:30:14 +00:00
疯狂的狮子Li
6fe269efc7 fix 修复 !pr47 导致的打包异常 2023-10-16 15:13:27 +08:00
疯狂的狮子Li
920e079727 update 优化 富文本Editor组件检验图片格式 2023-10-09 12:00:15 +08:00
疯狂的狮子Li
a2f13185e1 fix 修复 HeaderSearch组件跳转query参数丢失问题 2023-10-09 11:57:22 +08:00
疯狂的狮子Li
078bb50130 update vue-quill 1.1.0 => 1.2.0 2023-10-09 11:47:29 +08:00
疯狂的狮子Li
4854d8df00 update 优化 操作日志列表新增IP地址查询 2023-10-09 11:46:53 +08:00
疯狂的狮子Li
ecf062605d update 优化 菜单管理类型为按钮状态可选 2023-10-09 11:41:53 +08:00
疯狂的狮子Li
b989b07121 update 优化 用户初始密码从参数配置查询 2023-10-09 11:19:32 +08:00
疯狂的狮子Li
bf957f06a0 !51 update 优化 通过参数键名获取键值接口的返回体
Merge pull request !51 from David Wei/update/config_response
2023-10-08 08:56:00 +00:00
David Wei
aed8c89ded update 优化 通过参数键名获取键值接口的返回体 2023-10-08 16:05:58 +08:00
疯狂的狮子Li
4085811d24 !48 修复#I8550V
Merge pull request !48 from ahaos/ts
2023-09-28 16:51:40 +00:00
ahao
fe384a3020 fix #I8550V https://gitee.com/dromara/RuoYi-Vue-Plus/issues/I8550V 2023-09-29 00:06:57 +08:00
ahaos
c6f3cd068e !47 优化表格列的显示与隐藏小组件
Merge pull request !47 from 森爷/ts
2023-09-28 14:15:14 +00:00
DESKTOP-IGCH756\PC
99a6b56233 优化表格列的显示与隐藏小组件 2023-09-28 14:58:34 +08:00
疯狂的狮子Li
8ed32775cb !44 fix 个人信息修改密码接口隐藏新旧密码参数明文
Merge pull request !44 from Bleachtred/ts
2023-09-26 08:06:46 +00:00
bleachtred
395db813b5 fix 个人信息修改密码接口,隐藏新旧密码参数明文 2023-09-25 15:29:32 +08:00
疯狂的狮子Li
ab1a7204fa update 优化 页面输入框样式 2023-09-17 15:53:25 +08:00
疯狂的狮子Li
92b2b489a4 fix 修复 自定义字典样式不生效的问题 2023-09-14 17:22:36 +08:00
疯狂的狮子Li
956d2ad495 update 优化 !pr40 代码结构 2023-09-09 11:44:56 +08:00
疯狂的狮子Li
cb6cbc4f40 !40 优化字典标签支持数组和多标签
Merge pull request !40 from 抓蛙师/ts
2023-09-09 03:42:40 +00:00
抓蛙师
14538ce399 优化字典标签支持数组和多标签 2023-09-08 18:35:17 +08:00
疯狂的狮子Li
6c16d023f4 fix 修复 login 页面 loading 未关闭问题 2023-09-08 12:28:09 +08:00
238 changed files with 17076 additions and 4055 deletions

View File

@@ -11,15 +11,25 @@ VITE_APP_BASE_API = '/dev-api'
VITE_APP_CONTEXT_PATH = '/'
# 监控地址
VITE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications'
VITE_APP_MONITOR_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 私钥与后端加密公钥对应 如更换需前后端一同更换
VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE='
# 客户端id
VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
# websocket 开关 默认使用sse推送
VITE_APP_WEBSOCKET = false
# sse 开关
VITE_APP_SSE = true

View File

@@ -8,10 +8,10 @@ VITE_APP_ENV = 'production'
VITE_APP_CONTEXT_PATH = '/'
# 监控地址
VITE_APP_MONITRO_ADMIN = '/admin/applications'
VITE_APP_MONITOR_ADMIN = '/admin/applications'
# powerjob 控制台地址
VITE_APP_POWERJOB_ADMIN = '/powerjob'
# SnailJob 控制台地址
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
# 生产环境
VITE_APP_BASE_API = '/prod-api'
@@ -21,8 +21,18 @@ VITE_BUILD_COMPRESS = gzip
VITE_APP_PORT = 80
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
VITE_APP_ENCRYPT = true
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE='
# 客户端id
VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
# websocket 开关 默认使用sse推送
VITE_APP_WEBSOCKET = false
# sse 开关
VITE_APP_SSE = true

View File

@@ -11,7 +11,7 @@ dist
.husky
.local
/bin
.eslintrc.js
.eslintrc.cjs
prettier.config.js
src/assets
tailwind.config.js
tailwind.config.js

View File

@@ -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',
{

1
.gitignore vendored
View File

@@ -22,6 +22,7 @@ selenium-debug.log
package-lock.json
yarn.lock
pnpm-lock.yaml
# 编译生成的文件
auto-imports.d.ts

20
.prettierrc Normal file
View File

@@ -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"
}

View File

@@ -1,46 +0,0 @@
/**
* 代码格式化配置
*/
module.exports = {
// 一行最多多少个字符
printWidth: 150,
// 指定每个缩进级别的空格数
tabWidth: 2,
// 使用制表符而不是空格缩进行
useTabs: false,
// 在语句末尾是否需要分号
semi: true,
// 是否使用单引号
singleQuote: true,
// 更改引用对象属性的时间 可选值"<as-needed|consistent|preserve>"
quoteProps: 'as-needed',
// 在JSX中使用单引号而不是双引号
jsxSingleQuote: false,
// 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>"默认none
trailingComma: 'none',
// 在对象文字中的括号之间打印空格
bracketSpacing: true,
// jsx 标签的反尖括号需要换行
jsxBracketSameLine: false,
embeddedLanguageFormatting: 'off',
// 在单独的箭头函数参数周围包括括号 always(x) => x \ avoidx => 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 结尾是 可选值"<auto|lf|crlf|cr>"
endOfLine: 'auto'
};

103
README.md
View File

@@ -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,57 +18,59 @@ npm install --registry=https://registry.npmmirror.com
# 启动服务
npm run dev
# 构建生产环境 yarn build:prod
# 构建生产环境
npm run build:prod
# 前端访问地址 http://localhost:80
```
## 本框架与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 '屏幕截图') |

View File

@@ -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]
}
};

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
@@ -9,7 +9,7 @@
<title>RuoYi-Vue-Plus多租户管理系统</title>
<!--[if lt IE 11
]><script>
window.location.href='/html/ie.html';
window.location.href = '/html/ie.html';
</script><!
[endif]-->
<style>
@@ -47,7 +47,7 @@
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
border-top-color: #fff;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
@@ -57,7 +57,7 @@
}
#loader:before {
content: "";
content: '';
position: absolute;
top: 5px;
left: 5px;
@@ -65,7 +65,7 @@
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
border-top-color: #fff;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
@@ -74,7 +74,7 @@
}
#loader:after {
content: "";
content: '';
position: absolute;
top: 15px;
left: 15px;
@@ -82,7 +82,7 @@
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
border-top-color: #fff;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
@@ -90,7 +90,6 @@
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
@@ -119,13 +118,12 @@
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171C6;
background: #7171c6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
@@ -140,21 +138,20 @@
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.loaded #loader {
@@ -182,7 +179,7 @@
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #FFF;
color: #fff;
font-size: 19px;
width: 100%;
text-align: center;
@@ -197,7 +194,7 @@
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #FFF;
color: #fff;
opacity: 0.5;
}
</style>

View File

@@ -1,15 +1,16 @@
{
"name": "ruoyi-vue-plus",
"version": "5.1.0",
"version": "5.2.3",
"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,74 @@
"url": "https://gitee.com/JavaLionLi/plus-ui.git"
},
"dependencies": {
"@element-plus/icons-vue": "2.1.0",
"@vueup/vue-quill": "1.1.0",
"@vueuse/core": "9.5.0",
"@element-plus/icons-vue": "2.3.1",
"@highlightjs/vue-plugin": "2.1.0",
"@vueup/vue-quill": "1.2.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",
"crypto-js": "4.2.0",
"diagram-js": "12.3.0",
"didi": "9.0.2",
"echarts": "5.5.0",
"element-plus": "2.7.8",
"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",
"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"
"pinia": "2.1.7",
"screenfull": "6.0.2",
"vue": "3.4.34",
"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"
},
"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",
"@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.12",
"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"
}
}

View File

@@ -1,21 +1,20 @@
<template>
<el-config-provider :locale="appStore.locale" :size="size">
<el-config-provider :locale="appStore.locale" :size="appStore.size">
<router-view />
</el-config-provider>
</template>
<script setup lang="ts">
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import useSettingsStore from '@/store/modules/settings';
import { handleThemeStyle } from '@/utils/theme';
import useAppStore from '@/store/modules/app';
const appStore = useAppStore();
const size = computed(() => appStore.size as any);
onMounted(() => {
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme)
})
})
handleThemeStyle(useSettingsStore().theme);
});
});
</script>

View File

@@ -20,7 +20,8 @@ export function login(data: LoginData): AxiosPromise<LoginResult> {
url: '/auth/login',
headers: {
isToken: false,
isEncrypt: true
isEncrypt: true,
repeatSubmit: false
},
method: 'post',
data: params
@@ -29,14 +30,20 @@ export function login(data: LoginData): AxiosPromise<LoginResult> {
// 注册方法
export function register(data: any) {
const params = {
...data,
clientId: clientId,
grantType: 'password'
};
return request({
url: '/auth/register',
headers: {
isToken: false,
isEncrypt: true
isEncrypt: true,
repeatSubmit: false
},
method: 'post',
data: data
data: params
});
}
@@ -44,6 +51,10 @@ export function register(data: any) {
* 注销
*/
export function logout() {
request({
url: '/resource/sse/close',
method: 'get'
});
return request({
url: '/auth/logout',
method: 'post'

View File

@@ -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'
});
}

View File

@@ -1,4 +1,5 @@
export interface OperLogQuery extends PageQuery {
operIp: string;
title: string;
operName: string;
businessType: string;

View File

@@ -64,12 +64,12 @@ export const delClient = (id: string | number | Array<string | number>) => {
/**
* 状态修改
* @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({

View File

@@ -7,7 +7,7 @@ export interface ClientVO {
/**
* 客户端id
*/
clientId: string | number;
clientId: string;
/**
* 客户端key

View File

@@ -20,7 +20,7 @@ export function getConfig(configId: string | number): AxiosPromise<ConfigVO> {
}
// 根据参数键名查询参数值
export function getConfigKey(configKey: string): AxiosPromise<ConfigVO> {
export function getConfigKey(configKey: string): AxiosPromise<string> {
return request({
url: '/system/config/configKey/' + configKey,
method: 'get'

View File

@@ -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;

View File

@@ -19,6 +19,18 @@ export function getPost(postId: string | number): AxiosPromise<PostVO> {
});
}
// 获取岗位选择框列表
export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise<PostVO[]> {
return request({
url: '/system/post/optionselect',
method: 'get',
params: {
postIds: postIds,
deptId: deptId
}
});
}
// 新增岗位
export function addPost(data: PostForm) {
return request({

View File

@@ -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;
}

View File

@@ -12,6 +12,17 @@ export const listRole = (query: RoleQuery): AxiosPromise<RoleVO[]> => {
});
};
/**
* 通过roleIds查询角色
* @param roleIds
*/
export const optionSelect = (roleIds: (number | string)[]): AxiosPromise<RoleVO[]> => {
return request({
url: '/system/role/optionselect?roleIds=' + roleIds,
method: 'get'
});
};
/**
* 查询角色详细
*/
@@ -142,3 +153,8 @@ export const deptTreeSelect = (roleId: string | number): AxiosPromise<RoleDeptTr
method: 'get'
});
};
export default {
optionSelect,
listRole
};

View File

@@ -1,10 +1,14 @@
import request from '@/utils/request';
// 绑定账号
export function authBinding(source: string) {
export function authBinding(source: string, tenantId: string) {
return request({
url: '/auth/binding/' + source,
method: 'get'
method: 'get',
params: {
tenantId: tenantId,
domain: window.location.host
}
});
}

View File

@@ -25,7 +25,8 @@ export function addTenant(data: TenantForm) {
url: '/system/tenant',
method: 'post',
headers: {
isEncrypt: true
isEncrypt: true,
repeatSubmit: false
},
data: data
});
@@ -90,3 +91,11 @@ export function syncTenantPackage(tenantId: string | number, packageId: string |
params: data
});
}
// 同步租户字典
export function syncTenantDict() {
return request({
url: '/system/tenant/syncTenantDict',
method: 'get',
});
}

View File

@@ -17,6 +17,17 @@ export const listUser = (query: UserQuery): AxiosPromise<UserVO[]> => {
});
};
/**
* 通过用户ids查询用户
* @param userIds
*/
export const optionSelect = (userIds: (number | string)[]): AxiosPromise<UserVO[]> => {
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,9 +146,10 @@ export const updateUserPwd = (oldPassword: string, newPassword: string) => {
url: '/system/user/profile/updatePwd',
method: 'put',
headers: {
isEncrypt: true
isEncrypt: true,
repeatSubmit: false
},
params: data
data: data
});
};
@@ -199,6 +212,7 @@ export const deptTreeSelect = (): AxiosPromise<DeptVO[]> => {
export default {
listUser,
getUser,
optionSelect,
addUser,
updateUser,
delUser,

View File

@@ -1,4 +1,3 @@
import { DeptVO } from './../dept/types';
import { RoleVO } from '@/api/system/role/types';
import { PostVO } from '@/api/system/post/types';
@@ -27,6 +26,7 @@ export interface UserQuery extends PageQuery {
*/
export interface UserVO extends BaseEntity {
userId: string | number;
tenantId: string;
deptId: number;
userName: string;
nickName: string;
@@ -40,7 +40,7 @@ export interface UserVO extends BaseEntity {
loginIp: string;
loginDate: string;
remark: string;
dept: DeptVO;
deptName: string;
roles: RoleVO[];
roleIds: any;
postIds: any;

View File

@@ -28,7 +28,7 @@ export const getGenTable = (tableId: string | number): AxiosPromise<GenTableVO>
};
// 修改代码生成信息
export const updateGenTable = (data: DbTableForm) => {
export const updateGenTable = (data: DbTableForm): AxiosPromise<GenTableVO> => {
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<GenTableVO> => {
return request({
url: '/tool/gen/importTable',
method: 'post',

View File

@@ -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<CategoryVO[]> => {
return request({
url: '/workflow/category/list',
method: 'get',
params: query
});
};
/**
* 查询流程分类详细
* @param id
*/
export const getCategory = (id: string | number): AxiosPromise<CategoryVO> => {
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<string | number>) => {
return request({
url: '/workflow/category/' + id,
method: 'delete'
});
};

View File

@@ -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;
}

View File

@@ -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<DefinitionConfigVO> => {
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<string | number>) => {
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'
});
};

View File

@@ -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;
}

View File

@@ -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<FormManageVO[]> => {
return request({
url: '/workflow/formManage/list',
method: 'get',
params: query
});
};
/**
* 查询表单管理列表
* @param query
* @returns {*}
*/
export const selectListFormManage = (): AxiosPromise<FormManageVO[]> => {
return request({
url: '/workflow/formManage/list/selectList',
method: 'get'
});
};
/**
* 查询表单管理详细
* @param id
*/
export const getFormManage = (id: string | number): AxiosPromise<FormManageVO> => {
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<string | number>) => {
return request({
url: '/workflow/formManage/' + id,
method: 'delete'
});
};

View File

@@ -0,0 +1,69 @@
export interface FormManageVO {
/**
* 主键
*/
id: string | number;
/**
* 表单名称
*/
formName: string;
/**
* 表单类型
*/
formType: string;
/**
* 表单类型名称
*/
formTypeName: string;
/**
* 路由地址/表单ID
*/
router: string;
/**
* 备注
*/
remark: string;
}
export interface FormManageForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 表单名称
*/
formName?: string;
/**
* 表单类型
*/
formType?: string;
/**
* 路由地址/表单ID
*/
router?: string;
/**
* 备注
*/
remark?: string;
}
export interface FormManageQuery extends PageQuery {
/**
* 表单名称
*/
formName?: string;
/**
* 表单类型
*/
formType?: string;
}

View File

@@ -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<LeaveVO[]> => {
return request({
url: '/workflow/leave/list',
method: 'get',
params: query
});
};
/**
* 查询请假详细
* @param id
*/
export const getLeave = (id: string | number): AxiosPromise<LeaveVO> => {
return request({
url: '/workflow/leave/' + id,
method: 'get'
});
};
/**
* 新增请假
* @param data
*/
export const addLeave = (data: LeaveForm): AxiosPromise<LeaveVO> => {
return request({
url: '/workflow/leave',
method: 'post',
data: data
});
};
/**
* 修改请假
* @param data
*/
export const updateLeave = (data: LeaveForm): AxiosPromise<LeaveVO> => {
return request({
url: '/workflow/leave',
method: 'put',
data: data
});
};
/**
* 删除请假
* @param id
*/
export const delLeave = (id: string | number | Array<string | number>) => {
return request({
url: '/workflow/leave/' + id,
method: 'delete'
});
};

View File

@@ -0,0 +1,24 @@
export interface LeaveVO {
id: string | number;
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark: string;
status?: string;
}
export interface LeaveForm extends BaseEntity {
id?: string | number;
leaveType?: string;
startDate?: string;
endDate?: string;
leaveDays?: number;
remark?: string;
status?: string;
}
export interface LeaveQuery extends PageQuery {
startLeaveDays?: number;
endLeaveDays?: number;
}

View File

@@ -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<ModelVO[]> => {
return request({
url: '/workflow/model/list',
method: 'get',
params: query
});
};
/**
* 查询模型信息
* @param query
* @returns {*}
*/
export const getInfo = (id: string): AxiosPromise<ModelForm> => {
return request({
url: '/workflow/model/getInfo/' + id,
method: 'get'
});
};
/**
* 新增模型
* @param data
* @returns {*}
*/
export const addModel = (data: ModelForm): AxiosPromise<void> => {
return request({
url: '/workflow/model/save',
method: 'post',
data: data
});
};
/**
* 修改模型信息
* @param data
* @returns {*}
*/
export function update(data: ModelForm): AxiosPromise<void> {
return request({
url: '/workflow/model/update',
method: 'put',
data: data
});
}
/**
* 修改模型信息
* @param data
* @returns {*}
*/
export function editModelXml(data: ModelForm): AxiosPromise<void> {
return request({
url: '/workflow/model/editModelXml',
method: 'put',
data: data
});
}
/**
* 按id删除模型
* @returns {*}
* @param id 模型id
*/
export function delModel(id: string | string[]): AxiosPromise<void> {
return request({
url: '/workflow/model/' + id,
method: 'delete'
});
}
/**
* 模型部署
* @returns {*}
* @param id 模型id
*/
export const modelDeploy = (id: string): AxiosPromise<void> => {
return request({
url: `/workflow/model/modelDeploy/${id}`,
method: 'post'
});
};
/**
* 复制模型
* @param data
* @returns {*}
*/
export const copyModel = (data: ModelForm): AxiosPromise<void> => {
return request({
url: '/workflow/model/copyModel',
method: 'post',
data: data
});
};

View File

@@ -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;
}

View File

@@ -0,0 +1,38 @@
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;
}

View File

@@ -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<ProcessDefinitionVO[]> => {
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<any> => {
return request({
url: `/workflow/processDefinition/definitionImage/${processDefinitionId}` + '?t' + Math.random(),
method: 'get'
});
};
/**
* 通过流程定义id获取xml
* @param processDefinitionId 流程定义id
* @returns
*/
export const definitionXml = (processDefinitionId: string): AxiosPromise<definitionXmlVO> => {
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'
});
};

View File

@@ -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;
}

View File

@@ -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<ProcessInstanceVO[]> => {
return request({
url: '/workflow/processInstance/getPageByRunning',
method: 'get',
params: query
});
};
/**
* 查询已完成实例列表
* @param query
* @returns {*}
*/
export const getPageByFinish = (query: ProcessInstanceQuery): AxiosPromise<ProcessInstanceVO[]> => {
return request({
url: '/workflow/processInstance/getPageByFinish',
method: 'get',
params: query
});
};
/**
* 通过业务id获取历史流程图
*/
export const getHistoryImage = (businessKey: string) => {
return request({
url: `/workflow/processInstance/getHistoryImage/${businessKey}` + '?t' + Math.random(),
method: 'get'
});
};
/**
* 通过业务id获取历史流程图运行中历史等节点
*/
export const getHistoryList = (businessKey: string): AxiosPromise<Record<string, any>> => {
return request({
url: `/workflow/processInstance/getHistoryList/${businessKey}` + '?t' + Math.random(),
method: 'get'
});
};
/**
* 获取审批记录
* @param businessKey 业务id
* @returns
*/
export const getHistoryRecord = (businessKey: string | number) => {
return request({
url: `/workflow/processInstance/getHistoryRecord/${businessKey}`,
method: 'get'
});
};
/**
* 作废
* @param data 参数
* @returns
*/
export const deleteRunInstance = (data: object) => {
return request({
url: `/workflow/processInstance/deleteRunInstance`,
method: 'post',
data: data
});
};
/**
* 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息
* @param businessKey 业务id
* @returns
*/
export const deleteRunAndHisInstance = (businessKey: string | string[]) => {
return request({
url: `/workflow/processInstance/deleteRunAndHisInstance/${businessKey}`,
method: 'delete'
});
};
/**
* 已完成的实例 删除程实例,删除历史记录,删除业务与流程关联信息
* @param businessKey 业务id
* @returns
*/
export const deleteFinishAndHisInstance = (businessKey: string | string[]) => {
return request({
url: `/workflow/processInstance/deleteFinishAndHisInstance/${businessKey}`,
method: 'delete'
});
};
/**
* 分页查询当前登录人单据
* @param query
* @returns {*}
*/
export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise<ProcessInstanceVO[]> => {
return request({
url: '/workflow/processInstance/getPageByCurrent',
method: 'get',
params: query
});
};
/**
* 撤销流程
* @param businessKey 业务id
* @returns
*/
export const cancelProcessApply = (businessKey: string) => {
return request({
url: `/workflow/processInstance/cancelProcessApply/${businessKey}`,
method: 'post'
});
};
export default {
getPageByRunning,
getPageByFinish,
getHistoryImage,
getHistoryList,
getHistoryRecord,
deleteRunInstance,
deleteRunAndHisInstance,
deleteFinishAndHisInstance,
getPageByCurrent,
cancelProcessApply
};

View File

@@ -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[];
}

View File

@@ -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<TaskVO[]> => {
return request({
url: '/workflow/task/getPageByTaskWait',
method: 'get',
params: query
});
};
/**
* 查询已办列表
* @param query
* @returns {*}
*/
export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
return request({
url: '/workflow/task/getPageByTaskFinish',
method: 'get',
params: query
});
};
/**
* 查询当前用户的抄送列表
* @param query
* @returns {*}
*/
export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
return request({
url: '/workflow/task/getPageByTaskCopy',
method: 'get',
params: query
});
};
/**
* 当前租户所有待办任务
* @param query
* @returns {*}
*/
export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
return request({
url: '/workflow/task/getPageByAllTaskWait',
method: 'get',
params: query
});
};
/**
* 当前租户所有已办任务
* @param query
* @returns {*}
*/
export const getPageByAllTaskFinish = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
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<string>, 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'
});
};

View File

@@ -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;
}

View File

@@ -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('请到模型配置菜单!');
}
}
};

View File

@@ -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;
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path d="M321.94 98L158.82 237.78a24 24 0 000 36.44L321.94 414c15.57 13.34 39.62 2.28 39.62-18.22v-279.6c0-20.5-24.05-31.56-39.62-18.18z"/></svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path d="M190.06 414l163.12-139.78a24 24 0 000-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z"/></svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@@ -0,0 +1 @@
<svg t="1715954426124" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3305" width="200" height="200"><path d="M664.081597 1023.943114a78.246037 78.246037 0 0 1-78.985549-76.795456v-284.996471a78.27448 78.27448 0 0 1 78.985549-76.93767h280.843828A78.189152 78.189152 0 0 1 1023.939417 662.151187v284.996471a78.246037 78.246037 0 0 1-79.013992 76.795456z m-585.067605 0a78.246037 78.246037 0 0 1-78.985549-76.795456v-284.996471a78.160709 78.160709 0 0 1 78.985549-76.93767h280.786942a78.302923 78.302923 0 0 1 79.042434 76.93767v284.996471h-0.170656a78.246037 78.246037 0 0 1-78.985549 76.795456z m0-585.096048a78.217594 78.217594 0 0 1-78.985549-76.93767V76.912925a78.189152 78.189152 0 0 1 78.957106-76.795456h280.786942a78.27448 78.27448 0 0 1 79.042435 76.93767v284.996471a78.27448 78.27448 0 0 1-79.013992 76.795456z m589.675333-5.688552a77.193655 77.193655 0 0 1-77.990052-75.885288V75.888985a77.25054 77.25054 0 0 1 77.990052-75.942173h277.26004a77.25054 77.25054 0 0 1 77.961609 75.942173v281.384241a77.421197 77.421197 0 0 1-78.132266 75.885288z" p-id="3306" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1 @@
<svg t="1716006237008" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12400" width="200" height="200"><path d="M738.826039 1005.166431c-150.226824 0-272.00251-121.916235-272.00251-272.303686 0-150.407529 121.775686-272.323765 272.00251-272.323765 150.206745 0 271.982431 121.916235 271.982432 272.323765 0 150.387451-121.775686 272.303686-271.982432 272.303686z m-0.040157-508.225255c-128.582275 0-232.789333 104.347608-232.789333 233.09051s104.207059 233.110588 232.789333 233.110589c128.562196 0 232.769255-104.367686 232.769255-233.110589 0-128.742902-104.207059-233.09051-232.769255-233.09051z m10.561255 318.243138s-3.694431 3.674353-7.408941 3.674353a18.010353 18.010353 0 0 1-25.941333 0l-74.10949-80.916079a17.66902 17.66902 0 0 1 0-25.740549c7.408941-7.368784 22.246902-7.368784 25.941333 0l63.006118 69.872941 129.686588-117.699764a18.010353 18.010353 0 0 1 25.941333 0 17.709176 17.709176 0 0 1 0 25.760627L749.347137 815.184314zM391.529412 682.666667H190.745098a20.078431 20.078431 0 0 1 0-40.156863h200.784314a20.078431 20.078431 0 1 1 0 40.156863zM170.666667 261.019608a20.078431 20.078431 0 0 1 20.078431-20.078432h481.882353a20.078431 20.078431 0 0 1 0 40.156863H190.745098a20.078431 20.078431 0 0 1-20.078431-20.078431z m341.333333 200.784314H190.745098a20.078431 20.078431 0 0 1 0-40.156863h321.254902a20.078431 20.078431 0 0 1 0 40.156863zM813.176471 120.470588a80.313725 80.313725 0 0 0-80.313726-80.313725H130.509804a80.313725 80.313725 0 0 0-80.313726 80.313725v762.980392a80.313725 80.313725 0 0 0 80.313726 80.313726h366.832941a346.112 346.112 0 0 0 40.417882 40.779294H130.509804a120.470588 120.470588 0 0 1-120.470588-120.470588V120.470588a120.470588 120.470588 0 0 1 120.470588-120.470588h602.352941a120.470588 120.470588 0 0 1 120.470588 120.470588v293.667137a340.188863 340.188863 0 0 0-40.156862-8.533333V120.470588z" fill="currentColor" p-id="12401"></path></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1 @@
<svg t="1715953291934" class="icon" viewBox="0 0 1061 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1715" id="mx_n_1715953291935" width="200" height="200"><path d="M447.122465 467.332105L49.240301 268.161564A33.501036 33.501036 0 0 0 0.136043 300.744763v441.020484a33.042117 33.042117 0 0 0 16.06214 27.994016L413.162511 1018.034062a33.959954 33.959954 0 0 0 17.438895 5.50702 33.042117 33.042117 0 0 0 33.042117-33.042118V497.161795a33.042117 33.042117 0 0 0-17.438895-29.82969zM398.018207 931.298504l-331.339011-208.348907v-367.134638l331.339011 162.915996zM1046.010843 263.572381a33.042117 33.042117 0 0 0-31.665363 0L550.838 467.332105a33.042117 33.042117 0 0 0-19.733487 30.288608v493.33717a33.042117 33.042117 0 0 0 49.563176 28.452934l463.048562-265.254776a33.042117 33.042117 0 0 0 16.521059-28.452934V291.566398a33.042117 33.042117 0 0 0-14.685386-27.994017z m-50.939931 441.020484L596.72983 931.298504v-413.026468l397.882163-176.224626zM991.399565 178.672496a33.042117 33.042117 0 0 0-22.486996-29.829689L550.838 1.530034a32.583199 32.583199 0 0 0-19.733487 0L83.659173 158.021173a33.042117 33.042117 0 0 0-4.130264 61.036134l397.882163 199.170541a33.042117 33.042117 0 0 0 14.685386 3.212428 33.959954 33.959954 0 0 0 13.30863 0l463.966399-205.595398a33.042117 33.042117 0 0 0 22.028078-37.172382zM494.391049 349.849021L180.490934 195.193555l358.874108-125.743613 328.126583 112.434982z m0 0" fill="currentColor" p-id="1716"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1 @@
<svg t="1716006583362" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="38505" width="200" height="200"><path d="M733.696 666.624l56.32-65.536-15.36-12.8c-41.472-34.816-87.552-61.44-136.192-79.36 75.264-49.152 124.928-134.144 124.928-230.912 0-152.576-123.904-276.48-276.48-276.48-74.24 0-143.872 28.672-195.584 80.384-52.224 51.712-80.896 121.344-80.896 195.584 0 92.16 45.568 174.08 115.2 224.256-81.408 26.624-156.672 74.752-215.552 144.896C34.304 736.768-4.096 850.944 0.512 968.192l1.024 20.48 86.528-4.608-1.024-19.968c-4.096-96.256 27.136-188.928 88.576-261.12 136.704-162.816 380.416-184.32 543.232-48.64l14.848 12.288zM296.96 278.016c0-106.496 83.456-189.952 189.952-189.952 104.96 0 189.952 84.992 189.952 189.952 0 106.496-83.456 189.952-189.952 189.952S296.96 384.512 296.96 278.016z m690.688 522.24H802.304c13.824-16.896 32.256-38.4 55.808-67.072 7.68-8.192 11.776-19.456 10.752-31.744-1.024-11.776-6.144-22.528-15.36-29.696-8.192-7.68-19.456-11.264-31.232-10.752-12.288 1.024-23.04 6.656-30.208 15.872-38.4 45.568-96.256 114.176-101.376 119.808-7.68 7.68-10.752 15.36-13.312 22.528-4.096 8.704-4.096 16.384-4.096 24.064 0 5.632 0 12.8 3.584 23.04 2.56 7.68 6.144 15.872 13.824 23.552l104.96 124.416 4.096 2.048c9.216 4.096 18.432 6.144 26.624 6.144 8.704 0 21.504-4.096 28.672-11.776 8.704-8.704 13.824-19.968 14.336-31.744 0-10.752-3.584-20.48-11.264-28.16l-54.272-63.488h183.296c19.456 0 35.84-18.944 36.352-43.008v-0.512c0.512-25.088-14.848-43.52-35.84-43.52z" fill="currentColor" p-id="38506"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1 @@
<svg t="1715953932254" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11266" width="200" height="200"><path d="M955.59576334 565.84816928C921.71190561 470.40769794 828.48968821 401.08719229 717.79871055 401.08719229c-111.30100029 0-204.91141024 70.09689085-238.29616047 166.36920831h-253.43576475c-26.23088067 0-47.5261393 24.84446618-47.5261329 55.45640711s21.2952586 55.4564006 47.5261329 55.45640054h242.73267482c6.54385326 41.3150179 23.95716606 79.02537397 49.30074631 110.91280755h-292.03342113c-26.23088067 0-47.5261393 24.84446618-47.5261329 55.45640061s21.2952586 55.4564006 47.5261329 55.45640059h214.0617167a376.93717152 376.93717152 0 0 0-33.44021086 110.91280754h-292.47706801a46.36155474 46.36155474 0 0 1-45.91790151-46.8052016V169.1685161c0-25.06629616 21.23980441-45.36333956 47.35977009-45.3633331h63.38666838v55.45640059c0 50.07713168 67.6013528 55.4564006 110.91280122 55.45640061 43.31144833 0 88.50841878 5.76746809 88.5084187-55.45640061v-55.45640059h44.53149358v55.45640059c0 61.22386864 38.15400297 55.4564006 88.84115713 55.45640061 50.74260854 0 88.56387296 5.76746809 88.56387308-55.45640061v-55.45640059h44.19875511v55.45640059c0 61.22386864 38.43128719 55.4564006 89.11844137 55.45640061s110.91280771-2.82827659 110.91280118-55.45640061v-55.45640059h63.44212904a47.69250853 47.69250853 0 0 1 47.74796275 47.63704778l-0.22182994 394.4059385zM407.96379074 345.63079175h-181.95245955c-26.23088067 0-47.5261393 24.84446618-47.52613946 55.45640054s21.2952586 55.4564006 47.52613946 55.45640711h181.95245955c26.23088067 0 47.5261393-24.84446618 47.52613268-55.45640711s-21.2952586-55.4564006-47.52613268-55.45640054z m325.75090957-166.36920816c-30.61193437 0-55.4564006-18.63335139-55.45640712-41.59230208v-83.18460405c0-22.95895071 24.84446618-41.59230206 55.45640712-41.592302s55.4564006 18.63335139 55.4564006 41.592302v83.18460405c0 22.95895071-24.84446618 41.59230206-55.4564006 41.59230208z m-222.71291552 0c-30.61193437 0-55.4009463-18.63335139-55.4009464-41.59230208v-83.18460405c0-22.95895071 24.84446618-41.59230206 55.4009464-41.592302 30.61193437 0 55.4564006 18.63335139 55.45640054 41.592302v83.18460405c-0.0554542 22.95895071-24.84446618 41.59230206-55.45640054 41.59230208z m-220.6610244 0c-30.61193437 0-55.4009463-18.63335139-55.40094634-41.59230208v-83.18460405c0-22.95895071 24.84446618-41.59230206 55.40094634-41.592302 30.61193437 0 55.4564006 18.63335139 55.45640063 41.592302v83.18460405c0 22.95895071-24.84446618 41.59230206-55.45640063 41.59230208z m443.31847922 665.92048622c-91.28124099 0-165.53736215-74.69977454-165.53736218-166.59103817 0-91.83580289 74.2561211-166.59103164 165.53736218-166.59103164s165.53736215 74.75522879 165.53736218 166.59103164-74.2561211 166.59103164-165.53736218 166.59103817z m-115.73750824-29.33644132c32.1647114 24.45627358 71.98241282 39.59587158 115.68205395 39.59587144 44.14329437 0 84.34918863-15.47233629 116.68026924-40.3722568a235.13514545 235.13514545 0 0 1 105.14533952 195.98292729h-443.6512175c0-80.35632762 41.92504052-153.94697186 106.14355479-195.20654193z" fill="currentColor" p-id="11267"></path></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1 @@
<svg t="1716005059256" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3268" width="200" height="200"><path d="M497.798958 952.225272A345.95419 345.95419 0 0 1 359.273733 892.652247a171.541601 171.541601 0 0 0 7.177473-47.37132A179.436821 179.436821 0 0 0 211.417793 665.126359a345.95419 345.95419 0 0 1 185.896546-380.40606 179.436821 179.436821 0 0 0 317.244299 0 351.696169 351.696169 0 0 1 143.549456 128.476763 35.169617 35.169617 0 0 0 30.145386 16.508188 37.322859 37.322859 0 0 0 19.379177-5.024231 36.605111 36.605111 0 0 0 10.766209-46.653574 424.188644 424.188644 0 0 0-183.743304-160.775391v-13.637198a180.872315 180.872315 0 1 0-358.873642 0 129.194511 129.194511 0 0 0 0 15.79044A423.470897 423.470897 0 0 0 132.465591 600.529103a467.253481 467.253481 0 0 0 6.459726 71.774728A180.154568 180.154568 0 0 0 187.014385 1024a178.001326 178.001326 0 0 0 139.96072-68.185992 430.64837 430.64837 0 0 0 158.62215 62.444014h6.459725a35.887364 35.887364 0 0 0 5.741978-71.774729z m57.419783-861.29674a109.097587 109.097587 0 1 1-108.37984 110.533082A109.097587 109.097587 0 0 1 555.218741 90.928532zM187.014385 952.225272a109.097587 109.097587 0 1 1 108.37984-108.37984A109.097587 109.097587 0 0 1 187.014385 952.225272zM933.471559 617.755038l-104.791103-71.774728a35.887364 35.887364 0 0 0-48.089068 8.612967L560.242972 858.918125a37.322859 37.322859 0 0 0-6.459725 24.403408l9.330714 104.073356a35.169617 35.169617 0 0 0 14.354946 25.838902 38.758353 38.758353 0 0 0 21.532418 7.177473h7.177473l98.331378-21.532419a38.758353 38.758353 0 0 0 22.250166-14.354946L945.673263 665.126359a36.605111 36.605111 0 0 0 5.741978-27.274397 37.322859 37.322859 0 0 0-17.943682-20.096924zM675.800285 930.692853l-45.218079 9.330715-4.306484-49.524563 193.791766-262.695505 45.218079 29.427638z m311.50232-399.067489l-103.355608-66.750497a35.887364 35.887364 0 0 0-49.524563 10.048462 35.169617 35.169617 0 0 0 10.766209 49.524562L947.826505 593.35163a34.45187 34.45187 0 0 0 20.096924 5.741979 37.322859 37.322859 0 0 0 30.145386-15.790441 36.605111 36.605111 0 0 0-10.76621-51.677804z" fill="currentColor" p-id="3269"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,29 @@
<svg width="200" height="200" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_446_540)">
<path d="M113.069 160.072C103.717 170.743 93.0453 180.216 81.5345 188.609C61.5105 174.46 44.3642 156.595 30.9349 135.971C23.5009 124.46 17.2659 112.11 12.4697 99.0407C9.592 91.3668 7.19392 83.3332 5.27545 75.2996C2.03803 61.3907 0.359375 47.0022 0.359375 32.1341C0.359375 30.6953 0.359375 29.1365 0.359375 27.6977C6.35459 23.9806 12.7095 20.7432 19.0644 17.7456C20.7431 32.1341 24.1004 46.043 28.8966 59.3524C31.6544 66.9063 34.7719 74.3404 38.4889 81.4147C44.604 93.5251 52.0381 104.796 60.4314 115.228C75.1796 133.093 92.9254 148.321 113.069 160.072Z" fill="url(#paint0_linear_446_540)"/>
<path d="M196.643 67.6256C195.084 76.3786 192.926 84.8918 190.168 93.1652C178.897 91.1269 167.266 90.0477 155.276 90.0477C154.197 90.0477 153.118 90.0477 152.039 90.0477C126.859 90.4074 102.878 95.6832 80.9352 105.036C72.302 94.8439 64.868 83.453 58.9927 71.3427C81.6546 61.8702 106.475 56.7144 132.614 56.7144C141.487 56.7144 150.24 57.3139 158.753 58.5129C171.823 60.1916 184.533 63.3091 196.643 67.6256Z" fill="url(#paint1_linear_446_540)"/>
<path d="M199.64 34.0528C199.64 39.2087 199.401 44.3646 199.041 49.4005C186.691 44.1247 173.621 40.048 160.072 37.53C148.321 35.2518 136.211 34.0528 123.981 34.0528C97.7218 34.0528 72.6619 39.3286 49.88 48.9209C42.6858 51.9185 35.7313 55.3958 29.0167 59.2327C24.2205 46.0432 20.8632 32.0144 19.1846 17.6259C26.6186 14.1487 34.2925 11.271 42.2062 8.75301C60.3117 3.11751 79.4964 0 99.4005 0C119.904 0 139.568 3.23741 158.153 9.11272C172.782 13.789 186.691 20.2638 199.52 28.1775C199.64 30.2159 199.64 32.1343 199.64 34.0528Z" fill="url(#paint2_linear_446_540)"/>
<path d="M190.168 93.2855C182.494 116.547 170.384 137.65 154.796 155.875C149.76 161.751 144.364 167.386 138.609 172.542C126.858 183.214 113.789 192.446 99.7601 200C93.4052 196.523 87.41 192.686 81.5347 188.609C93.0455 180.336 103.717 170.744 113.069 160.072C117.866 154.676 122.302 148.921 126.499 143.046C137.65 127.098 146.403 109.233 152.158 90.1679C153.237 90.1679 154.316 90.1679 155.396 90.1679C167.146 90.048 178.777 91.1272 190.168 93.2855Z" fill="url(#paint3_linear_446_540)"/>
</g>
<defs>
<linearGradient id="paint0_linear_446_540" x1="15.8569" y1="27.5782" x2="86.4712" y2="182.06" gradientUnits="userSpaceOnUse">
<stop stop-color="#57A4F7"/>
<stop offset="1" stop-color="#2158F9"/>
</linearGradient>
<linearGradient id="paint1_linear_446_540" x1="58.9501" y1="80.8427" x2="196.648" y2="80.8427" gradientUnits="userSpaceOnUse">
<stop stop-color="#2158F9"/>
<stop offset="1" stop-color="#33E1E5"/>
</linearGradient>
<linearGradient id="paint2_linear_446_540" x1="19.1564" y1="29.6353" x2="199.647" y2="29.6353" gradientUnits="userSpaceOnUse">
<stop stop-color="#255DF9"/>
<stop offset="1" stop-color="#7C35BA"/>
</linearGradient>
<linearGradient id="paint3_linear_446_540" x1="95.3808" y1="192.567" x2="174.674" y2="97.4815" gradientUnits="userSpaceOnUse">
<stop stop-color="#54A0F7"/>
<stop offset="1" stop-color="#2158F9"/>
</linearGradient>
<clipPath id="clip0_446_540">
<rect width="200" height="200" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1 @@
<svg t="1716005941920" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6808" width="200" height="200"><path d="M739.555556 512a256 256 0 1 1 0 512 256 256 0 0 1 0-512z m18.887111-512a180.167111 180.167111 0 0 1 179.882666 169.870222l0.284445 10.24v311.068445a28.444444 28.444444 0 0 1-56.433778 5.12l-0.455111-5.12V180.110222a123.278222 123.278222 0 0 0-114.460445-122.936889l-8.817777-0.341333H209.237333a123.278222 123.278222 0 0 0-122.993777 114.460444l-0.284445 8.817778v662.641778c0 65.080889 50.460444 118.385778 114.460445 122.88l8.817777 0.341333h283.875556a28.444444 28.444444 0 0 1 5.12 56.433778l-5.12 0.455111h-283.875556a180.167111 180.167111 0 0 1-179.882666-169.927111l-0.284445-10.24V180.167111A180.167111 180.167111 0 0 1 198.997333 0.227556L209.237333 0h549.205334zM739.555556 568.888889a199.111111 199.111111 0 1 0 0 398.222222 199.111111 199.111111 0 0 0 0-398.222222z m115.712 314.026667a14.222222 14.222222 0 0 1 0 28.444444h-222.890667a14.222222 14.222222 0 0 1 0-28.444444h222.890667z m-45.738667-227.555556a74.126222 74.126222 0 0 1-37.660445 95.459556v24.234666c0 6.257778 5.12 11.377778 11.377778 11.377778h51.313778c19.057778-0.170667 34.645333 16.042667 34.929778 36.295111v25.486222a11.377778 11.377778 0 0 1-11.377778 11.377778h-228.579556a11.377778 11.377778 0 0 1-11.377777-11.377778v-25.486222c0.512-20.48 16.213333-36.693333 35.271111-36.295111h51.143111a11.377778 11.377778 0 0 0 11.377778-11.377778v-24.291555c-16.440889-7.793778-32.426667-21.674667-39.253334-38.570667a73.500444 73.500444 0 0 1 36.295111-95.459556c35.328-16.497778 81.123556 0.967111 96.540445 38.684445zM360.789333 682.666667a28.444444 28.444444 0 0 1 5.12 56.433777l-5.12 0.455112H199.111111a28.444444 28.444444 0 0 1-5.12-56.433778L199.111111 682.666667h161.678222z m113.777778-227.555556a28.444444 28.444444 0 0 1 5.12 56.433778L474.510222 512H199.111111a28.444444 28.444444 0 0 1-5.12-56.433778L199.111111 455.111111h275.456zM768 227.555556a28.444444 28.444444 0 0 1 5.12 56.433777L768 284.444444H199.111111a28.444444 28.444444 0 0 1-5.12-56.433777L199.111111 227.555556h568.888889z" fill="currentColor" p-id="6809"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1 @@
<svg t="1716004936483" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2712" width="200" height="200"><path d="M1024.99477 113.778v227.555a57.458 57.458 0 0 1-58.027 56.89H734.86277a57.458 57.458 0 0 1-58.027-56.89v-56.889H560.83877v455.112h115.996v-56.89a57.458 57.458 0 0 1 58.027-56.888h231.936a57.458 57.458 0 0 1 58.197 56.889v227.555a57.458 57.458 0 0 1-58.027 56.89H734.86277a57.458 57.458 0 0 1-58.027-56.89v-56.889H502.86877a57.458 57.458 0 0 1-58.027-56.889V568.89L274.51677 735.972a46.763 46.763 0 0 1-65.252 0l-195.754-192a44.658 44.658 0 0 1 0-64l195.754-192.057a46.763 46.763 0 0 1 65.252 0L445.01277 455.11V227.556a57.458 57.458 0 0 1 58.027-56.89h173.966v-56.888a57.458 57.458 0 0 1 58.026-56.89h231.936a57.458 57.458 0 0 1 58.027 56.89z" fill="currentColor" p-id="2713"></path></svg>

After

Width:  |  Height:  |  Size: 844 B

View File

@@ -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;
}

View File

@@ -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 {

View File

@@ -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;
@@ -227,23 +229,4 @@
margin-right: 16px;
}
}
// the scroll bar appears when the sub-menu is too long
> .el-menu--popup {
max-height: 100vh;
overflow-y: auto;
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
}

View File

@@ -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

View File

@@ -0,0 +1,23 @@
function generateRandomValue() {
// 生成一个随机数
const randomValue = Math.random().toString(36).slice(2, 12);
return `Process_${randomValue}`;
}
const cartage: string = 'default';
export default `<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" targetNamespace="http://www.flowable.org/processdef">
<process id="process_${generateRandomValue()}" name="name_${generateRandomValue()}">
<startEvent id="startNode1" name="开始" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_flow">
<bpmndi:BPMNPlane id="BPMNPlane_flow" bpmnElement="T-2d89e7a3-ba79-4abd-9f64-ea59621c258c">
<bpmndi:BPMNShape id="BPMNShape_startNode1" bpmnElement="startNode1" bioc:stroke="">
<omgdc:Bounds x="240" y="200" width="30" height="30" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="242" y="237" width="23" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>`;

126
src/bpmn/assets/lang/zh.ts Normal file
View File

@@ -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': '流程元素必须是池/参与者的子元素'
};

File diff suppressed because it is too large Load Diff

View File

@@ -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-expect-error 忽略异常
super(config, injector, eventBus, contextPad, modeling, elementFactory, connect, create, popupMenu, canvas, rules, translate);
this._contextPad = contextPad;
this._modeling = modeling;
this._elementFactory = elementFactory;
this._connect = connect;
this._create = create;
this._popupMenu = popupMenu;
this._canvas = canvas;
this._rules = rules;
this._autoPlace = injector.get('autoPlace', false);
}
getContextPadEntries(element: Element) {
const actions: Record<string, any> = {};
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;

View File

@@ -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;

View File

@@ -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'];

View File

@@ -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;

View File

@@ -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;

View File

@@ -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
}
};

View File

@@ -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;
}
}
}
}

145
src/bpmn/hooks/usePanel.ts Normal file
View File

@@ -0,0 +1,145 @@
import showConfig from '../assets/showConfig';
import type { ModdleElement } from 'bpmn';
import useModelerStore from '@/store/modules/modeler';
import { MultiInstanceTypeEnum } from '@/enums/bpmn/IndexEnums';
interface Options {
element: ModdleElement;
}
export default (ops: Options) => {
const { element } = ops;
const { getModeling, getModdle } = useModelerStore();
const modeling = getModeling();
const moddle = getModdle();
/**
* 当前节点类型
*/
const elementType = computed(() => {
const bizObj = element.businessObject;
return bizObj.eventDefinitions ? bizObj.eventDefinitions[0].$type : bizObj.$type;
});
/**
* 用于控制面板字段显示与隐藏的配置
*/
const config = computed(() => showConfig[elementType.value] || {});
/**
* 创建一个节点
* @param elementType 节点类型
* @param properties 属性
* @param parent 父节点
*/
const createModdleElement = (elementType: string, properties: any, parent: ModdleElement) => {
const element = moddle.create(elementType, properties);
parent && (element.$parent = parent);
return element;
};
/**
* 获取扩展属性,如果不存在会自动创建
*/
const getExtensionElements = (create = true) => {
let extensionElements = element.businessObject.get<ModdleElement>('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
};
};

View File

@@ -0,0 +1,34 @@
import type { ModdleElement } from 'bpmn';
interface Options {
element: ModdleElement;
}
interface Data {
id: string;
}
export default (ops: Options) => {
const { element } = ops;
const parseData = <T>(): 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
};
};

496
src/bpmn/index.vue Normal file
View File

@@ -0,0 +1,496 @@
<template>
<div class="containers-bpmn">
<!-- dark模式下 连接线的箭头样式 -->
<svg width="0" height="0" style="position: absolute">
<defs>
<marker id="markerArrow-dark-mode" viewBox="0 0 20 20" refX="11" refY="10" markerWidth="10" markerHeight="10" orient="auto">
<path d="M 1 5 L 11 10 L 1 15 Z" class="arrow-dark" />
</marker>
</defs>
</svg>
<div v-loading="loading" class="app-containers-bpmn">
<el-container class="h-full">
<el-container style="align-items: stretch">
<el-header>
<div class="process-toolbar">
<el-space wrap :size="10">
<el-tooltip effect="dark" content="自适应屏幕" placement="bottom">
<el-button size="small" icon="Rank" @click="fitViewport" />
</el-tooltip>
<el-tooltip effect="dark" content="放大" placement="bottom">
<el-button size="small" icon="ZoomIn" @click="zoomViewport(true)" />
</el-tooltip>
<el-tooltip effect="dark" content="缩小" placement="bottom">
<el-button size="small" icon="ZoomOut" @click="zoomViewport(false)" />
</el-tooltip>
<el-tooltip effect="dark" content="后退" placement="bottom">
<el-button size="small" icon="Back" @click="bpmnModeler.get('commandStack').undo()" />
</el-tooltip>
<el-tooltip effect="dark" content="前进" placement="bottom">
<el-button size="small" icon="Right" @click="bpmnModeler.get('commandStack').redo()" />
</el-tooltip>
</el-space>
<el-space wrap :size="10" style="float: right; padding-right: 10px">
<el-button size="small" type="primary" @click="saveXml"> </el-button>
<el-dropdown size="small">
<el-button size="small" type="primary"> </el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="Document" @click="previewXML">XML预览</el-dropdown-item>
<el-dropdown-item icon="View" @click="previewSVG"> SVG预览</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-dropdown size="small">
<el-button size="small" type="primary"> </el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="Download" @click="downloadXML">下载XML</el-dropdown-item>
<el-dropdown-item icon="Download" @click="downloadSVG"> 下载SVG</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-space>
</div>
</el-header>
<div ref="canvas" class="canvas" />
</el-container>
<div :class="{ 'process-panel': true, 'hide': panelFlag }">
<div class="process-panel-bar" @click="panelBarClick">
<div class="open-bar">
<el-link type="default" :underline="false">
<svg-icon class-name="open-bar" :icon-class="panelFlag ? 'caret-back' : 'caret-forward'"></svg-icon>
</el-link>
</div>
</div>
<transition enter-active-class="animate__animated animate__fadeIn">
<div v-show="showPanel" v-if="bpmnModeler" class="panel-content">
<PropertyPanel :modeler="bpmnModeler" />
</div>
</transition>
</div>
</el-container>
</div>
</div>
<div>
<el-dialog v-model="perviewXMLShow" title="XML预览" width="80%" append-to-body>
<highlightjs :code="xmlStr" language="XML" />
</el-dialog>
</div>
<div>
<el-dialog v-model="perviewSVGShow" title="SVG预览" width="80%" append-to-body>
<div style="text-align: center" v-html="svgData" />
</el-dialog>
</div>
</template>
<script lang="ts" setup name="BpmnDesign">
import 'bpmn-js/dist/assets/diagram-js.css';
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css';
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
import './assets/style/index.scss';
import type { Canvas, Modeler } from 'bpmn';
import PropertyPanel from './panel/index.vue';
import BpmnModeler from 'bpmn-js/lib/Modeler.js';
import defaultXML from './assets/defaultXML';
import flowableModdle from './assets/moddle/flowable';
import Modules from './assets/module/index';
import useModelerStore from '@/store/modules/modeler';
import useDialog from '@/hooks/useDialog';
const emit = defineEmits(['closeCallBack', 'saveCallBack']);
const { visible, title, openDialog, closeDialog } = useDialog({
title: '编辑流程'
});
const modelerStore = useModelerStore();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const panelFlag = ref(false);
const showPanel = ref(true);
const canvas = ref<HTMLDivElement>();
const panel = ref<HTMLDivElement>();
const bpmnModeler = ref<Modeler>();
const zoom = ref(1);
const perviewXMLShow = ref(false);
const perviewSVGShow = ref(false);
const xmlStr = ref('');
const svgData = ref('');
const loading = ref(false);
const panelBarClick = () => {
// 延迟执行,否则会导致面板收起时,属性面板不显示
panelFlag.value = !panelFlag.value;
setTimeout(() => {
showPanel.value = !panelFlag.value;
}, 100);
};
/**
* 初始化Canvas
*/
const initCanvas = () => {
bpmnModeler.value = new BpmnModeler({
container: canvas.value,
// 键盘
keyboard: {
bindTo: window // 或者window注意与外部表单的键盘监听事件是否冲突
},
propertiesPanel: {
parent: panel.value
},
additionalModules: Modules,
moddleExtensions: {
flowable: flowableModdle
}
});
};
/**
* 初始化Model
*/
const initModel = () => {
if (modelerStore.getModeler()) {
modelerStore.getModeler().destroy();
modelerStore.setModeler(undefined);
}
modelerStore.setModeler(bpmnModeler.value);
};
/**
* 新建
*/
const newDiagram = async () => {
await proxy?.$modal.confirm('是否确认新建');
initDiagram();
};
/**
* 初始化
*/
const initDiagram = (xml?: string) => {
if (!xml) xml = defaultXML;
bpmnModeler.value.importXML(xml);
};
/**
* 自适应屏幕
*/
const fitViewport = () => {
zoom.value = bpmnModeler.value.get<Canvas>('canvas').zoom('fit-viewport');
const bbox = document.querySelector<SVGGElement>('.app-containers-bpmn .viewport').getBBox();
const currentViewBox = bpmnModeler.value.get<Canvas>('canvas').viewbox();
const elementMid = {
x: bbox.x + bbox.width / 2 - 65,
y: bbox.y + bbox.height / 2
};
bpmnModeler.value.get<Canvas>('canvas').viewbox({
x: elementMid.x - currentViewBox.width / 2,
y: elementMid.y - currentViewBox.height / 2,
width: currentViewBox.width,
height: currentViewBox.height
});
zoom.value = (bbox.width / currentViewBox.width) * 1.8;
};
/**
* 放大或者缩小
* @param zoomIn true 放大 | false 缩小
*/
const zoomViewport = (zoomIn = true) => {
zoom.value = bpmnModeler.value.get<Canvas>('canvas').zoom();
zoom.value += zoomIn ? 0.1 : -0.1;
bpmnModeler.value.get<Canvas>('canvas').zoom(zoom.value);
};
/**
* 下载XML
*/
const downloadXML = async () => {
try {
const { xml } = await bpmnModeler.value.saveXML({ format: true });
downloadFile(`${getProcessElement().name}.bpmn20.xml`, xml, 'application/xml');
} catch (e) {
proxy?.$modal.msgError(e);
}
};
/**
* 下载SVG
*/
const downloadSVG = async () => {
try {
const { svg } = await bpmnModeler.value.saveSVG();
downloadFile(getProcessElement().name, svg, 'image/svg+xml');
} catch (e) {
proxy?.$modal.msgError(e);
}
};
/**
* XML预览
*/
const previewXML = async () => {
try {
const { xml } = await bpmnModeler.value.saveXML({ format: true });
xmlStr.value = xml;
perviewXMLShow.value = true;
} catch (e) {
proxy?.$modal.msgError(e);
}
};
/**
* SVG预览
*/
const previewSVG = async () => {
try {
const { svg } = await bpmnModeler.value.saveSVG();
svgData.value = svg;
perviewSVGShow.value = true;
} catch (e) {
proxy?.$modal.msgError(e);
}
};
const curNodeInfo = reactive({
curType: '', // 任务类型 用户任务
curNode: '',
expValue: '' //多用户和部门角色实现
});
const downloadFile = (fileName: string, data: any, type: string) => {
const a = document.createElement('a');
const url = window.URL.createObjectURL(new Blob([data], { type: type }));
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};
const getProcessElement = () => {
const rootElements = bpmnModeler.value?.getDefinitions().rootElements;
for (let i = 0; i < rootElements.length; i++) {
if (rootElements[i].$type === 'bpmn:Process') return rootElements[i];
}
};
const getProcess = () => {
const element = getProcessElement();
return {
id: element.id,
name: element.name
};
};
const saveXml = async () => {
const { xml } = await bpmnModeler.value.saveXML({ format: true });
const { svg } = await bpmnModeler.value.saveSVG();
const process = getProcess();
let data = {
xml: xml,
svg: svg,
key: process.id,
name: process.name,
loading: loading
};
emit('saveCallBack', data);
};
const open = (xml?: string) => {
openDialog();
nextTick(() => {
initDiagram(xml);
});
};
const close = () => {
closeDialog();
};
onMounted(() => {
nextTick(() => {
initCanvas();
initModel();
});
});
/**
* 对外暴露子组件方法
*/
defineExpose({
initDiagram,
saveXml,
open,
close
});
</script>
<style lang="scss">
/** 夜间模式 线条的颜色 */
$stroke-color-dark: white;
$bpmn-font-size: 12px;
/** 日间模式 字体颜色 */
$bpmn-font-color-dark: white;
/** 夜间模式 字体颜色 */
$bpmn-font-color-light: #222;
/* 背景网格 */
@mixin djs-container {
background-image: linear-gradient(90deg, hsl(0deg 0% 78.4% / 15%) 10%, transparent 0), linear-gradient(hsl(0deg 0% 78.4% / 15%) 10%, transparent 0) !important;
background-size: 10px 10px !important;
}
html[class='light'] {
/** 从左侧拖动时的背景图 */
svg.new-parent {
@include djs-container;
}
/** 双击编辑元素时样式保持一致 */
div.djs-direct-editing-parent {
border-radius: 10px;
background-color: transparent !important;
color: $bpmn-font-color-light;
}
g.djs-visual {
.djs-label {
fill: $bpmn-font-color-light !important;
font-size: $bpmn-font-size !important;
}
}
}
html[class='dark'] {
/** dark模式下 连接线的箭头样式 */
.arrow-dark {
stroke-width: 1px;
stroke-linecap: round;
stroke: $stroke-color-dark;
fill: $stroke-color-dark;
stroke-linejoin: round;
}
/** 从左侧拖动时的背景图 */
svg.new-parent {
background-color: black !important;
@include djs-container;
}
/** 双击编辑元素时样式保持一致 */
div.djs-direct-editing-parent {
border-radius: 10px;
background-color: transparent !important;
color: $bpmn-font-color-dark;
}
/** 元素相关设置 */
g.djs-visual {
/** 元素边框 需要去除文字(.djs-label) */
& > *:first-child:not(.djs-label) {
stroke: $stroke-color-dark !important;
}
/** 字体颜色 */
.djs-label {
fill: $bpmn-font-color-dark !important;
font-size: $bpmn-font-size !important;
}
/* 连接线样式 */
path[data-corner-radius] {
stroke: $stroke-color-dark !important;
marker-end: url('#markerArrow-dark-mode') !important;
}
}
}
.containers-bpmn {
height: 100%;
.app-containers-bpmn {
width: 100%;
height: 100%;
.canvas {
width: 100%;
height: 100%;
@include djs-container;
}
.el-header {
height: 35px;
padding: 0;
}
.process-panel {
transition: width 0.25s ease-in;
.process-panel-bar {
width: 34px;
height: 40px;
.open-bar {
width: 34px;
line-height: 40px;
}
}
// 收起面板样式
&.hide {
width: 34px;
overflow: hidden;
padding: 0;
.process-panel-bar {
width: 34px;
height: 100%;
box-sizing: border-box;
display: block;
text-align: left;
line-height: 34px;
}
.process-panel-bar:hover {
background-color: var(--bpmn-panel-bar-background-color);
}
}
}
}
}
pre {
margin: 0;
height: 100%;
max-height: calc(80vh - 32px);
overflow-x: hidden;
overflow-y: auto;
.hljs {
word-break: break-word;
white-space: pre-wrap;
padding: 0.5em;
}
}
.open-bar {
font-size: 20px;
cursor: pointer;
text-align: center;
}
.process-panel {
box-sizing: border-box;
padding: 0 8px 0 8px;
border-left: 1px solid var(--bpmn-panel-border);
box-shadow: var(--bpmn-panel-box-shadow) 0 0 8px;
max-height: 100%;
width: 25%;
height: calc(100vh - 100px);
.el-collapse {
height: calc(100vh - 182px);
overflow: auto;
}
}
// 任务栏 透明度
//:deep(.djs-palette) {
// opacity: 0.3;
// transition: all 1s;
//}
//
//:deep(.djs-palette:hover) {
// opacity: 1;
// transition: all 1s;
//}
</style>

View File

@@ -0,0 +1,68 @@
<template>
<div>
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item prop="id" label="节点 ID">
<el-input v-model="formData.id" @change="idChange"> </el-input>
</el-form-item>
<el-form-item prop="name" label="节点名称">
<el-input v-model="formData.name" @change="nameChange"> </el-input>
</el-form-item>
</el-form>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener :element="element"></ExecutionListener>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
import useParseElement from '../hooks/useParseElement';
import usePanel from '../hooks/usePanel';
import type { Modeler, ModdleElement } from 'bpmn';
import type { GatewayPanel } from 'bpmnDesign';
import ExecutionListener from './property/ExecutionListener.vue';
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { nameChange, idChange } = usePanel({
element: toRaw(props.element)
});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const currentCollapseItem = ref(['1', '2']);
const formData = ref(parseData<GatewayPanel>());
const formRules = ref<ElFormRules>({
processCategory: [{ required: true, message: '请选择', trigger: 'blur' }],
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,68 @@
<template>
<div>
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px">
<el-form-item prop="id" label="节点 ID">
<el-input v-model="formData.id" @change="idChange"></el-input>
</el-form-item>
<el-form-item prop="name" label="节点名称">
<el-input v-model="formData.name" @change="nameChange"></el-input>
</el-form-item>
</el-form>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener :element="element"></ExecutionListener>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
import useParseElement from '../hooks/useParseElement';
import usePanel from '../hooks/usePanel';
import ExecutionListener from './property/ExecutionListener.vue';
import type { ModdleElement } from 'bpmn';
import type { ParticipantPanel } from 'bpmnDesign';
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { nameChange, idChange } = usePanel({
element: toRaw(props.element)
});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const formData = ref(parseData<ParticipantPanel>());
const currentCollapseItem = ref(['1', '2']);
const formRules = ref<ElFormRules>({
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,71 @@
<template>
<div>
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="流程标识" prop="id">
<el-input v-model="formData.id" @change="idChange"></el-input>
</el-form-item>
<el-form-item label="流程名称" prop="name">
<el-input v-model="formData.name" @change="nameChange"></el-input>
</el-form-item>
</el-form>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener :element="element"></ExecutionListener>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
import ExecutionListener from './property/ExecutionListener.vue';
import useParseElement from '../hooks/useParseElement';
import usePanel from '../hooks/usePanel';
import type { Modeler, ModdleElement } from 'bpmn';
import type { ProcessPanel } from 'bpmnDesign';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const { idChange, nameChange } = usePanel({
element: toRaw(props.element)
});
const currentCollapseItem = ref(['1', '2']);
const formData = ref<ProcessPanel>(parseData<ProcessPanel>());
const formRules = ref<ElFormRules>({
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,95 @@
<template>
<div>
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px">
<el-form-item prop="id" label="节点 ID">
<el-input v-model="formData.id" @change="idChange"> </el-input>
</el-form-item>
<el-form-item prop="name" label="节点名称">
<el-input v-model="formData.name" @change="nameChange"> </el-input>
</el-form-item>
<el-form-item prop="conditionExpression" label="跳转条件">
<el-input v-model="formData.conditionExpressionValue" @change="conditionExpressionChange"> </el-input>
</el-form-item>
<el-form-item prop="skipExpression" label="跳过表达式">
<el-input v-model="formData.skipExpression" @change="skipExpressionChange"> </el-input>
</el-form-item>
</el-form>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener :element="element"></ExecutionListener>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
import useParseElement from '../hooks/useParseElement';
import useModelerStore from '@/store/modules/modeler';
import usePanel from '../hooks/usePanel';
import ExecutionListener from './property/ExecutionListener.vue';
import type { Modeler, ModdleElement } from 'bpmn';
import type { SequenceFlowPanel } from 'bpmnDesign';
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { nameChange, idChange, updateProperties } = usePanel({
element: toRaw(props.element)
});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const moddle = useModelerStore().getModdle();
const currentCollapseItem = ref(['1', '2']);
const formData = ref(parseData<SequenceFlowPanel>());
const formRules = ref<ElFormRules>({
processCategory: [{ required: true, message: '请选择', trigger: 'blur' }],
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
const conditionExpressionChange = (val: string) => {
if (val) {
const newCondition = moddle.create('bpmn:FormalExpression', { body: val });
updateProperties({ conditionExpression: newCondition });
} else {
updateProperties({ conditionExpression: null });
}
};
const skipExpressionChange = (val: string) => {
updateProperties({ 'flowable:skipExpression': val });
};
onBeforeMount(() => {
if (formData.value.conditionExpression) {
formData.value.conditionExpressionValue = formData.value.conditionExpression.body;
}
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,67 @@
<template>
<div>
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px">
<el-form-item prop="id" label="节点 ID">
<el-input v-model="formData.id" @change="idChange"> </el-input>
</el-form-item>
<el-form-item prop="name" label="节点名称">
<el-input v-model="formData.name" @change="nameChange"> </el-input>
</el-form-item>
</el-form>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener :element="element"></ExecutionListener>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
import ExecutionListener from './property/ExecutionListener.vue';
import useParseElement from '../hooks/useParseElement';
import usePanel from '../hooks/usePanel';
import type { Modeler, ModdleElement } from 'bpmn';
import type { StartEndPanel } from 'bpmnDesign';
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { nameChange, idChange } = usePanel({
element: toRaw(props.element)
});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const formData = ref(parseData<StartEndPanel>());
const currentCollapseItem = ref(['1', '2']);
const formRules = ref<ElFormRules>({
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,193 @@
<template>
<div>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px">
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form-item prop="id" label="节点 ID">
<el-input v-model="formData.id" @change="idChange"> </el-input>
</el-form-item>
<el-form-item prop="name" label="节点名称">
<el-input v-model="formData.name" @change="nameChange"> </el-input>
</el-form-item>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener :element="element"></ExecutionListener>
</div>
</el-collapse-item>
<el-collapse-item name="3">
<template #title>
<div class="collapse__title">
<el-icon>
<HelpFilled />
</el-icon>
多实例
</div>
</template>
<div>
<el-form-item label="多实例类型">
<el-select v-model="formData.multiInstanceType" @change="multiInstanceTypeChange">
<el-option v-for="item in constant.MultiInstanceType" :key="item.id" :value="item.value" :label="item.label"> </el-option>
</el-select>
</el-form-item>
<div v-if="formData.multiInstanceType !== MultiInstanceTypeEnum.NONE">
<el-form-item label="集合">
<template #label>
<span>
集合
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
属性会作为表达式进行解析如果表达式解析为字符串而不是一个集合<br />
不论是因为本身配置的就是静态字符串值还是表达式计算结果为字符串<br />
这个字符串都会被当做变量名并从流程变量中用于获取实际的集合
</template>
</el-tooltip>
</span>
</template>
<el-input v-model="formData.collection" @change="collectionChange"></el-input>
</el-form-item>
<el-form-item label="元素变量">
<template #label>
<span>
元素变量
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
每创建一个用户任务前先以该元素变量为label集合中的一项为value<br />
创建局部流程变量该局部流程变量被用于指派用户任务<br />
一般来说该字符串应与指定人员变量相同
</template>
</el-tooltip>
</span>
</template>
<el-input v-model="formData.elementVariable" @change="elementVariableChange"> </el-input>
</el-form-item>
<el-form-item label="完成条件">
<template #label>
<span>
完成条件
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
多实例活动在所有实例都完成时结束然而也可以指定一个表达式在每个实例<br />
结束时进行计算当表达式计算为true时将销毁所有剩余的实例并结束多实例<br />
活动继续执行流程例如 ${nrOfCompletedInstances/nrOfInstances >= 0.6 }<br />
表示当任务完成60%该节点就算完成
</template>
</el-tooltip>
</span>
</template>
<el-input v-model="formData.completionCondition" @change="completionConditionChange"> </el-input>
</el-form-item>
</div>
</div>
</el-collapse-item>
</el-collapse>
</el-form>
</div>
</template>
<script setup lang="ts">
import ExecutionListener from './property/ExecutionListener.vue';
import useParseElement from '../hooks/useParseElement';
import usePanel from '../hooks/usePanel';
import type { ModdleElement } from 'bpmn';
import type { SubProcessPanel } from 'bpmnDesign';
import { MultiInstanceTypeEnum } from '@/enums/bpmn/IndexEnums';
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { nameChange, idChange, updateProperties, createModdleElement, constant } = usePanel({
element: toRaw(props.element)
});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const formData = ref(parseData<SubProcessPanel>());
const currentCollapseItem = ref(['1', '2', '3']);
const multiInstanceTypeChange = (newVal) => {
if (newVal !== MultiInstanceTypeEnum.NONE) {
let loopCharacteristics = props.element.businessObject.get('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
loopCharacteristics.isSequential = newVal === MultiInstanceTypeEnum.SERIAL;
updateProperties({ loopCharacteristics: loopCharacteristics });
} else {
updateProperties({ loopCharacteristics: undefined });
}
};
const collectionChange = (newVal) => {
let loopCharacteristics = props.element.businessObject.get('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
loopCharacteristics.collection = newVal && newVal.length > 0 ? newVal : undefined;
updateProperties({ loopCharacteristics: loopCharacteristics });
};
const elementVariableChange = (newVal) => {
let loopCharacteristics = props.element.businessObject.get('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
loopCharacteristics.elementVariable = newVal && newVal.length > 0 ? newVal : undefined;
updateProperties({ loopCharacteristics: loopCharacteristics });
};
const completionConditionChange = (newVal) => {
let loopCharacteristics = props.element.businessObject.get<ModdleElement>('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
if (newVal && newVal.length > 0) {
if (!loopCharacteristics.completionCondition) {
loopCharacteristics.completionCondition = createModdleElement('bpmn:Expression', { body: newVal }, loopCharacteristics);
} else {
loopCharacteristics.completionCondition.body = newVal;
}
} else {
loopCharacteristics.completionCondition = undefined;
}
updateProperties({ loopCharacteristics: loopCharacteristics });
};
onBeforeMount(() => {
if (formData.value.loopCharacteristics) {
const loopCharacteristics = formData.value.loopCharacteristics;
formData.value.collection = loopCharacteristics.collection || '';
formData.value.elementVariable = loopCharacteristics.elementVariable || '';
formData.value.completionCondition = loopCharacteristics.completionCondition?.body || '';
formData.value.multiInstanceType = loopCharacteristics.isSequential ? MultiInstanceTypeEnum.SERIAL : MultiInstanceTypeEnum.PARALLEL;
}
});
const formRules = ref<ElFormRules>({
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,491 @@
<template>
<div>
<el-form ref="formRef" size="default" :model="formData" :rules="formRules" label-width="100px">
<el-collapse v-model="currentCollapseItem">
<el-collapse-item name="1">
<template #title>
<div class="collapse__title">
<el-icon>
<InfoFilled />
</el-icon>
常规
</div>
</template>
<div>
<el-form-item prop="id" label="节点 ID">
<el-input v-model="formData.id" @change="idChange"> </el-input>
</el-form-item>
<el-form-item prop="name" label="节点名称">
<el-input v-model="formData.name" @change="nameChange"> </el-input>
</el-form-item>
<el-form-item v-if="showConfig.skipExpression" prop="skipExpression" label="跳过表达式">
<el-input v-model="formData.skipExpression" @change="skipExpressionChange"> </el-input>
</el-form-item>
<el-form-item v-loading="formManageListLoading" prop="formKey" label="表单地址">
<el-select v-model="formData.formKey" clearable filterable placeholder="请选择表单" style="width: 260px" @change="formKeyChange">
<el-option
v-for="item in formManageList"
:key="item.id"
:label="item.formTypeName + ':' + item.formName"
:value="item.formType + ':' + item.id"
/>
</el-select>
</el-form-item>
</div>
</el-collapse-item>
<el-collapse-item name="2">
<template #title>
<div class="collapse__title">
<el-icon>
<Checked />
</el-icon>
任务
</div>
</template>
<div>
<el-form-item v-if="showConfig.async" prop="sync" label="是否异步">
<el-switch v-model="formData.async" inline-prompt active-text="是" inactive-text="否" @change="syncChange" />
</el-form-item>
<el-tabs tab-position="left" class="demo-tabs">
<el-tab-pane label="身份存储">
<el-form-item label="分配人员">
<el-input v-model="formData.assignee" @blur="blurAssignee(formData.assignee)">
<template #append>
<el-button icon="Search" type="primary" @click="openSingleUserSelect" />
</template>
</el-input>
</el-form-item>
<el-form-item label="候选人员">
<el-badge :value="selectUserLength" :max="99">
<el-button size="small" type="primary" @click="openUserSelect">选择人员</el-button>
</el-badge>
</el-form-item>
<el-form-item label="候选组">
<el-badge :value="selectRoleLength" :max="99">
<el-button size="small" type="primary" @click="openRoleSelect">选择组</el-button>
</el-badge>
</el-form-item>
</el-tab-pane>
<!-- <el-tab-pane label="固定值">
<el-form-item prop="auditUserType" label="分配类型">
<el-select v-model="formData.allocationType">
<el-option v-for="item in AllocationTypeSelect" :key="item.id" :value="item.value" :label="item.label"> </el-option>
</el-select>
</el-form-item>
<el-form-item v-if="formData.allocationType === AllocationTypeEnum.USER" label="分配人员">
<el-input v-model="formData.assignee">
<template #append>
<el-button icon="Search" type="primary" @click="openSingleUserSelect" />
</template>
</el-input>
</el-form-item>
<div v-if="formData.allocationType === AllocationTypeEnum.CANDIDATE">
<el-form-item label="候选人员">
<el-badge :value="selectUserLength" :max="99">
<el-button size="small" type="primary" @click="openUserSelect">选择人员</el-button>
</el-badge>
</el-form-item>
<el-form-item label="候选组">
<el-badge :value="selectRoleLength" :max="99">
<el-button size="small" type="primary" @click="openRoleSelect">选择组</el-button>
</el-badge>
</el-form-item>
</div>
<el-form-item v-if="formData.allocationType === AllocationTypeEnum.SPECIFY && showConfig.specifyDesc" style="">
<el-radio-group v-model="formData.specifyDesc" class="ml-4">
<el-radio v-for="item in SpecifyDesc" :key="item.id" :value="item.value" size="large">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-tab-pane> -->
</el-tabs>
<el-form-item v-if="showConfig.dueDate" prop="dueDate" label="到期时间">
<el-input v-model="formData.dueDate" clearable @change="dueDateChange" @click="openDueDate">
<template #append>
<el-button icon="Search" type="primary" @click="openDueDate" />
</template>
</el-input>
</el-form-item>
<el-form-item v-if="showConfig.priority" prop="priority" label="优先级">
<el-input-number v-model="formData.priority" :min="0" @change="priorityChange"> </el-input-number>
</el-form-item>
</div>
</el-collapse-item>
<el-collapse-item name="3">
<template #title>
<div class="collapse__title">
<el-icon>
<HelpFilled />
</el-icon>
多实例
</div>
</template>
<div>
<el-form-item label="多实例类型">
<el-select v-model="formData.multiInstanceType" @change="multiInstanceTypeChange">
<el-option v-for="item in constant.MultiInstanceType" :key="item.id" :value="item.value" :label="item.label"> </el-option>
</el-select>
</el-form-item>
<div v-if="formData.multiInstanceType !== MultiInstanceTypeEnum.NONE">
<el-form-item label="集合">
<template #label>
<span>
集合
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
属性会作为表达式进行解析如果表达式解析为字符串而不是一个集合<br />
不论是因为本身配置的就是静态字符串值还是表达式计算结果为字符串<br />
这个字符串都会被当做变量名并从流程变量中用于获取实际的集合
</template>
</el-tooltip>
</span>
</template>
<el-input v-model="formData.collection" @change="collectionChange"></el-input>
</el-form-item>
<el-form-item label="元素变量">
<template #label>
<span>
元素变量
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
每创建一个用户任务前先以该元素变量为label集合中的一项为value<br />
创建局部流程变量该局部流程变量被用于指派用户任务<br />
一般来说该字符串应与指定人员变量相同
</template>
</el-tooltip>
</span>
</template>
<el-input v-model="formData.elementVariable" @change="elementVariableChange"> </el-input>
</el-form-item>
<el-form-item label="完成条件">
<template #label>
<span>
完成条件
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
多实例活动在所有实例都完成时结束然而也可以指定一个表达式在每个实例<br />
结束时进行计算当表达式计算为true时将销毁所有剩余的实例并结束多实例<br />
活动继续执行流程例如 ${nrOfCompletedInstances/nrOfInstances >= 0.6 }<br />
表示当任务完成60%该节点就算完成
</template>
</el-tooltip>
</span>
</template>
<el-input v-model="formData.completionCondition" @change="completionConditionChange"> </el-input>
</el-form-item>
</div>
</div>
</el-collapse-item>
<el-collapse-item v-if="showConfig.taskListener" name="4">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
任务监听器
</div>
</template>
<div>
<TaskListener v-if="showConfig.taskListener" :element="element"></TaskListener>
</div>
</el-collapse-item>
<el-collapse-item v-if="showConfig.executionListener" name="5">
<template #title>
<div class="collapse__title">
<el-icon>
<BellFilled />
</el-icon>
执行监听器
</div>
</template>
<div>
<ExecutionListener v-if="showConfig.executionListener" :element="element"></ExecutionListener>
</div>
</el-collapse-item>
<el-form-item v-if="showConfig.isForCompensation" prop="isForCompensation" label="是否为补偿">
<el-switch v-model="formData.isForCompensation" inline-prompt active-text="是" inactive-text="否" />
</el-form-item>
<el-form-item v-if="showConfig.triggerServiceTask" prop="triggerServiceTask" label="服务任务可触发">
<el-switch v-model="formData.triggerServiceTask" inline-prompt active-text="是" inactive-text="否" />
</el-form-item>
<el-form-item v-if="showConfig.autoStoreVariables" prop="autoStoreVariables" label="自动存储变量">
<el-switch v-model="formData.autoStoreVariables" inline-prompt active-text="是" inactive-text="否" />
</el-form-item>
<el-form-item v-if="showConfig.ruleVariablesInput" prop="skipExpression" label="输入变量">
<el-input v-model="formData.ruleVariablesInput"> </el-input>
</el-form-item>
<el-form-item v-if="showConfig.exclude" prop="exclude" label="排除">
<el-switch v-model="formData.exclude" inline-prompt active-text="是" inactive-text="否" />
</el-form-item>
<el-form-item v-if="showConfig.class" prop="class" label="类">
<el-input v-model="formData.class"> </el-input>
</el-form-item>
</el-collapse>
</el-form>
<UserSelect ref="userSelectRef" :data="formData.candidateUsers" @confirm-call-back="userSelectCallBack"></UserSelect>
<UserSelect ref="singleUserSelectRef" :data="formData.assignee" :multiple="false" @confirm-call-back="singleUserSelectCallBack"></UserSelect>
<RoleSelect ref="roleSelectRef" :data="formData.candidateGroups" @confirm-call-back="roleSelectCallBack"></RoleSelect>
<DueDate ref="dueDateRef" v-model="formData.dueDate" :data="formData.dueDate" @confirm-call-back="dueDateCallBack"></DueDate>
</div>
</template>
<script setup lang="ts">
import useParseElement from '../hooks/useParseElement';
import usePanel from '../hooks/usePanel';
import UserSelect from '@/components/UserSelect';
import RoleSelect from '@/components/RoleSelect';
import ExecutionListener from './property/ExecutionListener.vue';
import TaskListener from './property/TaskListener.vue';
import DueDate from './property/DueDate.vue';
import type { ModdleElement } from 'bpmn';
import type { TaskPanel } from 'bpmnDesign';
import { AllocationTypeEnum, MultiInstanceTypeEnum, SpecifyDescEnum } from '@/enums/bpmn/IndexEnums';
import { UserVO } from '@/api/system/user/types';
import { RoleVO } from '@/api/system/role/types';
import { selectListFormManage } from '@/api/workflow/formManage';
import { FormManageVO } from '@/api/workflow/formManage/types';
const formManageList = ref<FormManageVO[]>([]);
const formManageListLoading = ref(false);
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { showConfig, nameChange, formKeyChange, idChange, updateProperties, getExtensionElements, createModdleElement, constant } = usePanel({
element: toRaw(props.element)
});
const { parseData } = useParseElement({
element: toRaw(props.element)
});
const initFormData = {
id: '',
name: '',
dueDate: '',
multiInstanceType: MultiInstanceTypeEnum.NONE,
allocationType: AllocationTypeEnum.USER,
specifyDesc: SpecifyDescEnum.SPECIFY_SINGLE
};
const formData = ref({ ...initFormData, ...parseData<TaskPanel>() });
const assignee = ref<Partial<UserVO>>({
userName: ''
});
const currentCollapseItem = ref(['1', '2']);
const userSelectRef = ref<InstanceType<typeof UserSelect>>();
const singleUserSelectRef = ref<InstanceType<typeof UserSelect>>();
const roleSelectRef = ref<InstanceType<typeof RoleSelect>>();
const dueDateRef = ref<InstanceType<typeof DueDate>>();
const openUserSelect = () => {
userSelectRef.value.open();
};
const openSingleUserSelect = () => {
if (formData.value.assignee?.includes('$')) {
formData.value.assignee = '';
}
singleUserSelectRef.value.open();
};
const openRoleSelect = () => {
roleSelectRef.value.open();
};
const openDueDate = (e) => {
dueDateRef.value.openDialog();
};
const blurAssignee = (assignee) => {
updateProperties({ 'flowable:assignee': assignee ? assignee : undefined });
};
const singleUserSelectCallBack = (data: UserVO[]) => {
const user: UserVO = data.length !== 0 ? data[0] : undefined;
updateProperties({ 'flowable:assignee': user?.userId });
assignee.value = user ? user : { userName: '' };
formData.value.assignee = String(user?.userId);
let extensionElements = getExtensionElements();
extensionElements.values = extensionElements.get('values').filter((item) => item.$type !== 'flowable:extAssignee');
if (user) {
const extAssigneeElement = createModdleElement('flowable:extAssignee', { body: '' }, extensionElements);
extensionElements.get('values').push(extAssigneeElement);
extAssigneeElement.body = JSON.stringify({ userName: user.userName, userId: user.userId });
}
if (extensionElements.values.length === 0) {
extensionElements = undefined;
}
updateProperties({ extensionElements: extensionElements });
};
const userSelectCallBack = (data: UserVO[]) => {
let extensionElements = getExtensionElements();
extensionElements.values = extensionElements.values.filter((item) => item.$type !== 'flowable:extCandidateUsers');
if (data.length === 0) {
formData.value.candidateUsers = undefined;
updateProperties({ 'flowable:candidateUsers': undefined });
} else {
const userIds = data.map((item) => item.userId).join(',');
formData.value.candidateUsers = userIds;
updateProperties({ 'flowable:candidateUsers': userIds });
const extCandidateUsersElement = createModdleElement('flowable:extCandidateUsers', { body: '' }, extensionElements);
extensionElements.values.push(extCandidateUsersElement);
const users = data.map((item) => {
return {
userId: item.userId,
userName: item.userName
};
});
extCandidateUsersElement.body = JSON.stringify(users);
}
if (extensionElements.values.length === 0) {
extensionElements = undefined;
}
updateProperties({ extensionElements: extensionElements });
};
const roleSelectCallBack = (data: RoleVO[]) => {
if (data.length === 0) {
formData.value.candidateGroups = '';
updateProperties({ 'flowable:candidateGroups': undefined });
} else {
const roleIds = data.map((item) => item.roleId).join(',');
formData.value.candidateGroups = roleIds;
updateProperties({ 'flowable:candidateGroups': roleIds });
}
};
const dueDateCallBack = (data: string) => {
updateProperties({ 'flowable:dueDate': data });
};
const taskTabClick = (e) => {
formData.value.candidateGroups = '';
formData.value.candidateUsers = '';
formData.value.assignee = '';
// formData.value.fixedAssignee = '';
assignee.value = {};
};
const syncChange = (newVal) => {
updateProperties({ 'flowable:async': newVal });
};
const skipExpressionChange = (newVal) => {
updateProperties({ 'flowable:skipExpression': newVal && newVal.length > 0 ? newVal : undefined });
};
const priorityChange = (newVal) => {
updateProperties({ 'flowable:priority': newVal });
};
const fixedAssigneeChange = (newVal) => {
updateProperties({ 'flowable:assignee': newVal && newVal.length > 0 ? newVal : undefined });
};
const multiInstanceTypeChange = (newVal) => {
if (newVal !== MultiInstanceTypeEnum.NONE) {
let loopCharacteristics = props.element.businessObject.get('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
loopCharacteristics.isSequential = newVal === MultiInstanceTypeEnum.SERIAL;
updateProperties({ loopCharacteristics: loopCharacteristics });
} else {
updateProperties({ loopCharacteristics: undefined });
}
};
const collectionChange = (newVal) => {
let loopCharacteristics = props.element.businessObject.get('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
loopCharacteristics.collection = newVal && newVal.length > 0 ? newVal : undefined;
updateProperties({ loopCharacteristics: loopCharacteristics });
};
const elementVariableChange = (newVal) => {
let loopCharacteristics = props.element.businessObject.get('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
loopCharacteristics.elementVariable = newVal && newVal.length > 0 ? newVal : undefined;
updateProperties({ loopCharacteristics: loopCharacteristics });
};
const completionConditionChange = (newVal) => {
let loopCharacteristics = props.element.businessObject.get<ModdleElement>('loopCharacteristics');
if (!loopCharacteristics) {
loopCharacteristics = createModdleElement('bpmn:MultiInstanceLoopCharacteristics', {}, props.element.businessObject);
}
if (newVal && newVal.length > 0) {
if (!loopCharacteristics.completionCondition) {
loopCharacteristics.completionCondition = createModdleElement('bpmn:Expression', { body: newVal }, loopCharacteristics);
} else {
loopCharacteristics.completionCondition.body = newVal;
}
} else {
loopCharacteristics.completionCondition = undefined;
}
updateProperties({ loopCharacteristics: loopCharacteristics });
};
const dueDateChange = (newVal) => {
updateProperties({ 'flowable:dueDate': newVal && newVal.length > 0 ? newVal : undefined });
};
const selectUserLength = computed(() => {
if (formData.value.candidateUsers) {
return formData.value.candidateUsers.split(',').length;
} else {
return 0;
}
});
const selectRoleLength = computed(() => {
if (formData.value.candidateGroups) {
return formData.value.candidateGroups.split(',').length;
} else {
return 0;
}
});
onBeforeMount(() => {
const extensionElements = getExtensionElements(false);
if (extensionElements && extensionElements.get('values')) {
let extAssigneeElement = extensionElements.get('values').find((item) => item.$type === 'flowable:extAssignee');
if (extAssigneeElement) {
assignee.value = JSON.parse(extAssigneeElement.body);
}
}
if (formData.value.loopCharacteristics) {
const loopCharacteristics = formData.value.loopCharacteristics;
formData.value.collection = loopCharacteristics.collection || '';
formData.value.elementVariable = loopCharacteristics.elementVariable || '';
formData.value.completionCondition = loopCharacteristics.completionCondition?.body || '';
formData.value.multiInstanceType = loopCharacteristics.isSequential ? MultiInstanceTypeEnum.SERIAL : MultiInstanceTypeEnum.PARALLEL;
}
if (formData.value.assignee) {
formData.value.fixedAssignee = formData.value.assignee;
}
});
const formRules = ref<ElFormRules>({
id: [{ required: true, message: '请输入', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }]
});
const AllocationTypeSelect = [
{ id: 'b9cdf970-dd91-47c0-819f-42a7010ca2a6', label: '指定人员', value: AllocationTypeEnum.USER },
{ id: '3f7ccbcd-c464-4602-bb9d-e96649d10585', label: '候选人员', value: AllocationTypeEnum.CANDIDATE },
{ id: 'c49065e0-7f2d-4c09-aedb-ab2d47d9a454', label: '发起人自己', value: AllocationTypeEnum.YOURSELF },
{ id: '6ef40a03-7e9a-4898-89b2-c88fe9064542', label: '发起人指定', value: AllocationTypeEnum.SPECIFY }
];
const SpecifyDesc = [
{ id: 'fa253b34-4335-458c-b1bc-b039e2a2b7a6', label: '指定一个人', value: 'specifySingle' },
{ id: '7365ff54-2e05-4312-9bfb-0b8edd779c5b', label: '指定多个人', value: 'specifyMultiple' }
];
const listFormManage = async () => {
formManageListLoading.value = true;
const res = await selectListFormManage();
formManageList.value = res.data;
formManageListLoading.value = false;
};
onMounted(() => {
nextTick(() => {
listFormManage();
});
});
</script>
<style lang="scss" scoped></style>

110
src/bpmn/panel/index.vue Normal file
View File

@@ -0,0 +1,110 @@
<template>
<div ref="propertyPanel">
<div v-if="nodeName" class="node-name">{{ nodeName }}</div>
<component :is="component" v-if="element" :element="element" />
</div>
</template>
<script setup lang="ts" name="PropertyPanel">
import { NodeName } from '../assets/lang/zh';
import TaskPanel from './TaskPanel.vue';
import ProcessPanel from './ProcessPanel.vue';
import StartEndPanel from './StartEndPanel.vue';
import GatewayPanel from './GatewayPanel.vue';
import SequenceFlowPanel from './SequenceFlowPanel.vue';
import ParticipantPanel from './ParticipantPanel.vue';
import SubProcessPanel from './SubProcessPanel.vue';
import type { Modeler, ModdleElement } from 'bpmn';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
interface propsType {
modeler: Modeler;
}
const props = withDefaults(defineProps<propsType>(), {});
const element = ref<ModdleElement>();
const processElement = ref<ModdleElement>();
const startEndType = ['bpmn:IntermediateThrowEvent', 'bpmn:StartEvent', 'bpmn:EndEvent'];
const taskType = [
'bpmn:UserTask',
'bpmn:Task',
'bpmn:SendTask',
'bpmn:ReceiveTask',
'bpmn:ManualTask',
'bpmn:BusinessRuleTask',
'bpmn:ServiceTask',
'bpmn:ScriptTask'
];
const sequenceType = ['bpmn:SequenceFlow'];
const gatewayType = ['bpmn:InclusiveGateway', 'bpmn:ExclusiveGateway', 'bpmn:ParallelGateway', 'bpmn:EventBasedGateway', 'bpmn:ComplexGateway'];
const processType = ['bpmn:Process'];
// 组件计算
const component = computed(() => {
if (!element.value) return null;
const type = element.value.type;
if (startEndType.includes(type)) return StartEndPanel;
if (taskType.includes(type)) return TaskPanel;
if (sequenceType.includes(type)) return SequenceFlowPanel;
if (gatewayType.includes(type)) return GatewayPanel;
if (processType.includes(type)) return ProcessPanel;
if (type === 'bpmn:Participant') return ParticipantPanel;
if (type === 'bpmn:SubProcess') return SubProcessPanel;
//return proxy?.$modal.msgWarning('面板开发中....');
return undefined;
});
const nodeName = computed(() => {
if (element.value) {
const bizObj = element.value.businessObject;
const type = bizObj?.eventDefinitions && bizObj?.eventDefinitions.length > 0 ? bizObj.eventDefinitions[0].$type : bizObj.$type;
return NodeName[type] || type;
}
return '';
});
const handleModeler = () => {
props.modeler.on('root.added', (e: any) => {
element.value = null;
if (e.element.type === 'bpmn:Process') {
nextTick(() => {
element.value = e.element;
processElement.value = e.element;
});
}
});
props.modeler.on('element.click', (e: any) => {
if (e.element.type === 'bpmn:Process') {
nextTick(() => {
element.value = e.element;
processElement.value = e.element;
});
}
});
props.modeler.on('selection.changed', (e: any) => {
// 先给null为了让vue刷新
element.value = null;
const newElement = e.newSelection[0];
if (newElement) {
nextTick(() => {
element.value = newElement;
});
} else {
nextTick(() => {
element.value = processElement.value;
});
}
});
};
onMounted(() => {
handleModeler();
});
</script>
<style scoped lang="scss">
.node-name {
font-size: 16px;
font-weight: bold;
padding: 10px;
}
</style>

View File

@@ -0,0 +1,252 @@
<template>
<div>
<el-dialog v-model="visible" :title="title" width="600px" append-to-body>
<el-form label-width="100px">
<el-form-item label="小时">
<el-radio-group v-model="hourValue" @change="hourChange">
<el-radio-button label="4" value="4" />
<el-radio-button label="8" value="8" />
<el-radio-button label="12" value="12" />
<el-radio-button label="24" value="24" />
<el-radio-button label="自定义" value="自定义" />
<el-input-number v-show="hourValue === '自定义'" v-model="customHourValue" :min="1" @change="customHourValueChange"></el-input-number>
</el-radio-group>
</el-form-item>
<el-form-item label="天">
<el-radio-group v-model="dayValue" @change="dayChange">
<el-radio-button label="1" value="1" />
<el-radio-button label="2" value="2" />
<el-radio-button label="3" value="3" />
<el-radio-button label="4" value="4" />
<el-radio-button label="自定义" value="自定义" />
<el-input-number v-show="dayValue === '自定义'" v-model="customDayValue" :min="1" @change="customDayValueChange"></el-input-number>
</el-radio-group>
</el-form-item>
<el-form-item label="周">
<el-radio-group v-model="weekValue" @change="weekChange">
<el-radio-button label="1" value="1" />
<el-radio-button label="2" value="2" />
<el-radio-button label="3" value="3" />
<el-radio-button label="4" value="4" />
<el-radio-button label="自定义" value="自定义" />
<el-input-number v-show="weekValue === '自定义'" v-model="customWeekValue" :min="1" @change="customWeekValueChange"></el-input-number>
</el-radio-group>
</el-form-item>
<el-form-item label="月">
<el-radio-group v-model="monthValue" @change="monthChange">
<el-radio-button label="1" value="1" />
<el-radio-button label="2" value="2" />
<el-radio-button label="3" value="3" />
<el-radio-button label="4" value="4" />
<el-radio-button label="自定义" value="自定义" />
<el-input-number v-show="monthValue === '自定义'" v-model="customMonthValue" :min="1" @change="customMonthValueChange"></el-input-number>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<div>
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="confirm">确定</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import useDialog from '@/hooks/useDialog';
interface PropType {
modelValue?: string;
data?: string;
}
const prop = withDefaults(defineProps<PropType>(), {
modelValue: '',
data: ''
});
const emit = defineEmits(['update:modelValue', 'confirmCallBack']);
const { title, visible, openDialog, closeDialog } = useDialog({
title: '设置任务到期时间'
});
const formValue = ref();
const valueType = ref();
const hourValue = ref('');
const dayValue = ref('');
const weekValue = ref('');
const monthValue = ref('');
const customHourValue = ref(1);
const customDayValue = ref(1);
const customWeekValue = ref(1);
const customMonthValue = ref(1);
const hourValueConst = ['4', '8', '12', '24'];
const dayAndWeekAndMonthValueConst = ['1', '2', '3', '4'];
const initValue = () => {
formValue.value = prop.data;
if (prop.data) {
const lastStr = prop.data.substring(prop.data.length - 1);
if (lastStr === 'H') {
const hourValueValue = prop.data.substring(2, prop.data.length - 1);
if (hourValueConst.includes(hourValueValue)) {
hourValue.value = hourValueValue;
} else {
hourValue.value = '自定义';
customHourValue.value = Number(hourValueValue);
}
}
const dayAndWeekAndMonthValue = prop.data.substring(1, prop.data.length - 1);
if (lastStr === 'D') {
if (dayAndWeekAndMonthValueConst.includes(dayAndWeekAndMonthValue)) {
dayValue.value = dayAndWeekAndMonthValue;
} else {
dayValue.value = '自定义';
customDayValue.value = Number(dayAndWeekAndMonthValue);
}
}
if (lastStr === 'W') {
if (dayAndWeekAndMonthValueConst.includes(dayAndWeekAndMonthValue)) {
weekValue.value = dayAndWeekAndMonthValue;
} else {
weekValue.value = '自定义';
customWeekValue.value = Number(dayAndWeekAndMonthValue);
}
}
if (lastStr === 'M') {
if (dayAndWeekAndMonthValueConst.includes(dayAndWeekAndMonthValue)) {
monthValue.value = dayAndWeekAndMonthValue;
} else {
monthValue.value = '自定义';
customMonthValue.value = Number(dayAndWeekAndMonthValue);
}
}
}
};
const confirm = () => {
emit('update:modelValue', formValue.value);
emit('confirmCallBack', formValue.value);
closeDialog();
};
const customHourValueChange = (customHourValue) => {
formValue.value = `PT${customHourValue}H`;
dayValue.value = '';
weekValue.value = '';
monthValue.value = '';
customDayValue.value = 1;
customWeekValue.value = 1;
customMonthValue.value = 1;
};
const customDayValueChange = (customDayValue) => {
formValue.value = `P${customDayValue}D`;
hourValue.value = '';
weekValue.value = '';
monthValue.value = '';
customHourValue.value = 1;
customWeekValue.value = 1;
customMonthValue.value = 1;
};
const customWeekValueChange = (customWeekValue) => {
formValue.value = `P${customWeekValue}W`;
hourValue.value = '';
dayValue.value = '';
monthValue.value = '';
customHourValue.value = 1;
customDayValue.value = 1;
customMonthValue.value = 1;
};
const customMonthValueChange = (customMonthValue) => {
formValue.value = `P${customMonthValue}M`;
hourValue.value = '';
dayValue.value = '';
weekValue.value = '';
customHourValue.value = 1;
customDayValue.value = 1;
customWeekValue.value = 1;
};
const hourChange = (hourValue) => {
if (hourValue === '自定义') {
formValue.value = `PT${customHourValue.value}H`;
} else {
formValue.value = `PT${hourValue}H`;
}
dayValue.value = '';
weekValue.value = '';
monthValue.value = '';
customDayValue.value = 1;
customWeekValue.value = 1;
customMonthValue.value = 1;
};
const dayChange = (dayValue) => {
if (dayValue === '自定义') {
formValue.value = `P${customDayValue.value}D`;
} else {
formValue.value = `P${dayValue}D`;
}
hourValue.value = '';
weekValue.value = '';
monthValue.value = '';
customHourValue.value = 1;
customWeekValue.value = 1;
customMonthValue.value = 1;
};
const weekChange = (weekValue) => {
if (weekValue === '自定义') {
formValue.value = `P${customWeekValue.value}W`;
} else {
formValue.value = `P${weekValue}W`;
}
hourValue.value = '';
dayValue.value = '';
monthValue.value = '';
customHourValue.value = 1;
customDayValue.value = 1;
customMonthValue.value = 1;
};
const monthChange = (monthValue) => {
if (monthValue === '自定义') {
formValue.value = `P${customMonthValue.value}M`;
} else {
formValue.value = `P${monthValue}M`;
}
hourValue.value = '';
dayValue.value = '';
weekValue.value = '';
customHourValue.value = 1;
customDayValue.value = 1;
customWeekValue.value = 1;
};
watch(
() => visible.value,
() => {
if (visible.value) {
initValue();
}
}
);
defineExpose({
openDialog,
closeDialog
});
</script>

View File

@@ -0,0 +1,308 @@
<template>
<div>
<vxe-toolbar>
<template #buttons>
<el-button type="primary" link size="small" @click="insertEvent">新增</el-button>
<el-button type="primary" link size="small" @click="removeSelectRowEvent">删除</el-button>
</template>
</vxe-toolbar>
<vxe-table
ref="tableRef"
size="mini"
height="100px"
border
show-overflow
keep-source
:data="tableData"
:menu-config="menuConfig"
@cell-dblclick="cellDBLClickEvent"
@menu-click="contextMenuClickEvent"
>
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column type="seq" width="40"></vxe-column>
<vxe-column field="event" title="事件" min-width="100px">
<template #default="slotParams">
<span>{{ eventSelect.find((e) => e.value === slotParams.row.event)?.label }}</span>
</template>
</vxe-column>
<vxe-column field="type" title="类型" min-width="100px">
<template #default="slotParams">
<span>{{ typeSelect.find((e) => e.value === slotParams.row.type)?.label }}</span>
</template>
</vxe-column>
<vxe-column field="className" title="Java 类名" min-width="100px"> </vxe-column>
</vxe-table>
<el-dialog
v-model="formDialog.visible.value"
:title="formDialog.title.value"
width="600px"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
append-to-body
>
<el-form ref="formRef" :model="formData" :rules="tableRules" label-width="100px">
<el-form-item label="事件" prop="event">
<el-select v-model="formData.event">
<el-option v-for="item in eventSelect" :key="item.id" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="类型" prop="type">
<template #label>
<span>
类型
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
示例 com.company.MyCustomListener自定义类必须实现 org.flowable.engine.delegate.TaskListener 接口<br />
表达式示例 ${myObject.callMethod(task, task.eventName)}<br />
委托表达式示例 ${myListenerSpringBean} springBean 需要实现 org.flowable.engine.delegate.TaskListener 接口
</template>
</el-tooltip>
</span>
</template>
<el-select v-model="formData.type">
<el-option v-for="item in typeSelect" :key="item.id" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item
:label="typeSelect.filter((e) => e.value === formData.type)[0] ? typeSelect.filter((e) => e.value === formData.type)[0]?.label : '表达式'"
prop="className"
>
<el-input v-model="formData.className" type="text"></el-input>
</el-form-item>
</el-form>
<el-tabs type="border-card">
<el-tab-pane label="参数">
<ListenerParam ref="listenerParamRef" :table-data="formData.params" />
</el-tab-pane>
</el-tabs>
<template #footer>
<div class="dialog-footer">
<el-button @click="formDialog.closeDialog"> </el-button>
<el-button type="primary" @click="submitEvent"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import ListenerParam from './ListenerParam.vue';
import { VxeTableEvents, VxeTableInstance, VxeTablePropTypes } from 'vxe-table';
import type { ExecutionListenerVO } from 'bpmnDesign';
import type { Moddle, Modeler, ModdleElement } from 'bpmn';
import usePanel from '../../hooks/usePanel';
import useDialog from '@/hooks/useDialog';
import useModelerStore from '@/store/modules/modeler';
const emit = defineEmits(['close']);
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const selectRow = ref<ExecutionListenerVO | null>();
const formDialog = useDialog({
title: selectRow.value ? '编辑&保存' : '新增&保存'
});
const { showConfig, elementType, updateProperties } = usePanel({
element: toRaw(props.element)
});
const { getModdle } = useModelerStore();
const moddle = getModdle();
const listenerParamRef = ref<InstanceType<typeof ListenerParam>>();
const tableRef = ref<VxeTableInstance<ExecutionListenerVO>>();
const formRef = ref<ElFormInstance>();
const initData: ExecutionListenerVO = {
event: '',
type: '',
className: '',
params: []
};
const formData = ref<ExecutionListenerVO>({ ...initData });
const tableData = ref<ExecutionListenerVO[]>([]);
const tableRules = ref<ElFormRules>({
event: [{ required: true, message: '请选择', trigger: 'blur' }],
type: [{ required: true, message: '请选择', trigger: 'blur' }],
className: [{ required: true, message: '请输入', trigger: 'blur' }]
});
const submitEvent = async () => {
const error = await listenerParamRef.value.validate();
await formRef.value.validate((validate) => {
if (validate && !error) {
const $table = tableRef.value;
if ($table) {
formData.value.params = listenerParamRef.value.getTableData();
if (selectRow.value) {
Object.assign(selectRow.value, formData.value);
} else {
$table.insertAt({ ...formData.value }, -1);
}
updateElement();
formDialog.closeDialog();
}
}
});
};
const removeSelectRowEvent = async () => {
const $table = tableRef.value;
if ($table) {
const selectCount = $table.getCheckboxRecords().length;
if (selectCount === 0) {
proxy?.$modal.msgWarning('请选择行');
} else {
await $table.removeCheckboxRow();
updateElement();
}
}
};
const insertEvent = async () => {
Object.assign(formData.value, initData);
selectRow.value = null;
formDialog.openDialog();
};
const editEvent = (row: ExecutionListenerVO) => {
Object.assign(formData.value, row);
selectRow.value = row;
formDialog.openDialog();
};
const removeEvent = async (row: ExecutionListenerVO) => {
await proxy?.$modal.confirm('您确定要删除该数据?');
const $table = tableRef.value;
if ($table) {
await $table.remove(row);
updateElement();
}
};
const updateElement = () => {
const $table = tableRef.value;
const data = $table.getTableData().fullData;
if (data.length) {
let extensionElements = props.element.businessObject.get('extensionElements');
if (!extensionElements) {
extensionElements = moddle.create('bpmn:ExtensionElements');
}
// 清除旧值
extensionElements.values = extensionElements.values?.filter((item) => item.$type !== 'flowable:ExecutionListener') ?? [];
data.forEach((item) => {
const executionListener = moddle.create('flowable:ExecutionListener');
executionListener['event'] = item.event;
executionListener[item.type] = item.className;
if (item.params && item.params.length) {
item.params.forEach((field) => {
const fieldElement = moddle.create('flowable:Field');
fieldElement['name'] = field.name;
fieldElement[field.type] = field.value;
executionListener.get('fields').push(fieldElement);
});
}
extensionElements.get('values').push(executionListener);
});
updateProperties({ extensionElements: extensionElements });
} else {
const extensionElements = props.element.businessObject[`extensionElements`];
if (extensionElements) {
extensionElements.values = extensionElements.values?.filter((item) => item.$type !== 'flowable:ExecutionListener') ?? [];
}
}
};
const cellDBLClickEvent: VxeTableEvents.CellDblclick<ExecutionListenerVO> = ({ row }) => {
editEvent(row);
};
const menuConfig = reactive<VxeTablePropTypes.MenuConfig<ExecutionListenerVO>>({
body: {
options: [
[
{ code: 'edit', name: '编辑', prefixIcon: 'vxe-icon-edit', disabled: false },
{ code: 'remove', name: '删除', prefixIcon: 'vxe-icon-delete', disabled: false }
]
]
},
visibleMethod({ options, column }) {
const isDisabled = !column;
options.forEach((list) => {
list.forEach((item) => {
item.disabled = isDisabled;
});
});
return true;
}
});
const contextMenuClickEvent: VxeTableEvents.MenuClick<ExecutionListenerVO> = ({ menu, row, column }) => {
const $table = tableRef.value;
if ($table) {
switch (menu.code) {
case 'edit':
editEvent(row);
break;
case 'remove':
removeEvent(row);
break;
}
}
};
const initTableData = () => {
tableData.value =
props.element.businessObject.extensionElements?.values
.filter((item) => item.$type === 'flowable:ExecutionListener')
.map((item) => {
let type;
if ('class' in item) type = 'class';
if ('expression' in item) type = 'expression';
if ('delegateExpression' in item) type = 'delegateExpression';
return {
event: item.event,
type: type,
className: item[type],
params:
item.fields?.map((field) => {
let fieldType;
if ('stringValue' in field) fieldType = 'stringValue';
if ('expression' in field) fieldType = 'expression';
return {
name: field.name,
type: fieldType,
value: field[fieldType]
};
}) ?? []
};
}) ?? [];
};
onMounted(() => {
initTableData();
});
const typeSelect = [
{ id: '742fdeb7-23b4-416b-ac66-cd4ec8b901b7', label: '类', value: 'class' },
{ id: '660c9c46-8fae-4bae-91a0-0335420019dc', label: '表达式', value: 'expression' },
{ id: '4b8135ab-6bc3-4a0f-80be-22f58bc6c5fd', label: '委托表达式', value: 'delegateExpression' }
];
const eventSelect = [
{ id: 'e6e0a51a-2d5d-4dc4-b847-b5c14f43a6ab', label: '开始', value: 'start' },
{ id: '6da97c1e-15fc-4445-8943-75d09f49778e', label: '结束', value: 'end' },
{ id: '6a2cbcec-e026-4f11-bef7-fff0b5c871e2', label: '启用', value: 'take' }
];
</script>
<style scoped lang="scss">
.el-badge {
:deep(.el-badge__content) {
top: 10px;
}
}
</style>

View File

@@ -0,0 +1,121 @@
<template>
<vxe-toolbar>
<template #buttons>
<el-button icon="Plus" @click="insertRow">新增</el-button>
</template>
</vxe-toolbar>
<vxe-table
ref="tableRef"
:height="height"
border
show-overflow
keep-source
:data="tableData"
:edit-rules="tableRules"
:edit-config="{ trigger: 'click', mode: 'row', showStatus: true }"
>
<vxe-column type="seq" width="40"></vxe-column>
<vxe-column field="type" title="类型" :edit-render="{}">
<template #default="slotParams">
<span>{{ typeSelect.find((e) => e.value === slotParams.row.type)?.label }}</span>
</template>
<template #edit="slotParams">
<vxe-select v-model="slotParams.row.type">
<vxe-option v-for="item in typeSelect" :key="item.id" :value="item.value" :label="item.label"></vxe-option>
</vxe-select>
</template>
</vxe-column>
<vxe-column field="name" title="名称" :edit-render="{}">
<template #edit="slotParams">
<vxe-input v-model="slotParams.row.name" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="value" title="值" :edit-render="{}">
<template #edit="slotParams">
<vxe-input v-model="slotParams.row.value" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column title="操作" width="100" show-overflow align="center">
<template #default="slotParams">
<el-tooltip content="删除" placement="top">
<el-button link type="danger" icon="Delete" @click="removeRow(slotParams.row)"></el-button>
</el-tooltip>
</template>
</vxe-column>
</vxe-table>
</template>
<script setup lang="ts">
import { VXETable, VxeTableInstance, VxeTablePropTypes } from 'vxe-table';
import type { ParamVO } from 'bpmnDesign';
import useDialog from '@/hooks/useDialog';
interface PropType {
height?: string;
tableData?: ParamVO[];
}
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const props = withDefaults(defineProps<PropType>(), {
height: '200px',
tableData: () => []
});
const tableRules = ref<VxeTablePropTypes.EditRules>({
type: [{ required: true, message: '请选择', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }],
value: [{ required: true, message: '请输入', trigger: 'blur' }]
});
const { title, visible, openDialog, closeDialog } = useDialog({
title: '监听器参数'
});
const typeSelect = [
{ id: '742fdeb7-23b4-416b-ac66-cd4ec8b901b7', label: '字符串', value: 'stringValue' },
{ id: '660c9c46-8fae-4bae-91a0-0335420019dc', label: '表达式', value: 'expression' }
];
const tableRef = ref<VxeTableInstance<ParamVO>>();
const getTableData = () => {
const $table = tableRef.value;
if ($table) {
return $table.getTableData().fullData;
}
return [];
};
const insertRow = async () => {
const $table = tableRef.value;
if ($table) {
const { row: newRow } = await $table.insertAt({}, -1);
// 插入一条数据并触发校验
await $table.validate(newRow);
}
};
const removeRow = async (row: ParamVO) => {
await proxy?.$modal.confirm('您确定要删除该数据?');
const $table = tableRef.value;
if ($table) {
await $table.remove(row);
}
};
const validate = async () => {
const $table = tableRef.value;
if ($table) {
return await $table.validate(true);
}
};
defineExpose({
closeDialog,
openDialog,
validate,
getTableData
});
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,310 @@
<template>
<div>
<vxe-toolbar>
<template #buttons>
<el-button type="primary" link size="small" @click="insertEvent">新增</el-button>
<el-button type="primary" link size="small" @click="removeSelectRowEvent">删除</el-button>
</template>
</vxe-toolbar>
<vxe-table
ref="tableRef"
size="mini"
height="100px"
border
show-overflow
keep-source
:data="tableData"
:menu-config="menuConfig"
@cell-dblclick="cellDBLClickEvent"
@menu-click="contextMenuClickEvent"
>
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column type="seq" width="40"></vxe-column>
<vxe-column field="event" title="事件" min-width="100px">
<template #default="slotParams">
<span>{{ eventSelect.find((e) => e.value === slotParams.row.event)?.label }}</span>
</template>
</vxe-column>
<vxe-column field="type" title="类型" min-width="100px">
<template #default="slotParams">
<span>{{ typeSelect.find((e) => e.value === slotParams.row.type)?.label }}</span>
</template>
</vxe-column>
<vxe-column field="className" title="Java 类名" min-width="100px"> </vxe-column>
</vxe-table>
<el-dialog
v-model="formDialog.visible.value"
:title="formDialog.title.value"
width="600px"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
append-to-body
>
<el-form ref="formRef" :model="formData" :rules="tableRules" label-width="100px">
<el-form-item label="事件" prop="event">
<template #label>
<span>
事件
<el-tooltip placement="top">
<el-icon><QuestionFilled /></el-icon>
<template #content>
create创建当任务已经创建并且所有任务参数都已经设置时触发<br />
assignment指派当任务已经指派给某人时触发请注意当流程执行到达用户任务时在触发create事件之前会首先触发assignment事件<br />
complete完成当任务已经完成从运行时数据中删除前触发<br />
delete删除在任务即将被删除前触发请注意任务由completeTask正常完成时也会触发
</template>
</el-tooltip>
</span>
</template>
<el-select v-model="formData.event">
<el-option v-for="item in eventSelect" :key="item.id" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="formData.type">
<el-option v-for="item in typeSelect" :key="item.id" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item
:label="typeSelect.filter((e) => e.value === formData.type)[0] ? typeSelect.filter((e) => e.value === formData.type)[0]?.label : '表达式'"
prop="className"
>
<el-input v-model="formData.className" type="text"></el-input>
</el-form-item>
</el-form>
<el-tabs type="border-card">
<el-tab-pane label="参数">
<ListenerParam ref="listenerParamRef" :table-data="formData.params" />
</el-tab-pane>
</el-tabs>
<template #footer>
<div class="dialog-footer">
<el-button @click="formDialog.closeDialog"> </el-button>
<el-button type="primary" @click="submitEvent"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import ListenerParam from './ListenerParam.vue';
import { VxeTableEvents, VxeTableInstance, VxeTablePropTypes } from 'vxe-table';
import type { TaskListenerVO } from 'bpmnDesign';
import type { ModdleElement } from 'bpmn';
import usePanel from '../../hooks/usePanel';
import useDialog from '@/hooks/useDialog';
import useModelerStore from '@/store/modules/modeler';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
interface PropType {
element: ModdleElement;
}
const props = withDefaults(defineProps<PropType>(), {});
const selectRow = ref<TaskListenerVO | null>();
const formDialog = useDialog({
title: selectRow.value ? '编辑&保存' : '新增&保存'
});
const { showConfig, elementType, updateProperties } = usePanel({
element: toRaw(props.element)
});
const { getModdle } = useModelerStore();
const moddle = getModdle();
const listenerParamRef = ref<InstanceType<typeof ListenerParam>>();
const tableRef = ref<VxeTableInstance<TaskListenerVO>>();
const formRef = ref<ElFormInstance>();
const initData: TaskListenerVO = {
event: '',
type: '',
className: '',
name: '',
params: []
};
const formData = ref<TaskListenerVO>({ ...initData });
const currentIndex = ref(0);
const tableData = ref<TaskListenerVO[]>([]);
const tableRules = ref<VxeTablePropTypes.EditRules>({
event: [{ required: true, message: '请选择', trigger: 'blur' }],
type: [{ required: true, message: '请选择', trigger: 'blur' }],
name: [{ required: true, message: '请输入', trigger: 'blur' }],
className: [{ required: true, message: '请输入', trigger: 'blur' }]
});
const submitEvent = async () => {
const error = await listenerParamRef.value.validate();
await formRef.value.validate((validate) => {
if (validate && !error) {
const $table = tableRef.value;
if ($table) {
formData.value.params = listenerParamRef.value.getTableData();
if (selectRow.value) {
Object.assign(selectRow.value, formData.value);
} else {
$table.insertAt({ ...formData.value }, -1);
}
updateElement();
formDialog.closeDialog();
}
}
});
};
const insertEvent = async () => {
Object.assign(formData.value, initData);
selectRow.value = null;
formDialog.openDialog();
};
const editEvent = (row: TaskListenerVO) => {
Object.assign(formData.value, row);
selectRow.value = row;
formDialog.openDialog();
};
const removeEvent = async (row: TaskListenerVO) => {
await proxy?.$modal.confirm('您确定要删除该数据?');
const $table = tableRef.value;
if ($table) {
await $table.remove(row);
updateElement();
}
};
const removeSelectRowEvent = async () => {
const $table = tableRef.value;
if ($table) {
const selectCount = $table.getCheckboxRecords().length;
if (selectCount === 0) {
proxy?.$modal.msgWarning('请选择行');
} else {
await $table.removeCheckboxRow();
updateElement();
}
}
};
const updateElement = () => {
const $table = tableRef.value;
const data = $table.getTableData().fullData;
if (data.length) {
let extensionElements = props.element.businessObject.get('extensionElements');
if (!extensionElements) {
extensionElements = moddle.create('bpmn:ExtensionElements');
}
// 清除旧值
extensionElements.values = extensionElements.values?.filter((item) => item.$type !== 'flowable:TaskListener') ?? [];
data.forEach((item) => {
const taskListener = moddle.create('flowable:TaskListener');
taskListener['event'] = item.event;
taskListener[item.type] = item.className;
if (item.params && item.params.length) {
item.params.forEach((field) => {
const fieldElement = moddle.create('flowable:Field');
fieldElement['name'] = field.name;
fieldElement[field.type] = field.value;
taskListener.get('fields').push(fieldElement);
});
}
extensionElements.get('values').push(taskListener);
});
updateProperties({ extensionElements: extensionElements });
} else {
const extensionElements = props.element.businessObject[`extensionElements`];
if (extensionElements) {
extensionElements.values = extensionElements.values?.filter((item) => item.$type !== 'flowable:TaskListener') ?? [];
}
}
};
const cellDBLClickEvent: VxeTableEvents.CellDblclick<TaskListenerVO> = ({ row }) => {
editEvent(row);
};
const menuConfig = reactive<VxeTablePropTypes.MenuConfig<TaskListenerVO>>({
body: {
options: [
[
{ code: 'edit', name: '编辑', prefixIcon: 'vxe-icon-edit', disabled: false },
{ code: 'remove', name: '删除', prefixIcon: 'vxe-icon-delete', disabled: false }
]
]
},
visibleMethod({ options, column }) {
const isDisabled = !column;
options.forEach((list) => {
list.forEach((item) => {
item.disabled = isDisabled;
});
});
return true;
}
});
const contextMenuClickEvent: VxeTableEvents.MenuClick<TaskListenerVO> = ({ menu, row, column }) => {
const $table = tableRef.value;
if ($table) {
switch (menu.code) {
case 'edit':
editEvent(row);
break;
case 'remove':
removeEvent(row);
break;
}
}
};
const initTableData = () => {
tableData.value =
props.element.businessObject.extensionElements?.values
.filter((item) => item.$type === 'flowable:TaskListener')
.map((item) => {
let type;
if ('class' in item) type = 'class';
if ('expression' in item) type = 'expression';
if ('delegateExpression' in item) type = 'delegateExpression';
return {
event: item.event,
type: type,
className: item[type],
params:
item.fields?.map((field) => {
let fieldType;
if ('stringValue' in field) fieldType = 'stringValue';
if ('expression' in field) fieldType = 'expression';
return {
name: field.name,
type: fieldType,
value: field[fieldType]
};
}) ?? []
};
}) ?? [];
};
onMounted(() => {
initTableData();
});
const typeSelect = [
{ id: '742fdeb7-23b4-416b-ac66-cd4ec8b901b7', label: '类', value: 'class' },
{ id: '660c9c46-8fae-4bae-91a0-0335420019dc', label: '表达式', value: 'expression' },
{ id: '4b8135ab-6bc3-4a0f-80be-22f58bc6c5fd', label: '委托表达式', value: 'delegateExpression' }
];
const eventSelect = [
{ id: 'e6e0a51a-2d5d-4dc4-b847-b5c14f43a6ab', label: '创建', value: 'create' },
{ id: '6da97c1e-15fc-4445-8943-75d09f49778e', label: '指派', value: 'assignment' },
{ id: '6a2cbcec-e026-4f11-bef7-fff0b5c871e2', label: '完成', value: 'complete' },
{ id: '68801972-85f1-482f-bd86-1fad015c26ed', label: '删除', value: 'delete' }
];
</script>
<style scoped lang="scss">
.el-badge {
:deep(.el-badge__content) {
top: 10px;
}
}
</style>

View File

@@ -0,0 +1,71 @@
<template>
<div class="design">
<el-dialog v-model="visible" width="100%" fullscreen :title="title">
<div class="modeler">
<bpmn-design ref="bpmnDesignRef" @save-call-back="saveCallBack"></bpmn-design>
</div>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="Design">
import { getInfo, editModelXml } from '@/api/workflow/model';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { ModelForm } from '@/api/workflow/model/types';
import BpmnDesign from '@/bpmn/index.vue';
import useDialog from '@/hooks/useDialog';
const bpmnDesignRef = ref<InstanceType<typeof BpmnDesign>>();
const modelForm = ref<ModelForm>();
const emit = defineEmits(['closeCallBack']);
const { visible, title } = useDialog({
title: '编辑流程'
});
const modelId = ref('');
const open = async (id) => {
visible.value = true;
modelId.value = id;
const { data } = await getInfo(id);
modelForm.value = data;
bpmnDesignRef.value.initDiagram(modelForm.value.xml);
};
//保存模型
const saveCallBack = async (data) => {
await proxy?.$modal.confirm('是否确认保存?');
data.loading.value = true;
modelForm.value.id = modelId.value;
modelForm.value.xml = data.xml;
modelForm.value.svg = data.svg;
modelForm.value.key = data.key;
modelForm.value.name = data.name;
editModelXml(modelForm.value).then((res) => {
if (res.code === 200) {
visible.value = false;
proxy?.$modal.msgSuccess('保存成功');
emit('closeCallBack', data);
}
});
data.loading.value = false;
};
/**
* 对外暴露子组件方法
*/
defineExpose({
open
});
</script>
<style lang="scss" scoped>
.design {
:deep(.el-dialog .el-dialog__body) {
max-height: 100% !important;
min-height: calc(100vh - 80px);
padding: 10px 0 10px 0 !important;
}
:deep(.el-dialog__header) {
padding: 0 0 5px 0 !important;
}
}
</style>

View File

@@ -0,0 +1,411 @@
<template>
<div v-loading="loading" class="bpmnDialogContainers">
<el-header style="border-bottom: 1px solid rgb(218 218 218); height: auto">
<div class="header-div">
<div>
<el-tooltip effect="dark" content="自适应屏幕" placement="bottom">
<el-button size="small" icon="Rank" @click="fitViewport" />
</el-tooltip>
<el-tooltip effect="dark" content="放大" placement="bottom">
<el-button size="small" icon="ZoomIn" @click="zoomViewport(true)" />
</el-tooltip>
<el-tooltip effect="dark" content="缩小" placement="bottom">
<el-button size="small" icon="ZoomOut" @click="zoomViewport(false)" />
</el-tooltip>
</div>
<div>
<div class="tips-label">
<div class="un-complete">未完成</div>
<div class="in-progress">进行中</div>
<div class="complete">已完成</div>
</div>
</div>
</div>
</el-header>
<div class="flow-containers">
<el-container class="bpmn-el-container" style="align-items: stretch">
<el-main style="padding: 0">
<div ref="canvas" class="canvas" />
</el-main>
</el-container>
</div>
</div>
</template>
<script lang="ts" setup>
import BpmnViewer from 'bpmn-js/lib/Viewer';
import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
import ZoomScrollModule from 'diagram-js/lib/navigation/zoomscroll';
import { ModuleDeclaration } from 'didi';
import type { Canvas, ModdleElement } from 'bpmn';
import EventBus from 'diagram-js/lib/core/EventBus';
import Overlays from 'diagram-js/lib/features/overlays/Overlays';
import processApi from '@/api/workflow/processInstance/index';
const canvas = ref<HTMLElement>();
const modeler = ref<BpmnViewer>();
const taskList = ref([]);
const zoom = ref(1);
const xml = ref('');
const loading = ref(false);
const bpmnVisible = ref(true);
const historyList = ref([]);
const init = (businessKey) => {
loading.value = true;
bpmnVisible.value = true;
nextTick(async () => {
if (modeler.value) modeler.value.destroy();
modeler.value = new BpmnViewer({
container: canvas.value,
additionalModules: [
{
//禁止滚轮滚动
zoomScroll: ['value', '']
},
ZoomScrollModule,
MoveCanvasModule
] as ModuleDeclaration[]
});
const resp = await processApi.getHistoryList(businessKey);
xml.value = resp.data.xml;
taskList.value = resp.data.taskList;
historyList.value = resp.data.historyList;
await createDiagram(xml.value);
loading.value = false;
});
};
const initXml = (xmlStr: string) => {
loading.value = true;
bpmnVisible.value = true;
nextTick(async () => {
if (modeler.value) modeler.value.destroy();
modeler.value = new BpmnViewer({
container: canvas.value,
additionalModules: [
{
//禁止滚轮滚动
zoomScroll: ['value', '']
},
ZoomScrollModule,
MoveCanvasModule
] as ModuleDeclaration[]
});
xml.value = xmlStr;
await createDiagram(xml.value);
loading.value = false;
});
};
const createDiagram = async (data) => {
try {
await modeler.value.importXML(data);
fitViewport();
fillColor();
loading.value = false;
addEventBusListener();
} catch (err) {
console.log(err);
}
};
const addEventBusListener = () => {
const eventBus = modeler.value.get<EventBus>('eventBus');
const overlays = modeler.value.get<Overlays>('overlays');
eventBus.on<ModdleElement>('element.hover', (e) => {
let data = historyList.value.find((t) => t.taskDefinitionKey === e.element.id);
if (e.element.type === 'bpmn:UserTask' && data) {
setTimeout(() => {
genNodeDetailBox(e, overlays, data);
}, 10);
}
});
eventBus.on('element.out', (e) => {
overlays.clear();
});
};
const genNodeDetailBox = (e, overlays, data) => {
overlays.add(e.element.id, {
position: { top: e.element.height, left: 0 },
html: `<div class="verlays">
<p>审批人员: ${data.nickName || ''}<p/>
<p>节点状态:${data.status || ''}</p>
<p>开始时间:${data.startTime || ''}</p>
<p>结束时间:${data.endTime || ''}</p>
<p>审批耗时:${data.runDuration || ''}</p>
<p>流程版本v${data.version || ''}</p>
</div>`
});
};
// 让图能自适应屏幕
const fitViewport = () => {
zoom.value = modeler.value.get<Canvas>('canvas').zoom('fit-viewport');
const bbox = document.querySelector<SVGGElement>('.flow-containers .viewport').getBBox();
const currentViewBox = modeler.value.get('canvas').viewbox();
const elementMid = {
x: bbox.x + bbox.width / 2 - 65,
y: bbox.y + bbox.height / 2
};
modeler.value.get<Canvas>('canvas').viewbox({
x: elementMid.x - currentViewBox.width / 2,
y: elementMid.y - currentViewBox.height / 2,
width: currentViewBox.width,
height: currentViewBox.height
});
zoom.value = (bbox.width / currentViewBox.width) * 1.8;
};
// 放大缩小
const zoomViewport = (zoomIn = true) => {
zoom.value = modeler.value.get<Canvas>('canvas').zoom();
zoom.value += zoomIn ? 0.1 : -0.1;
modeler.value.get<Canvas>('canvas').zoom(zoom.value);
};
//上色
const fillColor = () => {
const canvas = modeler.value.get<Canvas>('canvas');
bpmnNodeList(modeler.value._definitions.rootElements[0].flowElements, canvas);
};
//递归上色
const bpmnNodeList = (flowElements, canvas) => {
flowElements.forEach((n) => {
if (n.$type === 'bpmn:UserTask') {
const completeTask = taskList.value.find((m) => m.key === n.id);
if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo');
n.outgoing?.forEach((nn) => {
const targetTask = taskList.value.find((m) => m.key === nn.targetRef.id);
if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo');
} else if (nn.targetRef.$type === 'bpmn:ExclusiveGateway') {
canvas.addMarker(nn.id, completeTask.completed ? 'highlight' : 'highlight-todo');
canvas.addMarker(nn.targetRef.id, completeTask.completed ? 'highlight' : 'highlight-todo');
nn.targetRef.outgoing.forEach((e) => {
gateway(e.id, e.targetRef.$type, e.targetRef.id, canvas, completeTask.completed);
});
} else if (nn.targetRef.$type === 'bpmn:ParallelGateway') {
canvas.addMarker(nn.id, completeTask.completed ? 'highlight' : 'highlight-todo');
canvas.addMarker(nn.targetRef.id, completeTask.completed ? 'highlight' : 'highlight-todo');
nn.targetRef.outgoing.forEach((e) => {
gateway(e.id, e.targetRef.$type, e.targetRef.id, canvas, completeTask.completed);
});
} else if (nn.targetRef.$type === 'bpmn:InclusiveGateway') {
canvas.addMarker(nn.id, completeTask.completed ? 'highlight' : 'highlight-todo');
canvas.addMarker(nn.targetRef.id, completeTask.completed ? 'highlight' : 'highlight-todo');
nn.targetRef.outgoing.forEach((e) => {
gateway(e.id, e.targetRef.$type, e.targetRef.id, canvas, completeTask.completed);
});
}
});
}
} else if (n.$type === 'bpmn:ExclusiveGateway') {
n.outgoing.forEach((nn) => {
const targetTask = taskList.value.find((m) => m.key === nn.targetRef.id);
if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo');
}
});
} else if (n.$type === 'bpmn:ParallelGateway') {
n.outgoing.forEach((nn) => {
const targetTask = taskList.value.find((m) => m.key === nn.targetRef.id);
if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo');
}
});
} else if (n.$type === 'bpmn:InclusiveGateway') {
n.outgoing.forEach((nn) => {
const targetTask = taskList.value.find((m) => m.key === nn.targetRef.id);
if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo');
}
});
} else if (n.$type === 'bpmn:SubProcess') {
const completeTask = taskList.value.find((m) => m.key === n.id);
if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo');
}
bpmnNodeList(n.flowElements, canvas);
} else if (n.$type === 'bpmn:StartEvent') {
canvas.addMarker(n.id, 'startEvent');
if (n.outgoing) {
n.outgoing.forEach((nn) => {
const completeTask = taskList.value.find((m) => m.key === nn.targetRef.id);
if (completeTask) {
canvas.addMarker(nn.id, 'highlight');
canvas.addMarker(n.id, 'highlight');
}
});
}
} else if (n.$type === 'bpmn:EndEvent') {
canvas.addMarker(n.id, 'endEvent');
const completeTask = taskList.value.find((m) => m.key === n.id);
if (completeTask) {
canvas.addMarker(completeTask.key, 'highlight');
canvas.addMarker(n.id, 'highlight');
return;
}
}
});
};
const gateway = (id, targetRefType, targetRefId, canvas, completed) => {
if (targetRefType === 'bpmn:ExclusiveGateway') {
canvas.addMarker(id, completed ? 'highlight' : 'highlight-todo');
canvas.addMarker(targetRefId, completed ? 'highlight' : 'highlight-todo');
}
if (targetRefType === 'bpmn:ParallelGateway') {
canvas.addMarker(id, completed ? 'highlight' : 'highlight-todo');
canvas.addMarker(targetRefId, completed ? 'highlight' : 'highlight-todo');
}
if (targetRefType === 'bpmn:InclusiveGateway') {
canvas.addMarker(id, completed ? 'highlight' : 'highlight-todo');
canvas.addMarker(targetRefId, completed ? 'highlight' : 'highlight-todo');
}
};
defineExpose({
init,
initXml
});
</script>
<style lang="scss" scoped>
.canvas {
width: 100%;
height: 100%;
}
.header-div {
display: flex;
padding: 10px 0;
justify-content: space-between;
.tips-label {
display: flex;
div {
margin-right: 10px;
padding: 5px;
font-size: 12px;
}
.un-complete {
border: 1px solid #000;
}
.in-progress {
background-color: rgb(255, 237, 204);
border: 1px dashed orange;
}
.complete {
background-color: rgb(204, 230, 204);
border: 1px solid green;
}
}
}
.view-mode {
.el-header,
.el-aside,
.djs-palette,
.bjs-powered-by {
display: none;
}
.el-loading-mask {
background-color: initial;
}
.el-loading-spinner {
display: none;
}
}
.bpmn-el-container {
height: calc(100vh - 350px);
}
.flow-containers {
width: 100%;
height: 100%;
overflow-y: auto;
.canvas {
width: 100%;
height: 100%;
}
.load {
margin-right: 10px;
}
:deep(.el-form-item__label) {
font-size: 13px;
}
:deep(.djs-palette) {
left: 0 !important;
top: 0;
border-top: none;
}
:deep(.djs-container svg) {
min-height: 650px;
}
:deep(.startEvent.djs-shape .djs-visual > :nth-child(1)) {
fill: #77df6d !important;
}
:deep(.endEvent.djs-shape .djs-visual > :nth-child(1)) {
fill: #ee7b77 !important;
}
:deep(.highlight.djs-shape .djs-visual > :nth-child(1)) {
fill: green !important;
stroke: green !important;
fill-opacity: 0.2 !important;
}
:deep(.highlight.djs-shape .djs-visual > :nth-child(2)) {
fill: green !important;
}
:deep(.highlight.djs-shape .djs-visual > path) {
fill: green !important;
fill-opacity: 0.2 !important;
stroke: green !important;
}
:deep(.highlight.djs-connection > .djs-visual > path) {
stroke: green !important;
}
// 边框滚动动画
@keyframes path-animation {
from {
stroke-dashoffset: 100%;
}
to {
stroke-dashoffset: 0%;
}
}
:deep(.highlight-todo.djs-connection > .djs-visual > path) {
animation: path-animation 60s;
animation-timing-function: linear;
animation-iteration-count: infinite;
stroke-dasharray: 4px !important;
stroke: orange !important;
fill-opacity: 0.2 !important;
marker-end: url('#sequenceflow-end-_E7DFDF-_E7DFDF-803g1kf6zwzmcig1y2ulm5egr');
}
:deep(.highlight-todo.djs-shape .djs-visual > :nth-child(1)) {
animation: path-animation 60s;
animation-timing-function: linear;
animation-iteration-count: infinite;
stroke-dasharray: 4px !important;
stroke: orange !important;
fill: orange !important;
fill-opacity: 0.2 !important;
}
}
:deep(.verlays) {
width: 250px;
background: rgb(102, 102, 102);
border-radius: 4px;
border: 1px solid #ebeef5;
color: #fff;
padding: 15px 10px;
p {
line-height: 28px;
margin: 0;
padding: 0;
}
cursor: pointer;
}
</style>

View File

@@ -2,8 +2,7 @@
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path">
<span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{
item.meta?.title }}</span>
<span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta?.title }}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta?.title }}</a>
</el-breadcrumb-item>
</transition-group>
@@ -11,42 +10,42 @@
</template>
<script setup lang="ts">
import { RouteLocationMatched } from 'vue-router'
import { RouteLocationMatched } from 'vue-router';
const route = useRoute();
const router = useRouter();
const levelList = ref<RouteLocationMatched[]>([])
const levelList = ref<RouteLocationMatched[]>([]);
const getBreadcrumb = () => {
// only show routes with meta.title
let matched = route.matched.filter(item => item.meta && item.meta.title);
const first = matched[0]
let matched = route.matched.filter((item) => item.meta && item.meta.title);
const first = matched[0];
// 判断是否为首页
if (!isDashboard(first)) {
matched = ([{ path: '/index', meta: { title: '首页' } }] as any).concat(matched)
matched = ([{ path: '/index', meta: { title: '首页' } }] as any).concat(matched);
}
levelList.value = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}
levelList.value = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
};
const isDashboard = (route: RouteLocationMatched) => {
const name = route && route.name as string
const name = route && (route.name as string);
if (!name) {
return false
return false;
}
return name.trim() === 'Index'
}
const handleLink = (item: RouteLocationMatched) => {
const { redirect, path } = item
redirect ? router.push(redirect as string) : router.push(path)
}
return name.trim() === 'Index';
};
const handleLink = (item) => {
const { redirect, path } = item;
redirect ? router.push(redirect) : router.push(path);
};
watchEffect(() => {
// if you go to the redirect page, do not update the breadcrumbs
if (route.path.startsWith('/redirect/')) return
getBreadcrumb()
})
if (route.path.startsWith('/redirect/')) return;
getBreadcrumb();
});
onMounted(() => {
getBreadcrumb();
})
});
</script>
<style lang="scss" scoped>

View File

@@ -1,53 +1,50 @@
<!-- 代码构建 -->
<script setup lang="ts">
const props = defineProps({
showBtn: {
type: Boolean,
default: false
},
formJson: {
type: Object,
default: undefined
}
})
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const buildRef = ref();
const emits = defineEmits(['reJson', 'saveDesign']);
//获取表单json
const getJson = () => {
const formJson = JSON.stringify(buildRef.value.getFormJson())
const fieldJson = JSON.stringify(buildRef.value.getFieldWidgets())
let data = {
formJson, fieldJson
}
emits("saveDesign", data)
}
onMounted(() => {
if (props.formJson) {
buildRef.value.setFormJson(props.formJson)
}
})
</script>
<template>
<!-- 代码构建 -->
<div>
<v-form-designer
class="build"
ref="buildRef"
class="build"
:designer-config="{ importJsonButton: true, exportJsonButton: true, exportCodeButton: true, generateSFCButton: true, formTemplates: true }"
>
<template #customToolButtons v-if="showBtn">
<template v-if="showBtn" #customToolButtons>
<el-button link type="primary" icon="Select" @click="getJson">保存</el-button>
</template>
</v-form-designer>
</div>
</template>
<script setup lang="ts">
interface Props {
showBtn: boolean;
formJson: any;
}
const props = withDefaults(defineProps<Props>(), {
showBtn: true,
formJson: ''
});
const buildRef = ref();
const emits = defineEmits(['reJson', 'saveDesign']);
//获取表单json
const getJson = () => {
const formJson = JSON.stringify(buildRef.value.getFormJson());
const fieldJson = JSON.stringify(buildRef.value.getFieldWidgets());
let data = {
formJson,
fieldJson
};
emits('saveDesign', data);
};
onMounted(() => {
if (props.formJson) {
buildRef.value.setFormJson(props.formJson);
}
});
</script>
<style lang="scss">
.build {
margin: 0 !important;

View File

@@ -1,62 +1,57 @@
<template>
<div class="">
<v-form-render ref="vFormRef" :form-json="formJson" :form-data="formData" />
</div>
</template>
<!-- 动态表单渲染 -->
<script setup name="Render">
<script setup name="Render" lang="ts">
interface Props {
formJson: string | object;
formData: string | object;
isView: boolean;
}
const props = defineProps({
formJson: {
type: [String, Object],
default: ""
},
formData: {
type: [String, Object],
default: ""
},
isView: {
type: Boolean,
default: false
}
})
const props = withDefaults(defineProps<Props>(), {
formJson: '',
formData: '',
isView: false
});
const vFormRef = ref(null)
const vFormRef = ref();
// 获取表单数据-异步
const getFormData = () => {
return vFormRef.value.getFormData()
}
return vFormRef.value.getFormData();
};
/**
* 设置表单内容
* @param {表单配置} formConf
* formConfig{ formTemplate表单模板formData表单数据hiddenField需要隐藏的字段字符串集合disabledField需要禁用的自读字符串集合}
*/
const initForm = (formConf) => {
const { formTemplate, formData, hiddenField, disabledField } = toRaw(formConf)
const initForm = (formConf: any) => {
const { formTemplate, formData, hiddenField, disabledField } = toRaw(formConf);
if (formTemplate) {
vFormRef.value.setFormJson(formTemplate)
vFormRef.value.setFormJson(formTemplate);
if (formData) {
vFormRef.value.setFormData(formData)
vFormRef.value.setFormData(formData);
}
if (disabledField && disabledField.length > 0) {
setTimeout(() => {
vFormRef.value.disableWidgets(disabledField)
}, 200)
vFormRef.value.disableWidgets(disabledField);
}, 200);
}
if (hiddenField && hiddenField.length > 0) {
setTimeout(() => {
vFormRef.value.hideWidgets(hiddenField)
}, 200)
vFormRef.value.hideWidgets(hiddenField);
}, 200);
}
if (props.isView) {
console.log(props.isView)
setTimeout(() => {
vFormRef.value.disableForm()
}, 100)
vFormRef.value.disableForm();
}, 100);
}
}
}
defineExpose({ getFormData, initForm })
};
defineExpose({ getFormData, initForm });
</script>
<template>
<div class="">
<v-form-render ref="vFormRef" :form-json="formJson" :form-data="formData" />
</div>
</template>

View File

@@ -2,18 +2,31 @@
<div>
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<span v-if="item.elTagType == 'default' || item.elTagType == ''" :key="item.value" :index="index" :class="item.elTagClass">
{{ item.label + " " }}
<span
v-if="(item.elTagType === 'default' || item.elTagType === '') && (item.elTagClass === '' || item.elTagClass == null)"
:key="item.value"
:index="index"
:class="item.elTagClass"
>
{{ item.label + ' ' }}
</span>
<el-tag
v-else
:disable-transitions="true"
:key="item.value + ''"
:disable-transitions="true"
:index="index"
:type="item.elTagType === 'primary' ? '' : item.elTagType"
:type="
item.elTagType === 'primary' ||
item.elTagType === 'success' ||
item.elTagType === 'info' ||
item.elTagType === 'warning' ||
item.elTagType === 'danger'
? item.elTagType
: 'primary'
"
:class="item.elTagClass"
>
{{ item.label + " " }}
{{ item.label + ' ' }}
</el-tag>
</template>
</template>
@@ -24,70 +37,54 @@
</template>
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes';
const props = defineProps({
// 数据
options: {
type: Array as PropType<DictDataOption[]>,
default: null,
},
// 当前的值
value: [Number, String, Array] as PropType<number | string | Array<number | string>>,
// 当未找到匹配的数据时显示value
showValue: propTypes.bool.def(true),
interface Props {
options: Array<DictDataOption>;
value: number | string | Array<number | string>;
showValue?: boolean;
separator?: string;
}
const props = withDefaults(defineProps<Props>(), {
showValue: true,
separator: ','
});
const values = computed(() => {
if (props.value !== null && typeof props.value !== "undefined") {
return Array.isArray(props.value) ? props.value : [String(props.value)];
} else {
return [];
}
if (props.value === '' || props.value === null || typeof props.value === 'undefined') return [];
return Array.isArray(props.value) ? props.value.map((item) => '' + item) : String(props.value).split(props.separator);
});
const unmatch = computed(() => {
if (props.value !== null && typeof props.value !== "undefined") {
// 传入值为非数组
if (!Array.isArray(props.value)) {
if (props.options.some((v) => v.value == props.value)) {
return false;
}
return true;
if (props.options?.length == 0 || props.value === '' || props.value === null || typeof props.value === 'undefined') return false;
// 传入值为非数组
let unmatch = false; // 添加一个标志来判断是否有未匹配项
values.value.forEach((item) => {
if (!props.options.some((v) => v.value === item)) {
unmatch = true; // 如果有未匹配项将标志设置为true
}
return true;
}
// 没有value不显示
return false;
});
return unmatch; // 返回标志的值
});
const unmatchArray = computed(() => {
// 记录未匹配的项
// 记录未匹配的项
const itemUnmatchArray: Array<string | number> = [];
if (props.value !== null && typeof props.value !== "undefined") {
// 传入值为非数组
if (!Array.isArray(props.value)) {
itemUnmatchArray.push(props.value);
} else {
// 传入值为Array
props.value.forEach((item) => {
if (!props.options.some((v) => v.value == item)) {
itemUnmatchArray.push(item);
}
});
}
if (props.value !== '' && props.value !== null && typeof props.value !== 'undefined') {
values.value.forEach((item) => {
if (!props.options.some((v) => v.value === item)) {
itemUnmatchArray.push(item);
}
});
}
// 没有value不显示
return handleArray(itemUnmatchArray);
});
const handleArray = (array: Array<string | number>) => {
if (array.length === 0) return "";
if (array.length === 0) return '';
return array.reduce((pre, cur) => {
return pre + " " + cur;
return pre + ' ' + cur;
});
}
};
</script>
<style scoped>

View File

@@ -1,6 +1,7 @@
<template>
<div>
<el-upload
v-if="type === 'url'"
:action="upload.url"
:before-upload="handleBeforeUpload"
:on-success="handleUploadSuccess"
@@ -9,28 +10,30 @@
name="file"
:show-file-list="false"
:headers="upload.headers"
style="display: none"
v-if="type === 'url'"
>
<i ref="uploadRef"></i>
</el-upload>
<div class="editor">
<quill-editor
ref="myQuillEditor"
v-model:content="content"
contentType="html"
@textChange="(e: any) => $emit('update:modelValue', content)"
:options="options"
:style="styles"
/>
</div>
</div>
<div class="editor">
<quill-editor
ref="quillEditorRef"
v-model:content="content"
content-type="html"
:options="options"
:style="styles"
@text-change="(e: any) => $emit('update:modelValue', content)"
/>
</div>
</template>
<script setup lang="ts">
import { QuillEditor, Quill } from '@vueup/vue-quill';
import '@vueup/vue-quill/dist/vue-quill.snow.css';
import { QuillEditor, Quill } from '@vueup/vue-quill';
import { propTypes } from '@/utils/propTypes';
import { globalHeaders } from "@/utils/request";
import { globalHeaders } from '@/utils/request';
defineEmits(['update:modelValue']);
const props = defineProps({
/* 编辑器的内容 */
@@ -52,42 +55,43 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const upload = reactive<UploadOption>({
headers: globalHeaders(),
url: import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload'
})
const myQuillEditor = ref();
});
const quillEditorRef = ref();
const uploadRef = ref<HTMLDivElement>();
const options = ref({
theme: "snow",
const options = ref<any>({
theme: 'snow',
bounds: document.body,
debug: "warn",
debug: 'warn',
modules: {
// 工具栏配置
toolbar: {
container: [
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
["blockquote", "code-block"], // 引用 代码块
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
[{ indent: "-1" }, { indent: "+1" }], // 缩进
[{ size: ["small", false, "large", "huge"] }], // 字体大小
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
[{ align: [] }], // 对齐方式
["clean"], // 清除文本格式
["link", "image", "video"] // 链接、图片、视频
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
['blockquote', 'code-block'], // 引用 代码块
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
[{ indent: '-1' }, { indent: '+1' }], // 缩进
[{ size: ['small', false, 'large', 'huge'] }], // 字体大小
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
[{ align: [] }], // 对齐方式
['clean'], // 清除文本格式
['link', 'image', 'video'] // 链接、图片、视频
],
handlers: {
image: function (value: any) {
image: (value: boolean) => {
if (value) {
// 调用element图片上传
(document.querySelector(".editor-img-uploader>.el-upload") as HTMLDivElement)?.click();
uploadRef.value.click();
} else {
Quill.format("image", true);
Quill.format('image', true);
}
},
},
}
}
}
},
placeholder: '请输入内容',
readOnly: props.readOnly,
readOnly: props.readOnly
});
const styles = computed(() => {
@@ -99,36 +103,47 @@ const styles = computed(() => {
style.height = `${props.height}px`;
}
return style;
})
});
const content = ref("");
watch(() => props.modelValue, (v) => {
if (v !== content.value) {
content.value = v === undefined ? "<p></p>" : v;
}
}, { immediate: true });
const content = ref('');
watch(
() => props.modelValue,
(v: string) => {
if (v !== content.value) {
content.value = v || '<p></p>';
}
},
{ immediate: true }
);
// 图片上传成功返回图片地址
const handleUploadSuccess = (res: any) => {
// 获取富文本实例
let quill = toRaw(myQuillEditor.value).getQuill();
// 如果上传成功
if (res.code === 200) {
// 获取富文本实例
let quill = toRaw(quillEditorRef.value).getQuill();
// 获取光标位置
let length = quill.selection.savedRange.index;
// 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, "image", res.data.url);
quill.insertEmbed(length, 'image', res.data.url);
// 调整光标到最后
quill.setSelection(length + 1);
proxy?.$modal.closeLoading();
} else {
proxy?.$modal.loading(res.msg);
proxy?.$modal.msgError('图片插入失败');
proxy?.$modal.closeLoading();
}
}
};
// 图片上传前拦截
const handleBeforeUpload = (file: any) => {
const type = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg'];
const isJPG = type.includes(file.type);
//检验文件格式
if (!isJPG) {
proxy?.$modal.msgError(`图片格式错误!`);
return false;
}
// 校检文件大小
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
@@ -139,107 +154,91 @@ const handleBeforeUpload = (file: any) => {
}
proxy?.$modal.loading('正在上传文件,请稍候...');
return true;
}
};
// 图片失败拦截
const handleUploadError = (err: any) => {
console.error(err);
proxy?.$modal.msgError('上传文件失败');
}
};
</script>
<style>
.editor-img-uploader {
display: none;
}
.editor,
.ql-toolbar {
white-space: pre-wrap !important;
line-height: normal !important;
}
.quill-img {
display: none;
}
.ql-snow .ql-tooltip[data-mode="link"]::before {
content: "请输入链接地址:";
.ql-snow .ql-tooltip[data-mode='link']::before {
content: '请输入链接地址:';
}
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
border-right: 0;
content: "保存";
content: '保存';
padding-right: 0;
}
.ql-snow .ql-tooltip[data-mode="video"]::before {
content: "请输入视频地址:";
.ql-snow .ql-tooltip[data-mode='video']::before {
content: '请输入视频地址:';
}
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
content: "14px";
content: '14px';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
content: "10px";
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
content: '10px';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
content: "18px";
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
content: '18px';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
content: "32px";
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
content: '32px';
}
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
content: "文本";
content: '文本';
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
content: "标题1";
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
content: '标题1';
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
content: "标题2";
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
content: '标题2';
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
content: "标题3";
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
content: '标题3';
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
content: "标题4";
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
content: '标题4';
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
content: "标题5";
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
content: '标题5';
}
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
content: "标题6";
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
content: '标题6';
}
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: "标准字体";
content: '标准字体';
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
content: "衬线字体";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
content: '衬线字体';
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
content: "等宽字体";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
content: '等宽字体';
}
</style>

View File

@@ -1,6 +1,7 @@
<template>
<div class="upload-file">
<el-upload
ref="fileUploadRef"
multiple
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
@@ -12,30 +13,29 @@
:show-file-list="false"
:headers="headers"
class="upload-file-uploader"
ref="fileUploadRef"
>
<!-- 上传按钮 -->
<el-button type="primary">选取文件</el-button>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" v-if="showTip">
<div v-if="showTip" class="el-upload__tip">
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
</template>
的文件
</div>
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
<el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
<el-button type="danger" link @click="handleDelete(index)">删除</el-button>
</div>
</li>
</transition-group>
@@ -43,20 +43,23 @@
</template>
<script setup lang="ts">
import { listByIds, delOss } from "@/api/system/oss";
import { propTypes } from '@/utils/propTypes';
import { globalHeaders } from "@/utils/request";
import { delOss, listByIds } from '@/api/system/oss';
import { globalHeaders } from '@/utils/request';
const props = defineProps({
modelValue: [String, Object, Array],
// 数量限制
limit: propTypes.number.def(5),
// 大小限制(MB)
fileSize: propTypes.number.def(5),
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(["doc", "xls", "ppt", "txt", "pdf"]),
// 是否显示提示
isShowTip: propTypes.bool.def(true),
modelValue: {
type: [String, Object, Array],
default: () => []
},
// 数量限制
limit: propTypes.number.def(5),
// 大小限制(MB)
fileSize: propTypes.number.def(5),
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']),
// 是否显示提示
isShowTip: propTypes.bool.def(true)
});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -65,153 +68,162 @@ const number = ref(0);
const uploadList = ref<any[]>([]);
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadFileUrl = ref(baseUrl + "/resource/oss/upload"); // 上传文件服务器地址
const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址
const headers = ref(globalHeaders());
const fileList = ref<any[]>([]);
const showTip = computed(
() => props.isShowTip && (props.fileType || props.fileSize)
);
const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize));
const fileUploadRef = ref<ElUploadInstance>();
watch(() => props.modelValue, async val => {
watch(
() => props.modelValue,
async (val) => {
if (val) {
let temp = 1;
// 首先将值转为数组
let list = [];
if (Array.isArray(val)) {
list = val;
} else {
const res = await listByIds(val as string)
list = res.data.map((oss) => {
const data = { name: oss.originalName, url: oss.url, ossId: oss.ossId };
return data;
});
}
// 然后将数组转为对象数组
fileList.value = list.map(item => {
item = { name: item.name, url: item.url, ossId: item.ossId };
item.uid = item.uid || new Date().getTime() + temp++;
return item;
let temp = 1;
// 首先将值转为数组
let list: any[] = [];
if (Array.isArray(val)) {
list = val;
} else {
const res = await listByIds(val);
list = res.data.map((oss) => {
return {
name: oss.originalName,
url: oss.url,
ossId: oss.ossId
};
});
}
// 然后将数组转为对象数组
fileList.value = list.map((item) => {
item = { name: item.name, url: item.url, ossId: item.ossId };
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
fileList.value = [];
return [];
fileList.value = [];
return [];
}
}, { deep: true, immediate: true });
},
{ deep: true, immediate: true }
);
// 上传前校检格式和大小
const handleBeforeUpload = (file: any) => {
// 校检文件类型
if (props.fileType.length) {
const fileName = file.name.split('.');
const fileExt = fileName[fileName.length - 1];
const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
if (!isTypeOk) {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join("/")}格式文件!`);
return false;
}
// 校检文件类型
if (props.fileType.length) {
const fileName = file.name.split('.');
const fileExt = fileName[fileName.length - 1];
const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
if (!isTypeOk) {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`);
return false;
}
// 校检文件大小
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
return false;
}
}
// 校检文件大小
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
return false;
}
proxy?.$modal.loading("正在上传文件,请稍候...");
number.value++;
return true;
}
}
proxy?.$modal.loading('正在上传文件,请稍候...');
number.value++;
return true;
};
// 文件个数超出
const handleExceed = () => {
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
}
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
};
// 上传失败
const handleUploadError = () => {
proxy?.$modal.msgError("上传文件失败");
}
proxy?.$modal.msgError('上传文件失败');
};
// 上传成功回调
const handleUploadSuccess = (res: any, file: UploadFile) => {
if (res.code === 200) {
uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId });
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
fileUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
}
if (res.code === 200) {
uploadList.value.push({
name: res.data.fileName,
url: res.data.url,
ossId: res.data.ossId
});
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
fileUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
};
// 删除文件
const handleDelete = (index: number) => {
let ossId = fileList.value[index].ossId;
delOss(ossId);
fileList.value.splice(index, 1);
emit("update:modelValue", listToString(fileList.value));
}
let ossId = fileList.value[index].ossId;
delOss(ossId);
fileList.value.splice(index, 1);
emit('update:modelValue', listToString(fileList.value));
};
// 上传结束处理
const uploadedSuccessfully = () => {
if (number.value > 0 && uploadList.value.length === number.value) {
fileList.value = fileList.value.filter(f => f.url !== undefined).concat(uploadList.value);
uploadList.value = [];
number.value = 0;
emit("update:modelValue", listToString(fileList.value));
proxy?.$modal.closeLoading();
}
}
if (number.value > 0 && uploadList.value.length === number.value) {
fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
uploadList.value = [];
number.value = 0;
emit('update:modelValue', listToString(fileList.value));
proxy?.$modal.closeLoading();
}
};
// 获取文件名称
const getFileName = (name: string) => {
// 如果是url那么取最后的名字 如果不是直接返回
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1);
} else {
return name;
}
}
// 如果是url那么取最后的名字 如果不是直接返回
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1);
} else {
return name;
}
};
// 对象转成指定字符串分隔
const listToString = (list: any[], separator?: string) => {
let strs = "";
separator = separator || ",";
list.forEach(item => {
if (item.ossId) {
strs += item.ossId + separator;
}
})
return strs != "" ? strs.substring(0, strs.length - 1) : "";
}
let strs = '';
separator = separator || ',';
list.forEach((item) => {
if (item.ossId) {
strs += item.ossId + separator;
}
});
return strs != '' ? strs.substring(0, strs.length - 1) : '';
};
</script>
<style scoped lang="scss">
.upload-file-uploader {
margin-bottom: 5px;
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
margin-right: 10px;
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div style="padding: 0 15px;" @click="toggleClick">
<div style="padding: 0 15px" @click="toggleClick">
<svg :class="{ 'is-active': isActive }" class="hamburger" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="64" height="64">
<path
d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"
@@ -13,12 +13,12 @@ import { propTypes } from '@/utils/propTypes';
defineProps({
isActive: propTypes.bool.def(false)
})
});
const emit = defineEmits(['toggleClick'])
const emit = defineEmits(['toggleClick']);
const toggleClick = () => {
emit('toggleClick');
}
};
</script>
<style scoped>

View File

@@ -1,5 +1,5 @@
<template>
<div :class="{ 'show': show }" class="header-search">
<div :class="{ show: show }" class="header-search">
<svg-icon class-name="search-icon" icon-class="search" @click.stop="click" />
<el-select
ref="headerSearchSelectRef"
@@ -22,12 +22,12 @@ import Fuse from 'fuse.js';
import { getNormalPath } from '@/utils/ruoyi';
import { isHttp } from '@/utils/validate';
import usePermissionStore from '@/store/modules/permission';
import { RouteOption } from 'vue-router';
import { RouteRecordRaw } from 'vue-router';
type Router = Array<{
path: string;
title: string[];
}>
path: string;
title: string[];
}>;
const search = ref('');
const options = ref<any>([]);
@@ -36,146 +36,160 @@ const show = ref(false);
const fuse = ref();
const headerSearchSelectRef = ref<ElSelectInstance>();
const router = useRouter();
const routes = computed(() => usePermissionStore().routes);
const routes = computed(() => usePermissionStore().getRoutes());
const click = () => {
show.value = !show.value
if (show.value) {
headerSearchSelectRef.value && headerSearchSelectRef.value.focus()
}
show.value = !show.value;
if (show.value) {
headerSearchSelectRef.value && headerSearchSelectRef.value.focus();
}
};
const close = () => {
headerSearchSelectRef.value && headerSearchSelectRef.value.blur()
options.value = []
show.value = false
}
headerSearchSelectRef.value && headerSearchSelectRef.value.blur();
options.value = [];
show.value = false;
};
const change = (val: any) => {
const path = val.path;
if (isHttp(path)) {
// http(s):// 路径新窗口打开
const pindex = path.indexOf("http");
window.open(path.substr(pindex, path.length), "_blank");
const path = val.path;
const query = val.query;
if (isHttp(path)) {
// http(s):// 路径新窗口打开
const pindex = path.indexOf('http');
window.open(path.substr(pindex, path.length), '_blank');
} else {
if (query) {
router.push({ path: path, query: JSON.parse(query) });
} else {
router.push(path)
router.push(path);
}
search.value = ''
options.value = []
nextTick(() => {
show.value = false
})
}
}
search.value = '';
options.value = [];
nextTick(() => {
show.value = false;
});
};
const initFuse = (list: Router) => {
fuse.value = new Fuse(list, {
shouldSort: true,
threshold: 0.4,
location: 0,
distance: 100,
minMatchCharLength: 1,
keys: [{
name: 'title',
weight: 0.7
}, {
name: 'path',
weight: 0.3
}]
})
}
fuse.value = new Fuse(list, {
shouldSort: true,
threshold: 0.4,
location: 0,
distance: 100,
minMatchCharLength: 1,
keys: [
{
name: 'title',
weight: 0.7
},
{
name: 'path',
weight: 0.3
}
]
});
};
// Filter out the routes that can be displayed in the sidebar
// And generate the internationalized title
const generateRoutes = (routes: RouteOption[], basePath = '', prefixTitle: string[] = []) => {
let res: Router = []
routes.forEach(r => {
// skip hidden router
if (!r.hidden) {
const p = r.path.length > 0 && r.path[0] === '/' ? r.path : '/' + r.path;
const data = {
path: !isHttp(r.path) ? getNormalPath(basePath + p) : r.path,
title: [...prefixTitle]
}
if (r.meta && r.meta.title) {
data.title = [...data.title, r.meta.title];
if (r.redirect !== 'noRedirect') {
// only push the routes with title
// special case: need to exclude parent router without redirect
res.push(data);
}
}
// recursive child routes
if (r.children) {
const tempRoutes = generateRoutes(r.children, data.path, data.title);
if (tempRoutes.length >= 1) {
res = [...res, ...tempRoutes];
}
}
const generateRoutes = (routes: RouteRecordRaw[], basePath = '', prefixTitle: string[] = []) => {
let res: Router = [];
routes.forEach((r) => {
// skip hidden router
if (!r.hidden) {
const p = r.path.length > 0 && r.path[0] === '/' ? r.path : '/' + r.path;
const data = {
path: !isHttp(r.path) ? getNormalPath(basePath + p) : r.path,
title: [...prefixTitle],
query: ''
};
if (r.meta && r.meta.title) {
data.title = [...data.title, r.meta.title];
if (r.redirect !== 'noRedirect') {
// only push the routes with title
// special case: need to exclude parent router without redirect
res.push(data);
}
})
return res;
}
const querySearch = (query: string) => {
if (query !== '') {
options.value = fuse.value.search(query)
} else {
options.value = []
}
if (r.query) {
data.query = r.query;
}
// recursive child routes
if (r.children) {
const tempRoutes = generateRoutes(r.children, data.path, data.title);
if (tempRoutes.length >= 1) {
res = [...res, ...tempRoutes];
}
}
}
}
});
return res;
};
const querySearch = (query: string) => {
if (query !== '') {
options.value = fuse.value.search(query);
} else {
options.value = [];
}
};
onMounted(() => {
searchPool.value = generateRoutes(routes.value);
})
searchPool.value = generateRoutes(routes.value);
});
// watchEffect(() => {
// searchPool.value = generateRoutes(routes.value)
// })
watch(show, (value) => {
if (value) {
document.body.addEventListener('click', close)
} else {
document.body.removeEventListener('click', close)
}
})
if (value) {
document.body.addEventListener('click', close);
} else {
document.body.removeEventListener('click', close);
}
});
watch(searchPool, (list) => {
initFuse(list)
})
watch(searchPool, (list: Router) => {
initFuse(list);
});
</script>
<style lang="scss" scoped>
.header-search {
font-size: 0 !important;
font-size: 0 !important;
.search-icon {
cursor: pointer;
font-size: 18px;
vertical-align: middle;
.search-icon {
cursor: pointer;
font-size: 18px;
vertical-align: middle;
}
.header-search-select {
font-size: 18px;
transition: width 0.2s;
width: 0;
overflow: hidden;
background: transparent;
border-radius: 0;
display: inline-block;
vertical-align: middle;
:deep(.el-input__inner) {
border-radius: 0;
border: 0;
padding-left: 0;
padding-right: 0;
box-shadow: none !important;
border-bottom: 1px solid #d9d9d9;
vertical-align: middle;
}
}
&.show {
.header-search-select {
font-size: 18px;
transition: width 0.2s;
width: 0;
overflow: hidden;
background: transparent;
border-radius: 0;
display: inline-block;
vertical-align: middle;
:deep(.el-input__inner) {
border-radius: 0;
border: 0;
padding-left: 0;
padding-right: 0;
box-shadow: none !important;
border-bottom: 1px solid #d9d9d9;
vertical-align: middle;
}
}
&.show {
.header-search-select {
width: 210px;
margin-left: 10px;
}
width: 210px;
margin-left: 10px;
}
}
}
</style>

View File

@@ -1,25 +1,25 @@
<template>
<div class="relative" :style="{ width: width }">
<el-input v-model="modelValue" readonly @click="visible = !visible" placeholder="点击选择图标">
<div class="relative" :style="{ 'width': width }">
<el-input v-model="modelValue" readonly placeholder="点击选择图标" @click="visible = !visible">
<template #prepend>
<svg-icon :icon-class="modelValue as string" />
<svg-icon :icon-class="modelValue" />
</template>
</el-input>
<el-popover shadow="none" :visible="visible" placement="bottom-end" trigger="click" :width="450">
<template #reference>
<div @click="visible = !visible" class="cursor-pointer text-[#999] absolute right-[10px] top-0 height-[32px] leading-[32px]">
<div class="cursor-pointer text-[#999] absolute right-[10px] top-0 height-[32px] leading-[32px]" @click="visible = !visible">
<i-ep-caret-top v-show="visible"></i-ep-caret-top>
<i-ep-caret-bottom v-show="!visible"></i-ep-caret-bottom>
</div>
</template>
<el-input class="p-2" v-model="filterValue" placeholder="搜索图标" clearable @input="filterIcons" />
<el-input v-model="filterValue" class="p-2" placeholder="搜索图标" clearable @input="filterIcons" />
<el-scrollbar height="w-[200px]">
<ul class="icon-list">
<el-tooltip v-for="(iconName, index) in iconNames" :key="index" :content="iconName" placement="bottom" effect="light">
<li :class="['icon-item', {active: modelValue == iconName}]" @click="selectedIcon(iconName)">
<li :class="['icon-item', { active: modelValue == iconName }]" @click="selectedIcon(iconName)">
<svg-icon color="var(--el-text-color-regular)" :icon-class="iconName" />
</li>
</el-tooltip>
@@ -50,13 +50,11 @@ const filterValue = ref('');
*/
const filterIcons = () => {
if (filterValue.value) {
iconNames.value = icons.filter(iconName =>
iconName.includes(filterValue.value)
);
iconNames.value = icons.filter((iconName) => iconName.includes(filterValue.value));
} else {
iconNames.value = icons;
}
}
};
/**
* 选择图标
* @param iconName 选择的图标名称
@@ -64,12 +62,12 @@ const filterIcons = () => {
const selectedIcon = (iconName: string) => {
emit('update:modelValue', iconName);
visible.value = false;
}
};
</script>
<style scoped lang="scss">
.el-scrollbar {
max-height: calc(50vh - 100px)!important;
max-height: calc(50vh - 100px) !important;
overflow-y: auto;
}
.el-divider--horizontal {
@@ -99,8 +97,8 @@ const selectedIcon = (iconName: string) => {
}
}
.active {
border-color: var(--el-color-primary);
color: var(--el-color-primary);
}
border-color: var(--el-color-primary);
color: var(--el-color-primary);
}
}
</style>

View File

@@ -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`));
</script>
<style lang="scss" scoped>

View File

@@ -1,6 +1,7 @@
<template>
<div class="component-upload-image">
<el-upload
ref="imageUpload"
multiple
:action="uploadImgUrl"
list-type="picture-card"
@@ -9,7 +10,6 @@
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:before-remove="handleDelete"
:show-file-list="true"
:headers="headers"
@@ -22,13 +22,13 @@
</el-icon>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" v-if="showTip">
<div v-if="showTip" class="el-upload__tip">
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
</template>
的文件
</div>
@@ -40,177 +40,195 @@
</template>
<script setup lang="ts">
import { listByIds, delOss } from "@/api/system/oss";
import { ComponentInternalInstance } from "vue";
import { OssVO } from "@/api/system/oss/types";
import { listByIds, delOss } from '@/api/system/oss';
import { OssVO } from '@/api/system/oss/types';
import { propTypes } from '@/utils/propTypes';
import {globalHeaders} from "@/utils/request";
import { globalHeaders } from '@/utils/request';
import { compressAccurately } from 'image-conversion';
const props = defineProps({
modelValue: [String, Object, Array],
// 图片数量限制
limit: propTypes.number.def(5),
// 大小限制(MB)
fileSize: propTypes.number.def(5),
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(["png", "jpg", "jpeg"]),
// 是否显示提示
isShowTip: {
type: Boolean,
default: true
},
modelValue: {
type: [String, Object, Array],
default: () => []
},
// 图片数量限制
limit: propTypes.number.def(5),
// 大小限制(MB)
fileSize: propTypes.number.def(5),
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(['png', 'jpg', 'jpeg']),
// 是否显示提示
isShowTip: {
type: Boolean,
default: true
},
// 是否支持压缩,默认否
compressSupport: {
type: Boolean,
default: false
},
// 压缩目标大小单位KB。默认300KB以上文件才压缩并压缩至300KB以内
compressTargetSize: propTypes.number.def(300)
});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const emit = defineEmits(['update:modelValue']);
const number = ref(0);
const uploadList = ref<any[]>([]);
const dialogImageUrl = ref("");
const dialogImageUrl = ref('');
const dialogVisible = ref(false);
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadImgUrl = ref(baseUrl + "/resource/oss/upload"); // 上传的图片服务器地址
const uploadImgUrl = ref(baseUrl + '/resource/oss/upload'); // 上传的图片服务器地址
const headers = ref(globalHeaders());
const fileList = ref<any[]>([]);
const showTip = computed(
() => props.isShowTip && (props.fileType || props.fileSize)
);
const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize));
const imageUploadRef = ref<ElUploadInstance>();
watch(() => props.modelValue, async val => {
watch(
() => props.modelValue,
async (val: string) => {
if (val) {
// 首先将值转为数组
let list: OssVO[] = [];
if (Array.isArray(val)) {
list = val as OssVO[];
// 首先将值转为数组
let list: OssVO[] = [];
if (Array.isArray(val)) {
list = val as OssVO[];
} else {
const res = await listByIds(val);
list = res.data;
}
// 然后将数组转为对象数组
fileList.value = list.map((item) => {
// 字符串回显处理 如果此处存的是url可直接回显 如果存的是id需要调用接口查出来
let itemData;
if (typeof item === 'string') {
itemData = { name: item, url: item };
} else {
const res = await listByIds(val as string)
list = res.data
// 此处name使用ossId 防止删除出现重名
itemData = { name: item.ossId, url: item.url, ossId: item.ossId };
}
// 然后将数组转为对象数组
fileList.value = list.map(item => {
// 字符串回显处理 如果此处存的是url可直接回显 如果存的是id需要调用接口查出来
let itemData;
if (typeof item === "string") {
itemData = { name: item, url: item };
} else {
// 此处name使用ossId 防止删除出现重名
itemData = { name: item.ossId, url: item.url, ossId: item.ossId };
}
return itemData;
});
return itemData;
});
} else {
fileList.value = [];
return [];
fileList.value = [];
return [];
}
}, { deep: true, immediate: true });
},
{ deep: true, immediate: true }
);
/** 上传前loading加载 */
const handleBeforeUpload = (file: any) => {
let isImg = false;
if (props.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = props.fileType.some((type: any) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
let isImg = false;
if (props.fileType.length) {
let fileExtension = '';
if (file.name.lastIndexOf('.') > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1);
}
if (!isImg) {
proxy?.$modal.msgError(
`文件格式不正确, 请上传${props.fileType.join("/")}图片格式文件!`
);
return false;
isImg = props.fileType.some((type: any) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf('image') > -1;
}
if (!isImg) {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}图片格式文件!`);
return false;
}
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传头像图片大小不能超过 ${props.fileSize} MB!`);
return false;
}
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传头像图片大小不能超过 ${props.fileSize} MB!`);
return false;
}
}
proxy?.$modal.loading("正在上传图片,请稍候...");
}
//压缩图片,开启压缩并且大于指定的压缩大小时才压缩
if (props.compressSupport && file.size / 1024 > props.compressTargetSize) {
proxy?.$modal.loading('正在上传图片,请稍候...');
number.value++;
}
return compressAccurately(file, props.compressTargetSize);
} else {
proxy?.$modal.loading('正在上传图片,请稍候...');
number.value++;
}
};
// 文件个数超出
const handleExceed = () => {
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
}
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
};
// 上传成功回调
const handleUploadSuccess = (res: any, file: UploadFile) => {
if (res.code === 200) {
uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId });
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
imageUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
}
if (res.code === 200) {
uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId });
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
imageUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
};
// 删除图片
const handleDelete = (file: UploadFile): boolean => {
const findex = fileList.value.map(f => f.name).indexOf(file.name);
if (findex > -1 && uploadList.value.length === number.value) {
let ossId = fileList.value[findex].ossId;
delOss(ossId);
fileList.value.splice(findex, 1);
emit("update:modelValue", listToString(fileList.value));
return false;
}
return true;
}
const findex = fileList.value.map((f) => f.name).indexOf(file.name);
if (findex > -1 && uploadList.value.length === number.value) {
let ossId = fileList.value[findex].ossId;
delOss(ossId);
fileList.value.splice(findex, 1);
emit('update:modelValue', listToString(fileList.value));
return false;
}
return true;
};
// 上传结束处理
const uploadedSuccessfully = () => {
if (number.value > 0 && uploadList.value.length === number.value) {
fileList.value = fileList.value.filter(f => f.url !== undefined).concat(uploadList.value);
uploadList.value = [];
number.value = 0;
emit("update:modelValue", listToString(fileList.value));
proxy?.$modal.closeLoading();
}
}
if (number.value > 0 && uploadList.value.length === number.value) {
fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
uploadList.value = [];
number.value = 0;
emit('update:modelValue', listToString(fileList.value));
proxy?.$modal.closeLoading();
}
};
// 上传失败
const handleUploadError = () => {
proxy?.$modal.msgError("上传图片失败");
proxy?.$modal.closeLoading();
}
proxy?.$modal.msgError('上传图片失败');
proxy?.$modal.closeLoading();
};
// 预览
const handlePictureCardPreview = (file: any) => {
dialogImageUrl.value = file.url;
dialogVisible.value = true;
}
dialogImageUrl.value = file.url;
dialogVisible.value = true;
};
// 对象转成指定字符串分隔
const listToString = (list: any[], separator?: string) => {
let strs = "";
separator = separator || ",";
for (let i in list) {
if (undefined !== list[i].ossId && list[i].url.indexOf("blob:") !== 0) {
strs += list[i].ossId + separator;
}
let strs = '';
separator = separator || ',';
for (let i in list) {
if (undefined !== list[i].ossId && list[i].url.indexOf('blob:') !== 0) {
strs += list[i].ossId + separator;
}
return strs != "" ? strs.substring(0, strs.length - 1) : "";
}
}
return strs != '' ? strs.substring(0, strs.length - 1) : '';
};
</script>
<style scoped lang="scss">
// .el-upload--picture-card 控制加号部分
:deep(.hide .el-upload--picture-card) {
display: none;
display: none;
}
</style>

Some files were not shown because too many files have changed in this diff Show More