Compare commits

...

456 Commits

Author SHA1 Message Date
kuaifan
9eaa575d1a build 2022-03-04 08:53:42 +08:00
kuaifan
996ed78a0e perf: 优化仪表盘角标数 2022-03-04 08:51:22 +08:00
kuaifan
1759572b2e perf: 优化客户端任务详情按command+s保存 2022-03-04 08:50:22 +08:00
kuaifan
0a9f9eea90 build 2022-03-04 00:00:26 +08:00
kuaifan
223fb540b1 perf: 优化文件重命名,支持按esc取消编辑 2022-03-03 23:57:58 +08:00
kuaifan
c5f1c95f7b perf: 任务详情打开操作菜单时按esc任务窗口隐藏了但是菜单还看见 2022-03-03 23:06:54 +08:00
kuaifan
3bbcbca926 build 2022-03-03 16:21:08 +08:00
kuaifan
63c1deb630 fix: md编辑器出现toc混乱的情况 2022-03-03 16:17:49 +08:00
kuaifan
424e2428fe pref: 上传文件名称过程显示错位的问题 2022-03-03 15:11:50 +08:00
kuaifan
2fdef45156 pref: 退出登录返回登录页而不是注册页 2022-03-03 15:11:34 +08:00
kuaifan
4cd4550a36 pref: 网络异常的情况下需提示网络异常而不是系统出错 2022-03-03 14:53:01 +08:00
kuaifan
16af625aef no msg 2022-03-03 14:35:21 +08:00
kuaifan
8e72794c07 pref: 任务详情当任务倒计时结束时显示"超期未完成"标签 2022-03-03 14:35:12 +08:00
kuaifan
d9cf6d7e1b pref: 优化脚本,支持部分服务器是docker compose命令 2022-03-03 14:22:25 +08:00
kuaifan
f4e4252227 perf: 优化已读回执 2022-03-03 11:41:54 +08:00
kuaifan
7107409b1b no message 2022-03-02 08:46:29 +08:00
kuaifan
6c086fab6f no message 2022-03-02 08:32:38 +08:00
kuaifan
d027d67e08 pref: 倒计时刚到到达0时会显示自定义才继续显示计时,且未显示超时标签 2022-03-02 08:25:38 +08:00
kuaifan
a7d9e635eb pref: 鼠标滑动至仪表盘中的待完成任务卡片时,卡片周围未显示光晕,且未显示为手指样式 2022-03-02 08:19:09 +08:00
kuaifan
e7196efaea pref: 优化任务详细描述显示 2022-03-02 08:17:30 +08:00
kuaifan
0a2a903c74 fix: 修复登录页设置下拉显示不全的情况 2022-03-02 07:59:53 +08:00
kuaifan
8104c26b19 处理任务简介出现"的情况 2022-03-02 07:48:29 +08:00
kuaifan
101d5c7eb0 build 2022-02-28 00:23:20 +08:00
kuaifan
cad253b85f feat: 导出任务功能 2022-02-28 00:21:48 +08:00
kuaifan
f17009a988 优化左上角菜单集合 2022-02-27 22:54:48 +08:00
kuaifan
1f76278d2b 优化客户端升级提示 2022-02-27 22:53:54 +08:00
kuaifan
e032d29c91 修复数据库字段填写错误 2022-02-27 21:12:11 +08:00
kuaifan
31d1b0c994 nomsg 2022-02-27 15:03:39 +08:00
kuaifan
611c6d415c perf: 记录任务工作流变化 2022-02-27 14:12:15 +08:00
kuaifan
e3b7ac00fd perf: 优化修改工作流的过程 2022-02-27 14:11:50 +08:00
kuaifan
7c952822db perf: 优化任务排序 2022-02-27 11:06:18 +08:00
kuaifan
b9e435c0e2 perf: 支持nodejs16+ 2022-02-27 10:59:38 +08:00
kuaifan
356d40e640 feat: 文件支持拖动到列表上传 2022-02-25 22:49:56 +08:00
kuaifan
123ffd4e66 no message 2022-02-25 22:47:56 +08:00
kuaifan
c952659620 fix: 修复无法预览pdf文件 2022-02-25 22:15:25 +08:00
kuaifan
ea8e1e9c57 优化样式 2022-02-25 15:14:20 +08:00
kuaifan
478d63893b fix: 无法浏览聊天图片的问题 2022-02-25 14:38:40 +08:00
kuaifan
b5ccba552f build 2022-02-25 09:12:28 +08:00
kuaifan
8d2ee364ba perf: 文件、聊天文件、任务文件预览优化(支持预览drawio、mind等) 2022-02-25 09:11:58 +08:00
kuaifan
14006068c8 优化样式 2022-02-25 00:13:15 +08:00
kuaifan
b4358ffc66 fix: 登录页重复填写sso地址无法保存的问题 2022-02-25 00:09:57 +08:00
kuaifan
33135b1df1 fix: 无法移动共享文件夹内创建的文件 2022-02-25 00:08:32 +08:00
kuaifan
9a66c38e01 fix: 客户端无法编辑office文件 2022-02-25 00:05:35 +08:00
kuaifan
81132ecab0 fix: 客户端无法下载文件 2022-02-25 00:05:12 +08:00
kuaifan
9d89af37be build 2022-02-24 09:04:03 +08:00
kuaifan
fbc8a36232 perf: 消息会话右键时隐藏滚动条 2022-02-24 09:03:15 +08:00
kuaifan
ea028ea1a1 perf: 页面高度足够时只滚动项目部分 2022-02-24 09:02:42 +08:00
kuaifan
35b1c12bb5 Merge branch 'develop' of ssh://git.gezi.vip:6006/gx/dootask
# Conflicts:
#	electron/package.json
#	package.json
#	public/js/app.js
2022-02-24 08:07:40 +08:00
kuaifan
fc89d96635 优化drawio不显示添加模板 2022-02-24 00:45:53 +08:00
kuaifan
27129652f2 no message 2022-02-23 23:31:59 +08:00
kuaifan
23ef992a7f 优化创建者和协助人机制 2022-02-23 23:30:33 +08:00
kuaifan
04533e17ec Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	app/Models/ProjectTask.php
#	public/css/app.css
#	public/js/app.js
#	public/js/build/361.js
#	public/js/build/412.js
#	public/js/build/499.js.LICENSE.txt
#	public/js/build/659.js
#	public/js/build/659.js.LICENSE.txt
#	public/js/build/726.js.LICENSE.txt
#	public/js/build/747.js
2022-02-23 23:18:50 +08:00
kuaifan
7f2fcba542 no message 2022-02-23 23:03:35 +08:00
kuaifan
c115e2f985 build 2022-02-23 22:57:33 +08:00
kuaifan
88642c2003 perf: 客户端版本更新提示关闭 2022-02-23 22:53:04 +08:00
kuaifan
2c678b5363 no message 2022-02-23 22:52:36 +08:00
kuaifan
bc3b72fafe no message 2022-02-23 20:58:04 +08:00
韦荣超
df3b8cf09c perf: 除了任务状态,任务创建人和协助人权限与负责人的保持一致 2022-02-23 17:25:54 +08:00
kuaifan
65393b7809 优化客户端升级提示 2022-02-23 16:45:38 +08:00
韦荣超
9782c849ad build: e7efaed08a250e1d885377e18742f6e948f481a0 2022-02-23 16:27:57 +08:00
韦荣超
e7efaed08a perf: 议仪表盘添加'待完成任务'选项 2022-02-23 16:26:07 +08:00
kuaifan
337b3e5b5d 优化终端命令 2022-02-23 16:03:54 +08:00
kuaifan
7b1b7d1372 perf: 创建者及协助人可以修改任务但不能修改任务状态 2022-02-23 16:00:54 +08:00
韦荣超
e5b838a2b3 build: f9cc2ceb11efa4b280d4b6344f69e8a2be19bd59 2022-02-23 15:55:41 +08:00
韦荣超
f9cc2ceb11 perf: 优化点击右键时选中框缺少右侧线条 2022-02-23 15:51:24 +08:00
kuaifan
4f107c5618 perf: 客户端修改文件未保存关闭窗口前提示 2022-02-23 15:16:36 +08:00
韦荣超
b1c5aaff43 build: d0a4473e2bb057050959300e333eaea7cdc7a6ff 2022-02-23 15:04:21 +08:00
韦荣超
d0a4473e2b fix: 项目、消息置顶样式修改 2022-02-23 15:02:05 +08:00
kuaifan
1c79361094 fix: 修复客户端任务新窗口无法修改任务等级 2022-02-23 14:53:15 +08:00
kuaifan
f72114c223 优化electron通信 2022-02-23 14:52:39 +08:00
kuaifan
dbd59cd958 no message 2022-02-23 12:51:27 +08:00
韦荣超
d65f8a3c82 build: 96587a4e45ed4c89c12da4a58809f9c3ec88cb0f 2022-02-23 12:09:41 +08:00
韦荣超
96587a4e45 perf: 修改项目及消息置顶样式 2022-02-23 12:06:43 +08:00
韦荣超
76ab47c82e perf: 任务创建人和协助人可修改任务内容和详情,但不可修改任务状态 2022-02-23 11:09:12 +08:00
kuaifan
af8344c555 fix: 修复邮箱大写报错的问题 2022-02-23 10:03:15 +08:00
kuaifan
10ff02b8a0 perf: 修改任务时间日志 2022-02-23 09:58:55 +08:00
kuaifan
cb6cf1e34b 优化drawio 2022-02-23 09:41:19 +08:00
kuaifan
953e924aa2 build 2022-02-23 00:26:44 +08:00
kuaifan
2e0c262d32 no message 2022-02-23 00:19:32 +08:00
kuaifan
cbf2e6a140 no message 2022-02-23 00:07:27 +08:00
kuaifan
49c5a9f621 取消 electron-renderer 2022-02-22 21:02:27 +08:00
kuaifan
fb8f63f305 取消drawio网页版未保存提示 2022-02-22 20:51:07 +08:00
韦荣超
49ff61ad65 build: 695fb60aa4f4e1fcebc82099d3ec6b38ff6bc284 2022-02-22 17:43:08 +08:00
韦荣超
695fb60aa4 perf: 任务聊天中发送图片时,回车可确定发送 2022-02-22 17:39:22 +08:00
韦荣超
da20fafa39 build: d6a9ecd91287555b701ba9f92f64bd430b9574e7 2022-02-22 17:20:47 +08:00
韦荣超
d6a9ecd912 fix: 项目列表滚动'置顶'框隐藏 2022-02-22 17:19:08 +08:00
韦荣超
f95d721c9c build: 69d6417985a0f17bc053ac5786711ac6f3bceca5 2022-02-22 16:51:50 +08:00
韦荣超
69d6417985 feat: 项目列表添加置顶功能 2022-02-22 16:49:53 +08:00
kuaifan
ab2bbc28c8 no message 2022-02-22 14:24:27 +08:00
kuaifan
b0b39429ed build 2022-02-22 12:46:38 +08:00
kuaifan
ff14cbc752 feat: 支持文本、图表、思维导图下载上传 2022-02-22 12:24:16 +08:00
kuaifan
dd013aaaa3 优化drawio 2022-02-21 20:23:15 +08:00
kuaifan
119f61ef67 build 2022-02-21 18:49:38 +08:00
kuaifan
a99588c766 优化drawio路径 2022-02-21 18:11:41 +08:00
kuaifan
6f35fe9936 客户端drawio本地化 2022-02-21 17:46:00 +08:00
kuaifan
3112425e43 build 2022-02-20 21:27:52 +08:00
kuaifan
1ab3aefaa5 perf: 更新流程图表 2022-02-20 17:15:01 +08:00
kuaifan
be08732e6b 修复暗黑模式流程图无法正常浏览的问题 2022-02-19 14:43:11 +08:00
kuaifan
97b58b5f9a build 2022-02-19 14:31:10 +08:00
kuaifan
e4855875cf 优化文件多选部分 2022-02-19 14:29:22 +08:00
kuaifan
7a267cc07b 整理代码 2022-02-19 11:44:03 +08:00
kuaifan
f4f351cf9d Merge branch 'develop' of ssh://git.gezi.vip:6006/gx/dootask
# Conflicts:
#	public/css/app.css
#	public/js/app.js
#	public/js/build/208.js
#	public/js/build/389.js
#	public/js/build/406.js
#	public/js/build/406.js.LICENSE.txt
#	public/js/build/423.js
#	public/js/build/459.js
#	public/js/build/459.js.LICENSE.txt
#	public/js/build/688.js
#	public/js/build/688.js.LICENSE.txt
#	public/js/build/726.js
#	public/js/build/755.js
#	public/js/build/93.js
#	public/js/build/954.js
2022-02-19 09:30:13 +08:00
kuaifan
970b811ab9 no msg 2022-02-19 09:27:30 +08:00
kuaifan
99604dbe35 升级onlyoffice 2022-02-18 19:58:21 +08:00
韦荣超
09b1d89718 build: ccb889233c31d2d180cba378faa009052c24db70 2022-02-18 19:20:42 +08:00
韦荣超
9d1a9f3134 build: ccb889233c31d2d180cba378faa009052c24db70 2022-02-18 19:20:35 +08:00
韦荣超
ccb889233c fix: 【文件】右键多选所有文件复选框显示,取消所有选中消失 2022-02-18 19:19:05 +08:00
韦荣超
939f2cbf97 build: 4bd8835f239ca49a7b2cd11bd3dd4128611b14f5 2022-02-18 18:50:38 +08:00
韦荣超
580e0cb36a build: 4bd8835f239ca49a7b2cd11bd3dd4128611b14f5 2022-02-18 18:50:29 +08:00
韦荣超
4bd8835f23 fix: 消息:列表滚动隐藏'置顶'文案 2022-02-18 18:48:43 +08:00
韦荣超
22f32da0c5 build: aa8a094383bb60ea8313b4f50f80b48df15cff3e 2022-02-18 18:42:49 +08:00
韦荣超
aa8a094383 fix: 文件:列表模式右键后已选内容会错乱修复 2022-02-18 18:40:39 +08:00
韦荣超
4a72b7f089 build: a33e4905cf890fe713a368c9dee97e90c727150d 2022-02-18 17:03:18 +08:00
韦荣超
a33e4905cf fix: 消息:列表滚动右键Y轴值判断错误修复 2022-02-18 17:01:33 +08:00
韦荣超
40bd2f0742 build: 1fd73fe79e315e3fccd9f35a8ecf668c396d707a 2022-02-18 16:45:55 +08:00
韦荣超
1fd73fe79e fix: 消息:列表滚动在任意位置右键菜单错位问题修复 2022-02-18 16:43:27 +08:00
韦荣超
fd7d3e06f4 build: 7a4d27da69e9afaad5dc4b11441a3e8726e785a2 2022-02-18 16:17:41 +08:00
韦荣超
7a4d27da69 perf: 【文件】多个选择剪切功能与右键剪切重复,数据处理应该合拼;方格列表默认不显示复选框,右键菜单新增一个多选菜单 2022-02-18 16:14:54 +08:00
韦荣超
afbadf7d81 build: 4f2c0e94d94e91ab58238cca0d2df0bf978f5d0d 2022-02-18 14:02:22 +08:00
韦荣超
7b65c64431 build: 4f2c0e94d94e91ab58238cca0d2df0bf978f5d0d 2022-02-18 14:02:00 +08:00
韦荣超
4f2c0e94d9 perf: 优化注册提示 2022-02-18 13:59:40 +08:00
韦荣超
7593d7a3e9 build: 3400d1e8033d7da2067e1c9a9b6a8fc3a25cd7cf 2022-02-18 11:54:29 +08:00
韦荣超
35ddc4a472 Merge remote-tracking branch 'origin/chao-flow' into develop 2022-02-18 11:52:22 +08:00
韦荣超
3400d1e803 fix: 为引入组件报错 2022-02-18 11:51:11 +08:00
韦荣超
f672428fde build: 1521d1e8831a60f5f737a9480d2e8726ac98c4a5 2022-02-18 11:29:33 +08:00
韦荣超
4171d993d0 Merge remote-tracking branch 'origin/chao-flow' into develop
# Conflicts:
#	public/js/app.js
2022-02-18 11:25:49 +08:00
韦荣超
d22310ea31 build: 1521d1e8831a60f5f737a9480d2e8726ac98c4a5 2022-02-18 11:23:38 +08:00
韦荣超
1521d1e883 fix: 【文件】流程图只读接入新组件及删除旧组件引入代码 2022-02-18 11:21:56 +08:00
韦荣超
0412615f6e build: 2bd666efe7b4f2dc2bd250bcaf0b9abbf23b2584 2022-02-18 10:11:48 +08:00
韦荣超
2bd666efe7 perf: 消息列表需支持多个置顶 2022-02-18 10:10:17 +08:00
kuaifan
541e1f760b build 2022-02-17 20:39:47 +08:00
kuaifan
f176bed436 隐藏浏览流程图的滚动条(流程图使用拖动浏览) 2022-02-17 19:12:29 +08:00
kuaifan
403545cd9b perf: 没有时间还显示时间倒计时的问题 2022-02-17 19:11:52 +08:00
kuaifan
54e4ed27ae perf: 优化修改任务时间记录 2022-02-17 19:11:23 +08:00
kuaifan
e5ddf5616a perf: 优化文件重命名 2022-02-17 18:48:18 +08:00
kuaifan
967c4f04d9 fix: 修复复制文件内容为空的问题 2022-02-17 18:34:27 +08:00
kuaifan
36d4d445a6 fix: 流程图预览暗黑模式下看不见文字的问题 2022-02-17 17:47:51 +08:00
kuaifan
5ed0ae2fa9 perf: 主任务归档时同步子任务归档 2022-02-17 17:27:11 +08:00
韦荣超
503a719609 build: 2dcbba63cbf2f77a326dd4ab51acba1ad090ddcb 2022-02-17 15:22:31 +08:00
韦荣超
2dcbba63cb fix: 【消息】置顶会话在子类tab中排序错误修改 2022-02-17 15:20:47 +08:00
韦荣超
5e86bdfda7 build: 4f74a0440c4a3a8b214ff6b7c058dcb50ac0a99a 2022-02-17 14:43:21 +08:00
韦荣超
4f74a0440c perf: 【注册】校验参数是否合法顺序优化 2022-02-17 14:41:49 +08:00
韦荣超
858709f610 build: 6689d48fadfc1f1c5ddfe0ecaa05f1d75b70161e 2022-02-17 10:44:23 +08:00
韦荣超
6689d48fad perf: 【消息】列表置顶会话加背景颜色 2022-02-17 10:42:28 +08:00
韦荣超
8581a7c308 build: 9878efb198c5efe93eaa290c588e6e033029c8c3 2022-02-17 09:37:08 +08:00
韦荣超
9878efb198 perf: 【消息】列表取消置顶 2022-02-17 09:35:32 +08:00
韦荣超
9855c50367 build: 04c59041e0a135e835530baad95e2402d7b02a37 2022-02-17 09:19:35 +08:00
韦荣超
04c59041e0 feat: 【消息】列表增加点击右键置顶该聊天功能 2022-02-17 09:17:19 +08:00
kuaifan
7fb1ecc9b0 build 2022-02-15 15:44:43 +08:00
kuaifan
ecd2cdd28e perf: 会员选择输入框不刷新的情况 2022-02-15 15:41:45 +08:00
kuaifan
4b0ad22f8d fix: 取消(完成状态)变为待测试(改变状态),如果有状态负责人应该把状态负责人加上 2022-02-15 15:30:35 +08:00
kuaifan
789558da6c perf: 未完成状态禁止归档 2022-02-15 15:21:11 +08:00
kuaifan
3f96117a57 no message 2022-02-15 15:11:29 +08:00
kuaifan
282d6b5746 升级electron 2022-02-15 15:11:20 +08:00
kuaifan
86d2bb9e2a 升级tinymce 2022-02-15 15:11:00 +08:00
韦荣超
ab4fbf0437 Merge remote-tracking branch 'origin/chao-flow' into develop 2022-02-15 15:09:49 +08:00
韦荣超
ae527a78ef perf: 【文件】流程图新组件添加切换皮肤主题功能 2022-02-15 15:02:32 +08:00
韦荣超
8218868681 Merge remote-tracking branch 'origin/chao-flow' into develop 2022-02-15 14:15:00 +08:00
韦荣超
251f4ca4ac fix: 【文件】流程图新组件添加缺失图片 2022-02-15 14:13:42 +08:00
韦荣超
5d5c8ced24 Merge remote-tracking branch 'origin/chao-flow' into develop 2022-02-15 11:12:20 +08:00
韦荣超
f0ec9b7826 fix: 【文件】流程图新组件复选框在360浏览器中显示异常修改 2022-02-15 11:05:48 +08:00
kuaifan
90b8e785a4 fix: 已完成子任务还出现时间跳动的情况 2022-02-15 10:39:19 +08:00
韦荣超
cb11a71ff5 build: 重新编译 2022-02-15 09:11:14 +08:00
韦荣超
54dd90fc4a Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	public/js/app.js
#	public/js/build/423.js
#	public/js/build/726.js
#	public/js/build/93.js
2022-02-15 09:05:20 +08:00
kuaifan
4bb080bd58 vue data内支持this.$L 2022-02-14 18:59:53 +08:00
韦荣超
5115a048a3 Merge remote-tracking branch 'origin/chao-flow' into develop
# Conflicts:
#	public/css/app.css
#	public/js/app.js
#	public/js/build/423.js
#	public/js/build/93.js
2022-02-14 18:17:09 +08:00
韦荣超
259351cdd2 fix: 【文件】流程图去掉ctr+s提示框 2022-02-14 18:13:16 +08:00
kuaifan
972b8f83bc 添加任务详细描述取消文件上传 2022-02-14 17:37:11 +08:00
kuaifan
9f6b1c1e25 perf: 优化iPad兼容 2022-02-14 17:34:07 +08:00
kuaifan
6229a103aa perf: 优化右下角、登录页主题设置 2022-02-14 17:02:51 +08:00
韦荣超
84116e531b build: 2c1b944b7ced9b1401be1d263b38c8c546bb33cf 2022-02-14 13:42:45 +08:00
韦荣超
2c1b944b7c fix: 【文件】新版流程图右侧及底部被隐藏问题修改 2022-02-14 13:40:37 +08:00
kuaifan
0e66ca148d build 2022-02-13 14:10:06 +08:00
kuaifan
ce70c1ca3a perf: 单条消息最长2000个字符,超过自动分割发送,总最长20000 2022-02-12 17:01:12 +08:00
韦荣超
56b91a59a2 Merge remote-tracking branch 'origin/develop' into develop 2022-02-12 16:02:04 +08:00
kuaifan
8f1fbcb19e no message 2022-02-12 15:10:30 +08:00
韦荣超
a4799a1bc0 “新版本流程图文件” 2022-02-12 15:04:11 +08:00
韦荣超
cc24ff22e9 perf: 去掉刷新提示及前端报错 2022-02-12 15:02:10 +08:00
kuaifan
72ca335c4c perf: 下载、查看任务文件权限改为所有项目成员 2022-02-12 14:24:36 +08:00
kuaifan
0ef6476e58 perf: 任务详细描述取消文件上传 2022-02-12 14:15:23 +08:00
kuaifan
6ba63d1466 fix: 修复聊天mp4文件无法预览的问题 2022-02-12 14:14:18 +08:00
kuaifan
f9d28e1b6b perf: 优化任务详情拖动发送文件 2022-02-12 13:49:30 +08:00
韦荣超
63534d3eb5 feat: 更新流程图组件 2022-02-12 11:54:56 +08:00
韦荣超
2ab2cf01db “新版本流程图文件” 2022-02-12 11:51:37 +08:00
kuaifan
2fc039dd70 perf: 优化通知 2022-02-12 09:50:02 +08:00
韦荣超
230d1a1f86 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	app/Http/Controllers/Api/FileController.php
#	public/js/build/208.js
#	public/js/build/252.js
#	public/js/build/400.js
#	public/js/build/76.js
2022-02-11 11:01:05 +08:00
kuaifan
f7921bf388 build 2022-02-10 21:18:18 +08:00
kuaifan
feed984ba8 perf: 兼容iPad端 2022-02-10 21:03:36 +08:00
kuaifan
5324861f16 perf: 手动切换账号提示“项目不存在或不在成员列表内”的情况 2022-02-10 20:34:13 +08:00
kuaifan
ae80939d2e perf: 任务详情 2022-02-10 20:33:35 +08:00
kuaifan
c117e4b087 fix: 修复文件上传一直出现loading的情况 2022-02-10 20:33:14 +08:00
kuaifan
96580e2284 perf: 该文件版本已经改变了。该页面将被重新加载 2022-02-10 20:12:17 +08:00
kuaifan
bc3932c8b8 perf: 点击切换语言一级菜单出现的兼容问题 2022-02-10 17:10:18 +08:00
kuaifan
f7cd4f34d3 fix: 已存在的任务新添加负责人不出现在任务群聊里 2022-02-10 17:09:44 +08:00
kuaifan
3a76f51707 fix: 初次安装失败的情况 2022-02-10 16:41:07 +08:00
kuaifan
041ba8f2ed 优化onlyoffice样式 2022-02-09 21:52:04 +08:00
kuaifan
17e5d15b1b build 2022-02-09 21:50:12 +08:00
kuaifan
a6ba59eac0 perf: 上传文件夹 2022-02-09 21:04:18 +08:00
kuaifan
e89ff02b59 fix: 客户端偶尔出现无法打开文件的情况 2022-02-09 21:04:03 +08:00
kuaifan
b28be29dc8 build 2022-02-09 17:29:36 +08:00
kuaifan
9ad85e01de perf: 该文件版本已经改变了。该页面将被重新加载 2022-02-09 17:27:59 +08:00
kuaifan
d49790ba78 perf: 团队管理新增身份筛选项 2022-02-09 17:09:40 +08:00
kuaifan
598f01de95 no message 2022-02-09 16:59:48 +08:00
kuaifan
992e137339 perf: 任务文件支持更多格式上传 2022-02-09 16:59:42 +08:00
kuaifan
124666cca6 优化系统设置路由菜单 2022-02-09 16:13:13 +08:00
kuaifan
848359bf7b feat: 添加项目支持默认工作流 2022-02-09 16:05:25 +08:00
kuaifan
fb24af1900 feat: 新增自定义添加项目时的项目模板 2022-02-09 16:05:02 +08:00
韦荣超
3d6df3cc09 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	app/Http/Controllers/Api/DialogController.php
#	app/Http/Controllers/Api/ProjectController.php
#	app/Models/Project.php
#	electron/package.json
#	package.json
#	public/css/app.css
#	public/js/app.js
#	public/js/build/146.js
#	public/js/build/188.js
#	public/js/build/188.js.LICENSE.txt
#	public/js/build/244.js
#	public/js/build/244.js.LICENSE.txt
#	public/js/build/278.js
#	public/js/build/278.js.LICENSE.txt
#	public/js/build/30.js
#	public/js/build/423.js
#	public/js/build/43.js
#	public/js/build/525.js
#	public/js/build/644.js.LICENSE.txt
#	public/js/build/660.js
#	public/js/build/766.js
#	public/js/build/831.js
#	public/js/build/893.js
#	public/js/build/919.js
#	public/js/build/919.js.LICENSE.txt
#	public/js/build/934.js
#	public/js/build/934.js.LICENSE.txt
#	resources/assets/js/pages/manage/components/DialogList.vue
#	resources/assets/js/pages/manage/components/DialogWrapper.vue
#	resources/assets/js/pages/manage/components/TaskAdd.vue
#	resources/assets/sass/components/report.scss
2022-02-07 10:50:38 +08:00
kuaifan
ea58ed46f2 doc 2022-01-29 16:10:31 +08:00
kuaifan
32817a4275 build 2022-01-29 16:04:28 +08:00
kuaifan
95033cd5b7 perf: 优化项目筛选工作流 2022-01-29 16:02:49 +08:00
kuaifan
9999548bc2 perf: 优化撤回消息 2022-01-29 13:39:16 +08:00
kuaifan
3d04bd4444 build 2022-01-28 18:29:15 +08:00
kuaifan
21e618cca2 优化了一些代码 2022-01-28 18:27:47 +08:00
kuaifan
02eb386155 撤回消息优化 2022-01-28 15:09:57 +08:00
kuaifan
35bd038802 Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	app/Http/Controllers/Api/DialogController.php
#	app/Http/Controllers/Api/ProjectController.php
#	electron/package.json
#	package.json
#	public/css/app.css
#	public/docs/assets/main.bundle.js
#	public/js/app.js
#	public/js/build/146.js.LICENSE.txt
#	public/js/build/161.js
#	public/js/build/199.js
#	public/js/build/199.js.LICENSE.txt
#	public/js/build/218.js
#	public/js/build/218.js.LICENSE.txt
#	public/js/build/244.js
#	public/js/build/244.js.LICENSE.txt
#	public/js/build/309.js
#	public/js/build/423.js
#	public/js/build/43.js
#	public/js/build/693.js
#	public/js/build/717.js
#	public/js/build/717.js.LICENSE.txt
#	public/js/build/79.js.LICENSE.txt
#	resources/assets/js/pages/manage/components/TaskAdd.vue
2022-01-28 14:39:43 +08:00
kuaifan
1ff59aee56 perf: 优化修改工作流未保存关闭提示 2022-01-28 13:25:51 +08:00
kuaifan
d64fae1832 perf: 查看工作报告图片显示不全的问题 2022-01-28 13:12:11 +08:00
kuaifan
ae169810d0 perf: 优化UserInput组件 2022-01-28 13:04:54 +08:00
kuaifan
3c7619098a build 2022-01-28 01:20:36 +08:00
kuaifan
a881bfd63b fix: 客户端编辑文件不显示协助成员 2022-01-28 01:12:22 +08:00
kuaifan
09d3131d46 fix: 添加任务时选择任务组无效 2022-01-28 00:12:51 +08:00
kuaifan
53550b8975 fix: 工作报告弹窗被遮挡的问题 2022-01-27 23:55:13 +08:00
kuaifan
569164ed56 fix: 客户端任务窗口首次聊天失败的问题 2022-01-27 23:44:06 +08:00
kuaifan
f61d79d53e 客户端office查看修改窗口隐藏自带的标题 2022-01-27 23:28:38 +08:00
kuaifan
bba28d6b57 fix: 文件右键打开失效 2022-01-27 23:17:41 +08:00
Mr.Huan
469f30044a build: 0993d877990fcb77b3f865268370cdb04de18afd 2022-01-27 17:12:58 +08:00
Mr.Huan
0993d87799 fix: 修复工作汇报正文被图片撑开页面的问题 2022-01-27 17:11:48 +08:00
Mr.Huan
09fa33236f build: 4e9abd65120687e4bb6c84a037596c4c725f96fc 2022-01-27 16:33:25 +08:00
Mr.Huan
4e9abd6512 perf: 开放文件夹移动功能 2022-01-27 16:31:58 +08:00
Mr.Huan
2996c0b38e build: 36e366abe0f3af6b2693708a5f012b2ef7fcc57a 2022-01-27 15:58:26 +08:00
Mr.Huan
36e366abe0 perf: 优化文件模块用户体验 2022-01-27 15:55:44 +08:00
Mr.Huan
f9c6c6c127 build: 34772ef2bf11535c588e594ac976cd0706fc3e91 2022-01-27 14:35:17 +08:00
Mr.Huan
34772ef2bf perf: 文件增加取消选择按钮 2022-01-27 14:33:08 +08:00
Mr.Huan
305af935a7 feat: 文件支持批量移动 2022-01-27 14:24:01 +08:00
kuaifan
33f3c9acbf build 2022-01-27 12:25:10 +08:00
kuaifan
9e560c79ae 优化聊天消息附件支持预览 2022-01-27 12:17:30 +08:00
kuaifan
705d7f3da0 perf: 聊天消息附件支持预览 2022-01-27 00:44:49 +08:00
kuaifan
08372facd7 fix: 移动端无法上传任务文件的问题 2022-01-26 19:11:16 +08:00
kuaifan
886baa427b perf: 仪表盘鼠标滑过时间显示完整时间 2022-01-26 18:12:21 +08:00
kuaifan
8ff94bc138 fix: 任务中没有聊天记录时,发送图片无法成功 2022-01-26 18:05:53 +08:00
Mr.Huan
d0438390cc build: d22266a94725640f85bceb9978c13449dfa5c35c 2022-01-26 17:27:42 +08:00
Mr.Huan
d22266a947 perf: 聊天页面图片尺寸缩小至180px 2022-01-26 17:26:29 +08:00
Mr.Huan
e34fb25759 fix: 修复消息撤回文字提示在第一条时会被顶部遮住的问题 2022-01-26 17:23:20 +08:00
Mr.Huan
675955b2e6 build: 4516bce0eecf7f6224fde7cbd0c1de74be3f05af 2022-01-26 17:14:58 +08:00
Mr.Huan
4516bce0ee fix: 修复个人对话为空时无法重复打开该对话的问题 2022-01-26 17:13:20 +08:00
Mr.Huan
4853fbcec3 build: 72e5f9a83ed00e9514c3d6e9991d7ddf3193659c 2022-01-26 15:04:03 +08:00
Mr.Huan
72e5f9a83e fix: 修复消息撤回文字提示在第一条时会被顶部遮住的问题 2022-01-26 15:02:56 +08:00
Mr.Huan
1a1ddc34a2 build: 40ebfb676c044b8f02d3d43105de34b2762fab9c 2022-01-26 14:46:37 +08:00
Mr.Huan
40ebfb676c perf: 头像上传图片浏览组件增加空提醒 2022-01-26 14:43:29 +08:00
kuaifan
3bb7e958dc perf: macOS角标首次不显示的问题 2022-01-26 11:46:11 +08:00
Mr.Huan
19dd16fcf0 docs: 补充消息撤回功能API文档 2022-01-26 09:48:35 +08:00
kuaifan
f596749645 Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	electron/package.json
#	package.json
#	public/css/app.css
#	public/js/app.js
#	public/js/build/120.js
#	public/js/build/120.js.LICENSE.txt
#	public/js/build/146.js.LICENSE.txt
#	public/js/build/161.js
#	public/js/build/284.js
#	public/js/build/309.js
#	public/js/build/400.js
#	public/js/build/644.js
#	public/js/build/644.js.LICENSE.txt
#	public/js/build/79.js.LICENSE.txt
#	resources/assets/js/pages/manage/components/TaskAdd.vue
2022-01-26 09:35:16 +08:00
kuaifan
482813ea88 build 2022-01-26 01:33:53 +08:00
kuaifan
60e47e85a3 perf: 添加任务时如果自己不是任务负责人可选择加入协助人员列表 2022-01-26 01:12:00 +08:00
kuaifan
22c06fee5e 剔除模式代码优化 2022-01-26 00:02:15 +08:00
kuaifan
4a42ce87a2 feat: 工作流程负责人新增剔除模式(改变任务负责人并保留操作状态的人员) 2022-01-25 23:46:47 +08:00
kuaifan
a98e4dbcd4 perf: 文件列表模式右键重命名无效 2022-01-25 23:12:42 +08:00
kuaifan
7baa37ccd1 fix: macOS客户端首次不加载角标的问题 2022-01-25 23:06:08 +08:00
kuaifan
417017add9 优化编辑器皮肤 2022-01-25 23:04:51 +08:00
Mr.Huan
b5e3cc2503 build: 2e11fe2b5852ddaa7e14bf32f4e4e246ce539084 2022-01-25 16:51:32 +08:00
Mr.Huan
2e11fe2b58 feat: 文件网格模式支持批量删除文件 2022-01-25 16:49:54 +08:00
Mr.Huan
70f1258bab feat: 文件表格支持批量删除文件 2022-01-25 16:49:54 +08:00
韦荣超
d91fa33330 fix: 工作流列表接口用作筛选时不用传多余参数 2022-01-25 16:28:15 +08:00
kuaifan
8f0b5dc049 Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	app/Http/Controllers/Api/DialogController.php
#	electron/package.json
#	package.json
#	public/css/app.css
#	public/js/app.js
#	public/js/build/146.js
#	public/js/build/146.js.LICENSE.txt
#	public/js/build/178.js
#	public/js/build/178.js.LICENSE.txt
#	public/js/build/199.js
#	public/js/build/199.js.LICENSE.txt
#	public/js/build/309.js
#	public/js/build/328.js.LICENSE.txt
#	public/js/build/388.js
#	public/js/build/43.js
#	public/js/build/46.js.LICENSE.txt
#	public/js/build/857.js
#	public/js/build/857.js.LICENSE.txt
#	public/js/build/893.js
2022-01-25 16:12:53 +08:00
kuaifan
7f14a82053 perf: 任务群聊中拖拽文件或者照片时并未有确认窗口 2022-01-25 16:06:26 +08:00
kuaifan
b05db6d458 fix: 主任务负责人无法修改子任务负责人的问题 2022-01-25 15:49:22 +08:00
kuaifan
ea87092d73 fix: 设置主任务时间跟子任务没有交集时子任务时间改为跟主任务一致 2022-01-25 15:28:42 +08:00
kuaifan
f468f7ae27 build 2022-01-25 15:05:46 +08:00
kuaifan
f12c79d292 pref: 待处理时进入动态中点击重置,重置提示中的参数为空,点击确定后,提示流程不存在或者删除 2022-01-25 15:04:03 +08:00
kuaifan
6e76514a24 pref: 添加子任务时输入框为空,回车时提示的图标错误 2022-01-25 15:03:43 +08:00
kuaifan
88f3d3821e fix: 搜索后,点击查看已归档的任务,仍然显示这个搜索框 2022-01-25 15:03:24 +08:00
kuaifan
bed2e20a91 fix: 修复归档任务无法查看日志的问题 2022-01-25 14:50:39 +08:00
kuaifan
c7700bdfef perf: 上传文件夹应该保持目录结构 2022-01-25 14:46:52 +08:00
Mr.Huan
778f6367f9 fix: 动态中点击重置按钮后流程的字体颜色和背景颜色并未正确显示 2022-01-25 11:00:59 +08:00
Mr.Huan
6115eea401 build: ff62ef729a15d819970f155d657bbac2e85e2760 2022-01-25 09:39:03 +08:00
Mr.Huan
ff62ef729a perf: 支持xmind,rp格式文件上传 2022-01-25 09:37:45 +08:00
kuaifan
d0a432164d build 2022-01-25 02:06:27 +08:00
kuaifan
0f8d9e64ef no message 2022-01-25 01:30:55 +08:00
kuaifan
d1f5096a16 删除luckysheet 2022-01-25 00:32:51 +08:00
kuaifan
003de399dc 支持在线编辑代码 2022-01-25 00:24:47 +08:00
kuaifan
36989ce5ff feat: 新增文本文件编辑功能 2022-01-24 20:33:27 +08:00
Mr.Huan
fa987b4e30 build: b47c49424051a2233e0e826dbf9b4ce3447e4b89 2022-01-24 15:50:32 +08:00
Mr.Huan
b47c494240 fix: 修复任务负责人选择弹窗不随页面滚动的问题 2022-01-24 15:35:04 +08:00
kuaifan
1ab8a19f8e fix: 客户端无法下载聊天文件的问题 2022-01-24 15:18:35 +08:00
Mr.Huan
a31134195b build: 5580a4ee3db922ec516178231a00d121b29fdc88 2022-01-24 15:08:38 +08:00
Mr.Huan
5580a4ee3d fix: 修复添加任务变更栏目后无效果的问题 2022-01-24 15:07:01 +08:00
kuaifan
870276fa48 feat: 支持文件下载 2022-01-24 14:42:29 +08:00
Mr.Huan
608660a101 build: 25cb8015d0d46f8c0acf48d114df7d722cb90673 2022-01-24 11:56:07 +08:00
Mr.Huan
25cb8015d0 perf: 注册页面增加密码格式提醒 2022-01-24 11:54:47 +08:00
Mr.Huan
e686e8f58c build: 14b699b5b199f4568ab006b7657f811069f8420d 2022-01-24 10:39:13 +08:00
Mr.Huan
14b699b5b1 perf: 消息撤回后直接删除消息 2022-01-24 10:37:18 +08:00
韦荣超
ce0c86c8e5 build: 11d1f26724ebd740abf0c2f6f1c9fa4c51ad1802 2022-01-24 10:22:45 +08:00
韦荣超
11d1f26724 feat: 加入【项目管理】任务列表流程筛选被回滚功能 2022-01-24 10:20:59 +08:00
Mr.Huan
a8c0978f0d build: 0a0227cca43d3b211cd38fd23d4426d4a104036a 2022-01-24 09:31:52 +08:00
Mr.Huan
f643911014 feat: 聊天消息撤回-后端实现 2022-01-24 09:30:10 +08:00
Mr.Huan
0a0227cca4 feat: 聊天消息撤回-前端实现 2022-01-24 09:30:10 +08:00
kuaifan
8bacc3b6ba Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	electron/package.json
#	package.json
#	public/js/app.js
#	public/js/build/161.js
#	public/js/build/400.js
#	public/js/build/616.js
#	public/js/build/845.js
2022-01-24 01:45:08 +08:00
kuaifan
d516330a41 feat: 聊天粘贴发送文件、图片时预览确认 2022-01-24 01:30:10 +08:00
kuaifan
2d83faf144 build 2022-01-24 00:42:58 +08:00
kuaifan
c3fd6bf88f 优化日志显示 2022-01-24 00:40:14 +08:00
kuaifan
2a646becfd 优化项目简介样式 2022-01-24 00:33:31 +08:00
kuaifan
a825657516 fix: 修改主任务时间时未设置时间的子任务没有同步修改 2022-01-24 00:10:47 +08:00
kuaifan
b71dbe9832 perf: 任务详情窗口截止时间24小时倒计时 2022-01-24 00:05:36 +08:00
kuaifan
f06b4040bc 支持查看已归档任务 2022-01-23 23:55:56 +08:00
kuaifan
563cd4b843 优化已归档任务列表 2022-01-23 23:44:39 +08:00
kuaifan
834dc9bec9 支持查看已归档任务 2022-01-23 23:33:16 +08:00
kuaifan
e6e58a03a6 perf: 修改任务或修改项目后同步对话信息 2022-01-23 17:58:32 +08:00
kuaifan
d9f4adbe26 支持查看归档任务 2022-01-23 17:43:15 +08:00
kuaifan
1777153411 perf: 支持查看已归档任务详情 2022-01-23 17:36:19 +08:00
kuaifan
9b0ca581f1 perf: 消息列表显示任务基本状态 2022-01-23 16:17:11 +08:00
kuaifan
493cf7d46a perf: 优化消息对话排序 2022-01-23 15:01:58 +08:00
kuaifan
004bf36dc1 perf: 隐藏无聊天内容的对话 2022-01-23 14:51:32 +08:00
kuaifan
fcf7fb4b9f perf: 消息页再次点击类型定位到未读消息 2022-01-23 14:48:10 +08:00
kuaifan
130a85a5fc fix: flow文件路径引用错误导致无法编译的问题 2022-01-23 13:16:25 +08:00
Mr.Huan
d46eec568c build: 6529e4586820ae388273295f956e2f142275a494 2022-01-22 15:39:25 +08:00
Mr.Huan
7dc6d0ffb2 build: 6529e4586820ae388273295f956e2f142275a494 2022-01-22 15:28:37 +08:00
Mr.Huan
6529e45868 fix: 修复工作汇报选择接收人组件在调整窗体大小时发生位移的问题 2022-01-22 15:26:42 +08:00
Mr.Huan
3ba6ea9c7e perf: 调整周报签名的生成方法 2022-01-22 15:07:37 +08:00
kuaifan
b6ff6f5453 Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	public/js/app.js
#	public/js/build/657.js
#	public/js/build/782.js
#	public/js/build/845.js
2022-01-22 14:18:32 +08:00
Mr.Huan
cfa529b742 build: 2eabc76c1a7da69f9e5efd9cda024eb51daa19f7 2022-01-22 13:53:13 +08:00
Mr.Huan
2eabc76c1a fix: 修复周报点击编辑关闭后再点击"新建汇报"按钮导致用户列表无法重新加载的问题 2022-01-22 13:51:03 +08:00
韦荣超
463e67d64c fix:【工作汇报】修复新增今天的周报,提示要覆盖昨天日报的问题 2022-01-22 12:06:21 +08:00
韦荣超
1f96af1024 build: 563aa9295850392b13d1a1ef7600ebb80e2d3b87 2022-01-22 10:37:27 +08:00
韦荣超
563aa92958 fix: 【工作汇报】收到的汇报中,未读时发送人删除掉汇报对象,汇报对象的未读数量仍然未减少 2022-01-22 10:35:45 +08:00
kuaifan
f09b864e30 perf: 仅客户端或Chrome浏览器支持主题功能 2022-01-22 09:07:13 +08:00
kuaifan
7ce15d5a71 优化代码 2022-01-21 23:31:01 +08:00
kuaifan
cc767b164e 优化工作报告 2022-01-21 23:16:50 +08:00
kuaifan
230ff75c0b 优化搜索栏前端 2022-01-21 21:56:27 +08:00
kuaifan
da39739fb5 优化工作报告前端 2022-01-21 21:49:27 +08:00
kuaifan
c33be22057 Merge branch 'develop' of ssh://git.gezi.vip:6006/gx/dootask into develop
# Conflicts:
#	resources/assets/js/pages/manage/components/ReportDetail.vue
#	resources/assets/js/pages/manage/components/ReportEdit.vue
2022-01-21 21:04:28 +08:00
kuaifan
902f35d21b 优化前端代码 2022-01-21 21:02:17 +08:00
韦荣超
d8426780d2 build: a1aaf90d2ef6af3e46e22bf73016ae80f97a6aa2 2022-01-21 21:01:08 +08:00
韦荣超
a1aaf90d2e fix: 【工作报告】新增报告初始化数据不导入已有时间点数据 2022-01-21 20:59:28 +08:00
韦荣超
53ed4d4072 build: da75554447c8deb7167390d56bfbe9927266a1ee 2022-01-21 19:59:44 +08:00
韦荣超
da75554447 fix: 【工作报告】详情页面前端报错修改 2022-01-21 19:58:03 +08:00
韦荣超
04998d6a60 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	public/js/app.js
2022-01-21 18:10:53 +08:00
韦荣超
3d88a28465 build: 2dd8f75d526514a0adec9d3c8eac5f026b41eed0 2022-01-21 18:10:24 +08:00
韦荣超
2dd8f75d52 fix: 【工作报告】填写内容--汇报类型切换提交提示错误问题 2022-01-21 18:08:48 +08:00
kuaifan
7a4bdd0ada no message 2022-01-21 17:59:08 +08:00
韦荣超
0ed0b5ee43 build: 2475ee90ee493c5e88686a2dd618782f6c6a0850 2022-01-21 17:41:09 +08:00
韦荣超
2475ee90ee perf: 工作报告优化 2022-01-21 17:39:10 +08:00
kuaifan
511c19d5aa 优化前端代码 2022-01-21 14:49:20 +08:00
韦荣超
c4fed86f1e Merge remote-tracking branch 'origin/develop' into develop 2022-01-21 14:26:32 +08:00
韦荣超
18904ebbaa perf: 规范代码 2022-01-21 14:26:17 +08:00
kuaifan
da3672e6be 优化前端代码 2022-01-21 14:24:31 +08:00
kuaifan
52e9836bbf build 2022-01-21 14:07:14 +08:00
kuaifan
3201d90a53 格式化代码 2022-01-21 14:07:02 +08:00
kuaifan
cd9c1d9660 Merge branch 'master' of github.com:kuaifan/dootask into develop 2022-01-21 13:54:58 +08:00
kuaifan
0f54a1f638 no message 2022-01-21 13:50:41 +08:00
kuaifan
713316f87c 优化暗黑皮肤 2022-01-21 13:50:23 +08:00
kuaifan
88d38ba8d1 fix: 发送图片显示错误 2022-01-21 13:45:33 +08:00
kuaifan
164f3275f4 优化暗黑皮肤 2022-01-21 13:13:07 +08:00
韦荣超
a44d6b8b79 build: 942cf57c36c5fb2b636047edbebd75fc6c25c777 2022-01-21 12:10:48 +08:00
韦荣超
942cf57c36 perf: 工作报告优化 2022-01-21 12:06:26 +08:00
kuaifan
18bc75242b fix: 项目负责人还原已经回档的自己不是任务负责人的任务时,无法还原,且会提示错误 2022-01-21 11:10:29 +08:00
kuaifan
3b38c8b408 perf: 共享文件删除、移动改为仅限所有者或创建者操作 2022-01-21 10:00:31 +08:00
kuaifan
22e718423e 优化暗黑模式 2022-01-21 01:38:05 +08:00
kuaifan
0dc0e7226e 调整主题色 2022-01-20 22:59:51 +08:00
kuaifan
8069784198 no message 2022-01-20 00:38:30 +08:00
kuaifan
a9e71567fe Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	electron/package.json
#	package.json
#	public/css/app.css
#	public/js/app.js
#	public/js/build/146.js
#	public/js/build/169.js
#	public/js/build/631.js
#	public/js/build/679.js
#	public/js/build/700.js
#	public/js/build/728.js
#	public/js/build/802.js
#	public/js/build/823.js
#	public/js/build/954.js
#	resources/assets/js/pages/manage.vue
2022-01-20 00:33:05 +08:00
kuaifan
0fae151731 build 2022-01-20 00:20:06 +08:00
kuaifan
3bb0b55955 feat: 添加暗黑模式 2022-01-20 00:19:00 +08:00
kuaifan
071ca80bae fix: 无法读取 /www/.env:没有那个文件或目录 2022-01-18 22:52:43 +08:00
kuaifan
1abd78305f Merge branch 'master' of github.com:kuaifan/dootask into develop
# Conflicts:
#	public/css/app.css
#	public/js/app.js
#	public/js/build/120.js
#	public/js/build/120.js.LICENSE.txt
#	public/js/build/198.js
#	public/js/build/494.js
#	public/js/build/79.js
#	public/js/build/793.js
#	public/js/build/875.js
#	public/js/build/890.js
#	resources/assets/js/components/DrawerOverlay.vue
2022-01-17 17:13:12 +08:00
kuaifan
e1ef9a94af no message 2022-01-17 00:36:19 +08:00
kuaifan
9f62023175 build 2022-01-17 00:12:34 +08:00
kuaifan
c9a6d2f5a8 perf: 优化安装脚本 2022-01-16 22:03:50 +08:00
kuaifan
07fca8b895 fix: 最大只能上传64M的问题 2022-01-16 14:53:35 +08:00
kuaifan
1a65c4a579 修复客户端 2022-01-16 01:11:19 +08:00
kuaifan
7a28a8950c 修复前端编译 2022-01-16 00:43:05 +08:00
kuaifan
89e8b0d8b9 perf: 新增工作流初始化数据 2022-01-16 00:05:49 +08:00
kuaifan
74803df5bd no message 2022-01-15 23:37:29 +08:00
kuaifan
2a8e030fb4 perf: 优化客户端自动更新 2022-01-15 23:36:21 +08:00
kuaifan
c6ebe994cc build 2022-01-15 12:53:21 +08:00
kuaifan
be3677cfa8 优化DrawerOverlay组件支持底部显示动态改变尺寸 2022-01-15 12:16:50 +08:00
kuaifan
0c2e56271b 优化DrawerOverlay组件 2022-01-15 00:06:40 +08:00
kuaifan
b019d40009 fix: websocket获取链接失败 2022-01-14 23:15:59 +08:00
kuaifan
361484be95 build 2022-01-14 18:12:33 +08:00
kuaifan
f0ce6cc28f build 2022-01-14 17:59:07 +08:00
kuaifan
ede298a142 perf: 工作汇报样式 2022-01-14 17:57:51 +08:00
kuaifan
aca1a4d34c 优化ws返回的地址 2022-01-14 16:56:45 +08:00
韦荣超
e63c5c074c build: 0d0b5dd552aa634cf972bbc16addab5c242be14d 2022-01-14 16:46:30 +08:00
韦荣超
0d0b5dd552 fix: 【工作报告】填写'提交'按钮位置被挤压修改 2022-01-14 16:43:13 +08:00
kuaifan
08704e7f60 优化报错 2022-01-14 16:35:00 +08:00
韦荣超
d48ed18102 feat: 【工作报告】功能 2022-01-14 15:55:26 +08:00
kuaifan
3602acd187 build 2022-01-14 14:05:09 +08:00
kuaifan
ad477eb608 优化文案 2022-01-14 14:01:56 +08:00
kuaifan
0a393845e9 优化任务详情窗口聊天 2022-01-14 13:52:10 +08:00
kuaifan
59b98209ac 优化websocket重连后的逻辑 2022-01-14 13:46:22 +08:00
kuaifan
ac26713f86 优化查询代码 2022-01-14 12:19:50 +08:00
kuaifan
9250ef6f65 fix: 查看日历页面部分任务会不见 2022-01-14 10:23:43 +08:00
kuaifan
cabbeb07d0 优化websocket重连后的逻辑 2022-01-14 10:23:23 +08:00
kuaifan
43171645c0 build 2022-01-14 00:04:28 +08:00
kuaifan
79c1484288 新增优化websocket重连后刷新项目、对话、仪表盘数据 2022-01-13 23:59:38 +08:00
kuaifan
e730875db3 perf: 客户端更新提示 2022-01-13 23:55:07 +08:00
kuaifan
18e9fb99b5 更新nginx持续握手时间 2022-01-13 23:53:29 +08:00
kuaifan
fd82b9b555 build 2022-01-13 19:42:41 +08:00
kuaifan
5c3bf0067e 优化日志显示 2022-01-13 19:19:58 +08:00
kuaifan
ac6b90c986 fix: 任务流转会出错 2022-01-13 18:39:57 +08:00
kuaifan
7dcd8b29fc build 2022-01-13 11:50:54 +08:00
kuaifan
d951da2c02 fix: 修复客户端旧版本更新任务出现已完成列表中有状态为“进行中”的情况 2022-01-13 11:48:33 +08:00
kuaifan
605aee35c4 perf: 发送文件ws返回错误地址 2022-01-13 11:42:01 +08:00
kuaifan
dc1f1985e8 访问接口header加上version、platform 2022-01-13 11:22:46 +08:00
kuaifan
cebcc26baf 优化项目日志 2022-01-13 11:11:29 +08:00
kuaifan
75a12fc6f5 优化日志 2022-01-13 09:00:39 +08:00
kuaifan
a3e0d89eb0 修改任务状态判断是否项目负责人直接查表 2022-01-13 00:32:35 +08:00
kuaifan
9594cc674f no message 2022-01-13 00:30:36 +08:00
kuaifan
87cdee4fe8 pref: 优化任务日志的显示 2022-01-13 00:30:36 +08:00
kuaifan
1df55b78c2 perf: 项目页面点击搜索按钮再点击弹出的搜索框窗会隐藏 2022-01-13 00:30:36 +08:00
kuaifan
f7820a23be no message 2022-01-12 16:34:16 +08:00
kuaifan
f80b9cdca5 feat: 工作流程状态支持仅限状态负责人修改 2022-01-12 16:16:04 +08:00
kuaifan
f2180b22c7 build 2022-01-11 23:23:44 +08:00
kuaifan
a745088213 perf: 任务日志刷新 2022-01-11 23:17:59 +08:00
kuaifan
14be7bd2b1 no msg 2022-01-11 22:58:30 +08:00
kuaifan
d453ea66da 优化登录页按钮 2022-01-11 21:31:23 +08:00
kuaifan
e7ae86e261 feat: 任务流转自动负责人支持转让模式 2022-01-11 20:07:58 +08:00
kuaifan
b7417f41c5 perf: action中错误提醒弱化 2022-01-11 17:54:42 +08:00
kuaifan
9e7aa381ed perf: 手机版无法选择日期范围的问题 2022-01-11 17:47:34 +08:00
kuaifan
b02453e9f4 perf: 手机版无法聊天,输入页面跳动 2022-01-11 17:35:53 +08:00
kuaifan
6b7f8fd31c 优化完成任务标记 2022-01-11 14:18:49 +08:00
kuaifan
4652242d6b build 2022-01-11 12:16:01 +08:00
kuaifan
a47ca2f357 perf: 个人设置显示版本号 2022-01-11 12:13:26 +08:00
kuaifan
e5a1e58159 perf: 完成任务暂时继续显示在我的列表 2022-01-11 12:13:06 +08:00
kuaifan
01a1e34e99 no message 2022-01-11 10:59:47 +08:00
kuaifan
e711220a66 优化自定义服务器 2022-01-11 10:31:37 +08:00
kuaifan
1d20f529a0 no message 2022-01-11 00:28:58 +08:00
kuaifan
79a94d25bd perf: 客户端自动下载新版本更新 2022-01-10 19:27:43 +08:00
kuaifan
92793b8ff8 no message 2022-01-10 00:25:36 +08:00
kuaifan
982024f359 子任务时间在主任务时间内 2022-01-09 20:13:59 +08:00
kuaifan
e851bd4d61 子任务时间大于主任务时主任务自动修改 2022-01-09 18:56:30 +08:00
kuaifan
e4b9383e96 perf: 设置子任务时间时,如果主任务没有时间则自动设置 2022-01-09 18:20:36 +08:00
kuaifan
95ac9aac14 添加任务自动上工作流状态 2022-01-09 17:59:08 +08:00
kuaifan
b895eec69c 初步完成工作流 2022-01-09 17:52:46 +08:00
kuaifan
1fe4e80f82 no msg 2022-01-09 12:56:55 +08:00
kuaifan
eb1f5f2632 perf: 任务操作菜单组件化 2022-01-09 00:09:43 +08:00
kuaifan
114b792300 no message 2022-01-08 21:23:47 +08:00
kuaifan
56a352a9d2 perf: 调整仅项目负责人可以删除任务列表 2022-01-08 17:35:25 +08:00
kuaifan
4c4d60dd83 no message 2022-01-08 17:32:03 +08:00
kuaifan
134ab0fe98 no message 2022-01-08 17:27:30 +08:00
kuaifan
bbd394272f feat: 添加工作流 2022-01-08 17:24:48 +08:00
kuaifan
8a2571f514 no msg 2022-01-08 08:56:29 +08:00
kuaifan
bf15be8144 perf: 领取任务需要设置计划时间 2022-01-08 08:51:34 +08:00
kuaifan
bf6f8de7fa no msg 2022-01-08 00:35:01 +08:00
kuaifan
2e75e6ffb6 后台限制任务负责人、协助人员每项最多不能超过10个 2022-01-07 23:36:05 +08:00
kuaifan
b987be54bf 优化前端变量 2022-01-07 23:28:07 +08:00
kuaifan
533e8a3742 build 2022-01-07 19:12:38 +08:00
kuaifan
9d007e64f6 优化部分相同代码 2022-01-07 18:42:04 +08:00
kuaifan
8ec1578f50 左边底部新增添加任务选项 2022-01-07 18:23:30 +08:00
kuaifan
4e8cc36d3a 显示完成时间 2022-01-07 18:09:22 +08:00
kuaifan
5a64cb2323 替换Tooltip改成ETooltip 2022-01-07 18:09:05 +08:00
kuaifan
b2aba82a1b perf: 任务版本如果只有一个负责人时显示负责人的名字 2022-01-07 17:46:03 +08:00
kuaifan
9d9500ba1b fix: 其他人员添加任务会临时出现在自己的列表中 2022-01-07 17:26:22 +08:00
kuaifan
674c5a11c1 客户端pkg包安装前必须关闭已打开的应用 2022-01-07 10:56:07 +08:00
kuaifan
8e2b2947ae 版本号基于master分支生成 2022-01-07 10:16:35 +08:00
kuaifan
0413ca7cba 新增pkg安装包 2022-01-07 10:14:49 +08:00
2146 changed files with 55538 additions and 365305 deletions

View File

@ -19,7 +19,7 @@ jobs:
uses: loopwerk/tag-changelog@v1 uses: loopwerk/tag-changelog@v1
with: with:
token: ${{ secrets.GH_PAT }} token: ${{ secrets.GH_PAT }}
exclude_types: other,chore exclude_types: other,chore,build
- name: Create release - name: Create release
uses: actions/create-release@latest uses: actions/create-release@latest

1
.gitignore vendored
View File

@ -19,7 +19,6 @@ Homestead.yaml
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
test.* test.*
composer.lock
package-lock.json package-lock.json
laravels-timer-process.pid laravels-timer-process.pid
.DS_Store .DS_Store

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "resources/drawio"]
path = resources/drawio
url = https://github.com/jgraph/drawio.git

View File

@ -5,10 +5,15 @@ English | **[中文文档](./README_CN.md)**
- [Screenshot Preview](README_PREVIEW.md) - [Screenshot Preview](README_PREVIEW.md)
- [Demo site](http://www.dootask.com/) - [Demo site](http://www.dootask.com/)
**QQ Group**
Group No.: `546574618`
## Setup ## Setup
> `Docker` & `Docker Compose v2.0+` must be installed - `Docker` & `Docker Compose v2.0+` must be installed
- System: `Centos/Debian/Ubuntu/macOS`
- Hardware suggestion: 2 cores and above 2G memory
### Deployment project ### Deployment project
@ -16,9 +21,9 @@ English | **[中文文档](./README_CN.md)**
# 1、Clone the repository # 1、Clone the repository
# Clone projects on github # Clone projects on github
git clone https://github.com/kuaifan/dootask.git git clone --depth=1 https://github.com/kuaifan/dootask.git
# Or you can use gitee # Or you can use gitee
git clone https://gitee.com/aipaw/dootask.git git clone --depth=1 https://gitee.com/aipaw/dootask.git
# 2、Enter directory # 2、Enter directory
cd dootask cd dootask
@ -49,18 +54,28 @@ cd dootask
./cmd start ./cmd start
``` ```
### Development compilation
```bash
# Development mode, Mac OS only
./cmd dev
# Production projects, macOS only
./cmd prod
```
### Shortcuts for running command ### Shortcuts for running command
```bash ```bash
# You can do this using the following command # You can do this using the following command
./cmd artisan "your command" // To run a artisan command ./cmd artisan "your command" # To run a artisan command
./cmd php "your command" // To run a php command ./cmd php "your command" # To run a php command
./cmd nginx "your command" // To run a nginx command ./cmd nginx "your command" # To run a nginx command
./cmd redis "your command" // To run a redis command ./cmd redis "your command" # To run a redis command
./cmd composer "your command" // To run a composer command ./cmd composer "your command" # To run a composer command
./cmd supervisorctl "your command" // To run a supervisorctl command ./cmd supervisorctl "your command" # To run a supervisorctl command
./cmd test "your command" // To run a phpunit command ./cmd test "your command" # To run a phpunit command
./cmd mysql "your command" // To run a mysql command (backup: Backup database, recovery: Restore database) ./cmd mysql "your command" # To run a mysql command (backup: Backup database, recovery: Restore database)
``` ```
### NGINX PROXY SSL ### NGINX PROXY SSL
@ -89,6 +104,7 @@ git pull
./cmd uninstall ./cmd uninstall
./cmd install ./cmd install
./cmd mysql recovery ./cmd mysql recovery
./cmd artisan migrate
``` ```
## Uninstall ## Uninstall
@ -97,7 +113,3 @@ git pull
# Enter directory and run command # Enter directory and run command
./cmd uninstall ./cmd uninstall
``` ```
## Contact us
QQ Group: 546574618

View File

@ -5,10 +5,15 @@
- [截图预览](README_PREVIEW.md) - [截图预览](README_PREVIEW.md)
- [演示站点](http://www.dootask.com/) - [演示站点](http://www.dootask.com/)
**QQ交流群**
- QQ群号: `546574618`
## 安装程序 ## 安装程序
> 必须安装 `Docker``Docker Compose v2.0+` - 必须安装:`Docker``Docker Compose v2.0+`
- 支持环境:`Centos/Debian/Ubuntu/macOS`
- 硬件建议2核2G以上
### 部署项目 ### 部署项目
@ -16,9 +21,9 @@
# 1、克隆项目到您的本地或服务器 # 1、克隆项目到您的本地或服务器
# 通过github克隆项目 # 通过github克隆项目
git clone https://github.com/kuaifan/dootask.git git clone --depth=1 https://github.com/kuaifan/dootask.git
# 或者你也可以使用gitee # 或者你也可以使用gitee
git clone https://gitee.com/aipaw/dootask.git git clone --depth=1 https://gitee.com/aipaw/dootask.git
# 2、进入目录 # 2、进入目录
cd dootask cd dootask
@ -49,18 +54,29 @@ cd dootask
./cmd start ./cmd start
``` ```
### 开发编译
```bash
# 开发模式仅限macOS
./cmd dev
# 编译项目仅限macOS
./cmd prod
```
### 运行命令的快捷方式 ### 运行命令的快捷方式
```bash ```bash
# 你可以使用以下命令来执行 # 你可以使用以下命令来执行
./cmd artisan "your command" // 运行 artisan 命令 ./cmd artisan "your command" # 运行 artisan 命令
./cmd php "your command" // 运行 php 命令 ./cmd php "your command" # 运行 php 命令
./cmd nginx "your command" // 运行 nginx 命令 ./cmd nginx "your command" # 运行 nginx 命令
./cmd redis "your command" // 运行 redis 命令 ./cmd redis "your command" # 运行 redis 命令
./cmd composer "your command" // 运行 composer 命令 ./cmd composer "your command" # 运行 composer 命令
./cmd supervisorctl "your command" // 运行 supervisorctl 命令 ./cmd supervisorctl "your command" # 运行 supervisorctl 命令
./cmd test "your command" // 运行 phpunit 命令 ./cmd test "your command" # 运行 phpunit 命令
./cmd mysql "your command" // 运行 mysql 命令 (backup: 备份数据库recovery: 还原数据库) ./cmd mysql "your command" # 运行 mysql 命令 (backup: 备份数据库recovery: 还原数据库)
``` ```
### NGINX 代理 SSL ### NGINX 代理 SSL
@ -89,6 +105,7 @@ git pull
./cmd uninstall ./cmd uninstall
./cmd install ./cmd install
./cmd mysql recovery ./cmd mysql recovery
./cmd artisan migrate
``` ```
## 卸载项目 ## 卸载项目
@ -97,7 +114,3 @@ git pull
# 进入项目所在目录,运行以下命令 # 进入项目所在目录,运行以下命令
./cmd uninstall ./cmd uninstall
``` ```
## 联系我们
QQ群号: 546574618

View File

@ -10,7 +10,7 @@ if (!function_exists('asset_main')) {
if (!function_exists('seeders_at')) { if (!function_exists('seeders_at')) {
function seeders_at($data) function seeders_at($data)
{ {
$diff = time() - strtotime("2021-07-01"); $diff = time() - strtotime("2021-07-02");
$time = strtotime($data) + $diff; $time = strtotime($data) + $diff;
return date("Y-m-d H:i:s", $time); return date("Y-m-d H:i:s", $time);
} }

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api; namespace App\Http\Controllers\Api;
use App\Models\File;
use App\Models\ProjectTask; use App\Models\ProjectTask;
use App\Models\ProjectTaskFile; use App\Models\ProjectTaskFile;
use App\Models\User; use App\Models\User;
@ -10,7 +11,9 @@ use App\Models\WebSocketDialogMsg;
use App\Models\WebSocketDialogMsgRead; use App\Models\WebSocketDialogMsgRead;
use App\Models\WebSocketDialogUser; use App\Models\WebSocketDialogUser;
use App\Module\Base; use App\Module\Base;
use Carbon\Carbon;
use Request; use Request;
use Response;
/** /**
* @apiDefine dialog * @apiDefine dialog
@ -38,9 +41,10 @@ class DialogController extends AbstractController
{ {
$user = User::auth(); $user = User::auth();
// //
$list = WebSocketDialog::select(['web_socket_dialogs.*']) $list = WebSocketDialog::select(['web_socket_dialogs.*', 'u.top_at'])
->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id') ->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id')
->where('u.userid', $user->userid) ->where('u.userid', $user->userid)
->orderByDesc('u.top_at')
->orderByDesc('web_socket_dialogs.last_at') ->orderByDesc('web_socket_dialogs.last_at')
->paginate(Base::getPaginate(200, 100)); ->paginate(Base::getPaginate(200, 100));
$list->transform(function (WebSocketDialog $item) use ($user) { $list->transform(function (WebSocketDialog $item) use ($user) {
@ -160,23 +164,35 @@ class DialogController extends AbstractController
} }
/** /**
* @api {get} api/dialog/msg/sendtext 05. 未读消息 * @api {get} api/dialog/msg/unread 05. 获取未读消息数量
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup dialog * @apiGroup dialog
* @apiName msg__sendtext * @apiName msg__unread
*
* @apiParam {Number} [dialog_id] 对话ID留空获取总未读消息数量
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/ */
public function msg__unread() public function msg__unread()
{ {
$unread = WebSocketDialogMsgRead::whereUserid(User::userid())->whereReadAt(null)->count(); $dialog_id = intval(Request::input('dialog_id'));
//
$builder = WebSocketDialogMsgRead::whereUserid(User::userid())->whereReadAt(null);
if ($dialog_id > 0) {
$builder->whereDialogId($dialog_id);
}
$unread = $builder->count();
return Base::retSuccess('success', [ return Base::retSuccess('success', [
'unread' => $unread, 'unread' => $unread,
]); ]);
} }
/** /**
* @api {get} api/dialog/msg/sendtext 06. 发送消息 * @api {post} api/dialog/msg/sendtext 06. 发送消息
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -192,6 +208,7 @@ class DialogController extends AbstractController
*/ */
public function msg__sendtext() public function msg__sendtext()
{ {
Base::checkClientVersion('0.8.1');
$user = User::auth(); $user = User::auth();
// //
$chat_nickname = Base::settingFind('system', 'chat_nickname'); $chat_nickname = Base::settingFind('system', 'chat_nickname');
@ -202,8 +219,8 @@ class DialogController extends AbstractController
} }
} }
// //
$dialog_id = intval(Request::input('dialog_id')); $dialog_id = Base::getPostInt('dialog_id');
$text = trim(Request::input('text')); $text = trim(Base::getPostValue('text'));
// //
if (mb_strlen($text) < 1) { if (mb_strlen($text) < 1) {
return Base::retError('消息内容不能为空'); return Base::retError('消息内容不能为空');
@ -213,11 +230,21 @@ class DialogController extends AbstractController
// //
WebSocketDialog::checkDialog($dialog_id); WebSocketDialog::checkDialog($dialog_id);
// //
$msg = [ if (mb_strlen($text) > 2000) {
'text' => $text $array = mb_str_split($text, 2000);
]; } else {
$array = [$text];
}
// //
return WebSocketDialogMsg::sendMsg($dialog_id, 'text', $msg, $user->userid); $list = [];
foreach ($array as $item) {
$res = WebSocketDialogMsg::sendMsg($dialog_id, 'text', ['text' => $item], $user->userid);
if (Base::isSuccess($res)) {
$list[] = $res['data'];
}
}
//
return Base::retSuccess('发送成功', $list);
} }
/** /**
@ -245,7 +272,7 @@ class DialogController extends AbstractController
// //
$dialog = WebSocketDialog::checkDialog($dialog_id); $dialog = WebSocketDialog::checkDialog($dialog_id);
// //
$path = "uploads/chat/" . $user->userid . "/"; $path = "uploads/chat/" . date("Ym") . "/" . $dialog_id . "/";
$image64 = Base::getPostValue('image64'); $image64 = Base::getPostValue('image64');
$fileName = Base::getPostValue('filename'); $fileName = Base::getPostValue('filename');
if ($image64) { if ($image64) {
@ -257,7 +284,7 @@ class DialogController extends AbstractController
} else { } else {
$data = Base::upload([ $data = Base::upload([
"file" => Request::file('files'), "file" => Request::file('files'),
"type" => 'file', "type" => 'more',
"path" => $path, "path" => $path,
"fileName" => $fileName, "fileName" => $fileName,
]); ]);
@ -327,4 +354,137 @@ class DialogController extends AbstractController
$read = WebSocketDialogMsgRead::whereMsgId($msg_id)->get(); $read = WebSocketDialogMsgRead::whereMsgId($msg_id)->get();
return Base::retSuccess('success', $read ?: []); return Base::retSuccess('success', $read ?: []);
} }
/**
* @api {get} api/dialog/msg/detail 09. 消息详情
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup dialog
* @apiName msg__detail
*
* @apiParam {Number} msg_id 消息ID
* @apiParam {String} only_update_at 仅获取update_at字段
* - no (默认)
* - yes
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function msg__detail()
{
User::auth();
//
$msg_id = intval(Request::input('msg_id'));
$only_update_at = Request::input('only_update_at', 'no');
//
$dialogMsg = WebSocketDialogMsg::whereId($msg_id)->first();
if (empty($dialogMsg)) {
return Base::retError("文件不存在");
}
//
if ($only_update_at == 'yes') {
return Base::retSuccess('success', [
'id' => $dialogMsg->id,
'update_at' => Carbon::parse($dialogMsg->updated_at)->toDateTimeString()
]);
}
//
$data = $dialogMsg->toArray();
//
if ($data['type'] == 'file') {
$msg = Base::json2array($dialogMsg->getRawOriginal('msg'));
$msg = File::formatFileData($msg);
$data['content'] = $msg['content'];
$data['file_mode'] = $msg['file_mode'];
}
//
return Base::retSuccess('success', $data);
}
/**
* @api {get} api/dialog/msg/download 10. 文件下载
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup dialog
* @apiName msg__download
*
* @apiParam {Number} msg_id 消息ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function msg__download()
{
User::auth();
//
$msg_id = intval(Request::input('msg_id'));
//
$msg = WebSocketDialogMsg::whereId($msg_id)->first();
if (empty($msg)) {
abort(403, "This file not exist.");
}
if ($msg->type != 'file') {
abort(403, "This file not support download.");
}
$array = Base::json2array($msg->getRawOriginal('msg'));
//
return Response::download(public_path($array['path']), $array['name']);
}
/**
* @api {get} api/dialog/msg/withdraw 11. 聊天消息撤回
*
* @apiDescription 消息撤回限制24小时内需要token身份
* @apiVersion 1.0.0
* @apiGroup dialog
* @apiName msg__withdraw
*
* @apiParam {Number} msg_id 消息ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function msg__withdraw()
{
$user = User::auth();
$msg_id = intval(Request::input("msg_id"));
$msg = WebSocketDialogMsg::whereId($msg_id)->whereUserid($user->userid)->first();
if (empty($msg)) {
return Base::retError("消息不存在或已被删除");
}
$msg->deleteMsg();
return Base::retSuccess("success");
}
/**
* @api {get} api/dialog/top 12. 会话置顶
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup dialog
* @apiName top
*
* @apiParam {Number} dialog_id 会话ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function top()
{
$user = User::auth();
$dialogId = intval(Request::input('dialog_id'));
$dialogUser = WebSocketDialogUser::whereUserid($user->userid)->whereDialogId($dialogId)->first();
if (!$dialogUser) {
return Base::retError("会话不存在");
}
$dialogUser->top_at = $dialogUser->top_at ? null : Carbon::now();
$dialogUser->save();
return Base::retSuccess("success", $dialogId);
}
} }

View File

@ -2,7 +2,7 @@
namespace App\Http\Controllers\Api; namespace App\Http\Controllers\Api;
use App\Exceptions\ApiException;
use App\Models\AbstractModel; use App\Models\AbstractModel;
use App\Models\File; use App\Models\File;
use App\Models\FileContent; use App\Models\FileContent;
@ -11,6 +11,7 @@ use App\Models\FileUser;
use App\Models\User; use App\Models\User;
use App\Module\Base; use App\Module\Base;
use App\Module\Ihttp; use App\Module\Ihttp;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Request; use Request;
@ -205,22 +206,30 @@ class FileController extends AbstractController
'folder', 'folder',
'document', 'document',
'mind', 'mind',
'sheet', 'drawio',
'flow',
'word', 'word',
'excel', 'excel',
'ppt', 'ppt',
])) { ])) {
return Base::retError('类型错误'); return Base::retError('类型错误');
} }
$ext = ''; $ext = str_replace([
if (in_array($type, [ 'folder',
'document',
'mind',
'drawio',
'word', 'word',
'excel', 'excel',
'ppt', 'ppt',
])) { ], [
$ext = str_replace(['word', 'excel', 'ppt'], ['docx', 'xlsx', 'pptx'], $type); '',
} 'md',
'mind',
'drawio',
'docx',
'xlsx',
'pptx',
], $type);
// //
$userid = $user->userid; $userid = $user->userid;
if ($pid > 0) { if ($pid > 0) {
@ -293,9 +302,19 @@ class FileController extends AbstractController
'userid' => $userid, 'userid' => $userid,
'created_id' => $user->userid, 'created_id' => $user->userid,
]); ]);
$file->save(); $data = AbstractModel::transaction(function() use ($file) {
$content = FileContent::select(['content', 'text', 'size'])->whereFid($file->cid)->orderByDesc('id')->first();
$file->size = $content?->size ?: 0;
$file->save();
if ($content) {
$content = $content->toArray();
$content['fid'] = $file->id;
$content['userid'] = $file->userid;
FileContent::createInstance($content)->save();
}
return File::find($file->id);
});
// //
$data = File::find($file->id);
$data->pushMsg('add', $data); $data->pushMsg('add', $data);
return Base::retSuccess('复制成功', $data); return Base::retSuccess('复制成功', $data);
} }
@ -308,7 +327,7 @@ class FileController extends AbstractController
* @apiGroup file * @apiGroup file
* @apiName move * @apiName move
* *
* @apiParam {Number} id 文件ID * @apiParam {Numbers} ids 文件ID(格式:[id1, id2]
* @apiParam {Number} pid 移动到的文件夹ID * @apiParam {Number} pid 移动到的文件夹ID
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
@ -319,30 +338,45 @@ class FileController extends AbstractController
{ {
$user = User::auth(); $user = User::auth();
// //
$id = intval(Request::input('id')); $ids = Request::input('ids');
$pid = intval(Request::input('pid')); $pid = intval(Request::input('pid'));
// //
$file = File::permissionFind($id, 1000); if (!is_array($ids) || empty($ids)) {
// return Base::retError('请选择移动的文件或文件夹');
}
if (count($ids) > 100) {
return Base::retError('一次最多只能移动100个文件或文件夹');
}
if ($pid > 0) { if ($pid > 0) {
if (!File::whereUserid($user->userid)->whereId($pid)->exists()) { File::permissionFind($pid, 1);
return Base::retError('参数错误');
}
$arr = [];
$tid = $pid;
while ($tid > 0) {
$arr[] = $tid;
$tid = intval(File::whereId($tid)->value('pid'));
}
if (in_array($id, $arr)) {
return Base::retError('位置错误');
}
} }
// //
$file->pid = $pid; $files = [];
$file->save(); AbstractModel::transaction(function() use ($pid, $ids, &$files) {
$file->pushMsg('update', $file); foreach ($ids as $id) {
return Base::retSuccess('操作成功', $file); $file = File::permissionFind($id, 1000);
//
if ($pid > 0) {
$arr = [];
$tid = $pid;
while ($tid > 0) {
$arr[] = $tid;
$tid = intval(File::whereId($tid)->value('pid'));
}
if (in_array($id, $arr)) {
throw new ApiException('移动位置错误');
}
}
//
$file->pid = $pid;
$file->save();
$files[] = $file;
}
});
foreach ($files as $file) {
$file->pushMsg('update', $file);
}
return Base::retSuccess('操作成功', $files);
} }
/** /**
@ -353,7 +387,7 @@ class FileController extends AbstractController
* @apiGroup file * @apiGroup file
* @apiName remove * @apiName remove
* *
* @apiParam {Number} id 文件ID * @apiParam {Numbers} ids 文件ID(格式:[id1, id2]
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -363,12 +397,25 @@ class FileController extends AbstractController
{ {
User::auth(); User::auth();
// //
$id = intval(Request::input('id')); $ids = Request::input('ids');
// //
$file = File::permissionFind($id, 1000); if (!is_array($ids) || empty($ids)) {
return Base::retError('请选择删除的文件或文件夹');
}
if (count($ids) > 100) {
return Base::retError('一次最多只能删除100个文件或文件夹');
}
// //
$file->deleteFile(); $files = [];
return Base::retSuccess('删除成功', $file); AbstractModel::transaction(function() use ($ids, &$files) {
foreach ($ids as $id) {
$file = File::permissionFind($id, 1000);
$file->deleteFile();
$files[] = $file;
}
});
//
return Base::retSuccess('删除成功', $files);
} }
/** /**
@ -380,8 +427,14 @@ class FileController extends AbstractController
* @apiName content * @apiName content
* *
* @apiParam {Number|String} id * @apiParam {Number|String} id
* - Number 文件ID需要登录 * - Number: 文件ID需要登录
* - String 链接码(不需要登录,用于预览) * - String: 链接码(不需要登录,用于预览)
* @apiParam {String} only_update_at 仅获取update_at字段
* - no (默认)
* - yes
* @apiParam {String} down 直接下载
* - no: 浏览(默认)
* - yes: 下载office文件直接下载
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -390,6 +443,8 @@ class FileController extends AbstractController
public function content() public function content()
{ {
$id = Request::input('id'); $id = Request::input('id');
$down = Request::input('down', 'no');
$only_update_at = Request::input('only_update_at', 'no');
// //
if (Base::isNumber($id)) { if (Base::isNumber($id)) {
User::auth(); User::auth();
@ -404,8 +459,15 @@ class FileController extends AbstractController
return Base::retError('参数错误'); return Base::retError('参数错误');
} }
// //
if ($only_update_at == 'yes') {
return Base::retSuccess('success', [
'id' => $file->id,
'update_at' => Carbon::parse($file->updated_at)->toDateTimeString()
]);
}
//
$content = FileContent::whereFid($file->id)->orderByDesc('id')->first(); $content = FileContent::whereFid($file->id)->orderByDesc('id')->first();
return FileContent::formatContent($file->type, $content ? $content->content : []); return FileContent::formatContent($file, $content?->content, $down == 'yes');
} }
/** /**
@ -416,7 +478,7 @@ class FileController extends AbstractController
* @apiGroup file * @apiGroup file
* @apiName content__save * @apiName content__save
* *
* @apiParam {Number} id 文件ID * @apiParam {Number} id 文件ID
* @apiParam {Object} [D] Request Payload 提交 * @apiParam {Object} [D] Request Payload 提交
* - content: 内容 * - content: 内容
* *
@ -426,6 +488,7 @@ class FileController extends AbstractController
*/ */
public function content__save() public function content__save()
{ {
Base::checkClientVersion('0.9.13');
$user = User::auth(); $user = User::auth();
// //
$id = Base::getPostInt('id'); $id = Base::getPostInt('id');
@ -439,12 +502,11 @@ class FileController extends AbstractController
$isRep = false; $isRep = false;
preg_match_all("/<img\s*src=\"data:image\/(png|jpg|jpeg);base64,(.*?)\"/s", $data['content'], $matchs); preg_match_all("/<img\s*src=\"data:image\/(png|jpg|jpeg);base64,(.*?)\"/s", $data['content'], $matchs);
foreach ($matchs[2] as $key => $text) { foreach ($matchs[2] as $key => $text) {
$p = "uploads/files/document/" . $id . "/"; $tmpPath = "uploads/file/document/" . date("Ym") . "/" . $id . "/attached/";
Base::makeDir(public_path($p)); Base::makeDir(public_path($tmpPath));
$p.= md5($text) . "." . $matchs[1][$key]; $tmpPath .= md5($text) . "." . $matchs[1][$key];
$r = file_put_contents(public_path($p), base64_decode($text)); if (file_put_contents(public_path($tmpPath), base64_decode($text))) {
if ($r) { $data['content'] = str_replace($matchs[0][$key], '<img src="' . Base::fillUrl($tmpPath) . '"', $data['content']);
$data['content'] = str_replace($matchs[0][$key], '<img src="' . Base::fillUrl($p) . '"', $data['content']);
$isRep = true; $isRep = true;
} }
} }
@ -454,11 +516,41 @@ class FileController extends AbstractController
} }
} }
// //
switch ($file->type) {
case 'document':
$contentArray = Base::json2array($content);
$contentString = $contentArray['content'];
$file->ext = $contentArray['type'] == 'md' ? 'md' : 'text';
break;
case 'drawio':
$contentArray = Base::json2array($content);
$contentString = $contentArray['xml'];
$file->ext = 'drawio';
break;
case 'mind':
$contentString = $content;
$file->ext = 'mind';
break;
case 'code':
case 'txt':
$contentString = $content;
break;
default:
return Base::retError('参数错误');
}
$path = "uploads/file/" . $file->type . "/" . date("Ym") . "/" . $id . "/" . md5($contentString);
$save = public_path($path);
Base::makeDir(dirname($save));
file_put_contents($save, $contentString);
//
$content = FileContent::createInstance([ $content = FileContent::createInstance([
'fid' => $file->id, 'fid' => $file->id,
'content' => $content, 'content' => [
'type' => $file->ext,
'url' => $path
],
'text' => $text, 'text' => $text,
'size' => strlen($content), 'size' => filesize($save),
'userid' => $user->userid, 'userid' => $user->userid,
]); ]);
$content->save(); $content->save();
@ -498,7 +590,7 @@ class FileController extends AbstractController
if ($status === 2) { if ($status === 2) {
$parse = parse_url($url); $parse = parse_url($url);
$from = 'http://' . env('APP_IPPR') . '.3' . $parse['path'] . '?' . $parse['query']; $from = 'http://' . env('APP_IPPR') . '.3' . $parse['path'] . '?' . $parse['query'];
$path = 'uploads/office/' . date("Ym") . '/' . $file->id . '/' . $user->userid . '-' . $key; $path = 'uploads/file/' . $file->type . '/' . date("Ym") . '/' . $file->id . '/' . $key;
$save = public_path($path); $save = public_path($path);
Base::makeDir(dirname($save)); Base::makeDir(dirname($save));
$res = Ihttp::download($from, $save); $res = Ihttp::download($from, $save);
@ -516,6 +608,7 @@ class FileController extends AbstractController
$content->save(); $content->save();
// //
$file->size = $content->size; $file->size = $content->size;
$file->updated_at = Carbon::now();
$file->save(); $file->save();
$file->pushMsg('update', $file); $file->pushMsg('update', $file);
} }
@ -543,6 +636,7 @@ class FileController extends AbstractController
$user = User::auth(); $user = User::auth();
// //
$pid = intval(Request::input('pid')); $pid = intval(Request::input('pid'));
$webkitRelativePath = Request::input('webkitRelativePath');
// //
$userid = $user->userid; $userid = $user->userid;
if ($pid > 0) { if ($pid > 0) {
@ -557,7 +651,37 @@ class FileController extends AbstractController
} }
} }
// //
$path = 'uploads/office/' . date("Ym") . '/u' . $user->userid . '/'; $dirs = explode("/", $webkitRelativePath);
while (count($dirs) > 1) {
$dirName = array_shift($dirs);
if ($dirName) {
$pushMsg = [];
AbstractModel::transaction(function () use ($dirName, $user, $userid, &$pid, &$pushMsg) {
$dirRow = File::wherePid($pid)->whereType('folder')->whereName($dirName)->lockForUpdate()->first();
if (empty($dirRow)) {
$dirRow = File::createInstance([
'pid' => $pid,
'type' => 'folder',
'name' => $dirName,
'userid' => $userid,
'created_id' => $user->userid,
]);
if ($dirRow->save()) {
$pushMsg[] = File::find($dirRow->id);
}
}
if (empty($dirRow)) {
throw new ApiException('创建文件夹失败');
}
$pid = $dirRow->id;
});
foreach ($pushMsg as $tmpRow) {
$tmpRow->pushMsg('add', $tmpRow);
}
}
}
//
$path = 'uploads/tmp/' . date("Ym") . '/';
$data = Base::upload([ $data = Base::upload([
"file" => Request::file('files'), "file" => Request::file('files'),
"type" => 'more', "type" => 'more',
@ -570,6 +694,9 @@ class FileController extends AbstractController
$data = $data['data']; $data = $data['data'];
// //
$type = match ($data['ext']) { $type = match ($data['ext']) {
'text', 'md', 'markdown' => 'document',
'drawio' => 'drawio',
'mind' => 'mind',
'doc', 'docx' => "word", 'doc', 'docx' => "word",
'xls', 'xlsx' => "excel", 'xls', 'xlsx' => "excel",
'ppt', 'pptx' => "ppt", 'ppt', 'pptx' => "ppt",
@ -581,12 +708,22 @@ class FileController extends AbstractController
'ofd' => "ofd", 'ofd' => "ofd",
'pdf' => "pdf", 'pdf' => "pdf",
'txt' => "txt", 'txt' => "txt",
'html', 'htm', 'asp', 'jsp', 'xml', 'json', 'properties', 'md', 'gitignore', 'log', 'java', 'py', 'c', 'cpp', 'sql', 'sh', 'bat', 'm', 'bas', 'prg', 'cmd', 'htaccess', 'htgroups', 'htpasswd', 'conf', 'bat', 'cmd', 'cpp', 'c', 'cc', 'cxx', 'h', 'hh', 'hpp', 'ino', 'cs', 'css',
'php', 'go', 'python', 'js', 'ftl', 'css', 'lua', 'rb', 'yaml', 'yml', 'h', 'cs', 'aspx' => "code", 'dockerfile', 'go', 'html', 'htm', 'xhtml', 'vue', 'we', 'wpy', 'java', 'js', 'jsm', 'jsx', 'json', 'jsp', 'less', 'lua', 'makefile', 'gnumakefile',
'ocamlmakefile', 'make', 'mysql', 'nginx', 'ini', 'cfg', 'prefs', 'm', 'mm', 'pl', 'pm', 'p6', 'pl6', 'pm6', 'pgsql', 'php',
'inc', 'phtml', 'shtml', 'php3', 'php4', 'php5', 'phps', 'phpt', 'aw', 'ctp', 'module', 'ps1', 'py', 'r', 'rb', 'ru', 'gemspec', 'rake', 'guardfile', 'rakefile',
'gemfile', 'rs', 'sass', 'scss', 'sh', 'bash', 'bashrc', 'sql', 'sqlserver', 'swift', 'ts', 'typescript', 'str', 'vbs', 'vb', 'v', 'vh', 'sv', 'svh', 'xml',
'rdf', 'rss', 'wsdl', 'xslt', 'atom', 'mathml', 'mml', 'xul', 'xbl', 'xaml', 'yaml', 'yml',
'asp', 'properties', 'gitignore', 'log', 'bas', 'prg', 'python', 'ftl', 'aspx' => "code",
'mp3', 'wav', 'mp4', 'flv', 'mp3', 'wav', 'mp4', 'flv',
'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm' => "media", 'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm' => "media",
'xmind' => "xmind",
'rp' => "axure",
default => "", default => "",
}; };
if ($data['ext'] == 'markdown') {
$data['ext'] = 'md';
}
$file = File::createInstance([ $file = File::createInstance([
'pid' => $pid, 'pid' => $pid,
'name' => Base::rightDelete($data['name'], '.' . $data['ext']), 'name' => Base::rightDelete($data['name'], '.' . $data['ext']),
@ -596,9 +733,11 @@ class FileController extends AbstractController
'created_id' => $user->userid, 'created_id' => $user->userid,
]); ]);
// 开始创建 // 开始创建
return AbstractModel::transaction(function () use ($type, $user, $data, $file) { return AbstractModel::transaction(function () use ($webkitRelativePath, $type, $user, $data, $file) {
$file->size = $data['size'] * 1024;
$file->save(); $file->save();
// //
$data = Base::uploadMove($data, "uploads/file/" . $file->type . "/" . date("Ym") . "/" . $file->id . "/");
$content = FileContent::createInstance([ $content = FileContent::createInstance([
'fid' => $file->id, 'fid' => $file->id,
'content' => [ 'content' => [
@ -608,16 +747,16 @@ class FileController extends AbstractController
'url' => $data['path'] 'url' => $data['path']
], ],
'text' => '', 'text' => '',
'size' => $data['size'] * 1024, 'size' => $file->size,
'userid' => $user->userid, 'userid' => $user->userid,
]); ]);
$content->save(); $content->save();
// //
$file->size = $content->size; $tmpRow = File::find($file->id);
$file->save(); $tmpRow->pushMsg('add', $tmpRow);
// //
$data = File::find($file->id); $data = $tmpRow->toArray();
$data->pushMsg('add', $data); $data['full_name'] = $webkitRelativePath ?: $data['name'];
return Base::retSuccess($data['name'] . ' 上传成功', $data); return Base::retSuccess($data['name'] . ' 上传成功', $data);
}); });
} }

View File

@ -4,8 +4,11 @@ namespace App\Http\Controllers\Api;
use App\Exceptions\ApiException; use App\Exceptions\ApiException;
use App\Models\AbstractModel; use App\Models\AbstractModel;
use App\Models\File;
use App\Models\Project; use App\Models\Project;
use App\Models\ProjectColumn; use App\Models\ProjectColumn;
use App\Models\ProjectFlow;
use App\Models\ProjectFlowItem;
use App\Models\ProjectInvite; use App\Models\ProjectInvite;
use App\Models\ProjectLog; use App\Models\ProjectLog;
use App\Models\ProjectTask; use App\Models\ProjectTask;
@ -14,9 +17,13 @@ use App\Models\ProjectUser;
use App\Models\User; use App\Models\User;
use App\Models\WebSocketDialog; use App\Models\WebSocketDialog;
use App\Module\Base; use App\Module\Base;
use App\Module\BillExport;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Madzipper;
use Request; use Request;
use Response;
use Session;
/** /**
* @apiDefine project * @apiDefine project
@ -184,7 +191,7 @@ class ProjectController extends AbstractController
// //
$project = Project::userProject($project_id); $project = Project::userProject($project_id);
$data = array_merge($project->toArray(), $project->getTaskStatistics($user->userid), [ $data = array_merge($project->toArray(), $project->getTaskStatistics($user->userid), [
'project_user' => $project->projectUser 'project_user' => $project->projectUser,
]); ]);
// //
return Base::retSuccess('success', $data); return Base::retSuccess('success', $data);
@ -201,6 +208,9 @@ class ProjectController extends AbstractController
* @apiParam {String} name 项目名称 * @apiParam {String} name 项目名称
* @apiParam {String} [desc] 项目介绍 * @apiParam {String} [desc] 项目介绍
* @apiParam {String} [columns] 列表格式列表名称1,列表名称2 * @apiParam {String} [columns] 列表格式列表名称1,列表名称2
* @apiParam {String} [flow] 开启流程
* - open: 开启
* - close: 关闭(默认)
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -212,6 +222,7 @@ class ProjectController extends AbstractController
// 项目名称 // 项目名称
$name = trim(Request::input('name', '')); $name = trim(Request::input('name', ''));
$desc = trim(Request::input('desc', '')); $desc = trim(Request::input('desc', ''));
$flow = trim(Request::input('flow', 'close'));
if (mb_strlen($name) < 2) { if (mb_strlen($name) < 2) {
return Base::retError('项目名称不可以少于2个字'); return Base::retError('项目名称不可以少于2个字');
} elseif (mb_strlen($name) > 32) { } elseif (mb_strlen($name) > 32) {
@ -248,7 +259,7 @@ class ProjectController extends AbstractController
'desc' => $desc, 'desc' => $desc,
'userid' => $user->userid, 'userid' => $user->userid,
]); ]);
AbstractModel::transaction(function() use ($insertColumns, $project) { AbstractModel::transaction(function() use ($flow, $insertColumns, $project) {
$project->save(); $project->save();
ProjectUser::createInstance([ ProjectUser::createInstance([
'project_id' => $project->id, 'project_id' => $project->id,
@ -265,6 +276,10 @@ class ProjectController extends AbstractController
} }
$project->dialog_id = $dialog->id; $project->dialog_id = $dialog->id;
$project->save(); $project->save();
//
if ($flow == 'open') {
$project->addFlow(Base::json2array('[{"id":"-10","name":"\u5f85\u5904\u7406","status":"start","turns":["-10","-11","-12","-13"],"usertype":"add","userlimit":"0","sort":"0"},{"id":"-11","name":"\u8fdb\u884c\u4e2d","status":"progress","turns":["-10","-11","-12","-13"],"usertype":"add","userlimit":"0","sort":"1"},{"id":"-12","name":"\u5df2\u5b8c\u6210","status":"end","turns":["-10","-11","-12","-13"],"usertype":"add","userlimit":"0","sort":"2"},{"id":"-13","name":"\u5df2\u53d6\u6d88","status":"end","turns":["-10","-11","-12","-13"],"usertype":"add","userlimit":"0","sort":"3"}]'));
}
}); });
// //
$data = Project::find($project->id); $data = Project::find($project->id);
@ -308,7 +323,9 @@ class ProjectController extends AbstractController
$project = Project::userProject($project_id, true, true); $project = Project::userProject($project_id, true, true);
// //
if ($project->name != $name) { if ($project->name != $name) {
$project->addLog("修改项目名称:{$project->name} => {$name}"); $project->addLog("修改项目名称", [
'change' => [$project->name, $name]
]);
$project->name = $name; $project->name = $name;
} }
if ($project->desc != $desc) { if ($project->desc != $desc) {
@ -493,7 +510,7 @@ class ProjectController extends AbstractController
$projectInvite->save(); $projectInvite->save();
// //
$projectInvite->project->syncDialogUser(); $projectInvite->project->syncDialogUser();
$projectInvite->project->addLog("会员ID" . $user->userid . " 通过邀请链接加入项目"); $projectInvite->project->addLog("通过邀请链接加入项目");
// //
$data = $projectInvite->toArray(); $data = $projectInvite->toArray();
$data['already'] = true; $data['already'] = true;
@ -537,7 +554,7 @@ class ProjectController extends AbstractController
'owner' => 1, 'owner' => 1,
]); ]);
$project->syncDialogUser(); $project->syncDialogUser();
$project->addLog("移交项目给会员ID" . $owner_userid); $project->addLog("移交项目给", ['userid' => $owner_userid]);
}); });
// //
$project->pushMsg('detail'); $project->pushMsg('detail');
@ -590,13 +607,14 @@ class ProjectController extends AbstractController
if (!is_array($item['task'])) continue; if (!is_array($item['task'])) continue;
$index = 0; $index = 0;
foreach ($item['task'] as $task_id) { foreach ($item['task'] as $task_id) {
ProjectTask::whereId($task_id)->whereProjectId($project->id)->update([ if (ProjectTask::whereId($task_id)->whereProjectId($project->id)->whereCompleteAt(null)->update([
'column_id' => $item['id'], 'column_id' => $item['id'],
'sort' => $index 'sort' => $index
]); ])) {
ProjectTask::whereParentId($task_id)->whereProjectId($project->id)->update([ ProjectTask::whereParentId($task_id)->whereProjectId($project->id)->update([
'column_id' => $item['id'], 'column_id' => $item['id'],
]); ]);
}
$index++; $index++;
} }
} }
@ -632,7 +650,7 @@ class ProjectController extends AbstractController
$row = ProjectUser::whereProjectId($project->id)->whereUserid($user->userid)->first(); $row = ProjectUser::whereProjectId($project->id)->whereUserid($user->userid)->first();
$row?->exitProject(); $row?->exitProject();
$project->syncDialogUser(); $project->syncDialogUser();
$project->addLog("会员ID" . $user->userid . " 退出项目"); $project->addLog("退出项目");
$project->pushMsg('delete', null, $user->userid); $project->pushMsg('delete', null, $user->userid);
}); });
return Base::retSuccess('退出成功', ['id' => $project->id]); return Base::retSuccess('退出成功', ['id' => $project->id]);
@ -822,7 +840,7 @@ class ProjectController extends AbstractController
/** /**
* @api {get} api/project/column/remove 17. 删除任务列表 * @api {get} api/project/column/remove 17. 删除任务列表
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份(限:项目负责人)
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup project * @apiGroup project
* @apiName column__remove * @apiName column__remove
@ -844,7 +862,7 @@ class ProjectController extends AbstractController
return Base::retError('列表不存在'); return Base::retError('列表不存在');
} }
// 项目 // 项目
Project::userProject($column->project_id); Project::userProject($column->project_id, true, true);
// //
$column->deleteColumn(); $column->deleteColumn();
return Base::retSuccess('删除成功', ['id' => $column->id]); return Base::retSuccess('删除成功', ['id' => $column->id]);
@ -872,6 +890,7 @@ class ProjectController extends AbstractController
* - yes已完成 * - yes已完成
* - no未完成 * - no未完成
* @apiParam {String} [archived] 归档状态 * @apiParam {String} [archived] 归档状态
* - all所有
* - yes已归档 * - yes已归档
* - no未归档默认 * - no未归档默认
* @apiParam {Object} sorts 排序方式 * @apiParam {Object} sorts 排序方式
@ -907,7 +926,7 @@ class ProjectController extends AbstractController
// //
$scopeAll = false; $scopeAll = false;
if ($parent_id > 0) { if ($parent_id > 0) {
ProjectTask::userTask($parent_id); ProjectTask::userTask($parent_id, str_replace(['all', 'yes', 'no'], [null, false, true], $archived));
$scopeAll = true; $scopeAll = true;
$builder->where('project_tasks.parent_id', $parent_id); $builder->where('project_tasks.parent_id', $parent_id);
} elseif ($parent_id === -1) { } elseif ($parent_id === -1) {
@ -961,6 +980,154 @@ class ProjectController extends AbstractController
return Base::retSuccess('success', $list); return Base::retSuccess('success', $list);
} }
/**
* @api {get} api/project/task/export 18. 导出任务(限管理员)
*
* @apiDescription 导出指定范围任务已完成、未完成、已归档返回下载地址需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__export
*
* @apiParam {Array} [userid] 指定会员,如:[1, 2]
* @apiParam {Array} [time] 指定时间范围,如:['2020-12-12', '2020-12-30']
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function task__export()
{
$user = User::auth('admin');
//
$userid = Base::arrayRetainInt(Request::input('userid'), true);
$time = Request::input('time');
if (empty($userid) || empty($time)) {
return Base::retError('参数错误');
}
if (count($userid) > 20) {
return Base::retError('导出会员限制最多20个');
}
if (!(is_array($time) && Base::isDateOrTime($time[0]) && Base::isDateOrTime($time[1]))) {
return Base::retError('时间选择错误');
}
if (Carbon::parse($time[1])->timestamp - Carbon::parse($time[0])->timestamp > 90 * 86400) {
return Base::retError('时间范围限制最大90天');
}
//
$headings = [];
$headings[] = '任务ID';
$headings[] = '任务标题';
$headings[] = '负责人';
$headings[] = '创建人';
$headings[] = '是否完成';
$headings[] = '完成时间';
$headings[] = '是否归档';
$headings[] = '归档时间';
$headings[] = '任务开始时间';
$headings[] = '任务结束时间';
$headings[] = '结束剩余';
$headings[] = '所属项目';
$headings[] = '父级任务ID';
$datas = [];
//
$builder = ProjectTask::select(['project_tasks.*', 'project_task_users.userid as ownerid'])
->join('project_task_users', 'project_tasks.id', '=', 'project_task_users.task_id')
->where('project_task_users.owner', 1)
->whereIn('project_task_users.userid', $userid)
->betweenTime(Carbon::parse($time[0])->startOfDay(), Carbon::parse($time[1])->endOfDay());
$builder->orderByDesc('project_tasks.id')->chunk(100, function($tasks) use (&$datas) {
/** @var ProjectTask $task */
foreach ($tasks as $task) {
if ($task->complete_at) {
$a = Carbon::parse($task->complete_at)->timestamp;
$b = Carbon::parse($task->end_at)->timestamp;
if ($b > $a) {
$endSurplus = Base::timeDiff($a, $b);
} else {
$endSurplus = "-" . Base::timeDiff($b, $a);
}
} else {
$endSurplus = '-';
}
$datas[] = [
$task->id,
Base::filterEmoji($task->name),
Base::filterEmoji(User::userid2nickname($task->ownerid)) . " (ID: {$task->ownerid})",
Base::filterEmoji(User::userid2nickname($task->userid)) . " (ID: {$task->userid})",
$task->complete_at ? '已完成' : '-',
$task->complete_at ?: '-',
$task->archived_at ? '已归档' : '-',
$task->archived_at ?: '-',
$task->start_at ?: '-',
$task->end_at ?: '-',
$endSurplus,
Base::filterEmoji($task->project?->name) ?: '-',
$task->parent_id ?: '-',
];
}
});
//
$fileName = User::userid2nickname($userid[0]) ?: $userid[0];
if (count($userid) > 1) {
$fileName .= "" . count($userid) . "位成员";
}
$fileName .= '任务统计_' . Base::time() . '.xls';
$filePath = "temp/task/export/" . date("Ym", Base::time());
$res = BillExport::create()->setHeadings($headings)->setData($datas)->store($filePath . "/" . $fileName);
if ($res != 1) {
return Base::retError('导出失败,' . $fileName . '');
}
$xlsPath = storage_path("app/" . $filePath . "/" . $fileName);
$zipFile = "app/" . $filePath . "/" . Base::rightDelete($fileName, '.xls'). ".zip";
$zipPath = storage_path($zipFile);
if (file_exists($zipPath)) {
Base::deleteDirAndFile($zipPath, true);
}
try {
Madzipper::make($zipPath)->add($xlsPath)->close();
} catch (\Exception) { }
//
if (file_exists($zipPath)) {
$base64 = base64_encode(Base::array2string([
'file' => $zipFile,
]));
Session::put('task::export:userid', $user->userid);
return Base::retSuccess('success', [
'size' => Base::twoFloat(filesize($zipPath) / 1024, true),
'url' => Base::fillUrl('api/project/task/down?key=' . urlencode($base64)),
]);
} else {
return Base::retError('打包失败,请稍后再试...');
}
}
/**
* @api {get} api/project/task/down 18. 导出任务(限管理员)
*
* @apiDescription 导出指定范围任务已完成、未完成、已归档返回下载地址需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__down
*
* @apiParam {String} key 通过export接口得到的下载钥匙
*
* @apiSuccess {File} 文件下载
*/
public function task__down()
{
$userid = Session::get('task::export:userid');
if (empty($userid)) {
return Base::ajaxError("请求已过期,请重新导出!", [], 0, 502);
}
//
$array = Base::string2array(base64_decode(urldecode(Request::input('key'))));
$file = $array['file'];
if (empty($file) || !file_exists(storage_path($file))) {
return Base::ajaxError("文件不存在!", [], 0, 502);
}
return response()->download(storage_path($file));
}
/** /**
* @api {get} api/project/task/one 19. 获取单个任务信息 * @api {get} api/project/task/one 19. 获取单个任务信息
* *
@ -970,6 +1137,10 @@ class ProjectController extends AbstractController
* @apiName task__one * @apiName task__one
* *
* @apiParam {Number} task_id 任务ID * @apiParam {Number} task_id 任务ID
* @apiParam {String} [archived] 归档状态
* - all所有
* - yes已归档
* - no未归档默认
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述) * @apiSuccess {String} msg 返回信息(错误描述)
@ -980,8 +1151,9 @@ class ProjectController extends AbstractController
User::auth(); User::auth();
// //
$task_id = intval(Request::input('task_id')); $task_id = intval(Request::input('task_id'));
$archived = Request::input('archived', 'no');
// //
$task = ProjectTask::userTask($task_id, true, false, ['taskUser', 'taskTag']); $task = ProjectTask::userTask($task_id, str_replace(['all', 'yes', 'no'], [null, false, true], $archived), false, ['taskUser', 'taskTag']);
// //
$data = $task->toArray(); $data = $task->toArray();
$data['project_name'] = $task->project?->name; $data['project_name'] = $task->project?->name;
@ -1009,7 +1181,7 @@ class ProjectController extends AbstractController
// //
$task_id = intval(Request::input('task_id')); $task_id = intval(Request::input('task_id'));
// //
$task = ProjectTask::userTask($task_id); $task = ProjectTask::userTask($task_id, null);
// //
return Base::retSuccess('success', $task->content ?: json_decode('{}')); return Base::retSuccess('success', $task->content ?: json_decode('{}'));
} }
@ -1034,7 +1206,7 @@ class ProjectController extends AbstractController
// //
$task_id = intval(Request::input('task_id')); $task_id = intval(Request::input('task_id'));
// //
$task = ProjectTask::userTask($task_id); $task = ProjectTask::userTask($task_id, null);
// //
return Base::retSuccess('success', $task->taskFile); return Base::retSuccess('success', $task->taskFile);
} }
@ -1073,7 +1245,85 @@ class ProjectController extends AbstractController
} }
/** /**
* @api {post} api/project/task/add 23. 添加任务 * @api {get} api/project/task/filedetail 23. 获取任务文件详情
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__filedetail
*
* @apiParam {Number} file_id 文件ID
* @apiParam {String} only_update_at 仅获取update_at字段
* - no (默认)
* - yes
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function task__filedetail()
{
User::auth();
//
$file_id = intval(Request::input('file_id'));
$only_update_at = Request::input('only_update_at', 'no');
//
$file = ProjectTaskFile::find($file_id);
if (empty($file)) {
return Base::retError("文件不存在");
}
//
if ($only_update_at == 'yes') {
return Base::retSuccess('success', [
'id' => $file->id,
'update_at' => Carbon::parse($file->updated_at)->toDateTimeString()
]);
}
//
$data = $file->toArray();
$data['path'] = $file->getRawOriginal('path');
//
ProjectTask::userTask($file->task_id, null);
//
return Base::retSuccess('success', File::formatFileData($data));
}
/**
* @api {get} api/project/task/filedown 24. 下载任务文件
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__filedown
*
* @apiParam {Number} file_id 文件ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function task__filedown()
{
User::auth();
//
$file_id = intval(Request::input('file_id'));
//
$file = ProjectTaskFile::find($file_id);
if (empty($file)) {
abort(403, "This file not exist.");
}
//
try {
ProjectTask::userTask($file->task_id, null);
} catch (\Exception $e) {
abort(403, $e->getMessage() ?: "This file not support download.");
}
//
return Response::download(public_path($file->getRawOriginal('path')), $file->name);
}
/**
* @api {post} api/project/task/add 25. 添加任务
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1134,16 +1384,17 @@ class ProjectController extends AbstractController
'project_id' => $project->id, 'project_id' => $project->id,
'column_id' => $column->id, 'column_id' => $column->id,
])); ]));
$data = [ $data = ProjectTask::oneTask($task->id);
'new_column' => $newColumn, if ($newColumn) {
'task' => ProjectTask::oneTask($task->id), $data = $data->toArray();
]; $data['new_column'] = $newColumn;
}
$task->pushMsg('add', $data); $task->pushMsg('add', $data);
return Base::retSuccess('添加成功', $data); return Base::retSuccess('添加成功', $data);
} }
/** /**
* @api {get} api/project/task/addsub 24. 添加子任务 * @api {get} api/project/task/addsub 26. 添加子任务
* *
* @apiDescription 需要token身份项目、任务负责人 * @apiDescription 需要token身份项目、任务负责人
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1165,6 +1416,9 @@ class ProjectController extends AbstractController
$name = Request::input('name'); $name = Request::input('name');
// //
$task = ProjectTask::userTask($task_id, true, true); $task = ProjectTask::userTask($task_id, true, true);
if ($task->complete_at) {
return Base::retError('主任务已完成无法添加子任务');
}
// //
$task = ProjectTask::addTask([ $task = ProjectTask::addTask([
'name' => $name, 'name' => $name,
@ -1174,16 +1428,13 @@ class ProjectController extends AbstractController
'times' => [$task->start_at, $task->end_at], 'times' => [$task->start_at, $task->end_at],
'owner' => [User::userid()] 'owner' => [User::userid()]
]); ]);
$data = [ $data = ProjectTask::oneTask($task->id);
'new_column' => null,
'task' => ProjectTask::oneTask($task->id),
];
$task->pushMsg('add', $data); $task->pushMsg('add', $data);
return Base::retSuccess('添加成功', $data); return Base::retSuccess('添加成功', $data);
} }
/** /**
* @api {post} api/project/task/update 25. 修改任务、子任务 * @api {post} api/project/task/update 27. 修改任务、子任务
* *
* @apiDescription 需要token身份项目、任务负责人 * @apiDescription 需要token身份项目、任务负责人
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1202,6 +1453,7 @@ class ProjectController extends AbstractController
* @apiParam {String} [p_name] 优先级相关(子任务不支持) * @apiParam {String} [p_name] 优先级相关(子任务不支持)
* @apiParam {String} [p_color] 优先级相关(子任务不支持) * @apiParam {String} [p_color] 优先级相关(子任务不支持)
* *
* @apiParam {Number} [flow_item_id] 任务状态工作流状态ID
* @apiParam {String|false} [complete_at] 完成时间2020-01-01 00:00false表示未完成 * @apiParam {String|false} [complete_at] 完成时间2020-01-01 00:00false表示未完成
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
@ -1217,88 +1469,18 @@ class ProjectController extends AbstractController
// //
$task = ProjectTask::userTask($task_id, true, 2); $task = ProjectTask::userTask($task_id, true, 2);
// 更新任务 // 更新任务
$updateProject = false; $updateMarking = [];
$updateContent = false; $task->updateTask($data, $updateMarking);
$updateSubTask = false;
$task->updateTask($data, $updateProject, $updateContent, $updateSubTask);
// //
$data = ProjectTask::oneTask($task->id)->toArray(); $data = ProjectTask::oneTask($task->id)->toArray();
$data['is_update_project'] = $updateProject; $data['update_marking'] = $updateMarking ?: json_decode('{}');
$data['is_update_content'] = $updateContent;
$data['is_update_subtask'] = $updateSubTask;
$task->pushMsg('update', $data); $task->pushMsg('update', $data);
// //
return Base::retSuccess('修改成功', $data); return Base::retSuccess('修改成功', $data);
} }
/** /**
* @api {post} api/project/task/upload 26. 上传文件 * @api {get} api/project/task/dialog 28. 创建/获取聊天室
*
* @apiDescription 需要token身份项目、任务负责人
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__upload
*
* @apiParam {Number} task_id 任务ID
* @apiParam {String} [filename] post-文件名称
* @apiParam {String} [image64] post-base64图片二选一
* @apiParam {File} [files] post-文件对象(二选一)
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function task__upload()
{
$user = User::auth();
//
$task_id = Base::getPostInt('task_id');
//
$task = ProjectTask::userTask($task_id, true, true);
//
$path = "uploads/task/" . $task->id . "/";
$image64 = Base::getPostValue('image64');
$fileName = Base::getPostValue('filename');
if ($image64) {
$data = Base::image64save([
"image64" => $image64,
"path" => $path,
"fileName" => $fileName,
]);
} else {
$data = Base::upload([
"file" => Request::file('files'),
"type" => 'file',
"path" => $path,
"fileName" => $fileName,
]);
}
//
if (Base::isError($data)) {
return Base::retError($data['msg']);
} else {
$fileData = $data['data'];
$file = ProjectTaskFile::createInstance([
'project_id' => $task->project_id,
'task_id' => $task->id,
'name' => $fileData['name'],
'size' => $fileData['size'] * 1024,
'ext' => $fileData['ext'],
'path' => $fileData['path'],
'thumb' => Base::unFillUrl($fileData['thumb']),
'userid' => $user->userid,
]);
$file->save();
//
$file = ProjectTaskFile::find($file->id);
$task->addLog("上传文件:" . $file->name);
$task->pushMsg('upload', $file);
return Base::retSuccess("上传成功", $file);
}
}
/**
* @api {get} api/project/task/dialog 27. 创建/获取聊天室
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1345,7 +1527,7 @@ class ProjectController extends AbstractController
} }
/** /**
* @api {get} api/project/task/archived 28. 归档任务 * @api {get} api/project/task/archived 29. 归档任务
* *
* @apiDescription 需要token身份项目、任务负责人 * @apiDescription 需要token身份项目、任务负责人
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1379,11 +1561,15 @@ class ProjectController extends AbstractController
} elseif ($type == 'add') { } elseif ($type == 'add') {
$task->archivedTask(Carbon::now()); $task->archivedTask(Carbon::now());
} }
return Base::retSuccess('操作成功', ['id' => $task->id]); return Base::retSuccess('操作成功', [
'id' => $task->id,
'archived_at' => $task->archived_at,
'archived_userid' => $task->archived_userid,
]);
} }
/** /**
* @api {get} api/project/task/remove 29. 删除任务 * @api {get} api/project/task/remove 30. 删除任务
* *
* @apiDescription 需要token身份项目、任务负责人 * @apiDescription 需要token身份项目、任务负责人
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1409,7 +1595,240 @@ class ProjectController extends AbstractController
} }
/** /**
* @api {get} api/project/log/lists 30. 获取项目、任务日志 * @api {get} api/project/task/resetfromlog 31. 根据日志重置任务
*
* @apiDescription 需要token身份项目、任务负责人
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__resetfromlog
*
* @apiParam {Number} task_id 任务ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function task__resetfromlog()
{
User::auth();
//
$id = intval(Request::input('id'));
//
$projectLog = ProjectLog::find($id);
if (empty($projectLog) || empty($projectLog->task_id)) {
return Base::retError('记录不存在');
}
//
$task = ProjectTask::userTask($projectLog->task_id, true, true);
//
$record = $projectLog->record;
if ($record['flow'] && is_array($record['flow'])) {
$rawData = $record['flow'];
$newFlowItem = ProjectFlowItem::find(intval($rawData['flow_item_id']));
if (empty($newFlowItem)) {
return Base::retError('流程不存在或已被删除');
}
return AbstractModel::transaction(function() use ($rawData, $task, $newFlowItem) {
$currentFlowItem = $task->flow_item_id ? ProjectFlowItem::find($task->flow_item_id) : null;
//
$task->flow_item_id = $newFlowItem->id;
$task->flow_item_name = $newFlowItem->name;
$task->addLog("重置{任务}状态", [
'change' => [$currentFlowItem?->name, $newFlowItem->name]
]);
//
$updateMarking = [];
$data = array_intersect_key($rawData, array_flip(['complete_at', 'owner', 'assist']));
$task->updateTask($data, $updateMarking);
//
$data = ProjectTask::oneTask($task->id)->toArray();
$data["flow_item_name"] = $newFlowItem->status . "|" . $newFlowItem->name;
$data['update_marking'] = $updateMarking ?: json_decode('{}');
$task->pushMsg('update', $data);
//
return Base::retSuccess('重置成功', $data);
});
} else {
return Base::retError('暂不支持此操作');
}
}
/**
* @api {get} api/project/task/flow 32. 任务工作流信息
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName task__flow
*
* @apiParam {Number} task_id 任务ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function task__flow()
{
User::auth();
//
$task_id = intval(Request::input('task_id'));
//
$projectTask = ProjectTask::select(['id', 'project_id', 'complete_at', 'flow_item_id', 'flow_item_name'])->find($task_id);
if (empty($projectTask)) {
return Base::retError('任务不存在', [ 'task_id' => $task_id ], -4002);
}
//
$projectFlowItem = $projectTask->flow_item_id ? ProjectFlowItem::with(['projectFlow'])->find($projectTask->flow_item_id) : null;
if ($projectFlowItem?->projectFlow) {
$projectFlow = $projectFlowItem->projectFlow;
} else {
$projectFlow = ProjectFlow::whereProjectId($projectTask->project_id)->orderByDesc('id')->first();
}
if (empty($projectFlow)) {
return Base::retSuccess('success', [
'task_id' => $projectTask->id,
'flow_item_id' => 0,
'turns' => [],
]);
}
//
$turns = ProjectFlowItem::select(['id', 'name', 'status', 'turns'])->whereFlowId($projectFlow->id)->orderBy('sort')->get();
if (empty($projectFlowItem)) {
$data = [
'task_id' => $projectTask->id,
'flow_item_id' => 0,
'turns' => $turns,
];
if ($projectTask->complete_at) {
// 赋一个结束状态
foreach ($turns as $turn) {
if ($turn->status == 'end' || preg_match("/complete|done|完成/i", $turn->name)) {
$data['flow_item_id'] = $turn->id;
break;
}
}
if (empty($data['flow_item_id'])) {
foreach ($turns as $turn) {
if ($turn->status == 'end') {
$data['flow_item_id'] = $turn->id;
break;
}
}
}
} else {
// 赋一个开始状态
foreach ($turns as $turn) {
if ($turn->status == 'start') {
$data['flow_item_id'] = $turn->id;
break;
}
}
}
} else {
$data = [
'task_id' => $projectTask->id,
'flow_item_id' => $projectFlowItem->id,
'turns' => $turns,
];
}
//
return Base::retSuccess('success', $data);
}
/**
* @api {get} api/project/flow/list 33. 工作流列表
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName flow__list
*
* @apiParam {Number} project_id 项目ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function flow__list()
{
User::auth();
//
$project_id = intval(Request::input('project_id'));
//
$project = Project::userProject($project_id, true);
//
$list = ProjectFlow::with(['ProjectFlowItem'])->whereProjectId($project->id)->get();
return Base::retSuccess('success', $list);
}
/**
* @api {post} api/project/flow/save 34. 保存工作流
*
* @apiDescription 需要token身份项目负责人
* @apiVersion 1.0.0
* @apiGroup project
* @apiName flow__save
*
* @apiParam {Number} project_id 项目ID
* @apiParam {Array} flows 工作流数据
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function flow__save()
{
User::auth();
//
$project_id = intval(Base::getContentValue('project_id'));
$flows = Base::getContentValue('flows');
//
if (!is_array($flows)) {
return Base::retError('参数错误');
}
if (count($flows) > 10) {
return Base::retError('流程状态最多不能超过10个');
}
//
$project = Project::userProject($project_id, true, true);
//
return Base::retSuccess('保存成功', $project->addFlow($flows));
}
/**
* @api {get} api/project/flow/delete 35. 删除工作流
*
* @apiDescription 需要token身份项目负责人
* @apiVersion 1.0.0
* @apiGroup project
* @apiName flow__delete
*
* @apiParam {Number} project_id 项目ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function flow__delete()
{
User::auth();
//
$project_id = intval(Request::input('project_id'));
//
$project = Project::userProject($project_id, true, true);
//
return AbstractModel::transaction(function() use ($project) {
ProjectFlow::whereProjectId($project->id)->chunk(100, function($list) {
foreach ($list as $item) {
$item->deleteFlow();
}
});
return Base::retSuccess('删除成功');
});
}
/**
* @api {get} api/project/log/lists 36. 获取项目、任务日志
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -1433,18 +1852,21 @@ class ProjectController extends AbstractController
$project_id = intval(Request::input('project_id')); $project_id = intval(Request::input('project_id'));
$task_id = intval(Request::input('task_id')); $task_id = intval(Request::input('task_id'));
// //
$builder = ProjectLog::with(['user']); $builder = ProjectLog::select(["*"]);
if ($task_id > 0) { if ($task_id > 0) {
$task = ProjectTask::userTask($task_id); $task = ProjectTask::userTask($task_id, null);
$builder->whereTaskId($task->id); $builder->whereTaskId($task->id);
} else { } else {
$project = Project::userProject($project_id); $project = Project::userProject($project_id);
$builder->whereProjectId($project->id); $builder->with(['projectTask:id,parent_id,name'])->whereProjectId($project->id);
} }
// //
$list = $builder->orderByDesc('created_at')->paginate(Base::getPaginate(100, 20)); $list = $builder->orderByDesc('created_at')->paginate(Base::getPaginate(100, 20));
$list->transform(function (ProjectLog $log) { $list->transform(function (ProjectLog $log) use ($task_id) {
$timestamp = Carbon::parse($log->created_at)->timestamp; $timestamp = Carbon::parse($log->created_at)->timestamp;
if ($task_id === 0) {
$log->projectTask?->cancelAppend();
}
$log->time = [ $log->time = [
'ymd' => date(date("Y", $timestamp) == date("Y", Base::time()) ? "m-d" : "Y-m-d", $timestamp), 'ymd' => date(date("Y", $timestamp) == date("Y", Base::time()) ? "m-d" : "Y-m-d", $timestamp),
'hi' => date("h:i", $timestamp) , 'hi' => date("h:i", $timestamp) ,
@ -1456,4 +1878,31 @@ class ProjectController extends AbstractController
// //
return Base::retSuccess('success', $list); return Base::retSuccess('success', $list);
} }
/**
* @api {get} api/project/top 37. 项目置顶
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
* @apiGroup project
* @apiName top
*
* @apiParam {Number} project_id 项目ID
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function top()
{
$user = User::auth();
$projectId = intval(Request::input('project_id'));
$projectUser = ProjectUser::whereUserid($user->userid)->whereProjectId($projectId)->first();
if (!$projectUser) {
return Base::retError("项目不存在");
}
$projectUser->top_at = $projectUser->top_at ? null : Carbon::now();
$projectUser->save();
return Base::retSuccess("success", $projectId);
}
} }

View File

@ -0,0 +1,466 @@
<?php
namespace App\Http\Controllers\Api;
use App\Exceptions\ApiException;
use App\Models\ProjectTask;
use App\Models\Report;
use App\Models\ReportReceive;
use App\Models\User;
use App\Module\Base;
use App\Tasks\PushTask;
use Carbon\Carbon;
use Hhxsv5\LaravelS\Swoole\Task\Task;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Validation\Rule;
use Request;
use Illuminate\Support\Facades\Validator;
/**
* @apiDefine report
*
* 汇报
*/
class ReportController extends AbstractController
{
/**
* @api {get} api/report/my 01. 我发送的汇报
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName my
*
* @apiParam {String} [type] 汇报类型weekly:周报daily:日报
* @apiParam {Array} [created_at] 汇报时间
* @apiParam {Number} [page] 当前页,默认:1
* @apiParam {Number} [pagesize] 每页显示数量,默认:20,最大:50
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function my(): array
{
$user = User::auth();
// 搜索当前用户
$builder = Report::with(['receivesUser'])->whereUserid($user->userid);
$type = trim(Request::input('type'));
$createAt = Request::input('created_at');
in_array($type, [Report::WEEKLY, Report::DAILY]) && $builder->whereType($type);
$whereArray = [];
if (is_array($createAt)) {
if ($createAt[0] > 0) $whereArray[] = ['created_at', '>=', date('Y-m-d H:i:s', Base::dayTimeF($createAt[0]))];
if ($createAt[1] > 0) $whereArray[] = ['created_at', '<=', date('Y-m-d H:i:s', Base::dayTimeE($createAt[1]))];
}
$list = $builder->where($whereArray)->orderByDesc('created_at')->paginate(Base::getPaginate(50, 20));
return Base::retSuccess('success', $list);
}
/**
* @api {get} api/report/receive 02. 我接收的汇报
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName receive
*
* @apiParam {String} [username] 会员名
* @apiParam {String} [type] 汇报类型weekly:周报daily:日报
* @apiParam {Array} [created_at] 汇报时间
* @apiParam {Number} [page] 当前页,默认:1
* @apiParam {Number} [pagesize] 每页显示数量,默认:20,最大:50
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function receive(): array
{
$user = User::auth();
$builder = Report::with(['receivesUser']);
$builder->whereHas("receivesUser", function ($query) use ($user) {
$query->where("report_receives.userid", $user->userid);
});
$type = trim(Request::input('type'));
$createAt = Request::input('created_at');
$username = trim(Request::input('username', ''));
$builder->whereHas('sendUser', function ($query) use ($username) {
if (!empty($username)) {
$query->where('users.email', 'LIKE', '%' . $username . '%');
}
});
in_array($type, [Report::WEEKLY, Report::DAILY]) && $builder->whereType($type);
$whereArray = [];
if (is_array($createAt)) {
if ($createAt[0] > 0) $whereArray[] = ['created_at', '>=', date('Y-m-d H:i:s', Base::dayTimeF($createAt[0]))];
if ($createAt[1] > 0) $whereArray[] = ['created_at', '<=', date('Y-m-d H:i:s', Base::dayTimeE($createAt[1]))];
}
$list = $builder->where($whereArray)->orderByDesc('created_at')->paginate(Base::getPaginate(50, 20));
if ($list->items()) {
foreach ($list->items() as $item) {
$item->receive_time = ReportReceive::query()->whereRid($item["id"])->whereUserid($user->userid)->value("receive_time");
}
}
return Base::retSuccess('success', $list);
}
/**
* @api {get} api/report/store 03. 保存并发送工作汇报
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName store
*
* @apiParam {Number} [id] 汇报ID
* @apiParam {String} [title] 汇报标题
* @apiParam {Array} [type] 汇报类型weekly:周报daily:日报
* @apiParam {Number} [content] 内容
* @apiParam {Number} [receive] 汇报对象
* @apiParam {Number} [offset] 偏移量
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function store(): array
{
$input = [
"id" => Base::getPostValue("id", 0),
"title" => Base::getPostValue("title"),
"type" => Base::getPostValue("type"),
"content" => Base::getPostValue("content"),
"receive" => Base::getPostValue("receive"),
// 以当前日期为基础的周期偏移量。例如选择了上一周那么就是 -1上一天同理。
"offset" => Base::getPostValue("offset", 0),
];
$validator = Validator::make($input, [
'id' => 'numeric',
'title' => 'required',
'type' => ['required', Rule::in([Report::WEEKLY, Report::DAILY])],
'content' => 'required',
'receive' => 'required',
'offset' => ['numeric', 'max:0'],
], [
'id.numeric' => 'ID只能是数字',
'title.required' => '请填写标题',
'type.required' => '请选择汇报类型',
'type.in' => '汇报类型错误',
'content.required' => '请填写汇报内容',
'receive.required' => '请选择接收人',
'offset.numeric' => '工作汇报周期格式错误,只能是数字',
'offset.max' => '只能提交当天/本周或者之前的的工作汇报',
]);
if ($validator->fails())
return Base::retError($validator->errors()->first());
$user = User::auth();
// 接收人
if (is_array($input["receive"])) {
// 删除当前登录人
$input["receive"] = array_diff($input["receive"], [$user->userid]);
// 查询用户是否存在
if (count($input["receive"]) !== User::whereIn("userid", $input["receive"])->count())
return Base::retError("用户不存在");
foreach ($input["receive"] as $userid) {
$input["receive_content"][] = [
"receive_time" => Carbon::now()->toDateTimeString(),
"userid" => $userid,
"read" => 0,
];
}
}
// 在事务中运行
Report::transaction(function () use ($input, $user) {
$id = $input["id"];
if ($id) {
// 编辑
$report = Report::getOne($id);
$report->updateInstance([
"title" => $input["title"],
"type" => $input["type"],
"content" => htmlspecialchars($input["content"]),
]);
} else {
// 生成唯一标识
$sign = Report::generateSign($input["type"], $input["offset"]);
// 检查唯一标识是否存在
if (empty($input["id"])) {
if (Report::query()->whereSign($sign)->whereType($input["type"])->count() > 0)
throw new ApiException("请勿重复提交工作汇报");
}
$report = Report::createInstance([
"title" => $input["title"],
"type" => $input["type"],
"content" => htmlspecialchars($input["content"]),
"userid" => $user->userid,
"sign" => $sign,
]);
}
$report->save();
if (!empty($input["receive_content"])) {
// 删除关联
$report->Receives()->delete();
// 保存接收人
$report->Receives()->createMany($input["receive_content"]);
}
// 推送消息
$userids = [];
foreach ($input["receive_content"] as $item) {
$userids[] = $item['userid'];
}
if ($userids) {
$params = [
'ignoreFd' => Request::header('fd'),
'userid' => $userids,
'msg' => [
'type' => 'report',
'action' => 'unreadUpdate',
]
];
Task::deliver(new PushTask($params, false));
}
});
return Base::retSuccess('保存成功');
}
/**
* @api {get} api/report/template 04. 生成汇报模板
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName template
*
* @apiParam {Array} [type] 汇报类型weekly:周报daily:日报
* @apiParam {Number} [offset] 偏移量
* @apiParam {String} [date] 时间
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function template(): array
{
$user = User::auth();
$type = trim(Request::input("type"));
$offset = abs(intval(Request::input("offset", 0)));
$id = intval(Request::input("offset", 0));
$now_dt = trim(Request::input("date")) ? Carbon::parse(Request::input("date")) : Carbon::now();
// 获取开始时间
if ($type === Report::DAILY) {
$start_time = Carbon::today();
if ($offset > 0) {
// 将当前时间调整为偏移量当天结束
$now_dt->subDays($offset)->endOfDay();
// 开始时间偏移量计算
$start_time->subDays($offset);
}
$end_time = Carbon::instance($start_time)->endOfDay();
} else {
$start_time = Carbon::now();
if ($offset > 0) {
// 将当前时间调整为偏移量当周结束
$now_dt->subWeeks($offset)->endOfDay();
// 开始时间偏移量计算
$start_time->subWeeks($offset);
}
$start_time->startOfWeek();
$end_time = Carbon::instance($start_time)->endOfWeek();
}
// 生成唯一标识
$sign = Report::generateSign($type, 0, Carbon::instance($start_time));
$one = Report::query()->whereSign($sign)->whereType($type)->first();
// 如果已经提交了相关汇报
if ($one && $id > 0) {
return Base::retSuccess('success', [
"content" => $one->content,
"title" => $one->title,
"id" => $one->id,
]);
}
// 已完成的任务
$completeContent = "";
$complete_task = ProjectTask::query()
->whereNotNull("complete_at")
->whereBetween("complete_at", [$start_time->toDateTimeString(), $end_time->toDateTimeString()])
->whereHas("taskUser", function ($query) use ($user) {
$query->where("userid", $user->userid);
})
->orderByDesc("id")
->get();
if ($complete_task->isNotEmpty()) {
foreach ($complete_task as $task) {
$complete_at = Carbon::parse($task->complete_at);
$pre = $type == Report::WEEKLY ? ('<span>[' . Base::Lang('周' . ['日', '一', '二', '三', '四', '五', '六'][$complete_at->dayOfWeek]) . ']</span>&nbsp;') : '';
$completeContent .= '<li>' . $pre . $task->name . '</li>';
}
} else {
$completeContent = '<li>&nbsp;</li>';
}
// 未完成的任务
$unfinishedContent = "";
$unfinished_task = ProjectTask::query()
->whereNull("complete_at")
->whereNotNull("start_at")
->where("end_at", "<", $end_time->toDateTimeString())
->whereHas("taskUser", function ($query) use ($user) {
$query->where("userid", $user->userid);
})
->orderByDesc("id")
->get();
if ($unfinished_task->isNotEmpty()) {
foreach ($unfinished_task as $task) {
empty($task->end_at) || $end_at = Carbon::parse($task->end_at);
$pre = (!empty($end_at) && $end_at->lt($now_dt)) ? '<span style="color:#ff0000;">[' . Base::Lang('超期') . ']</span>&nbsp;' : '';
$unfinishedContent .= '<li>' . $pre . $task->name . '</li>';
}
} else {
$unfinishedContent = '<li>&nbsp;</li>';
}
// 生成标题
if ($type === Report::WEEKLY) {
$title = $user->nickname . "的周报[" . $start_time->format("m/d") . "-" . $end_time->format("m/d") . "]";
$title .= "[" . $start_time->month . "月第" . $start_time->weekOfMonth . "周]";
} else {
$title = $user->nickname . "的日报[" . $start_time->format("Y/m/d") . "]";
}
$data = [
"time" => $start_time->toDateTimeString(),
"complete_task" => $complete_task,
"unfinished_task" => $unfinished_task,
"content" => '<h2>' . Base::Lang('已完成工作') . '</h2><ol>' .
$completeContent . '</ol><h2>' .
Base::Lang('未完成的工作') . '</h2><ol>' .
$unfinishedContent . '</ol>',
"title" => $title,
];
if ($one) {
$data['id'] = $one->id;
}
return Base::retSuccess('success', $data);
}
/**
* @api {get} api/report/detail 05. 报告详情
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName detail
*
* @apiParam {Number} [id] 报告id
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function detail(): array
{
$id = intval(trim(Request::input("id")));
if (empty($id))
return Base::retError("缺少ID参数");
$one = Report::getOne($id);
$one->type_val = $one->getRawOriginal("type");
$user = User::auth();
// 标记为已读
if (!empty($one->receivesUser)) {
foreach ($one->receivesUser as $item) {
if ($item->userid === $user->userid && $item->pivot->read === 0) {
$one->receivesUser()->updateExistingPivot($user->userid, [
"read" => 1,
]);
}
}
}
return Base::retSuccess("success", $one);
}
/**
* @api {get} api/report/last_submitter 06. 获取最后一次提交的接收人
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName last_submitter
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function last_submitter(): array
{
$one = Report::getLastOne();
return Base::retSuccess("success", empty($one["receives"]) ? [] : $one["receives"]);
}
/**
* @api {get} api/report/unread 07. 获取未读
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName unread
*
* @apiParam {Number} [userid] 用户id
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function unread(): array
{
$userid = intval(trim(Request::input("userid")));
$user = empty($userid) ? User::auth() : User::find($userid);
$data = Report::whereHas("Receives", function (Builder $query) use ($user) {
$query->where("userid", $user->userid)->where("read", 0);
})->orderByDesc('created_at')->paginate(Base::getPaginate(50, 20));
return Base::retSuccess("success", $data);
}
/**
* @api {get} api/report/read 08. 标记汇报已读,可批量
*
* @apiVersion 1.0.0
* @apiGroup report
* @apiName read
*
* @apiParam {String} [ids] 报告id
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function read(): array
{
$user = User::auth();
$ids = Request::input("ids");
if (!is_array($ids) && !is_string($ids)) {
return Base::retError("请传入正确的工作汇报Id");
}
if (is_string($ids)) {
$ids = explode(",", $ids);
}
$data = Report::with(["receivesUser" => function (BelongsToMany $query) use ($user) {
$query->where("report_receives.userid", $user->userid)->where("read", 0);
}])->whereIn("id", $ids)->get();
if ($data->isNotEmpty()) {
foreach ($data as $item) {
(!empty($item->receivesUser) && $item->receivesUser->isNotEmpty()) && $item->receivesUser()->updateExistingPivot($user->userid, [
"read" => 1,
]);
}
}
return Base::retSuccess("success", $data);
}
}

View File

@ -101,12 +101,16 @@ class SystemController extends AbstractController
} }
/** /**
* @api {post} api/system/priority 03. 获取优先级、保存优先级 * @api {post} api/system/priority 03. 任务优先级
* *
* @apiDescription 获取任务优先级、保存任务优先级
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup system * @apiGroup system
* @apiName priority * @apiName priority
* *
* @apiParam {String} type
* - get: 获取(默认)
* - save: 保存(限管理员)
* @apiParam {Array} list 优先级数据,格式:[{name,color,days,priority}] * @apiParam {Array} list 优先级数据,格式:[{name,color,days,priority}]
* *
* @apiSuccess {Number} ret 返回状态码1正确、0错误 * @apiSuccess {Number} ret 返回状态码1正确、0错误
@ -146,7 +150,54 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/info 04. 获取终端详细信息 * @api {post} api/system/column/template 04. 创建项目模板
*
* @apiDescription 获取创建项目模板、保存创建项目模板
* @apiVersion 1.0.0
* @apiGroup system
* @apiName column__template
*
* @apiParam {String} type
* - get: 获取(默认)
* - save: 保存(限管理员)
* @apiParam {Array} list 优先级数据,格式:[{name,columns}]
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function column__template()
{
$type = trim(Request::input('type'));
if ($type == 'save') {
User::auth('admin');
$list = Base::getPostValue('list');
$array = [];
if (empty($list) || !is_array($list)) {
return Base::retError('参数错误');
}
foreach ($list AS $item) {
if (empty($item['name']) || empty($item['columns'])) {
continue;
}
$array[] = [
'name' => $item['name'],
'columns' => array_values(array_filter(array_unique(explode(",", $item['columns']))))
];
}
if (empty($array)) {
return Base::retError('参数为空');
}
$setting = Base::setting('columnTemplate', $array);
} else {
$setting = Base::setting('columnTemplate');
}
//
return Base::retSuccess('success', $setting);
}
/**
* @api {get} api/system/get/info 05. 获取终端详细信息
* *
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup system * @apiGroup system
@ -175,7 +226,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/ip 05. 获取IP地址 * @api {get} api/system/get/ip 06. 获取IP地址
* *
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup system * @apiGroup system
@ -190,7 +241,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/cnip 06. 是否中国IP地址 * @api {get} api/system/get/cnip 07. 是否中国IP地址
* *
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup system * @apiGroup system
@ -207,7 +258,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/ipgcj02 07. 获取IP地址经纬度 * @api {get} api/system/get/ipgcj02 08. 获取IP地址经纬度
* *
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup system * @apiGroup system
@ -224,7 +275,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/ipinfo 08. 获取IP地址详细信息 * @api {get} api/system/get/ipinfo 09. 获取IP地址详细信息
* *
* @apiVersion 1.0.0 * @apiVersion 1.0.0
* @apiGroup system * @apiGroup system
@ -241,7 +292,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {post} api/system/imgupload 09. 上传图片 * @api {post} api/system/imgupload 10. 上传图片
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -264,7 +315,7 @@ class SystemController extends AbstractController
if (!$scale[0] && !$scale[1]) { if (!$scale[0] && !$scale[1]) {
$scale = [2160, 4160, -1]; $scale = [2160, 4160, -1];
} }
$path = "uploads/picture/" . User::userid() . "/" . date("Ym") . "/"; $path = "uploads/user/picture/" . User::userid() . "/" . date("Ym") . "/";
$image64 = trim(Base::getPostValue('image64')); $image64 = trim(Base::getPostValue('image64'));
$fileName = trim(Base::getPostValue('filename')); $fileName = trim(Base::getPostValue('filename'));
if ($image64) { if ($image64) {
@ -291,7 +342,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/imgview 10. 浏览图片空间 * @api {get} api/system/get/imgview 11. 浏览图片空间
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -309,7 +360,7 @@ class SystemController extends AbstractController
if (User::userid() === 0) { if (User::userid() === 0) {
return Base::retError('身份失效,等重新登录'); return Base::retError('身份失效,等重新登录');
} }
$publicPath = "uploads/picture/" . User::userid() . "/"; $publicPath = "uploads/user/picture/" . User::userid() . "/";
$dirPath = public_path($publicPath); $dirPath = public_path($publicPath);
$dirs = $files = []; $dirs = $files = [];
// //
@ -387,7 +438,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {post} api/system/fileupload 11. 上传文件 * @api {post} api/system/fileupload 12. 上传文件
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -407,7 +458,7 @@ class SystemController extends AbstractController
if (User::userid() === 0) { if (User::userid() === 0) {
return Base::retError('身份失效,等重新登录'); return Base::retError('身份失效,等重新登录');
} }
$path = "uploads/files/" . User::userid() . "/" . date("Ym") . "/"; $path = "uploads/user/file/" . User::userid() . "/" . date("Ym") . "/";
$image64 = trim(Base::getPostValue('image64')); $image64 = trim(Base::getPostValue('image64'));
$fileName = trim(Base::getPostValue('filename')); $fileName = trim(Base::getPostValue('filename'));
if ($image64) { if ($image64) {

View File

@ -21,14 +21,20 @@ class VerifyCsrfToken extends Middleware
// 保存任务优先级 // 保存任务优先级
'api/system/priority/', 'api/system/priority/',
// 保存创建项目列表模板
'api/system/column/template/',
// 添加任务 // 添加任务
'api/project/task/add/', 'api/project/task/add/',
// 保存工作流
'api/project/flow/save/',
// 修改任务 // 修改任务
'api/project/task/update/', 'api/project/task/update/',
// 上传任务问题 // 聊天发文本
'api/project/task/upload/', 'api/dialog/msg/sendtext/',
// 聊天发文件 // 聊天发文件
'api/dialog/msg/sendfile/', 'api/dialog/msg/sendfile/',
@ -41,5 +47,8 @@ class VerifyCsrfToken extends Middleware
// 保存文件内容(上传) // 保存文件内容(上传)
'api/file/content/upload/', 'api/file/content/upload/',
// 保存汇报
'api/report/store/',
]; ];
} }

View File

@ -17,6 +17,8 @@ use Illuminate\Support\Facades\DB;
* @method static \Illuminate\Database\Eloquent\Builder|AbstractModel query() * @method static \Illuminate\Database\Eloquent\Builder|AbstractModel query()
* @method static \Illuminate\Database\Eloquent\Builder|AbstractModel saveOrIgnore() * @method static \Illuminate\Database\Eloquent\Builder|AbstractModel saveOrIgnore()
* @method static \Illuminate\Database\Eloquent\Builder|AbstractModel getKeyValue() * @method static \Illuminate\Database\Eloquent\Builder|AbstractModel getKeyValue()
* @method static \Illuminate\Database\Eloquent\Model|object|static|null cancelAppend()
* @method static \Illuminate\Database\Eloquent\Model|object|static|null cancelHidden()
* @method static \Illuminate\Database\Eloquent\Builder|static with($relations) * @method static \Illuminate\Database\Eloquent\Builder|static with($relations)
* @method static \Illuminate\Database\Query\Builder|static select($columns = []) * @method static \Illuminate\Database\Query\Builder|static select($columns = [])
* @method static \Illuminate\Database\Query\Builder|static whereNotIn($column, $values, $boolean = 'and') * @method static \Illuminate\Database\Query\Builder|static whereNotIn($column, $values, $boolean = 'and')
@ -62,6 +64,24 @@ class AbstractModel extends Model
return $this->$key; return $this->$key;
} }
/**
* 取消附加值
* @return static
*/
protected function scopeCancelAppend()
{
return $this->setAppends([]);
}
/**
* 取消隐藏值
* @return static
*/
protected function scopeCancelHidden()
{
return $this->setHidden([]);
}
/** /**
* 为数组 / JSON 序列化准备日期。 * 为数组 / JSON 序列化准备日期。
* @param DateTimeInterface $date * @param DateTimeInterface $date
@ -133,16 +153,23 @@ class AbstractModel extends Model
* @param $where * @param $where
* @param array $update 存在时更新的内容 * @param array $update 存在时更新的内容
* @param array $insert 不存在时插入的内容,如果没有则插入更新内容 * @param array $insert 不存在时插入的内容,如果没有则插入更新内容
* @param bool $isInsert 是否是插入数据
* @return AbstractModel|\Illuminate\Database\Eloquent\Builder|Model|object|static|null * @return AbstractModel|\Illuminate\Database\Eloquent\Builder|Model|object|static|null
*/ */
public static function updateInsert($where, $update = [], $insert = []) public static function updateInsert($where, $update = [], $insert = [], &$isInsert = true)
{ {
$row = static::where($where)->first(); $row = static::where($where)->first();
if (empty($row)) { if (empty($row)) {
$row = new static; $row = new static;
$row->updateInstance(array_merge($where, $insert ?: $update)); $array = array_merge($where, $insert ?: $update);
if (isset($array[$row->primaryKey])) {
unset($array[$row->primaryKey]);
}
$row->updateInstance($array);
$isInsert = true;
} elseif ($update) { } elseif ($update) {
$row->updateInstance($update); $row->updateInstance($update);
$isInsert = false;
} }
if (!$row->save()) { if (!$row->save()) {
return null; return null;

View File

@ -50,15 +50,48 @@ class File extends AbstractModel
{ {
use SoftDeletes; use SoftDeletes;
/**
* 文件文件
*/
const codeExt = [
'txt',
'htaccess', 'htgroups', 'htpasswd', 'conf', 'bat', 'cmd', 'cpp', 'c', 'cc', 'cxx', 'h', 'hh', 'hpp', 'ino', 'cs', 'css',
'dockerfile', 'go', 'html', 'htm', 'xhtml', 'vue', 'we', 'wpy', 'java', 'js', 'jsm', 'jsx', 'json', 'jsp', 'less', 'lua', 'makefile', 'gnumakefile',
'ocamlmakefile', 'make', 'mysql', 'nginx', 'ini', 'cfg', 'prefs', 'm', 'mm', 'pl', 'pm', 'p6', 'pl6', 'pm6', 'pgsql', 'php',
'inc', 'phtml', 'shtml', 'php3', 'php4', 'php5', 'phps', 'phpt', 'aw', 'ctp', 'module', 'ps1', 'py', 'r', 'rb', 'ru', 'gemspec', 'rake', 'guardfile', 'rakefile',
'gemfile', 'rs', 'sass', 'scss', 'sh', 'bash', 'bashrc', 'sql', 'sqlserver', 'swift', 'ts', 'typescript', 'str', 'vbs', 'vb', 'v', 'vh', 'sv', 'svh', 'xml',
'rdf', 'rss', 'wsdl', 'xslt', 'atom', 'mathml', 'mml', 'xul', 'xbl', 'xaml', 'yaml', 'yml',
'asp', 'properties', 'gitignore', 'log', 'bas', 'prg', 'python', 'ftl', 'aspx'
];
/**
* office文件
*/
const officeExt = [
'doc', 'docx',
'xls', 'xlsx',
'ppt', 'pptx',
];
/**
* 本地媒体文件
*/
const localExt = [
'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'raw',
'tif', 'tiff',
'mp3', 'wav', 'mp4', 'flv',
'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm',
];
/** /**
* 是否有访问权限 * 是否有访问权限
* @param $userid * @param $userid
* @return int -1:没有权限0:访问权限1:读写权限1000:所有者 * @return int -1:没有权限0:访问权限1:读写权限1000:所有者或创建者
*/ */
public function getPermission($userid) public function getPermission($userid)
{ {
if ($userid == $this->userid) { if ($userid == $this->userid || $userid == $this->created_id) {
// ① 自己的文件夹 // ① 自己的文件夹 或 自己创建的文件夹
return 1000; return 1000;
} }
$row = $this->getShareInfo(); $row = $this->getShareInfo();
@ -217,7 +250,7 @@ class File extends AbstractModel
/** /**
* 获取文件并检测权限 * 获取文件并检测权限
* @param $id * @param $id
* @param int $limit 要求权限: 0-访问权限、1-读写权限、1000-所有者 * @param int $limit 要求权限: 0-访问权限、1-读写权限、1000-所有者或创建者
* @param $permission * @param $permission
* @return File * @return File
*/ */
@ -231,7 +264,7 @@ class File extends AbstractModel
$permission = $file->getPermission(User::userid()); $permission = $file->getPermission(User::userid());
if ($permission < $limit) { if ($permission < $limit) {
$msg = match ($limit) { $msg = match ($limit) {
1000 => '仅限所有者操作', 1000 => '仅限所有者或创建者操作',
1 => '没有读写权限', 1 => '没有读写权限',
default => '没有访问权限', default => '没有访问权限',
}; };
@ -239,4 +272,77 @@ class File extends AbstractModel
} }
return $file; return $file;
} }
/**
* 格式化内容数据
* @param array $data [path, size, ext, name]
* @return array
*/
public static function formatFileData(array $data)
{
$filePath = $data['path'];
$fileSize = $data['size'];
$fileExt = $data['ext'];
$fileDotExt = '.' . $fileExt;
$fileName = Base::rightDelete($data['name'], $fileDotExt) . $fileDotExt;
$publicPath = public_path($filePath);
//
switch ($fileExt) {
case 'md':
case 'text':
// 文本
$data['content'] = [
'type' => $fileExt,
'content' => file_get_contents($publicPath),
];
$data['file_mode'] = $fileExt;
break;
case 'drawio':
// 图表
$data['content'] = [
'xml' => file_get_contents($publicPath)
];
$data['file_mode'] = $fileExt;
break;
case 'mind':
// 思维导图
$data['content'] = Base::json2array(file_get_contents($publicPath));
$data['file_mode'] = $fileExt;
break;
default:
if (in_array($fileExt, self::codeExt) && $fileSize < 2 * 1024 * 1024)
{
// 文本预览限制2M内的文件
$data['content'] = file_get_contents($publicPath);
$data['file_mode'] = 'code';
}
elseif (in_array($fileExt, File::officeExt))
{
// office预览
$data['content'] = '';
$data['file_mode'] = 'office';
}
else
{
// 其他预览
if (in_array($fileExt, File::localExt)) {
$url = Base::fillUrl($filePath);
} else {
$url = 'http://' . env('APP_IPPR') . '.3/' . $filePath;
}
$data['content'] = [
'preview' => true,
'url' => base64_encode(Base::urlAddparameter($url, [
'fullfilename' => $fileName
])),
];
$data['file_mode'] = 'preview';
}
break;
}
return $data;
}
} }

View File

@ -41,43 +41,53 @@ class FileContent extends AbstractModel
use SoftDeletes; use SoftDeletes;
/** /**
* 获取格式内容 * 获取格式内容(或下载)
* @param $type * @param File $file
* @param $content * @param $content
* @param $download
* @return array|\Symfony\Component\HttpFoundation\BinaryFileResponse * @return array|\Symfony\Component\HttpFoundation\BinaryFileResponse
*/ */
public static function formatContent($type, $content) public static function formatContent($file, $content, $download = false)
{ {
$content = Base::json2array($content); $name = $file->ext ? "{$file->name}.{$file->ext}" : null;
if (in_array($type, ['word', 'excel', 'ppt'])) { $content = Base::json2array($content ?: []);
if (in_array($file->type, ['word', 'excel', 'ppt'])) {
if (empty($content)) { if (empty($content)) {
return Response::download(resource_path('assets/statics/office/empty.' . str_replace(['word', 'excel', 'ppt'], ['docx', 'xlsx', 'pptx'], $type))); return Response::download(resource_path('assets/statics/office/empty.' . str_replace(['word', 'excel', 'ppt'], ['docx', 'xlsx', 'pptx'], $file->type)), $name);
} }
return Response::download(public_path($content['url'])); return Response::download(public_path($content['url']), $name);
} }
if (empty($content)) { if (empty($content)) {
$content = match ($type) { $content = match ($file->type) {
'document' => [ 'document' => [
"type" => "md", "type" => $file->ext,
"content" => "", "content" => "",
], ],
'sheet' => [
[
"name" => "Sheet1",
"config" => json_decode('{}'),
]
],
default => json_decode('{}'), default => json_decode('{}'),
}; };
if ($download) {
abort(403, "This file is empty.");
}
} else { } else {
$content['preview'] = false; $path = $content['url'];
if ($content['ext'] && !in_array($content['ext'], ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'])) { if ($file->ext) {
$url = 'http://' . env('APP_IPPR') . '.3/' . $content['url']; $res = File::formatFileData([
if (in_array($type, ['picture', 'image', 'tif', 'media'])) { 'path' => $path,
$url = Base::fillUrl($content['url']); 'ext' => $file->ext,
'size' => $file->size,
'name' => $file->name,
]);
$content = $res['content'];
} else {
$content['preview'] = false;
}
if ($download) {
$filePath = public_path($path);
if (isset($filePath)) {
return Response::download($filePath, $name);
} else {
abort(403, "This file not support download.");
} }
$content['url'] = base64_encode($url);
$content['preview'] = true;
} }
} }
return Base::retSuccess('success', [ 'content' => $content ]); return Base::retSuccess('success', [ 'content' => $content ]);

View File

@ -3,6 +3,7 @@
namespace App\Models; namespace App\Models;
use App\Exceptions\ApiException; use App\Exceptions\ApiException;
use App\Module\Base;
use App\Tasks\PushTask; use App\Tasks\PushTask;
use Carbon\Carbon; use Carbon\Carbon;
use DB; use DB;
@ -112,6 +113,7 @@ class Project extends AbstractModel
->select([ ->select([
'projects.*', 'projects.*',
'project_users.owner', 'project_users.owner',
'project_users.top_at',
]) ])
->leftJoin('project_users', function ($leftJoin) use ($userid) { ->leftJoin('project_users', function ($leftJoin) use ($userid) {
$leftJoin $leftJoin
@ -135,6 +137,7 @@ class Project extends AbstractModel
->select([ ->select([
'projects.*', 'projects.*',
'project_users.owner', 'project_users.owner',
'project_users.top_at',
]) ])
->join('project_users', 'projects.id', '=', 'project_users.project_id') ->join('project_users', 'projects.id', '=', 'project_users.project_id')
->where('project_users.userid', $userid); ->where('project_users.userid', $userid);
@ -211,7 +214,7 @@ class Project extends AbstractModel
*/ */
public function relationUserids() public function relationUserids()
{ {
return $this->projectUser->pluck('userid')->toArray(); return ProjectUser::whereProjectId($this->id)->orderBy('id')->pluck('userid')->toArray();
} }
/** /**
@ -285,18 +288,23 @@ class Project extends AbstractModel
/** /**
* 添加项目日志 * 添加项目日志
* @param string $detail * @param string $detail
* @param array $record
* @param int $userid * @param int $userid
* @return ProjectLog * @return ProjectLog
*/ */
public function addLog($detail, $userid = 0) public function addLog($detail, $record = [], $userid = 0)
{ {
$log = ProjectLog::createInstance([ $array = [
'project_id' => $this->id, 'project_id' => $this->id,
'column_id' => 0, 'column_id' => 0,
'task_id' => 0, 'task_id' => 0,
'userid' => $userid ?: User::userid(), 'userid' => $userid ?: User::userid(),
'detail' => $detail, 'detail' => $detail,
]); ];
if ($record) {
$array['record'] = $record;
}
$log = ProjectLog::createInstance($array);
$log->save(); $log->save();
return $log; return $log;
} }
@ -304,28 +312,153 @@ class Project extends AbstractModel
/** /**
* 推送消息 * 推送消息
* @param string $action * @param string $action
* @param array $data 发送内容,默认为[id=>项目ID] * @param array|self $data 发送内容,默认为[id=>项目ID]
* @param array $userid 指定会员,默认为项目所有成员 * @param array $userid 指定会员,默认为项目所有成员
*/ */
public function pushMsg($action, $data = null, $userid = null) public function pushMsg($action, $data = null, $userid = null)
{ {
if ($data === null) { if ($data === null) {
$data = ['id' => $this->id]; $data = ['id' => $this->id];
} elseif ($data instanceof self) {
$data = $data->toArray();
} }
//
$array = [$userid, []];
if ($userid === null) { if ($userid === null) {
$userid = $this->relationUserids(); $array[0] = $this->relationUserids();
} elseif (!is_array($userid)) {
$array[0] = [$userid];
} }
$params = [ //
'ignoreFd' => Request::header('fd'), if (isset($data['owner'])) {
'userid' => $userid, $owners = ProjectUser::whereProjectId($data['id'])->whereOwner(1)->pluck('userid')->toArray();
'msg' => [ $array = [array_intersect($array[0], $owners), array_diff($array[0], $owners)];
'type' => 'project', }
'action' => $action, //
'data' => $data, foreach ($array as $index => $item) {
] if ($index > 0) {
]; $data['owner'] = 0;
$task = new PushTask($params, false); }
Task::deliver($task); $params = [
'ignoreFd' => Request::header('fd'),
'userid' => array_values($item),
'msg' => [
'type' => 'project',
'action' => $action,
'data' => $data,
]
];
$task = new PushTask($params, false);
Task::deliver($task);
}
}
/**
* 添加工作流
* @param $flows
* @return mixed
*/
public function addFlow($flows)
{
return AbstractModel::transaction(function() use ($flows) {
$projectFlow = ProjectFlow::whereProjectId($this->id)->first();
if (empty($projectFlow)) {
$projectFlow = ProjectFlow::createInstance([
'project_id' => $this->id,
'name' => 'Default'
]);
if (!$projectFlow->save()) {
throw new ApiException('工作流创建失败');
}
}
//
$ids = [];
$idc = [];
$hasStart = false;
$hasEnd = false;
$upTaskList = [];
foreach ($flows as $item) {
$id = intval($item['id']);
$turns = Base::arrayRetainInt($item['turns'] ?: [], true);
$userids = Base::arrayRetainInt($item['userids'] ?: [], true);
$usertype = trim($item['usertype']);
$userlimit = intval($item['userlimit']);
if ($usertype == 'replace' && empty($userids)) {
throw new ApiException("状态[{$item['name']}]设置错误,设置流转模式时必须填写状态负责人");
}
if ($usertype == 'merge' && empty($userids)) {
throw new ApiException("状态[{$item['name']}]设置错误,设置剔除模式时必须填写状态负责人");
}
if ($userlimit && empty($userids)) {
throw new ApiException("状态[{$item['name']}]设置错误,设置限制负责人时必须填写状态负责人");
}
$flow = ProjectFlowItem::updateInsert([
'id' => $id,
'project_id' => $this->id,
'flow_id' => $projectFlow->id,
], [
'name' => trim($item['name']),
'status' => trim($item['status']),
'sort' => intval($item['sort']),
'turns' => $turns,
'userids' => $userids,
'usertype' => trim($item['usertype']),
'userlimit' => $userlimit,
], [], $isInsert);
if ($flow) {
$ids[] = $flow->id;
if ($flow->id != $id) {
$idc[$id] = $flow->id;
}
if ($flow->status == 'start') {
$hasStart = true;
}
if ($flow->status == 'end') {
$hasEnd = true;
}
if (!$isInsert) {
$upTaskList[$flow->id] = $flow->status . "|" . $flow->name;
}
}
}
if (!$hasStart) {
throw new ApiException('至少需要1个开始状态');
}
if (!$hasEnd) {
throw new ApiException('至少需要1个结束状态');
}
ProjectFlowItem::whereFlowId($projectFlow->id)->whereNotIn('id', $ids)->chunk(100, function($list) {
foreach ($list as $item) {
$item->deleteFlowItem();
}
});
//
foreach ($upTaskList as $id => $value) {
ProjectTask::whereFlowItemId($id)->update([
'flow_item_name' => $value
]);
}
//
$projectFlow = ProjectFlow::with(['projectFlowItem'])->whereProjectId($this->id)->find($projectFlow->id);
$itemIds = $projectFlow->projectFlowItem->pluck('id')->toArray();
foreach ($projectFlow->projectFlowItem as $item) {
$turns = $item->turns;
foreach ($idc as $oid => $nid) {
if (in_array($oid, $turns)) {
$turns = array_diff($turns, [$oid]);
$turns[] = $nid;
}
}
if (!in_array($item->id, $turns)) {
$turns[] = $item->id;
}
$turns = array_values(array_filter(array_unique(array_intersect($turns, $itemIds))));
sort($turns);
$item->turns = $turns;
ProjectFlowItem::whereId($item->id)->update([ 'turns' => Base::array2json($turns) ]);
}
return $projectFlow;
});
} }
/** /**

View File

@ -0,0 +1,51 @@
<?php
namespace App\Models;
use App\Module\Base;
/**
* App\Models\ProjectFlow
*
* @property int $id
* @property int|null $project_id 项目ID
* @property string|null $name 流程名称
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProjectFlowItem[] $projectFlowItem
* @property-read int|null $project_flow_item_count
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow query()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow whereProjectId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlow whereUpdatedAt($value)
* @mixin \Eloquent
*/
class ProjectFlow extends AbstractModel
{
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function projectFlowItem(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(ProjectFlowItem::class, 'flow_id', 'id')->orderBy('sort');
}
/**
* @return mixed
*/
public function deleteFlow()
{
return AbstractModel::transaction(function() {
ProjectFlowItem::whereProjectId($this->project_id)->chunk(100, function($list) {
foreach ($list as $item) {
$item->deleteFlowItem();
}
});
return $this->delete();
});
}
}

View File

@ -0,0 +1,90 @@
<?php
namespace App\Models;
use App\Module\Base;
/**
* App\Models\ProjectFlowItem
*
* @property int $id
* @property int|null $project_id 项目ID
* @property int|null $flow_id 流程ID
* @property string|null $name 名称
* @property string|null $status 状态
* @property array $turns 可流转
* @property array $userids 自动负责人ID
* @property string|null $usertype 流转模式
* @property int|null $userlimit 限制负责人
* @property int|null $sort 排序
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\ProjectFlow|null $projectFlow
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem query()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereFlowId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereProjectId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereSort($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereTurns($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereUserids($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereUserlimit($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectFlowItem whereUsertype($value)
* @mixin \Eloquent
*/
class ProjectFlowItem extends AbstractModel
{
protected $hidden = [
'created_at',
'updated_at',
];
/**
* @param $value
* @return array
*/
public function getTurnsAttribute($value)
{
if (is_array($value)) {
return $value;
}
return Base::json2array($value);
}
/**
* @param $value
* @return array
*/
public function getUseridsAttribute($value)
{
if (is_array($value)) {
return $value;
}
return Base::json2array($value);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function projectFlow(): \Illuminate\Database\Eloquent\Relations\HasOne
{
return $this->hasOne(ProjectFlow::class, 'id', 'flow_id');
}
/**
* @return bool|null
*/
public function deleteFlowItem()
{
ProjectTask::whereFlowItemId($this->id)->update([
'flow_item_id' => 0,
'flow_item_name' => "",
]);
return $this->delete();
}
}

View File

@ -2,6 +2,8 @@
namespace App\Models; namespace App\Models;
use App\Module\Base;
/** /**
* App\Models\ProjectLog * App\Models\ProjectLog
* *
@ -11,8 +13,10 @@ namespace App\Models;
* @property int|null $task_id 项目ID * @property int|null $task_id 项目ID
* @property int|null $userid 会员ID * @property int|null $userid 会员ID
* @property string|null $detail 详细信息 * @property string|null $detail 详细信息
* @property array $record 记录数据
* @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\ProjectTask|null $projectTask
* @property-read \App\Models\User|null $user * @property-read \App\Models\User|null $user
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog newQuery() * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog newQuery()
@ -22,6 +26,7 @@ namespace App\Models;
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereDetail($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereDetail($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereProjectId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereProjectId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereRecord($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereTaskId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereTaskId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereUserid($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectLog whereUserid($value)
@ -30,6 +35,18 @@ namespace App\Models;
class ProjectLog extends AbstractModel class ProjectLog extends AbstractModel
{ {
/**
* @param $value
* @return array
*/
public function getRecordAttribute($value)
{
if (is_array($value)) {
return $value;
}
return Base::json2array($value);
}
/** /**
* @return \Illuminate\Database\Eloquent\Relations\HasOne * @return \Illuminate\Database\Eloquent\Relations\HasOne
*/ */
@ -38,4 +55,12 @@ class ProjectLog extends AbstractModel
return $this->hasOne(User::class, 'userid', 'userid'); return $this->hasOne(User::class, 'userid', 'userid');
} }
/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function projectTask(): \Illuminate\Database\Eloquent\Relations\HasOne
{
return $this->hasOne(ProjectTask::class, 'id', 'task_id');
}
} }

View File

@ -21,6 +21,8 @@ use Request;
* @property int|null $project_id 项目ID * @property int|null $project_id 项目ID
* @property int|null $column_id 列表ID * @property int|null $column_id 列表ID
* @property int|null $dialog_id 聊天会话ID * @property int|null $dialog_id 聊天会话ID
* @property int|null $flow_item_id 工作流状态ID
* @property string|null $flow_item_name 工作流状态名称
* @property string|null $name 标题 * @property string|null $name 标题
* @property string|null $color 颜色 * @property string|null $color 颜色
* @property string|null $desc 描述 * @property string|null $desc 描述
@ -72,6 +74,8 @@ use Request;
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereDesc($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereDesc($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereDialogId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereDialogId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereEndAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereEndAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereFlowItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereFlowItemName($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTask wherePColor($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectTask wherePColor($value)
@ -108,7 +112,7 @@ class ProjectTask extends AbstractModel
public function getFileNumAttribute() public function getFileNumAttribute()
{ {
if (!isset($this->appendattrs['file_num'])) { if (!isset($this->appendattrs['file_num'])) {
$this->appendattrs['file_num'] = ProjectTaskFile::whereTaskId($this->id)->count(); $this->appendattrs['file_num'] = $this->parent_id > 0 ? 0 : ProjectTaskFile::whereTaskId($this->id)->count();
} }
return $this->appendattrs['file_num']; return $this->appendattrs['file_num'];
} }
@ -338,11 +342,13 @@ class ProjectTask extends AbstractModel
$content = $data['content']; $content = $data['content'];
$times = $data['times']; $times = $data['times'];
$owner = $data['owner']; $owner = $data['owner'];
$add_assist = intval($data['add_assist']);
$subtasks = $data['subtasks']; $subtasks = $data['subtasks'];
$p_level = intval($data['p_level']); $p_level = intval($data['p_level']);
$p_name = $data['p_name']; $p_name = $data['p_name'];
$p_color = $data['p_color']; $p_color = $data['p_color'];
$top = intval($data['top']); $top = intval($data['top']);
$userid = User::userid();
// //
if (ProjectTask::whereProjectId($project_id) if (ProjectTask::whereProjectId($project_id)
->whereNull('project_tasks.complete_at') ->whereNull('project_tasks.complete_at')
@ -407,17 +413,37 @@ class ProjectTask extends AbstractModel
$tmpArray[] = $uid; $tmpArray[] = $uid;
} }
$owner = $tmpArray; $owner = $tmpArray;
// 协助人员
$assist = [];
if (!in_array($userid, $owner) && $add_assist) {
$assist = [$userid];
}
// 创建人 // 创建人
$task->userid = User::userid(); $task->userid = $userid;
// 排序位置 // 排序位置
if ($top) { if ($top) {
$task->sort = intval(self::whereColumnId($task->column_id)->orderBy('sort')->value('sort')) - 1; $task->sort = intval(self::whereColumnId($task->column_id)->orderBy('sort')->value('sort')) - 1;
} else { } else {
$task->sort = intval(self::whereColumnId($task->column_id)->orderByDesc('sort')->value('sort')) + 1; $task->sort = intval(self::whereColumnId($task->column_id)->orderByDesc('sort')->value('sort')) + 1;
} }
// 工作流
$projectFlow = ProjectFlow::whereProjectId($project_id)->orderByDesc('id')->first();
if ($projectFlow) {
$projectFlowItem = ProjectFlowItem::whereFlowId($projectFlow->id)->orderBy('sort')->get();
// 赋一个开始状态
foreach ($projectFlowItem as $item) {
if ($item->status == 'start') {
$task->flow_item_id = $item->id;
$task->flow_item_name = $item->status . "|" . $item->name;
$owner = array_merge($owner, $item->userids);
break;
}
}
}
// //
return AbstractModel::transaction(function() use ($times, $subtasks, $content, $owner, $task) { return AbstractModel::transaction(function() use ($assist, $times, $subtasks, $content, $owner, $task) {
$task->save(); $task->save();
$owner = array_values(array_unique($owner));
foreach ($owner as $uid) { foreach ($owner as $uid) {
ProjectTaskUser::createInstance([ ProjectTaskUser::createInstance([
'project_id' => $task->project_id, 'project_id' => $task->project_id,
@ -427,6 +453,16 @@ class ProjectTask extends AbstractModel
'owner' => 1, 'owner' => 1,
])->save(); ])->save();
} }
$assist = array_values(array_unique(array_diff($assist, $owner)));
foreach ($assist as $uid) {
ProjectTaskUser::createInstance([
'project_id' => $task->project_id,
'task_id' => $task->id,
'task_pid' => $task->parent_id ?: $task->id,
'userid' => $uid,
'owner' => 0,
])->save();
}
if ($content) { if ($content) {
ProjectTaskContent::createInstance([ ProjectTaskContent::createInstance([
'project_id' => $task->project_id, 'project_id' => $task->project_id,
@ -453,7 +489,7 @@ class ProjectTask extends AbstractModel
self::addTask($subtask); self::addTask($subtask);
} }
} }
$task->addLog("创建{任务}" . $task->name); $task->addLog("创建{任务}");
return $task; return $task;
}); });
} }
@ -461,16 +497,109 @@ class ProjectTask extends AbstractModel
/** /**
* 修改任务 * 修改任务
* @param $data * @param $data
* @param bool $updateProject 是否更新项目数据(项目统计) * @param array $updateMarking 更新的标记
* @param bool $updateContent 是否更新任务详情 * - is_update_project 是否更新项目数据(项目统计)
* @param bool $updateSubTask 是否更新子任务 * - is_update_content 是否更新任务详情
* - is_update_maintask 是否更新主任务
* - is_update_subtask 是否更新子任务
* @return bool * @return bool
*/ */
public function updateTask($data, &$updateProject = false, &$updateContent = false, &$updateSubTask = false) public function updateTask($data, &$updateMarking = [])
{ {
AbstractModel::transaction(function () use ($data, &$updateProject, &$updateContent, &$updateSubTask) { AbstractModel::transaction(function () use ($data, &$updateMarking) {
// 判断版本
Base::checkClientVersion('0.6.0');
// 主任务
$mainTask = $this->parent_id > 0 ? self::find($this->parent_id) : null;
// 工作流
if (Arr::exists($data, 'flow_item_id')) {
$isProjectOwner = $this->useridInTheProject(User::userid()) === 2;
if (!$isProjectOwner && !$this->isOwner()) {
throw new ApiException('仅限项目或任务负责人修改任务状态');
}
if ($this->flow_item_id == $data['flow_item_id']) {
throw new ApiException('任务状态未发生改变');
}
$flowData = [
'flow_item_id' => $this->flow_item_id,
'flow_item_name' => $this->flow_item_name,
];
$currentFlowItem = null;
$newFlowItem = ProjectFlowItem::whereProjectId($this->project_id)->find(intval($data['flow_item_id']));
if (empty($newFlowItem) || empty($newFlowItem->projectFlow)) {
throw new ApiException('任务状态不存在');
}
if ($this->flow_item_id) {
// 判断符合流转
$currentFlowItem = ProjectFlowItem::find($this->flow_item_id);
if ($currentFlowItem) {
if (!in_array($newFlowItem->id, $currentFlowItem->turns)) {
throw new ApiException("当前状态[{$currentFlowItem->name}]不可流转到[{$newFlowItem->name}]");
}
if ($currentFlowItem->userlimit) {
if (!$isProjectOwner && !in_array(User::userid(), $currentFlowItem->userids)) {
throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改");
}
}
}
}
if ($newFlowItem->status == 'end') {
// 判断自动完成
if (!$this->complete_at) {
$flowData['complete_at'] = $this->complete_at;
$data['complete_at'] = date("Y-m-d H:i");
}
} else {
// 判断自动打开
if ($this->complete_at) {
$flowData['complete_at'] = $this->complete_at;
$data['complete_at'] = false;
}
}
if ($newFlowItem->userids) {
// 判断自动添加负责人
$flowData['owner'] = $data['owner'] = $this->taskUser->where('owner', 1)->pluck('userid')->toArray();
if (in_array($newFlowItem->usertype, ["replace", "merge"])) {
// 流转模式、剔除模式
if ($this->parent_id === 0) {
$flowData['assist'] = $data['assist'] = $this->taskUser->where('owner', 0)->pluck('userid')->toArray();
$data['assist'] = array_merge($data['assist'], $data['owner']);
}
$data['owner'] = $newFlowItem->userids;
// 判断剔除模式:保留操作状态的人员
if ($newFlowItem->usertype == "merge") {
$data['owner'][] = User::userid();
}
} else {
// 添加模式
$data['owner'] = array_merge($data['owner'], $newFlowItem->userids);
}
$data['owner'] = array_values(array_unique($data['owner']));
if (isset($data['assist'])) {
$data['assist'] = array_values(array_unique(array_diff($data['assist'], $data['owner'])));
}
}
$this->flow_item_id = $newFlowItem->id;
$this->flow_item_name = $newFlowItem->status . "|" . $newFlowItem->name;
$this->addLog("修改{任务}状态", [
'flow' => $flowData,
'change' => [$currentFlowItem?->name, $newFlowItem->name]
]);
ProjectTaskFlowChange::createInstance([
'task_id' => $this->id,
'userid' => User::userid(),
'before_flow_item_id' => $flowData['flow_item_id'],
'before_flow_item_name' => $flowData['flow_item_name'],
'after_flow_item_id' => $this->flow_item_id,
'after_flow_item_name' => $this->flow_item_name,
])->save();
}
// 状态 // 状态
if (Arr::exists($data, 'complete_at')) { if (Arr::exists($data, 'complete_at')) {
// 子任务:主任务已完成时无法修改
if ($mainTask?->complete_at) {
throw new ApiException('主任务已完成,无法修改子任务状态');
}
if (Base::isDate($data['complete_at'])) { if (Base::isDate($data['complete_at'])) {
// 标记已完成 // 标记已完成
if ($this->complete_at) { if ($this->complete_at) {
@ -484,8 +613,7 @@ class ProjectTask extends AbstractModel
} }
$this->completeTask(null); $this->completeTask(null);
} }
$updateProject = true; $updateMarking['is_update_project'] = true;
return;
} }
// 标题 // 标题
if (Arr::exists($data, 'name') && $this->name != $data['name']) { if (Arr::exists($data, 'name') && $this->name != $data['name']) {
@ -494,14 +622,19 @@ class ProjectTask extends AbstractModel
} elseif (mb_strlen($data['name']) > 255) { } elseif (mb_strlen($data['name']) > 255) {
throw new ApiException('任务描述最多只能设置255个字'); throw new ApiException('任务描述最多只能设置255个字');
} }
$this->addLog("修改{任务}标题:{$this->name} => {$data['name']}"); $this->addLog("修改{任务}标题", [
'change' => [$this->name, $data['name']]
]);
$this->name = $data['name']; $this->name = $data['name'];
} }
// 负责人 // 负责人
if (Arr::exists($data, 'owner')) { if (Arr::exists($data, 'owner')) {
$count = $this->taskUser->count(); $count = $this->taskUser->where('owner', 1)->count();
$array = []; $array = [];
$owner = is_array($data['owner']) ? $data['owner'] : [$data['owner']]; $owner = is_array($data['owner']) ? $data['owner'] : [$data['owner']];
if (count($owner) > 10) {
throw new ApiException('任务负责人最多不能超过10个');
}
foreach ($owner as $uid) { foreach ($owner as $uid) {
if (intval($uid) == 0) continue; if (intval($uid) == 0) continue;
if (!$this->project->useridInTheProject($uid)) continue; if (!$this->project->useridInTheProject($uid)) continue;
@ -523,54 +656,90 @@ class ProjectTask extends AbstractModel
if ($count == 0 && count($array) == 1 && $array[0] == User::userid()) { if ($count == 0 && count($array) == 1 && $array[0] == User::userid()) {
$this->addLog("认领{任务}"); $this->addLog("认领{任务}");
} else { } else {
$this->addLog("修改{任务}负责人" . implode(",", $array)); $this->addLog("修改{任务}负责人", ['userid' => $array]);
} }
} }
$rows = ProjectTaskUser::whereTaskId($this->id)->whereOwner(1)->whereNotIn('userid', $array)->get(); $rows = ProjectTaskUser::whereTaskId($this->id)->whereOwner(1)->whereNotIn('userid', $array)->get();
if ($rows->isNotEmpty()) { if ($rows->isNotEmpty()) {
$this->addLog("删除{任务}负责人" . $rows->implode('userid', ',')); $this->addLog("删除{任务}负责人", ['userid' => $rows->implode('userid', ',')]);
foreach ($rows as $row) { foreach ($rows as $row) {
$row->delete(); $row->delete();
} }
} }
$updateProject = true; $updateMarking['is_update_project'] = true;
$this->syncDialogUser(); $this->syncDialogUser();
} }
// 计划时间 // 计划时间(原则:子任务时间在主任务时间内)
if (Arr::exists($data, 'times')) { if (Arr::exists($data, 'times')) {
$originalWhere = [ $oldAt = [Carbon::parse($this->start_at), Carbon::parse($this->end_at)];
'parent_id' => $this->id, $oldStringAt = $this->start_at ? ($oldAt[0]->toDateTimeString() . '~' . $oldAt[1]->toDateTimeString()) : '';
'start_at' => $this->start_at,
'end_at' => $this->end_at,
];
$this->start_at = null; $this->start_at = null;
$this->end_at = null; $this->end_at = null;
$times = $data['times']; $times = $data['times'];
list($start, $end) = is_string($times) ? explode(",", $times) : (is_array($times) ? $times : []); list($start, $end) = is_string($times) ? explode(",", $times) : (is_array($times) ? $times : []);
if (Base::isDate($start) && Base::isDate($end) && $start != $end) { if (Base::isDate($start) && Base::isDate($end) && $start != $end) {
if ($this->parent_id > 0 && $data['skipTimesCheck'] !== true) { $start_at = Carbon::parse($start);
// 如果是子任务,则不能超过主任务时间 $end_at = Carbon::parse($end);
$mainTask = self::find($this->parent_id); if ($this->parent_id > 0) {
if (Carbon::parse($start)->lt($mainTask->start_at)) { // 判断同步主任务时间(子任务时间 超出 主任务)
throw new ApiException('子任务开始时间不能小于主任务开始时间'); if ($mainTask) {
} $isUp = false;
if (Carbon::parse($end)->gt($mainTask->end_at)) { if ($start_at->lt(Carbon::parse($mainTask->start_at))) {
throw new ApiException('子任务结束时间不能大于主任务结束时间'); $mainTask->start_at = $start_at;
$isUp = true;
}
if ($end_at->gt(Carbon::parse($mainTask->end_at))) {
$mainTask->end_at = $end_at;
$isUp = true;
}
if ($isUp) {
$updateMarking['is_update_maintask'] = true;
$mainTask->addLog("同步修改{任务}时间");
$mainTask->save();
}
} }
} }
$this->start_at = Carbon::parse($start); $this->start_at = $start_at;
$this->end_at = Carbon::parse($end); $this->end_at = $end_at;
} else {
if ($this->parent_id > 0) {
// 清空子任务时间(子任务时间等于主任务时间)
$this->start_at = $mainTask->start_at;
$this->end_at = $mainTask->end_at;
}
} }
if ($this->parent_id == 0) { if ($this->parent_id == 0) {
// 如果是主任务,则同步跟主任务相同时间的子任务 // 判断同步子任务时间(主任务时间 不在 子任务时间 之外)
self::where($originalWhere)->chunk(100, function($list) use ($times, &$updateSubTask) { self::whereParentId($this->id)->chunk(100, function($list) use ($oldAt, &$updateMarking) {
foreach ($list as $item) { /** @var self $subTask */
$item->updateTask(['times' => $times, 'skipTimesCheck' => true]); foreach ($list as $subTask) {
$start_at = Carbon::parse($subTask->start_at);
$end_at = Carbon::parse($subTask->end_at);
$isUp = false;
if (empty($subTask->start_at) || $start_at->eq($oldAt[0]) || $start_at->lt(Carbon::parse($this->start_at))) {
$subTask->start_at = $this->start_at;
$isUp = true;
}
if (empty($subTask->end_at) || $end_at->eq($oldAt[1]) || $end_at->gt(Carbon::parse($this->end_at))) {
$subTask->end_at = $this->end_at;
$isUp = true;
}
if ($subTask->start_at && Carbon::parse($subTask->start_at)->gt($subTask->end_at)) {
$subTask->start_at = $this->start_at;
$isUp = true;
}
if ($isUp) {
$updateMarking['is_update_subtask'] = true;
$subTask->addLog("同步修改{任务}时间");
$subTask->save();
}
} }
$updateSubTask = true;
}); });
} }
$this->addLog("修改{任务}时间"); $newStringAt = $this->start_at ? ($this->start_at->toDateTimeString() . '~' . $this->end_at->toDateTimeString()) : '';
$this->addLog("修改{任务}时间", [
'change' => [$oldStringAt, $newStringAt]
]);
} }
// 以下紧顶级任务可修改 // 以下紧顶级任务可修改
if ($this->parent_id === 0) { if ($this->parent_id === 0) {
@ -578,6 +747,9 @@ class ProjectTask extends AbstractModel
if (Arr::exists($data, 'assist')) { if (Arr::exists($data, 'assist')) {
$array = []; $array = [];
$assist = is_array($data['assist']) ? $data['assist'] : [$data['assist']]; $assist = is_array($data['assist']) ? $data['assist'] : [$data['assist']];
if (count($assist) > 10) {
throw new ApiException('任务协助人员最多不能超过10个');
}
foreach ($assist as $uid) { foreach ($assist as $uid) {
if (intval($uid) == 0) continue; if (intval($uid) == 0) continue;
if (!$this->project->useridInTheProject($uid)) continue; if (!$this->project->useridInTheProject($uid)) continue;
@ -593,11 +765,11 @@ class ProjectTask extends AbstractModel
$array[] = $uid; $array[] = $uid;
} }
if ($array) { if ($array) {
$this->addLog("修改{任务}协助人员" . implode(",", $array)); $this->addLog("修改{任务}协助人员", ['userid' => $array]);
} }
$rows = ProjectTaskUser::whereTaskId($this->id)->whereOwner(0)->whereNotIn('userid', $array)->get(); $rows = ProjectTaskUser::whereTaskId($this->id)->whereOwner(0)->whereNotIn('userid', $array)->get();
if ($rows->isNotEmpty()) { if ($rows->isNotEmpty()) {
$this->addLog("删除{任务}协助人员" . $rows->implode('userid', ',')); $this->addLog("删除{任务}协助人员", ['userid' => $rows->implode('userid', ',')]);
foreach ($rows as $row) { foreach ($rows as $row) {
$row->delete(); $row->delete();
} }
@ -606,7 +778,9 @@ class ProjectTask extends AbstractModel
} }
// 背景色 // 背景色
if (Arr::exists($data, 'color') && $this->color != $data['color']) { if (Arr::exists($data, 'color') && $this->color != $data['color']) {
$this->addLog("修改{任务}背景色:{$this->color} => {$data['color']}"); $this->addLog("修改{任务}背景色", [
'change' => [$this->color, $data['color']]
]);
$this->color = $data['color']; $this->color = $data['color'];
} }
// 列表 // 列表
@ -616,7 +790,9 @@ class ProjectTask extends AbstractModel
if (empty($column)) { if (empty($column)) {
throw new ApiException('请选择正确的列表'); throw new ApiException('请选择正确的列表');
} }
$this->addLog("修改{任务}列表:{$oldName} => {$column->name}"); $this->addLog("修改{任务}列表", [
'change' => [$oldName, $column->name]
]);
$this->column_id = $column->id; $this->column_id = $column->id;
} }
// 内容 // 内容
@ -629,10 +805,11 @@ class ProjectTask extends AbstractModel
]); ]);
$this->desc = Base::getHtml($data['content'], 100); $this->desc = Base::getHtml($data['content'], 100);
$this->addLog("修改{任务}详细描述"); $this->addLog("修改{任务}详细描述");
$updateContent = true; $updateMarking['is_update_content'] = true;
} }
// 优先级 // 优先级
$p = false; $p = false;
$oldPName = $this->p_name;
if (Arr::exists($data, 'p_level') && $this->p_level != $data['p_level']) { if (Arr::exists($data, 'p_level') && $this->p_level != $data['p_level']) {
$this->p_level = intval($data['p_level']); $this->p_level = intval($data['p_level']);
$p = true; $p = true;
@ -646,7 +823,9 @@ class ProjectTask extends AbstractModel
$p = true; $p = true;
} }
if ($p) { if ($p) {
$this->addLog("修改{任务}优先级"); $this->addLog("修改{任务}优先级", [
'change' => [$oldPName, $this->p_name]
]);
} }
} }
$this->save(); $this->save();
@ -663,9 +842,7 @@ class ProjectTask extends AbstractModel
{ {
if ($this->parent_id > 0) { if ($this->parent_id > 0) {
$task = self::find($this->parent_id); $task = self::find($this->parent_id);
if ($task) { $task?->syncDialogUser();
$task->syncDialogUser();
}
return; return;
} }
if (empty($this->dialog_id)) { if (empty($this->dialog_id)) {
@ -689,7 +866,7 @@ class ProjectTask extends AbstractModel
*/ */
public function relationUserids() public function relationUserids()
{ {
$userids = $this->taskUser->pluck('userid')->toArray(); $userids = ProjectTaskUser::whereTaskId($this->id)->orderByDesc('owner')->orderByDesc('id')->pluck('userid')->toArray();
$items = ProjectTask::with(['taskUser'])->where('parent_id', $this->id)->whereNull('archived_at')->get(); $items = ProjectTask::with(['taskUser'])->where('parent_id', $this->id)->whereNull('archived_at')->get();
foreach ($items as $item) { foreach ($items as $item) {
$userids = array_merge($userids, $item->taskUser->pluck('userid')->toArray()); $userids = array_merge($userids, $item->taskUser->pluck('userid')->toArray());
@ -725,6 +902,62 @@ class ProjectTask extends AbstractModel
return $user->owner ? 2 : 1; return $user->owner ? 2 : 1;
} }
/**
* 权限版本
* @param int $level 1-负责人2-协助人/负责人3-创建人/协助人/负责人
* @return bool
*/
public function permission($level = 1)
{
if ($level >= 3 && $this->isCreater()) {
return true;
}
if ($level >= 2 && $this->isAssister()) {
return true;
}
return $this->isOwner();
}
/**
* 判断是否创建者
* @return bool
*/
public function isCreater()
{
return $this->userid == User::userid();
}
/**
* 判断是否协助人员
* @return bool
*/
public function isAssister()
{
$row = $this;
while ($row->parent_id > 0) {
$row = self::find($row->parent_id);
}
return ProjectTaskUser::whereTaskId($row->id)->whereUserid(User::userid())->whereOwner(0)->exists();
}
/**
* 判断是否负责人(或者是主任务的负责人)
* @return bool
*/
public function isOwner()
{
if ($this->owner) {
return true;
}
if ($this->parent_id > 0) {
$mainTask = self::allData()->find($this->parent_id);
if ($mainTask->owner) {
return true;
}
}
return false;
}
/** /**
* 是否有负责人 * 是否有负责人
* @return bool * @return bool
@ -737,24 +970,6 @@ class ProjectTask extends AbstractModel
return $this->appendattrs['has_owner']; return $this->appendattrs['has_owner'];
} }
/**
* 是否负责人
* @param bool $isParent 是父级任务的负责人也算
* @return bool
*/
public function isOwner($isParent = true) {
if ($this->owner) {
return true;
}
if ($isParent && $this->parent_id > 0) {
$parentTask = self::find($this->parent_id);
if ($parentTask?->owner) {
return true;
}
}
return false;
}
/** /**
* 标记已完成、未完成 * 标记已完成、未完成
* @param Carbon|null $complete_at 完成时间 * @param Carbon|null $complete_at 完成时间
@ -766,7 +981,7 @@ class ProjectTask extends AbstractModel
if ($complete_at === null) { if ($complete_at === null) {
// 标记未完成 // 标记未完成
$this->complete_at = null; $this->complete_at = null;
$this->addLog("{任务}标记未完成" . $this->name); $this->addLog("标记{任务}未完成");
} else { } else {
// 标记已完成 // 标记已完成
if ($this->parent_id == 0) { if ($this->parent_id == 0) {
@ -778,7 +993,7 @@ class ProjectTask extends AbstractModel
throw new ApiException('请先领取任务'); throw new ApiException('请先领取任务');
} }
$this->complete_at = $complete_at; $this->complete_at = $complete_at;
$this->addLog("{任务}标记已完成" . $this->name); $this->addLog("标记{任务}已完成");
} }
$this->save(); $this->save();
}); });
@ -792,32 +1007,42 @@ class ProjectTask extends AbstractModel
*/ */
public function archivedTask($archived_at, $isAuto = false) public function archivedTask($archived_at, $isAuto = false)
{ {
if (!$this->complete_at) {
$flowItems = ProjectFlowItem::whereProjectId($this->project_id)->whereStatus('end')->pluck('name');
if ($flowItems) {
$flowItems = implode(",", array_values(array_unique($flowItems->toArray())));
}
if (empty($flowItems)) {
$flowItems = "已完成";
}
throw new ApiException('仅限【' . $flowItems . '】状态的任务归档');
}
AbstractModel::transaction(function () use ($isAuto, $archived_at) { AbstractModel::transaction(function () use ($isAuto, $archived_at) {
if ($archived_at === null) { if ($archived_at === null) {
// 取消归档 // 取消归档
$this->archived_at = null; $this->archived_at = null;
$this->archived_userid = User::userid(); $this->archived_userid = User::userid();
$this->archived_follow = 0; $this->archived_follow = 0;
$this->addLog("任务取消归档:" . $this->name); $this->addLog("任务取消归档");
$this->pushMsg('add', [
'new_column' => null,
'task' => ProjectTask::oneTask($this->id),
]);
} else { } else {
// 归档任务 // 归档任务
if ($isAuto === true) { if ($isAuto === true) {
$logText = "自动任务归档" . $this->name; $logText = "自动任务归档";
$userid = 0; $userid = 0;
} else { } else {
$logText = "任务归档" . $this->name; $logText = "任务归档";
$userid = User::userid(); $userid = User::userid();
} }
$this->archived_at = $archived_at; $this->archived_at = $archived_at;
$this->archived_userid = $userid; $this->archived_userid = $userid;
$this->archived_follow = 0; $this->archived_follow = 0;
$this->addLog($logText, $userid); $this->addLog($logText, [], $userid);
$this->pushMsg('archived');
} }
$this->pushMsg('update', [
'id' => $this->id,
'archived_at' => $this->archived_at,
'archived_userid' => $this->archived_userid,
]);
self::whereParentId($this->id)->update([ self::whereParentId($this->id)->update([
'archived_at' => $this->archived_at, 'archived_at' => $this->archived_at,
'archived_userid' => $this->archived_userid, 'archived_userid' => $this->archived_userid,
@ -841,7 +1066,7 @@ class ProjectTask extends AbstractModel
$dialog?->deleteDialog(); $dialog?->deleteDialog();
} }
self::whereParentId($this->id)->delete(); self::whereParentId($this->id)->delete();
$this->addLog("删除{任务}" . $this->name); $this->addLog("删除{任务}");
$this->delete(); $this->delete();
}); });
if ($pushMsg) { if ($pushMsg) {
@ -853,19 +1078,27 @@ class ProjectTask extends AbstractModel
/** /**
* 添加任务日志 * 添加任务日志
* @param string $detail * @param string $detail
* @param array $record
* @param int $userid * @param int $userid
* @return ProjectLog * @return ProjectLog
*/ */
public function addLog($detail, $userid = 0) public function addLog($detail, $record = [], $userid = 0)
{ {
$detail = str_replace("{任务}", $this->parent_id > 0 ? "子任务" : "任务", $detail); $detail = str_replace("{任务}", $this->parent_id ? "子任务" : "任务", $detail);
$log = ProjectLog::createInstance([ $array = [
'project_id' => $this->project_id, 'project_id' => $this->project_id,
'column_id' => $this->column_id, 'column_id' => $this->column_id,
'task_id' => $this->parent_id ?: $this->id, 'task_id' => $this->parent_id ?: $this->id,
'userid' => $userid ?: User::userid(), 'userid' => $userid ?: User::userid(),
'detail' => $detail, 'detail' => $detail,
]); ];
if ($this->parent_id) {
$record['subtitle'] = $this->name;
}
if ($record) {
$array['record'] = $record;
}
$log = ProjectLog::createInstance($array);
$log->save(); $log->save();
return $log; return $log;
} }
@ -873,8 +1106,8 @@ class ProjectTask extends AbstractModel
/** /**
* 推送消息 * 推送消息
* @param string $action * @param string $action
* @param array $data 发送内容,默认为[id, parent_id, project_id, column_id, dialog_id] * @param array|self $data 发送内容,默认为[id, parent_id, project_id, column_id, dialog_id]
* @param array $userid 指定会员,默认为项目所有成员 * @param array $userid 指定会员,默认为项目所有成员
*/ */
public function pushMsg($action, $data = null, $userid = null) public function pushMsg($action, $data = null, $userid = null)
{ {
@ -889,21 +1122,37 @@ class ProjectTask extends AbstractModel
'column_id' => $this->column_id, 'column_id' => $this->column_id,
'dialog_id' => $this->dialog_id, 'dialog_id' => $this->dialog_id,
]; ];
} elseif ($data instanceof self) {
$data = $data->toArray();
} }
//
$array = [$userid, []];
if ($userid === null) { if ($userid === null) {
$userid = $this->project->relationUserids(); $array[0] = $this->project->relationUserids();
} elseif (!is_array($userid)) {
$array[0] = [$userid];
}
//
if (isset($data['owner'])) {
$owners = ProjectTaskUser::whereTaskId($data['id'])->whereOwner(1)->pluck('userid')->toArray();
$array = [array_intersect($array[0], $owners), array_diff($array[0], $owners)];
}
foreach ($array as $index => $item) {
if ($index > 0) {
$data['owner'] = 0;
}
$params = [
'ignoreFd' => Request::header('fd'),
'userid' => array_values($item),
'msg' => [
'type' => 'projectTask',
'action' => $action,
'data' => $data,
]
];
$task = new PushTask($params, false);
Task::deliver($task);
} }
$params = [
'ignoreFd' => Request::header('fd'),
'userid' => $userid,
'msg' => [
'type' => 'projectTask',
'action' => $action,
'data' => $data,
]
];
$task = new PushTask($params, false);
Task::deliver($task);
} }
/** /**
@ -919,12 +1168,12 @@ class ProjectTask extends AbstractModel
/** /**
* 获取任务(会员有任务权限 会员存在项目内) * 获取任务(会员有任务权限 会员存在项目内)
* @param int $task_id * @param int $task_id
* @param bool $archived true:仅限未归档, false:不限制, null:不限制 * @param bool $archived true:仅限未归档, false:仅限已归档, null:不限制
* @param int|bool $mustOwner 0|false:不限制, 1|true:限制任务或项目负责人, 2:已有负责人才限制任务或项目负责人 * @param int|bool $permission 0|false:不限制, 1|true:限制项目负责人、任务负责人、协助人员及任务创建者, 2:已有负责人才限制true (子任务时如果是主任务负责人也可以)
* @param array $with * @param array $with
* @return self * @return self
*/ */
public static function userTask($task_id, $archived = true, $mustOwner = 0, $with = []) public static function userTask($task_id, $archived = true, $permission = 0, $with = [])
{ {
$task = self::with($with)->allData()->where("project_tasks.id", intval($task_id))->first(); $task = self::with($with)->allData()->where("project_tasks.id", intval($task_id))->first();
// //
@ -932,14 +1181,14 @@ class ProjectTask extends AbstractModel
throw new ApiException('任务不存在', [ 'task_id' => $task_id ], -4002); throw new ApiException('任务不存在', [ 'task_id' => $task_id ], -4002);
} }
if ($archived === true && $task->archived_at != null) { if ($archived === true && $task->archived_at != null) {
throw new ApiException('任务已归档', [ 'task_id' => $task_id ], -4002); throw new ApiException('任务已归档', [ 'task_id' => $task_id ]);
} }
if ($archived === false && $task->archived_at == null) { if ($archived === false && $task->archived_at == null) {
throw new ApiException('任务未归档', [ 'task_id' => $task_id ]); throw new ApiException('任务未归档', [ 'task_id' => $task_id ]);
} }
// //
try { try {
$project = Project::userProject($task->project_id, $archived); $project = Project::userProject($task->project_id);
} catch (Exception $e) { } catch (Exception $e) {
if ($task->owner === null) { if ($task->owner === null) {
throw new ApiException($e->getMessage(), [ 'task_id' => $task_id ], -4002); throw new ApiException($e->getMessage(), [ 'task_id' => $task_id ], -4002);
@ -950,11 +1199,11 @@ class ProjectTask extends AbstractModel
} }
} }
// //
if ($mustOwner === 2) { if ($permission === 2) {
$mustOwner = $task->hasOwner() ? 1 : 0; $permission = $task->hasOwner() ? 1 : 0;
} }
if (($mustOwner === 1 || $mustOwner === true) && !$task->owner && !$project->owner) { if (($permission === 1 || $permission === true) && !$project->owner && !$task->permission(3)) {
throw new ApiException('仅限项目或任务负责人操作'); throw new ApiException('仅限项目负责人、任务负责人、协助人员或任务创建者操作');
} }
// //
return $task; return $task;

View File

@ -0,0 +1,34 @@
<?php
namespace App\Models;
/**
* App\Models\ProjectTaskFlowChange
*
* @property int $id
* @property int|null $task_id 任务ID
* @property int|null $userid 会员ID
* @property int|null $before_flow_item_id 变化前工作流状态ID
* @property string|null $before_flow_item_name (变化前)工作流状态名称
* @property int|null $after_flow_item_id 变化后工作流状态ID
* @property string|null $after_flow_item_name (变化后)工作流状态名称
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange query()
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereAfterFlowItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereAfterFlowItemName($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereBeforeFlowItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereBeforeFlowItemName($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereTaskId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskFlowChange whereUserid($value)
* @mixin \Eloquent
*/
class ProjectTaskFlowChange extends AbstractModel
{
}

View File

@ -11,6 +11,7 @@ use App\Module\Base;
* @property int|null $project_id 项目ID * @property int|null $project_id 项目ID
* @property int|null $userid 成员ID * @property int|null $userid 成员ID
* @property int|null $owner 是否负责人 * @property int|null $owner 是否负责人
* @property string|null $top_at 置顶时间
* @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\Project|null $project * @property-read \App\Models\Project|null $project
@ -21,6 +22,7 @@ use App\Module\Base;
* @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereOwner($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereOwner($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereProjectId($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereProjectId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereTopAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereUserid($value) * @method static \Illuminate\Database\Eloquent\Builder|ProjectUser whereUserid($value)
* @mixin \Eloquent * @mixin \Eloquent

158
app/Models/Report.php Normal file
View File

@ -0,0 +1,158 @@
<?php
namespace App\Models;
use App\Exceptions\ApiException;
use Carbon\Carbon;
use Carbon\Traits\Creator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use JetBrains\PhpStorm\Pure;
/**
* App\Models\Report
*
* @property int $id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property string $title 标题
* @property string $type 汇报类型
* @property int $userid
* @property string $content
* @property string $sign 汇报唯一标识
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ReportReceive[] $Receives
* @property-read int|null $receives_count
* @property-read mixed $receives
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $receivesUser
* @property-read int|null $receives_user_count
* @property-read \App\Models\User|null $sendUser
* @method static Builder|Report newModelQuery()
* @method static Builder|Report newQuery()
* @method static Builder|Report query()
* @method static Builder|Report whereContent($value)
* @method static Builder|Report whereCreatedAt($value)
* @method static Builder|Report whereId($value)
* @method static Builder|Report whereSign($value)
* @method static Builder|Report whereTitle($value)
* @method static Builder|Report whereType($value)
* @method static Builder|Report whereUpdatedAt($value)
* @method static Builder|Report whereUserid($value)
* @mixin \Eloquent
*/
class Report extends AbstractModel
{
use HasFactory;
const WEEKLY = "weekly";
const DAILY = "daily";
protected $fillable = [
"title",
"type",
"userid",
"content",
];
protected $appends = [
'receives',
];
public function Receives(): HasMany
{
return $this->hasMany(ReportReceive::class, "rid");
}
public function receivesUser(): BelongsToMany
{
return $this->belongsToMany(User::class, ReportReceive::class, "rid", "userid")
->withPivot("receive_time", "read");
}
public function sendUser()
{
return $this->hasOne(User::class, "userid", "userid");
}
public function getTypeAttribute($value): string
{
return match ($value) {
Report::WEEKLY => "周报",
Report::DAILY => "日报",
default => "",
};
}
public function getContentAttribute($value): string
{
return htmlspecialchars_decode($value);
}
public function getReceivesAttribute()
{
if (!isset($this->appendattrs['receives'])) {
$this->appendattrs['receives'] = empty( $this->receivesUser ) ? [] : array_column($this->receivesUser->toArray(), "userid");
}
return $this->appendattrs['receives'];
}
/**
* 获取单条记录
* @param $id
* @param User|null $user
* @return Report|Builder|Model|object|null
* @throw ApiException
*/
public static function getOne($id, User $user = null)
{
$user === null && $user = User::auth();
$one = self::whereUserid($user->userid)->whereId($id)->first();
if ( empty($one) )
throw new ApiException("记录不存在");
return $one;
}
/**
* 获取最后一条提交记录
* @param User|null $user
* @return Builder|Model|\Illuminate\Database\Query\Builder|object
*/
public static function getLastOne(User $user = null)
{
$user === null && $user = User::auth();
$one = self::whereUserid($user->userid)->orderByDesc("created_at")->first();
if ( empty($one) )
throw new ApiException("记录不存在");
return $one;
}
/**
* 生成唯一标识
* @param $type
* @param $offset
* @param Carbon|null $time
* @return string
*/
public static function generateSign($type, $offset, Carbon $time = null): string
{
$user = User::auth();
$now_dt = $time === null ? Carbon::now() : $time;
$time_s = match ($type) {
Report::WEEKLY => function() use ($now_dt, $offset) {
// 如果设置了周期偏移量
empty( $offset ) || $now_dt->subWeeks( abs( $offset ) );
$now_dt->startOfWeek(); // 设置为当周第一天
return $now_dt->year . $now_dt->weekOfYear;
},
Report::DAILY => function() use ($now_dt, $offset) {
// 如果设置了周期偏移量
empty( $offset ) || $now_dt->subDays( abs( $offset ) );
return $now_dt->format("Ymd");
},
default => "",
};
return $user->userid . ( is_callable($time_s) ? $time_s() : "" );
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\ReportReceive
*
* @property int $id
* @property int $rid
* @property string|null $receive_time 接收时间
* @property int $userid 接收人
* @property int $read 是否已读
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive query()
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive whereRead($value)
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive whereReceiveTime($value)
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive whereRid($value)
* @method static \Illuminate\Database\Eloquent\Builder|ReportReceive whereUserid($value)
* @mixin \Eloquent
*/
class ReportReceive extends AbstractModel
{
use HasFactory;
// 关闭时间戳自动写入
public $timestamps = false;
protected $fillable = [
"rid",
"receive_time",
"userid",
"read",
];
}

View File

@ -28,8 +28,10 @@ use Carbon\Carbon;
* @property string|null $line_at 最后在线时间(接口) * @property string|null $line_at 最后在线时间(接口)
* @property int|null $task_dialog_id 最后打开的任务会话ID * @property int|null $task_dialog_id 最后打开的任务会话ID
* @property string|null $created_ip 注册IP * @property string|null $created_ip 注册IP
* @property string|null $disable_at 禁用时间
* @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Database\Factories\UserFactory factory(...$parameters)
* @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User newQuery() * @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User query() * @method static \Illuminate\Database\Eloquent\Builder|User query()
@ -37,6 +39,7 @@ use Carbon\Carbon;
* @method static \Illuminate\Database\Eloquent\Builder|User whereChangepass($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereChangepass($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedIp($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedIp($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereDisableAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereEncrypt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereEncrypt($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereIdentity($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereIdentity($value)
@ -178,7 +181,7 @@ class User extends AbstractModel
public static function reg($email, $password, $other = []) public static function reg($email, $password, $other = [])
{ {
//邮箱 //邮箱
if (!Base::isMail($email)) { if (!Base::isEmail($email)) {
throw new ApiException('请输入正确的邮箱地址'); throw new ApiException('请输入正确的邮箱地址');
} }
if (User::email2userid($email) > 0) { if (User::email2userid($email) > 0) {

View File

@ -120,10 +120,10 @@ class WebSocketDialog extends AbstractModel
break; break;
case "group": case "group":
if ($dialog->group_type === 'project') { if ($dialog->group_type === 'project') {
$dialog->group_info = Project::withTrashed()->select(['id', 'name'])->whereDialogId($dialog->id)->first(); $dialog->group_info = Project::withTrashed()->select(['id', 'name', 'archived_at', 'deleted_at'])->whereDialogId($dialog->id)->first()?->cancelAppend()->cancelHidden();
$dialog->name = $dialog->group_info ? $dialog->group_info->name : ''; $dialog->name = $dialog->group_info ? $dialog->group_info->name : '';
} elseif ($dialog->group_type === 'task') { } elseif ($dialog->group_type === 'task') {
$dialog->group_info = ProjectTask::withTrashed()->select(['id', 'name'])->whereDialogId($dialog->id)->first(); $dialog->group_info = ProjectTask::withTrashed()->select(['id', 'name', 'complete_at', 'archived_at', 'deleted_at'])->whereDialogId($dialog->id)->first()?->cancelAppend()->cancelHidden();
$dialog->name = $dialog->group_info ? $dialog->group_info->name : ''; $dialog->name = $dialog->group_info ? $dialog->group_info->name : '';
} }
break; break;

View File

@ -8,6 +8,7 @@ use App\Tasks\PushTask;
use App\Tasks\WebSocketDialogMsgTask; use App\Tasks\WebSocketDialogMsgTask;
use Carbon\Carbon; use Carbon\Carbon;
use Hhxsv5\LaravelS\Swoole\Task\Task; use Hhxsv5\LaravelS\Swoole\Task\Task;
use Illuminate\Database\Eloquent\SoftDeletes;
/** /**
* App\Models\WebSocketDialogMsg * App\Models\WebSocketDialogMsg
@ -21,11 +22,15 @@ use Hhxsv5\LaravelS\Swoole\Task\Task;
* @property int|null $send 发送数量 * @property int|null $send 发送数量
* @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property-read int|mixed $percentage * @property-read int|mixed $percentage
* @property-read \App\Models\WebSocketDialog|null $webSocketDialog
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg newQuery() * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg newQuery()
* @method static \Illuminate\Database\Query\Builder|WebSocketDialogMsg onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg query() * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg query()
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereDialogId($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereDialogId($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereMsg($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereMsg($value)
@ -34,10 +39,14 @@ use Hhxsv5\LaravelS\Swoole\Task\Task;
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereType($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereType($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereUserid($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogMsg whereUserid($value)
* @method static \Illuminate\Database\Query\Builder|WebSocketDialogMsg withTrashed()
* @method static \Illuminate\Database\Query\Builder|WebSocketDialogMsg withoutTrashed()
* @mixin \Eloquent * @mixin \Eloquent
*/ */
class WebSocketDialogMsg extends AbstractModel class WebSocketDialogMsg extends AbstractModel
{ {
use SoftDeletes;
protected $appends = [ protected $appends = [
'percentage', 'percentage',
]; ];
@ -46,6 +55,14 @@ class WebSocketDialogMsg extends AbstractModel
'updated_at', 'updated_at',
]; ];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function webSocketDialog(): \Illuminate\Database\Eloquent\Relations\HasOne
{
return $this->hasOne(WebSocketDialog::class, 'id', 'dialog_id');
}
/** /**
* 阅读占比 * 阅读占比
* @return int|mixed * @return int|mixed
@ -53,11 +70,7 @@ class WebSocketDialogMsg extends AbstractModel
public function getPercentageAttribute() public function getPercentageAttribute()
{ {
if (!isset($this->appendattrs['percentage'])) { if (!isset($this->appendattrs['percentage'])) {
if ($this->read > $this->send || empty($this->send)) { $this->generatePercentage();
$this->appendattrs['percentage'] = 100;
} else {
$this->appendattrs['percentage'] = intval($this->read / $this->send * 100);
}
} }
return $this->appendattrs['percentage']; return $this->appendattrs['percentage'];
} }
@ -81,6 +94,22 @@ class WebSocketDialogMsg extends AbstractModel
return $value; return $value;
} }
/**
* 获取占比
* @param bool $increment 是否新增阅读数
* @return int
*/
public function generatePercentage($increment = false) {
if ($increment) {
$this->increment('read');
}
if ($this->read > $this->send || empty($this->send)) {
return $this->appendattrs['percentage'] = 100;
} else {
return $this->appendattrs['percentage'] = intval($this->read / $this->send * 100);
}
}
/** /**
* 标记已送达 同时 告诉发送人已送达 * 标记已送达 同时 告诉发送人已送达
* @param $userid * @param $userid
@ -110,13 +139,17 @@ class WebSocketDialogMsg extends AbstractModel
if (!$msgRead->read_at) { if (!$msgRead->read_at) {
$msgRead->read_at = Carbon::now(); $msgRead->read_at = Carbon::now();
$msgRead->save(); $msgRead->save();
$this->increment('read'); $this->generatePercentage(true);
PushTask::push([ PushTask::push([
'userid' => $this->userid, 'userid' => $this->userid,
'msg' => [ 'msg' => [
'type' => 'dialog', 'type' => 'dialog',
'mode' => 'update', 'mode' => 'readed',
'data' => $this->toArray(), 'data' => [
'id' => $this->id,
'read' => $this->read,
'percentage' => $this->percentage,
],
] ]
]); ]);
} }
@ -124,6 +157,47 @@ class WebSocketDialogMsg extends AbstractModel
return true; return true;
} }
/**
* 删除消息
* @return void
*/
public function deleteMsg()
{
$send_dt = Carbon::parse($this->created_at)->addDay();
if ($send_dt->lt(Carbon::now())) {
throw new ApiException('已超过24小时此消息不能撤回');
}
AbstractModel::transaction(function() {
$deleteRead = WebSocketDialogMsgRead::whereMsgId($this->id)->whereNull('read_at')->delete(); // 未阅读记录不需要软删除,直接删除即可
$this->delete();
//
$last_msg = null;
if ($this->webSocketDialog) {
$last_msg = WebSocketDialogMsg::whereDialogId($this->dialog_id)->orderByDesc('id')->first();
$this->webSocketDialog->last_at = $last_msg->created_at;
$this->webSocketDialog->save();
}
//
$dialog = WebSocketDialog::find($this->dialog_id);
if ($dialog) {
$userids = $dialog->dialogUser->pluck('userid')->toArray();
PushTask::push([
'userid' => $userids,
'msg' => [
'type' => 'dialog',
'mode' => 'delete',
'data' => [
'id' => $this->id,
'dialog_id' => $this->dialog_id,
'last_msg' => $last_msg,
'update_read' => $deleteRead ? 1 : 0
],
]
]);
}
});
}
/** /**
* 发送消息 * 发送消息
* @param int $dialog_id 会话ID 聊天室ID * @param int $dialog_id 会话ID 聊天室ID

View File

@ -8,6 +8,7 @@ namespace App\Models;
* @property int $id * @property int $id
* @property int|null $dialog_id 对话ID * @property int|null $dialog_id 对话ID
* @property int|null $userid 会员ID * @property int|null $userid 会员ID
* @property string|null $top_at 置顶时间
* @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser newModelQuery()
@ -16,6 +17,7 @@ namespace App\Models;
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereDialogId($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereDialogId($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereTopAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereUserid($value) * @method static \Illuminate\Database\Eloquent\Builder|WebSocketDialogUser whereUserid($value)
* @mixin \Eloquent * @mixin \Eloquent

View File

@ -2,6 +2,7 @@
namespace App\Module; namespace App\Module;
use App\Exceptions\ApiException;
use App\Models\Setting; use App\Models\Setting;
use App\Models\Tmp; use App\Models\Tmp;
use Cache; use Cache;
@ -74,6 +75,31 @@ class Base
}); });
} }
/**
* 获取客户端版本号
* @return string
*/
public static function getClientVersion()
{
global $_A;
if (!isset($_A["__static_client_version"])) {
$_A["__static_client_version"] = Request::header('version') ?: '0.0.1';
}
return $_A["__static_client_version"];
}
/**
* 检查客户端版本
* @param string $min 最小版本
* @return void
*/
public static function checkClientVersion($min)
{
if (version_compare(Base::getClientVersion(), $min, '<')) {
throw new ApiException('当前版本 (v' . Base::getClientVersion() . ') 过低');
}
}
/** /**
* 判断是否域名格式 * 判断是否域名格式
* @param $domain * @param $domain
@ -316,19 +342,15 @@ class Base
{ {
if (strtolower($charset) == 'utf-8') { if (strtolower($charset) == 'utf-8') {
if (Base::getStrlen($string) <= $length) return $string; if (Base::getStrlen($string) <= $length) return $string;
$strcut = str_replace(array('&amp;', '&quot;', '&lt;', '&gt;'), array('&', '"', '<', '>'), $string); $strcut = Base::utf8Substr($string, $length, $start);
$strcut = Base::utf8Substr($strcut, $length, $start);
$strcut = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $strcut);
return $strcut . $dot; return $strcut . $dot;
} else { } else {
$length = $length * 2; $length = $length * 2;
if (strlen($string) <= $length) return $string; if (strlen($string) <= $length) return $string;
$string = str_replace(array('&amp;', '&quot;', '&lt;', '&gt;'), array('&', '"', '<', '>'), $string);
$strcut = ''; $strcut = '';
for ($i = 0; $i < $length; $i++) { for ($i = 0; $i < $length; $i++) {
$strcut .= ord($string[$i]) > 127 ? $string[$i] . $string[++$i] : $string[$i]; $strcut .= ord($string[$i]) > 127 ? $string[$i] . $string[++$i] : $string[$i];
} }
$strcut = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $strcut);
} }
return $strcut . $dot; return $strcut . $dot;
} }
@ -725,6 +747,7 @@ class Base
*/ */
public static function fillUrl($str = '') public static function fillUrl($str = '')
{ {
global $_A;
if (is_array($str)) { if (is_array($str)) {
foreach ($str as $key => $item) { foreach ($str as $key => $item) {
$str[$key] = Base::fillUrl($item); $str[$key] = Base::fillUrl($item);
@ -743,9 +766,12 @@ class Base
) { ) {
return $str; return $str;
} else { } else {
if ($_A['__fill_url_remote_url'] === true) {
return "{{RemoteURL}}" . $str;
}
try { try {
return url($str); return url($str);
} catch (\Throwable $e) { } catch (\Throwable) {
return self::getSchemeAndHost() . "/" . $str; return self::getSchemeAndHost() . "/" . $str;
} }
} }
@ -766,7 +792,7 @@ class Base
} }
try { try {
$find = url(''); $find = url('');
} catch (\Throwable $e) { } catch (\Throwable) {
$find = self::getSchemeAndHost(); $find = self::getSchemeAndHost();
} }
return Base::leftDelete($str, $find . '/'); return Base::leftDelete($str, $find . '/');
@ -782,6 +808,31 @@ class Base
return $scheme.($_SERVER['HTTP_HOST'] ?? ''); return $scheme.($_SERVER['HTTP_HOST'] ?? '');
} }
/**
* 地址后拼接参数
* @param $url
* @param $parames
* @return mixed|string
*/
public static function urlAddparameter($url, $parames)
{
if ($parames && is_array($parames)) {
$array = [];
foreach ($parames as $key => $val) {
$array[] = $key . "=" . $val;
}
if ($array) {
$query = implode("&", $array);
if (str_contains($url, "?")) {
$url .= "&" . $query;
} else {
$url .= "?" . $query;
}
}
}
return $url;
}
/** /**
* 格式化内容图片地址 * 格式化内容图片地址
* @param $content * @param $content
@ -830,13 +881,16 @@ class Base
/** /**
* 数组只保留数字的 * 数组只保留数字的
* @param $array * @param $array
* @param bool $int 是否格式化值
* @return array * @return array
*/ */
public static function arrayRetainInt($array) public static function arrayRetainInt($array, $int = false)
{ {
foreach ($array as $k => $v) { foreach ($array as $k => $v) {
if (!is_numeric($v)) { if (!is_numeric($v)) {
unset($array[$k]); unset($array[$k]);
} elseif ($int === true) {
$array[$k] = intval($v);
} }
} }
return array_values($array); return array_values($array);
@ -934,7 +988,7 @@ class Base
* @param string $str 需要检测的字符串 * @param string $str 需要检测的字符串
* @return int * @return int
*/ */
public static function isMail($str) public static function isEmail($str)
{ {
$RegExp = '/^[a-z0-9][a-z\.0-9-_]+@[a-z0-9_-]+(?:\.[a-z]{0,3}\.[a-z]{0,2}|\.[a-z]{0,3}|\.[a-z]{0,2})$/i'; $RegExp = '/^[a-z0-9][a-z\.0-9-_]+@[a-z0-9_-]+(?:\.[a-z]{0,3}\.[a-z]{0,2}|\.[a-z]{0,3}|\.[a-z]{0,2})$/i';
return preg_match($RegExp, $str); return preg_match($RegExp, $str);
@ -2216,7 +2270,7 @@ class Base
$type = ['zip']; $type = ['zip'];
break; break;
case 'file': case 'file':
$type = ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz']; $type = ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'];
break; break;
case 'firmware': case 'firmware':
$type = ['img', 'tar', 'bin']; $type = ['img', 'tar', 'bin'];
@ -2226,6 +2280,9 @@ class Base
break; break;
case 'more': case 'more':
$type = [ $type = [
'text', 'md', 'markdown',
'drawio',
'mind',
'docx', 'wps', 'doc', 'xls', 'xlsx', 'ppt', 'pptx', 'docx', 'wps', 'doc', 'xls', 'xlsx', 'ppt', 'pptx',
'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'raw', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'ico', 'raw',
'rar', 'zip', 'jar', '7-zip', 'tar', 'gzip', '7z', 'rar', 'zip', 'jar', '7-zip', 'tar', 'gzip', '7z',
@ -2234,10 +2291,17 @@ class Base
'ofd', 'ofd',
'pdf', 'pdf',
'txt', 'txt',
'html', 'htm', 'asp', 'jsp', 'xml', 'json', 'properties', 'md', 'gitignore', 'log', 'java', 'py', 'c', 'cpp', 'sql', 'sh', 'bat', 'm', 'bas', 'prg', 'cmd', 'htaccess', 'htgroups', 'htpasswd', 'conf', 'bat', 'cmd', 'cpp', 'c', 'cc', 'cxx', 'h', 'hh', 'hpp', 'ino', 'cs', 'css',
'php', 'go', 'python', 'js', 'ftl', 'css', 'lua', 'rb', 'yaml', 'yml', 'h', 'cs', 'aspx', 'dockerfile', 'go', 'html', 'htm', 'xhtml', 'vue', 'we', 'wpy', 'java', 'js', 'jsm', 'jsx', 'json', 'jsp', 'less', 'lua', 'makefile', 'gnumakefile',
'ocamlmakefile', 'make', 'mysql', 'nginx', 'ini', 'cfg', 'prefs', 'm', 'mm', 'pl', 'pm', 'p6', 'pl6', 'pm6', 'pgsql', 'php',
'inc', 'phtml', 'shtml', 'php3', 'php4', 'php5', 'phps', 'phpt', 'aw', 'ctp', 'module', 'ps1', 'py', 'r', 'rb', 'ru', 'gemspec', 'rake', 'guardfile', 'rakefile',
'gemfile', 'rs', 'sass', 'scss', 'sh', 'bash', 'bashrc', 'sql', 'sqlserver', 'swift', 'ts', 'typescript', 'str', 'vbs', 'vb', 'v', 'vh', 'sv', 'svh', 'xml',
'rdf', 'rss', 'wsdl', 'xslt', 'atom', 'mathml', 'mml', 'xul', 'xbl', 'xaml', 'yaml', 'yml',
'asp', 'properties', 'gitignore', 'log', 'bas', 'prg', 'python', 'ftl', 'aspx',
'mp3', 'wav', 'mp4', 'flv', 'mp3', 'wav', 'mp4', 'flv',
'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm', 'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm',
'xmind',
'rp',
]; ];
break; break;
default: default:
@ -2359,6 +2423,37 @@ class Base
} }
} }
/**
* 上传文件移动
* @param array $uploadResult
* @param string $newPath "/" 结尾
* @return array
*/
public static function uploadMove($uploadResult, $newPath)
{
if (str_ends_with($newPath, "/") && file_exists($uploadResult['file'])) {
Base::makeDir(public_path($newPath));
$oldPath = dirname($uploadResult['path']) . "/";
$newFile = str_replace($oldPath, $newPath, $uploadResult['file']);
if (rename($uploadResult['file'], $newFile)) {
$oldUrl = $uploadResult['url'];
$uploadResult['file'] = $newFile;
$uploadResult['path'] = str_replace($oldPath, $newPath, $uploadResult['path']);
$uploadResult['url'] = str_replace($oldPath, $newPath, $uploadResult['url']);
if ($uploadResult['thumb'] == $oldUrl) {
$uploadResult['thumb'] = $uploadResult['url'];
} elseif ($uploadResult['thumb']) {
$oldThumb = substr($uploadResult['thumb'], strpos($uploadResult['thumb'], $newPath));
$newThumb = str_replace($oldPath, $newPath, $oldThumb);
if (file_exists(public_path($oldThumb)) && rename(public_path($oldThumb), public_path($newThumb))) {
$uploadResult['thumb'] = str_replace($oldPath, $newPath, $uploadResult['thumb']);
}
}
}
}
return $uploadResult;
}
/** /**
* 生成缩略图 * 生成缩略图
* @param string $src_img 源图绝对完整地址{带文件名及后缀名} * @param string $src_img 源图绝对完整地址{带文件名及后缀名}
@ -2868,4 +2963,19 @@ class Base
$matrix = array_unique($matrix, SORT_REGULAR); $matrix = array_unique($matrix, SORT_REGULAR);
return array_merge($matrix); return array_merge($matrix);
} }
/**
* 去除emoji表情
* @param $str
* @return string|string[]|null
*/
public static function filterEmoji($str)
{
return preg_replace_callback(
'/./u',
function (array $match) {
return strlen($match[0]) >= 4 ? '' : $match[0];
},
$str);
}
} }

144
app/Module/BillExport.php Normal file
View File

@ -0,0 +1,144 @@
<?php
namespace App\Module;
use Excel;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithStrictNullComparison;
use Maatwebsite\Excel\Concerns\WithTitle;
use Maatwebsite\Excel\Events\AfterSheet;
use PhpOffice\PhpSpreadsheet\Cell\DataValidation;
use PhpOffice\PhpSpreadsheet\Writer\Exception;
class BillExport implements WithHeadings, WithEvents, FromCollection, WithTitle, WithStrictNullComparison
{
public $title;
public $headings = [];
public $data = [];
public $typeLists = [];
public $typeNumber = 0;
public function __construct($title, array $data)
{
$this->title = $title;
$this->data = $data;
}
public static function create($data = [], $title = "Sheet1") {
if (is_string($data)) {
list($title, $data) = [$data, $title];
}
if (!is_array($data)) {
$data = [];
}
return new BillExport($title, $data);
}
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function setHeadings(array $headings) {
$this->headings = $headings;
return $this;
}
public function setData(array $data) {
$this->data = $data;
return $this;
}
public function setTypeList(array $typeList, $number = 0) {
$this->typeLists = $typeList;
$this->typeNumber = $number;
return $this;
}
public function store($fileName = '') {
if (empty($fileName)) {
$fileName = date("YmdHis") . '.xls';
}
try {
return Excel::store($this, $fileName);
} catch (Exception $e) {
return "导出错误:" . $e->getMessage();
} catch (\PhpOffice\PhpSpreadsheet\Exception $e) {
return "导出错误:" . $e->getMessage();
}
}
public function download($fileName = '') {
if (empty($fileName)) {
$fileName = date("YmdHis") . '.xls';
}
try {
return Excel::download($this, $fileName);
} catch (Exception $e) {
return "导出错误:" . $e->getMessage();
} catch (\PhpOffice\PhpSpreadsheet\Exception $e) {
return "导出错误:" . $e->getMessage();
}
}
/**
* 导出的文件标题
* @return string
*/
public function title(): string
{
return $this->title;
}
/**
* 标题行
* @return array
*/
public function headings(): array
{
return $this->headings;
}
/**
* 导出的内容
* @return \Illuminate\Support\Collection
*/
public function collection()
{
return collect($this->data);
}
/**
* 设置单元格事件
* @return array
*/
public function registerEvents(): array
{
return [
AfterSheet::Class => function (AfterSheet $event) {
$count = count($this->data);
foreach ($this->typeLists AS $cell => $typeList) {
if ($cell && $typeList) {
$p = $this->headings ? 1 : 0;
for ($i = 1 + $p; $i <= max($count, $this->typeNumber) + $p; $i++) {
$validation = $event->sheet->getDelegate()->getCell($cell . $i)->getDataValidation();
$validation->setType(DataValidation::TYPE_LIST);
$validation->setErrorStyle(DataValidation::STYLE_WARNING);
$validation->setAllowBlank(false);
$validation->setShowDropDown(true);
$validation->setShowInputMessage(true);
$validation->setShowErrorMessage(true);
$validation->setErrorTitle('输入的值不合法');
$validation->setError('选择的值不在列表中,请选择列表中的值');
$validation->setPromptTitle('从列表中选择');
$validation->setPrompt('请选择下拉列表中的值');
$validation->setFormula1('"' . implode(',', $typeList) . '"');
}
}
}
}
];
}
}

16
app/Module/BillImport.php Normal file
View File

@ -0,0 +1,16 @@
<?php
namespace App\Module;
use Maatwebsite\Excel\Concerns\ToArray;
class BillImport implements ToArray
{
public function Array(Array $tables)
{
return $tables;
}
}

View File

@ -127,9 +127,11 @@ class WebSocketService implements WebSocketHandlerInterface
case 'readMsg': case 'readMsg':
$ids = is_array($data['id']) ? $data['id'] : [$data['id']]; $ids = is_array($data['id']) ? $data['id'] : [$data['id']];
$userid = $this->getUserid($frame->fd); $userid = $this->getUserid($frame->fd);
$list = WebSocketDialogMsg::whereIn('id', $ids)->get(); WebSocketDialogMsg::whereIn('id', $ids)->chunkById(20, function($list) use ($userid) {
$list->transform(function(WebSocketDialogMsg $item) use ($userid) { /** @var WebSocketDialogMsg $item */
$item->readSuccess($userid); foreach ($list as $item) {
$item->readSuccess($userid);
}
}); });
return; return;
@ -204,7 +206,19 @@ class WebSocketService implements WebSocketHandlerInterface
*/ */
private function deleteUser($fd) private function deleteUser($fd)
{ {
WebSocket::whereFd($fd)->delete(); $array = [];
WebSocket::whereFd($fd)->chunk(10, function($list) use (&$array) {
/** @var WebSocket $item */
foreach ($list as $item) {
$item->delete();
if ($item->path && str_starts_with($item->path, "file/content/")) {
$array[$item->path] = $item->path;
}
}
});
foreach ($array as $path) {
$this->pushPath($path);
}
} }
/** /**

View File

@ -33,6 +33,11 @@ class WebSocketDialogMsgTask extends AbstractTask
public function start() public function start()
{ {
global $_A;
$_A = [
'__fill_url_remote_url' => true,
];
//
$msg = WebSocketDialogMsg::find($this->id); $msg = WebSocketDialogMsg::find($this->id);
if (empty($msg)) { if (empty($msg)) {
return; return;

107
cmd
View File

@ -13,6 +13,7 @@ Error="${Red}[错误]${Font}"
cur_path="$(pwd)" cur_path="$(pwd)"
cur_arg=$@ cur_arg=$@
COMPOSE="docker-compose"
judge() { judge() {
if [[ 0 -eq $? ]]; then if [[ 0 -eq $? ]]; then
@ -31,6 +32,15 @@ rand() {
echo $(($num%$max+$min)) echo $(($num%$max+$min))
} }
rand_string() {
local lan=$1
if [[ `uname` == 'Linux' ]]; then
echo "$(date +%s%N | md5sum | cut -c 1-${lan})"
else
echo "$(docker run -it --rm alpine sh -c "date +%s%N | md5sum | cut -c 1-${lan}")"
fi
}
supervisorctl_restart() { supervisorctl_restart() {
local RES=`run_exec php "supervisorctl update $1"` local RES=`run_exec php "supervisorctl update $1"`
if [ -z "$RES" ]; then if [ -z "$RES" ]; then
@ -46,15 +56,24 @@ check_docker() {
echo -e "${Error} ${RedBG} 未安装 Docker${Font}" echo -e "${Error} ${RedBG} 未安装 Docker${Font}"
exit 1 exit 1
fi fi
docker-compose --version &> /dev/null docker-compose version &> /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${Error} ${RedBG} 未安装 Docker-compose${Font}" docker compose version &> /dev/null
if [ $? -ne 0 ]; then
echo -e "${Error} ${RedBG} 未安装 Docker-compose${Font}"
exit 1
fi
COMPOSE="docker compose"
fi
if [[ -n `$COMPOSE version | grep -E "\sv*1"` ]]; then
$COMPOSE version
echo -e "${Error} ${RedBG} Docker-compose 版本过低请升级至v2+${Font}"
exit 1 exit 1
fi fi
} }
check_node() { check_node() {
npm --version > /dev/null npm --version &> /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${Error} ${RedBG} 未安装nodejs${Font}" echo -e "${Error} ${RedBG} 未安装nodejs${Font}"
exit 1 exit 1
@ -62,7 +81,7 @@ check_node() {
} }
docker_name() { docker_name() {
echo `docker-compose ps | awk '{print $1}' | grep "\-$1\-"` echo `$COMPOSE ps | awk '{print $1}' | grep "\-$1\-"`
} }
run_compile() { run_compile() {
@ -117,11 +136,7 @@ run_exec() {
echo -e "${Error} ${RedBG} 没有找到 $container 容器! ${Font}" echo -e "${Error} ${RedBG} 没有找到 $container 容器! ${Font}"
exit 1 exit 1
fi fi
if [ "$container" = "mariadb" ] || [ "$container" = "nginx" ] || [ "$container" = "redis" ]; then docker exec -it "$name" /bin/sh -c "$cmd"
docker exec -it "$name" /bin/sh -c "$cmd"
else
docker exec -it "$name" /bin/bash -c "$cmd"
fi
} }
run_mysql() { run_mysql() {
@ -160,6 +175,7 @@ run_mysql() {
fi fi
docker cp $filename $container_name:/ docker cp $filename $container_name:/
run_exec mariadb "gunzip < /$inputname | mysql -u$username -p$password $database" run_exec mariadb "gunzip < /$inputname | mysql -u$username -p$password $database"
run_exec php "php artisan migrate"
judge "还原数据库" judge "还原数据库"
fi fi
} }
@ -177,8 +193,11 @@ env_set() {
if [ -z "$exist" ]; then if [ -z "$exist" ]; then
echo "$key=$val" >> $cur_path/.env echo "$key=$val" >> $cur_path/.env
else else
command="sed -i '/^$key=/c\\$key=$val' /www/.env" if [[ `uname` == 'Linux' ]]; then
docker run -it --rm -v ${cur_path}:/www alpine sh -c "$command" sed -i "/^${key}=/c\\${key}=${val}" ${cur_path}/.env
else
docker run -it --rm -v ${cur_path}:/www alpine sh -c "sed -i "/^${key}=/c\\${key}=${val}" /www/.env"
fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${Error} ${RedBG} 设置env参数失败${Font}" echo -e "${Error} ${RedBG} 设置env参数失败${Font}"
exit 1 exit 1
@ -191,10 +210,10 @@ env_init() {
cp .env.docker .env cp .env.docker .env
fi fi
if [ -z "$(env_get DB_ROOT_PASSWORD)" ]; then if [ -z "$(env_get DB_ROOT_PASSWORD)" ]; then
env_set DB_ROOT_PASSWORD "$(docker run -it --rm alpine sh -c "date +%s%N | md5sum | cut -c 1-16")" env_set DB_ROOT_PASSWORD "$(rand_string 16)"
fi fi
if [ -z "$(env_get APP_ID)" ]; then if [ -z "$(env_get APP_ID)" ]; then
env_set APP_ID "$(docker run -it --rm alpine sh -c "date +%s%N | md5sum | cut -c 1-6")" env_set APP_ID "$(rand_string 6)"
fi fi
if [ -z "$(env_get APP_IPPR)" ]; then if [ -z "$(env_get APP_IPPR)" ]; then
env_set APP_IPPR "10.$(rand 50 100).$(rand 100 200)" env_set APP_IPPR "10.$(rand 50 100).$(rand 100 200)"
@ -206,16 +225,28 @@ arg_get() {
local value="" local value=""
for var in $cur_arg; do for var in $cur_arg; do
if [[ "$find" == "y" ]]; then if [[ "$find" == "y" ]]; then
value=$var if [[ ! $var =~ "--" ]]; then
value=$var
fi
break break
fi fi
if [[ "--$1" == "$var" ]] || [[ "-$1" == "$var" ]]; then if [[ "--$1" == "$var" ]] || [[ "-$1" == "$var" ]]; then
find="y" find="y"
value="yes"
fi fi
done done
echo $value echo $value
} }
is_arm() {
local get_arch=`arch`
if [[ $get_arch =~ "aarch" ]] || [[ $get_arch =~ "arm" ]]; then
echo "yes"
else
echo "no"
fi
}
#################################################################################### ####################################################################################
#################################################################################### ####################################################################################
#################################################################################### ####################################################################################
@ -228,17 +259,25 @@ fi
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
if [[ "$1" == "init" ]] || [[ "$1" == "install" ]]; then if [[ "$1" == "init" ]] || [[ "$1" == "install" ]]; then
shift 1 shift 1
# 判断架构
if [[ "$(is_arm)" == "yes" ]] && [[ -z "$(arg_get force)" ]]; then
echo -e "${Error} ${RedBG}暂不支持arm架构强制安装请使用./cmd install --force${Font}"
exit 1
fi
# 初始化文件 # 初始化文件
rm -rf composer.lock if [[ -n "$(arg_get relock)" ]]; then
rm -rf package-lock.json rm -rf node_modules
rm -rf package-lock.json
rm -rf vendor
rm -rf composer.lock
fi
mkdir -p "${cur_path}/docker/log/supervisor" mkdir -p "${cur_path}/docker/log/supervisor"
mkdir -p "${cur_path}/docker/mysql/data" mkdir -p "${cur_path}/docker/mysql/data"
chmod -R 775 "${cur_path}/docker/log/supervisor" chmod -R 775 "${cur_path}/docker/log/supervisor"
chmod -R 775 "${cur_path}/docker/mysql/data" chmod -R 775 "${cur_path}/docker/mysql/data"
# 启动容器 # 启动容器
[ "$(arg_get port)" -gt 0 ] && env_set APP_PORT "$(arg_get port)" [[ "$(arg_get port)" -gt 0 ]] && env_set APP_PORT "$(arg_get port)"
docker-compose up -d $COMPOSE up php -d
docker-compose restart php
# 安装composer依赖 # 安装composer依赖
run_exec php "composer install" run_exec php "composer install"
if [ ! -f "${cur_path}/vendor/autoload.php" ]; then if [ ! -f "${cur_path}/vendor/autoload.php" ]; then
@ -250,7 +289,7 @@ if [ $# -gt 0 ]; then
echo -e "${Error} ${RedBG}composer install 失败,请重试! ${Font}" echo -e "${Error} ${RedBG}composer install 失败,请重试! ${Font}"
exit 1 exit 1
fi fi
[ -z "$(env_get APP_KEY)" ] && run_exec php "php artisan key:generate" [[ -z "$(env_get APP_KEY)" ]] && run_exec php "php artisan key:generate"
run_exec php "php bin/run --mode=prod" run_exec php "php bin/run --mode=prod"
# 检查数据库 # 检查数据库
remaining=10 remaining=10
@ -266,8 +305,8 @@ if [ $# -gt 0 ]; then
run_exec php "php artisan migrate --seed" run_exec php "php artisan migrate --seed"
# 设置初始化密码 # 设置初始化密码
res=`run_exec mariadb "sh /etc/mysql/repassword.sh"` res=`run_exec mariadb "sh /etc/mysql/repassword.sh"`
docker-compose stop $COMPOSE up -d
docker-compose start supervisorctl_restart php
echo -e "${OK} ${GreenBG} 安装完成 ${Font}" echo -e "${OK} ${GreenBG} 安装完成 ${Font}"
echo -e "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}" echo -e "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
echo -e "$res" echo -e "$res"
@ -280,7 +319,7 @@ if [ $# -gt 0 ]; then
run_exec php "composer update" run_exec php "composer update"
run_exec php "php artisan migrate" run_exec php "php artisan migrate"
supervisorctl_restart php supervisorctl_restart php
docker-compose up -d $COMPOSE up -d
elif [[ "$1" == "uninstall" ]]; then elif [[ "$1" == "uninstall" ]]; then
shift 1 shift 1
read -rp "确定要卸载(含:删除容器、数据库、日志)吗?(y/n): " uninstall read -rp "确定要卸载(含:删除容器、数据库、日志)吗?(y/n): " uninstall
@ -294,20 +333,20 @@ if [ $# -gt 0 ]; then
exit 2 exit 2
;; ;;
esac esac
docker-compose down $COMPOSE down
rm -rf "./docker/mysql/data" rm -rf "./docker/mysql/data"
rm -rf "./docker/log/supervisor" rm -rf "./docker/log/supervisor"
find "./storage/logs" -name "*.log" | xargs rm -rf find "./storage/logs" -name "*.log" | xargs rm -rf
echo -e "${OK} ${GreenBG} 卸载完成 ${Font}" echo -e "${OK} ${GreenBG} 卸载完成 ${Font}"
elif [[ "$1" == "reinstall" ]]; then elif [[ "$1" == "reinstall" ]]; then
shift 1 shift 1
./cmd uninstall ./cmd uninstall $@
sleep 3 sleep 3
./cmd install ./cmd install $@
elif [[ "$1" == "port" ]]; then elif [[ "$1" == "port" ]]; then
shift 1 shift 1
env_set APP_PORT "$1" env_set APP_PORT "$1"
docker-compose up -d $COMPOSE up -d
echo -e "${OK} ${GreenBG} 修改成功 ${Font}" echo -e "${OK} ${GreenBG} 修改成功 ${Font}"
echo -e "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}" echo -e "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
elif [[ "$1" == "repassword" ]]; then elif [[ "$1" == "repassword" ]]; then
@ -366,10 +405,10 @@ if [ $# -gt 0 ]; then
elif [[ "$1" == "composer" ]]; then elif [[ "$1" == "composer" ]]; then
shift 1 shift 1
e="composer $@" && run_exec php "$e" e="composer $@" && run_exec php "$e"
elif [[ "$1" == "super" ]]; then elif [[ "$1" == "service" ]]; then
shift 1 shift 1
supervisorctl_restart "$@" e="service $@" && run_exec php "$e"
elif [[ "$1" == "supervisorctl" ]]; then elif [[ "$1" == "super" ]] || [[ "$1" == "supervisorctl" ]]; then
shift 1 shift 1
e="supervisorctl $@" && run_exec php "$e" e="supervisorctl $@" && run_exec php "$e"
elif [[ "$1" == "models" ]]; then elif [[ "$1" == "models" ]]; then
@ -380,11 +419,11 @@ if [ $# -gt 0 ]; then
e="./vendor/bin/phpunit $@" && run_exec php "$e" e="./vendor/bin/phpunit $@" && run_exec php "$e"
elif [[ "$1" == "restart" ]]; then elif [[ "$1" == "restart" ]]; then
shift 1 shift 1
docker-compose stop "$@" $COMPOSE stop "$@"
docker-compose start "$@" $COMPOSE start "$@"
else else
docker-compose "$@" $COMPOSE "$@"
fi fi
else else
docker-compose ps $COMPOSE ps
fi fi

9554
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ class CreateProjectLogsTable extends Migration
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID'); $table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('column_id')->nullable()->default(0)->comment('列表ID'); $table->bigInteger('column_id')->nullable()->default(0)->comment('列表ID');
$table->bigInteger('task_id')->nullable()->default(0)->comment('项目ID'); $table->bigInteger('task_id')->nullable()->default(0)->comment('任务ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('会员ID'); $table->bigInteger('userid')->nullable()->default(0)->comment('会员ID');
$table->string('detail', 500)->nullable()->default('')->comment('详细信息'); $table->string('detail', 500)->nullable()->default('')->comment('详细信息');
$table->timestamps(); $table->timestamps();

View File

@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReportsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if ( Schema::hasTable('reports') )
return;
Schema::create('reports', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string("title")->default("")->comment("标题");
$table->enum("type", ["weekly", "daily"])->default("daily")->comment("汇报类型");
$table->unsignedBigInteger("userid")->default(0);
$table->longText("content")->nullable();
$table->index(["userid", "created_at"], "default");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('reports');
}
}

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReportReceivesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if ( Schema::hasTable('report_receives') )
return;
Schema::create('report_receives', function (Blueprint $table) {
$table->bigIncrements("id");
$table->unsignedInteger("rid")->default(0);
$table->timestamp("receive_time")->nullable()->comment("接收时间");
$table->unsignedBigInteger("userid")->default(0)->comment("接收人");
$table->unsignedTinyInteger("read")->default(0)->comment("是否已读");
$table->index(["userid", "receive_time"], "default");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('report_receives');
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddReportSign extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('reports', function (Blueprint $table) {
$table->string("sign")->default("")->comment("汇报唯一标识");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('reports', function (Blueprint $table) {
$table->dropColumn("sign");
});
}
}

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectFlowItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_flow_items', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('flow_id')->nullable()->default(0)->comment('流程ID');
$table->string('name', 50)->nullable()->default('')->comment('名称');
$table->string('status', 20)->nullable()->default('')->comment('状态');
$table->string('turns')->nullable()->default('')->comment('可流转');
$table->string('userids')->nullable()->default('')->comment('状态负责人ID');
$table->integer('sort')->nullable()->comment('排序');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_flow_items');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectFlowsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_flows', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->string('name', 50)->nullable()->default('')->comment('流程名称');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_flows');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ProjectTasksAddFlowItemIdFlowItemName extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('project_tasks', function (Blueprint $table) {
if (!Schema::hasColumn('project_tasks', 'flow_item_id')) {
$table->bigInteger('flow_item_id')->nullable()->default(0)->after('dialog_id')->comment('工作流状态ID');
$table->string('flow_item_name', 50)->nullable()->default('')->after('flow_item_id')->comment('工作流状态名称');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project_tasks', function (Blueprint $table) {
$table->dropColumn("flow_item_id");
$table->dropColumn("flow_item_name");
});
}
}

View File

@ -0,0 +1,42 @@
<?php
use App\Models\ProjectFlowItem;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ProjectFlowItemsAddUsertype extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$isAdd = false;
Schema::table('project_flow_items', function (Blueprint $table) use (&$isAdd) {
if (!Schema::hasColumn('project_flow_items', 'usertype')) {
$isAdd = true;
$table->string('usertype', 10)->nullable()->default('')->after('userids')->comment('流转模式');
}
});
if ($isAdd) {
ProjectFlowItem::where("usertype", "")->update([
'usertype' => 'add',
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project_flow_items', function (Blueprint $table) {
$table->dropColumn("usertype");
});
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ProjectLogsAddRecord extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('project_logs', function (Blueprint $table) {
if (!Schema::hasColumn('project_logs', 'record')) {
$table->text('record')->nullable()->after('detail')->comment('记录数据');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project_logs', function (Blueprint $table) {
$table->dropColumn("record");
});
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ProjectFlowItemsAddUserlimit extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('project_flow_items', function (Blueprint $table) {
if (!Schema::hasColumn('project_flow_items', 'userlimit')) {
$table->tinyInteger('userlimit')->nullable()->default(0)->after('usertype')->comment('限制负责人');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project_flow_items', function (Blueprint $table) {
$table->dropColumn("userlimit");
});
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class WebSocketDialogMsgsAddDeletes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('web_socket_dialog_msgs', function (Blueprint $table) {
if (!Schema::hasColumn('web_socket_dialog_msgs', 'deleted_at')) {
$table->softDeletes();
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('web_socket_dialog_msgs', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
}

View File

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class InsertSettingColumnTemplate extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$array = \App\Module\Base::setting('columnTemplate');
if (empty($array)) {
\App\Module\Base::setting('columnTemplate', [
[
'name' => '软件开发',
'columns' => ['产品规划', '前端开发', '后端开发', '测试', '发布', '其他'],
],
[
'name' => '产品开发',
'columns' => ['产品计划', '正在设计', '正在研发', '测试', '准备发布', '发布成功'],
],
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class WebSocketDialogUsersAddTopAt extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('web_socket_dialog_users', function (Blueprint $table) {
if (!Schema::hasColumn('web_socket_dialog_users', 'top_at')) {
$table->timestamp('top_at')->nullable()->after('userid')->comment('置顶时间');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('web_socket_dialog_users', function (Blueprint $table) {
$table->dropColumn("top_at");
});
}
}

View File

@ -0,0 +1,30 @@
<?php
use App\Models\File;
use Illuminate\Database\Migrations\Migration;
class FilesUpdateType extends Migration
{
/**
* 更改流程图文件类型
* @return void
*/
public function up()
{
File::whereType('flow')->update([
'type' => 'drawio'
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
File::whereType('drawio')->update([
'type' => 'flow'
]);
}
}

View File

@ -0,0 +1,75 @@
<?php
@error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
use App\Models\File;
use App\Models\FileContent;
use App\Module\Base;
use Carbon\Carbon;
use Illuminate\Database\Migrations\Migration;
class FilesUpdateExt extends Migration
{
/**
* 更新后缀
* @return void
*/
public function up()
{
File::whereIn('type', ['mind', 'drawio', 'document'])->where('ext', '')->orderBy('id')->chunk(100, function($files) {
/** @var File $file */
foreach ($files as $file) {
$fileContent = FileContent::whereFid($file->id)->orderByDesc('id')->first();
$contentArray = Base::json2array($fileContent?->content);
$contentString = '';
//
switch ($file->type) {
case 'document':
$file->ext = $contentArray['type'] ?: 'md';
$contentString = $contentArray['content'];
break;
case 'drawio':
$file->ext = 'drawio';
$contentString = $contentArray['xml'];
break;
case 'mind':
$file->ext = 'mind';
$contentString = $fileContent?->content;
break;
}
$file->save();
//
$path = 'uploads/file/' . $file->type . '/' . date("Ym", Carbon::parse($file->created_at)->timestamp) . '/' . $file->id . '/' . md5($contentString);
$save = public_path($path);
Base::makeDir(dirname($save));
file_put_contents($save, $contentString);
$content = [
'type' => $file->ext,
'url' => $path
];
//
$content = FileContent::createInstance([
'fid' => $file->id,
'content' => $content,
'text' => $fileContent?->text,
'size' => $file->size,
'userid' => $file->userid,
]);
$content->save();
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
File::whereIn('ext', ['mind', 'drawio', 'md'])->update([
'ext' => ''
]);
// ... 退回去意义不大,文件内容不做回滚操作
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ProjectUsersAddTopAt extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('project_users', function (Blueprint $table) {
if (!Schema::hasColumn('project_users', 'top_at')) {
$table->timestamp('top_at')->nullable()->after('owner')->comment('置顶时间');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project_users', function (Blueprint $table) {
$table->dropColumn("top_at");
});
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectTaskFlowChangesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_task_flow_changes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('task_id')->nullable()->default(0)->comment('任务ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('会员ID');
$table->bigInteger('before_item_id')->nullable()->default(0)->comment('变化前工作流状态ID');
$table->string('before_item_name', 50)->nullable()->default('')->comment('(变化前)工作流状态名称');
$table->bigInteger('after_item_id')->nullable()->default(0)->comment('变化后工作流状态ID');
$table->string('after_item_name', 50)->nullable()->default('')->comment('(变化后)工作流状态名称');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_task_flow_changes');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RenamePreProjectTaskFlowChangesItem extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('project_task_flow_changes', function (Blueprint $table) {
if (Schema::hasColumn('project_task_flow_changes', 'before_item_id')) {
$table->renameColumn('before_item_id', 'before_flow_item_id');
$table->renameColumn('before_item_name', 'before_flow_item_name');
$table->renameColumn('after_item_id', 'after_flow_item_id');
$table->renameColumn('after_item_name', 'after_flow_item_name');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project_task_flow_changes', function (Blueprint $table) {
//
});
}
}

View File

@ -18,6 +18,8 @@ class DatabaseSeeder extends Seeder
$this->call(FilesTableSeeder::class); $this->call(FilesTableSeeder::class);
$this->call(FileUsersTableSeeder::class); $this->call(FileUsersTableSeeder::class);
$this->call(ProjectColumnsTableSeeder::class); $this->call(ProjectColumnsTableSeeder::class);
$this->call(ProjectFlowItemsTableSeeder::class);
$this->call(ProjectFlowsTableSeeder::class);
$this->call(ProjectLogsTableSeeder::class); $this->call(ProjectLogsTableSeeder::class);
$this->call(ProjectTaskContentsTableSeeder::class); $this->call(ProjectTaskContentsTableSeeder::class);
$this->call(ProjectTaskUsersTableSeeder::class); $this->call(ProjectTaskUsersTableSeeder::class);

View File

@ -599,7 +599,5 @@ curl -O https://task.hitosea.com/uploads/files/3/202105/ba786dfc2f4c2fe916880474
'deleted_at' => NULL, 'deleted_at' => NULL,
), ),
)); ));
} }
} }

View File

@ -2,6 +2,10 @@
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\File;
use App\Models\FileContent;
use App\Module\Base;
use Carbon\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class FilesTableSeeder extends Seeder class FilesTableSeeder extends Seeder
@ -203,7 +207,7 @@ class FilesTableSeeder extends Seeder
'pid' => 0, 'pid' => 0,
'cid' => 0, 'cid' => 0,
'name' => '流程图', 'name' => '流程图',
'type' => 'flow', 'type' => 'drawio',
'ext' => '', 'ext' => '',
'size' => 5418, 'size' => 5418,
'userid' => 1, 'userid' => 1,
@ -280,5 +284,47 @@ class FilesTableSeeder extends Seeder
)); ));
File::whereIn('type', ['mind', 'drawio', 'document'])->where('ext', '')->orderBy('id')->chunk(100, function($files) {
/** @var File $file */
foreach ($files as $file) {
$fileContent = FileContent::whereFid($file->id)->orderByDesc('id')->first();
$contentArray = Base::json2array($fileContent?->content);
$contentString = '';
//
switch ($file->type) {
case 'document':
$file->ext = $contentArray['type'] ?: 'md';
$contentString = $contentArray['content'];
break;
case 'drawio':
$file->ext = 'drawio';
$contentString = $contentArray['xml'];
break;
case 'mind':
$file->ext = 'mind';
$contentString = $fileContent?->content;
break;
}
$file->save();
//
$path = 'uploads/file/' . $file->type . '/' . date("Ym", Carbon::parse($file->created_at)->timestamp) . '/' . $file->id . '/' . md5($contentString);
$save = public_path($path);
Base::makeDir(dirname($save));
file_put_contents($save, $contentString);
$content = [
'type' => $file->ext,
'url' => $path
];
//
$content = FileContent::createInstance([
'fid' => $file->id,
'content' => $content,
'text' => $fileContent?->text,
'size' => $file->size,
'userid' => $file->userid,
]);
$content->save();
}
});
} }
} }

View File

@ -0,0 +1,388 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class ProjectFlowItemsTableSeeder extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*/
public function run()
{
if (\DB::table('project_flow_items')->count() > 0) {
return;
}
\DB::table('project_flow_items')->insert(array (
0 =>
array (
'id' => 1,
'project_id' => 2,
'flow_id' => 1,
'name' => '待处理',
'status' => 'start',
'turns' => '[1,2,3,4]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 0,
'created_at' => '2022-01-15 23:43:15',
'updated_at' => '2022-01-15 23:43:15',
),
1 =>
array (
'id' => 2,
'project_id' => 2,
'flow_id' => 1,
'name' => '进行中',
'status' => 'progress',
'turns' => '[1,2,3,4]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 1,
'created_at' => '2022-01-15 23:43:15',
'updated_at' => '2022-01-15 23:43:15',
),
2 =>
array (
'id' => 3,
'project_id' => 2,
'flow_id' => 1,
'name' => '已完成',
'status' => 'end',
'turns' => '[1,2,3,4]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 2,
'created_at' => '2022-01-15 23:43:15',
'updated_at' => '2022-01-15 23:43:15',
),
3 =>
array (
'id' => 4,
'project_id' => 2,
'flow_id' => 1,
'name' => '已取消',
'status' => 'end',
'turns' => '[1,2,3,4]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 3,
'created_at' => '2022-01-15 23:43:15',
'updated_at' => '2022-01-15 23:43:15',
),
4 =>
array (
'id' => 5,
'project_id' => 3,
'flow_id' => 2,
'name' => '待处理',
'status' => 'start',
'turns' => '[5,6,7,8]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 0,
'created_at' => '2022-01-15 23:43:23',
'updated_at' => '2022-01-15 23:43:23',
),
5 =>
array (
'id' => 6,
'project_id' => 3,
'flow_id' => 2,
'name' => '进行中',
'status' => 'progress',
'turns' => '[5,6,7,8]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 1,
'created_at' => '2022-01-15 23:43:23',
'updated_at' => '2022-01-15 23:43:23',
),
6 =>
array (
'id' => 7,
'project_id' => 3,
'flow_id' => 2,
'name' => '已完成',
'status' => 'end',
'turns' => '[5,6,7,8]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 2,
'created_at' => '2022-01-15 23:43:23',
'updated_at' => '2022-01-15 23:43:23',
),
7 =>
array (
'id' => 8,
'project_id' => 3,
'flow_id' => 2,
'name' => '已取消',
'status' => 'end',
'turns' => '[5,6,7,8]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 3,
'created_at' => '2022-01-15 23:43:23',
'updated_at' => '2022-01-15 23:43:23',
),
8 =>
array (
'id' => 9,
'project_id' => 4,
'flow_id' => 3,
'name' => '待处理',
'status' => 'start',
'turns' => '[9,10,11,12]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 0,
'created_at' => '2022-01-15 23:43:28',
'updated_at' => '2022-01-15 23:43:28',
),
9 =>
array (
'id' => 10,
'project_id' => 4,
'flow_id' => 3,
'name' => '进行中',
'status' => 'progress',
'turns' => '[9,10,11,12]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 1,
'created_at' => '2022-01-15 23:43:28',
'updated_at' => '2022-01-15 23:43:28',
),
10 =>
array (
'id' => 11,
'project_id' => 4,
'flow_id' => 3,
'name' => '已完成',
'status' => 'end',
'turns' => '[9,10,11,12]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 2,
'created_at' => '2022-01-15 23:43:28',
'updated_at' => '2022-01-15 23:43:28',
),
11 =>
array (
'id' => 12,
'project_id' => 4,
'flow_id' => 3,
'name' => '已取消',
'status' => 'end',
'turns' => '[9,10,11,12]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 3,
'created_at' => '2022-01-15 23:43:28',
'updated_at' => '2022-01-15 23:43:28',
),
12 =>
array (
'id' => 13,
'project_id' => 5,
'flow_id' => 4,
'name' => '待处理',
'status' => 'start',
'turns' => '[13,14,15,16]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 0,
'created_at' => '2022-01-15 23:43:34',
'updated_at' => '2022-01-15 23:43:34',
),
13 =>
array (
'id' => 14,
'project_id' => 5,
'flow_id' => 4,
'name' => '进行中',
'status' => 'progress',
'turns' => '[13,14,15,16]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 1,
'created_at' => '2022-01-15 23:43:34',
'updated_at' => '2022-01-15 23:43:34',
),
14 =>
array (
'id' => 15,
'project_id' => 5,
'flow_id' => 4,
'name' => '已完成',
'status' => 'end',
'turns' => '[13,14,15,16]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 2,
'created_at' => '2022-01-15 23:43:34',
'updated_at' => '2022-01-15 23:43:34',
),
15 =>
array (
'id' => 16,
'project_id' => 5,
'flow_id' => 4,
'name' => '已取消',
'status' => 'end',
'turns' => '[13,14,15,16]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 3,
'created_at' => '2022-01-15 23:43:34',
'updated_at' => '2022-01-15 23:43:34',
),
16 =>
array (
'id' => 17,
'project_id' => 6,
'flow_id' => 5,
'name' => '待处理',
'status' => 'start',
'turns' => '[17,18,19,20]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 0,
'created_at' => '2022-01-15 23:43:40',
'updated_at' => '2022-01-15 23:43:40',
),
17 =>
array (
'id' => 18,
'project_id' => 6,
'flow_id' => 5,
'name' => '进行中',
'status' => 'progress',
'turns' => '[17,18,19,20]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 1,
'created_at' => '2022-01-15 23:43:40',
'updated_at' => '2022-01-15 23:43:40',
),
18 =>
array (
'id' => 19,
'project_id' => 6,
'flow_id' => 5,
'name' => '已完成',
'status' => 'end',
'turns' => '[17,18,19,20]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 2,
'created_at' => '2022-01-15 23:43:40',
'updated_at' => '2022-01-15 23:43:40',
),
19 =>
array (
'id' => 20,
'project_id' => 6,
'flow_id' => 5,
'name' => '已取消',
'status' => 'end',
'turns' => '[17,18,19,20]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 3,
'created_at' => '2022-01-15 23:43:40',
'updated_at' => '2022-01-15 23:43:40',
),
20 =>
array (
'id' => 21,
'project_id' => 7,
'flow_id' => 6,
'name' => '待处理',
'status' => 'start',
'turns' => '[21,22,23,24]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 0,
'created_at' => '2022-01-15 23:43:45',
'updated_at' => '2022-01-15 23:43:45',
),
21 =>
array (
'id' => 22,
'project_id' => 7,
'flow_id' => 6,
'name' => '进行中',
'status' => 'progress',
'turns' => '[21,22,23,24]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 1,
'created_at' => '2022-01-15 23:43:45',
'updated_at' => '2022-01-15 23:43:45',
),
22 =>
array (
'id' => 23,
'project_id' => 7,
'flow_id' => 6,
'name' => '已完成',
'status' => 'end',
'turns' => '[21,22,23,24]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 2,
'created_at' => '2022-01-15 23:43:45',
'updated_at' => '2022-01-15 23:43:45',
),
23 =>
array (
'id' => 24,
'project_id' => 7,
'flow_id' => 6,
'name' => '已取消',
'status' => 'end',
'turns' => '[21,22,23,24]',
'userids' => '[]',
'usertype' => 'add',
'userlimit' => 0,
'sort' => 3,
'created_at' => '2022-01-15 23:43:45',
'updated_at' => '2022-01-15 23:43:45',
),
));
}
}

View File

@ -0,0 +1,76 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class ProjectFlowsTableSeeder extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*/
public function run()
{
if (\DB::table('project_flows')->count() > 0) {
return;
}
\DB::table('project_flows')->insert(array (
0 =>
array (
'id' => 1,
'project_id' => 2,
'name' => 'Default',
'created_at' => '2022-01-15 23:43:15',
'updated_at' => '2022-01-15 23:43:15',
),
1 =>
array (
'id' => 2,
'project_id' => 3,
'name' => 'Default',
'created_at' => '2022-01-15 23:43:23',
'updated_at' => '2022-01-15 23:43:23',
),
2 =>
array (
'id' => 3,
'project_id' => 4,
'name' => 'Default',
'created_at' => '2022-01-15 23:43:28',
'updated_at' => '2022-01-15 23:43:28',
),
3 =>
array (
'id' => 4,
'project_id' => 5,
'name' => 'Default',
'created_at' => '2022-01-15 23:43:34',
'updated_at' => '2022-01-15 23:43:34',
),
4 =>
array (
'id' => 5,
'project_id' => 6,
'name' => 'Default',
'created_at' => '2022-01-15 23:43:40',
'updated_at' => '2022-01-15 23:43:40',
),
5 =>
array (
'id' => 6,
'project_id' => 7,
'name' => 'Default',
'created_at' => '2022-01-15 23:43:45',
'updated_at' => '2022-01-15 23:43:45',
),
));
}
}

View File

@ -296,7 +296,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 6, 'column_id' => 6,
'task_id' => 8, 'task_id' => 8,
'userid' => 1, 'userid' => 1,
'detail' => '任务标记已完成:官网项目一期', 'detail' => '标记任务已完成:官网项目一期',
'created_at' => seeders_at('2021-07-01 10:53:47'), 'created_at' => seeders_at('2021-07-01 10:53:47'),
'updated_at' => seeders_at('2021-07-01 10:53:47'), 'updated_at' => seeders_at('2021-07-01 10:53:47'),
), ),
@ -2998,7 +2998,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 27, 'column_id' => 27,
'task_id' => 77, 'task_id' => 77,
'userid' => 1, 'userid' => 1,
'detail' => '任务标记已完成:🚴 里程碑 1 需求评审完成,资源准备到位', 'detail' => '标记任务已完成:🚴 里程碑 1 需求评审完成,资源准备到位',
'created_at' => seeders_at('2021-07-01 15:39:46'), 'created_at' => seeders_at('2021-07-01 15:39:46'),
'updated_at' => seeders_at('2021-07-01 15:39:46'), 'updated_at' => seeders_at('2021-07-01 15:39:46'),
), ),
@ -3229,7 +3229,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记已完成:首页', 'detail' => '子标记任务已完成:首页',
'created_at' => seeders_at('2021-07-01 16:17:30'), 'created_at' => seeders_at('2021-07-01 16:17:30'),
'updated_at' => seeders_at('2021-07-01 16:17:30'), 'updated_at' => seeders_at('2021-07-01 16:17:30'),
), ),
@ -3240,7 +3240,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记已完成:公司介绍', 'detail' => '子标记任务已完成:公司介绍',
'created_at' => seeders_at('2021-07-01 16:17:31'), 'created_at' => seeders_at('2021-07-01 16:17:31'),
'updated_at' => seeders_at('2021-07-01 16:17:31'), 'updated_at' => seeders_at('2021-07-01 16:17:31'),
), ),
@ -3251,7 +3251,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记已完成:新闻动态', 'detail' => '子标记任务已完成:新闻动态',
'created_at' => seeders_at('2021-07-01 16:17:32'), 'created_at' => seeders_at('2021-07-01 16:17:32'),
'updated_at' => seeders_at('2021-07-01 16:17:32'), 'updated_at' => seeders_at('2021-07-01 16:17:32'),
), ),
@ -3262,7 +3262,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记已完成:产品介绍', 'detail' => '子标记任务已完成:产品介绍',
'created_at' => seeders_at('2021-07-01 16:17:34'), 'created_at' => seeders_at('2021-07-01 16:17:34'),
'updated_at' => seeders_at('2021-07-01 16:17:34'), 'updated_at' => seeders_at('2021-07-01 16:17:34'),
), ),
@ -3273,7 +3273,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记已完成:案例展示', 'detail' => '子标记任务已完成:案例展示',
'created_at' => seeders_at('2021-07-01 16:17:35'), 'created_at' => seeders_at('2021-07-01 16:17:35'),
'updated_at' => seeders_at('2021-07-01 16:17:35'), 'updated_at' => seeders_at('2021-07-01 16:17:35'),
), ),
@ -3284,7 +3284,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记已完成:联系我们', 'detail' => '子标记任务已完成:联系我们',
'created_at' => seeders_at('2021-07-01 16:17:36'), 'created_at' => seeders_at('2021-07-01 16:17:36'),
'updated_at' => seeders_at('2021-07-01 16:17:36'), 'updated_at' => seeders_at('2021-07-01 16:17:36'),
), ),
@ -3295,7 +3295,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '任务标记已完成:产品官网设计', 'detail' => '标记任务已完成:产品官网设计',
'created_at' => seeders_at('2021-07-01 16:17:37'), 'created_at' => seeders_at('2021-07-01 16:17:37'),
'updated_at' => seeders_at('2021-07-01 16:17:37'), 'updated_at' => seeders_at('2021-07-01 16:17:37'),
), ),
@ -3306,7 +3306,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '子任务标记未完成:联系我们', 'detail' => '标记子任务未完成:联系我们',
'created_at' => seeders_at('2021-07-01 16:17:41'), 'created_at' => seeders_at('2021-07-01 16:17:41'),
'updated_at' => seeders_at('2021-07-01 16:17:41'), 'updated_at' => seeders_at('2021-07-01 16:17:41'),
), ),
@ -3317,7 +3317,7 @@ class ProjectLogsTableSeeder extends Seeder
'column_id' => 32, 'column_id' => 32,
'task_id' => 85, 'task_id' => 85,
'userid' => 1, 'userid' => 1,
'detail' => '任务标记未完成:产品官网设计', 'detail' => '标记任务未完成:产品官网设计',
'created_at' => seeders_at('2021-07-01 16:17:44'), 'created_at' => seeders_at('2021-07-01 16:17:44'),
'updated_at' => seeders_at('2021-07-01 16:17:44'), 'updated_at' => seeders_at('2021-07-01 16:17:44'),
), ),

View File

@ -28,6 +28,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 2, 'column_id' => 2,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '说明:将进度分成多级 'name' => '说明:将进度分成多级
每张卡片为一个项目任务,标签表示任务状况 每张卡片为一个项目任务,标签表示任务状况
通过将卡片拖至不同的进度列表下,来表示各项目进度', 通过将卡片拖至不同的进度列表下,来表示各项目进度',
@ -54,6 +56,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 2, 'column_id' => 2,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '官网项目', 'name' => '官网项目',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -78,6 +82,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 2, 'column_id' => 2,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '新增职位需求', 'name' => '新增职位需求',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -102,6 +108,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 2, 'column_id' => 2,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '更新公司简介', 'name' => '更新公司简介',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -126,6 +134,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 3, 'column_id' => 3,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '官网项目四期', 'name' => '官网项目四期',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -150,6 +160,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 4, 'column_id' => 4,
'dialog_id' => 16, 'dialog_id' => 16,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '官网项目三期', 'name' => '官网项目三期',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -174,6 +186,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 5, 'column_id' => 5,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '官网项目二期', 'name' => '官网项目二期',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -198,6 +212,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 6, 'column_id' => 6,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 3,
'flow_item_name' => 'end|已完成',
'name' => '官网项目一期', 'name' => '官网项目一期',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -222,6 +238,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 7, 'column_id' => 7,
'dialog_id' => 18, 'dialog_id' => 18,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => '免费高品质的Sketch资源', 'name' => '免费高品质的Sketch资源',
'color' => '', 'color' => '',
'desc' => 'https://sketchrepo.com/', 'desc' => 'https://sketchrepo.com/',
@ -246,6 +264,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 7, 'column_id' => 7,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => '免费高品质的PSD资源', 'name' => '免费高品质的PSD资源',
'color' => '', 'color' => '',
'desc' => 'https://psdrepo.com/', 'desc' => 'https://psdrepo.com/',
@ -270,6 +290,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 7, 'column_id' => 7,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => '免费高清灵感图片网(偏文艺)', 'name' => '免费高清灵感图片网(偏文艺)',
'color' => '', 'color' => '',
'desc' => 'https://magdeleine.co/', 'desc' => 'https://magdeleine.co/',
@ -294,6 +316,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 7, 'column_id' => 7,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => '每天发现充满灵感且美丽的图片', 'name' => '每天发现充满灵感且美丽的图片',
'color' => '', 'color' => '',
'desc' => 'https://weheartit.com/', 'desc' => 'https://weheartit.com/',
@ -318,6 +342,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 8, 'column_id' => 8,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => '花瓣网:设计师寻找灵感的天堂', 'name' => '花瓣网:设计师寻找灵感的天堂',
'color' => '', 'color' => '',
'desc' => 'https://huaban.com/', 'desc' => 'https://huaban.com/',
@ -342,6 +368,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 8, 'column_id' => 8,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'WallHaven高清壁纸图片搜索引擎', 'name' => 'WallHaven高清壁纸图片搜索引擎',
'color' => '', 'color' => '',
'desc' => 'https://wallhaven.typepad.com/', 'desc' => 'https://wallhaven.typepad.com/',
@ -366,6 +394,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 8, 'column_id' => 8,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Pexels免费高品质图片 可商用', 'name' => 'Pexels免费高品质图片 可商用',
'color' => '', 'color' => '',
'desc' => 'https://www.pexels.com/', 'desc' => 'https://www.pexels.com/',
@ -390,6 +420,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 9, 'column_id' => 9,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'RetinizeiOS切图神器', 'name' => 'RetinizeiOS切图神器',
'color' => '', 'color' => '',
'desc' => 'http://retinize.it/', 'desc' => 'http://retinize.it/',
@ -414,6 +446,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 9, 'column_id' => 9,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'GuideGuide一款PS参考线插件', 'name' => 'GuideGuide一款PS参考线插件',
'color' => '', 'color' => '',
'desc' => 'https://guideguide.me/photoshop/', 'desc' => 'https://guideguide.me/photoshop/',
@ -438,6 +472,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 9, 'column_id' => 9,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Assistor PS一个功能强大的PS辅助工具', 'name' => 'Assistor PS一个功能强大的PS辅助工具',
'color' => '', 'color' => '',
'desc' => 'http://wit-web.azurewebsites.net/assistor/download', 'desc' => 'http://wit-web.azurewebsites.net/assistor/download',
@ -462,6 +498,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 10, 'column_id' => 10,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Fontello图标字体生成器', 'name' => 'Fontello图标字体生成器',
'color' => '', 'color' => '',
'desc' => 'http://fontello.com/', 'desc' => 'http://fontello.com/',
@ -486,6 +524,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 10, 'column_id' => 10,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'inconfont: 免费提供高度可辨识符号图标', 'name' => 'inconfont: 免费提供高度可辨识符号图标',
'color' => '', 'color' => '',
'desc' => 'https://www.iconfont.cn/', 'desc' => 'https://www.iconfont.cn/',
@ -510,6 +550,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 10, 'column_id' => 10,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'The Noun Project免费提供高度可辨识符号图标', 'name' => 'The Noun Project免费提供高度可辨识符号图标',
'color' => '', 'color' => '',
'desc' => 'https://thenounproject.com/', 'desc' => 'https://thenounproject.com/',
@ -534,6 +576,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 10, 'column_id' => 10,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'EasyIcon免费图标搜索和下载平台', 'name' => 'EasyIcon免费图标搜索和下载平台',
'color' => '', 'color' => '',
'desc' => 'https://www.easyicon.net/', 'desc' => 'https://www.easyicon.net/',
@ -558,6 +602,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 10, 'column_id' => 10,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Icon Deposit一个奇妙的图标下载站', 'name' => 'Icon Deposit一个奇妙的图标下载站',
'color' => '', 'color' => '',
'desc' => 'https://www.icondeposit.com/', 'desc' => 'https://www.icondeposit.com/',
@ -582,6 +628,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 10, 'column_id' => 10,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'iConifyMac平台的苹果应用图标自动化生成工具', 'name' => 'iConifyMac平台的苹果应用图标自动化生成工具',
'color' => '', 'color' => '',
'desc' => 'https://iconify.net/', 'desc' => 'https://iconify.net/',
@ -606,6 +654,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Logaster教你在线几分钟内搞定专业的LOGO', 'name' => 'Logaster教你在线几分钟内搞定专业的LOGO',
'color' => '', 'color' => '',
'desc' => '设计https://www.logaster.cn/', 'desc' => '设计https://www.logaster.cn/',
@ -630,6 +680,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'LogoLounge国际知名的LOGO设计权威网站', 'name' => 'LogoLounge国际知名的LOGO设计权威网站',
'color' => '', 'color' => '',
'desc' => 'https://www.logolounge.com/', 'desc' => 'https://www.logolounge.com/',
@ -654,6 +706,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'LogoMoose一个优秀的logo素材站点', 'name' => 'LogoMoose一个优秀的logo素材站点',
'color' => '', 'color' => '',
'desc' => 'https://www.logomoose.com/', 'desc' => 'https://www.logomoose.com/',
@ -678,6 +732,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'LOGOED一个展示Logo设计的博客', 'name' => 'LOGOED一个展示Logo设计的博客',
'color' => '', 'color' => '',
'desc' => 'http://www.logoed.co.uk/page/2/', 'desc' => 'http://www.logoed.co.uk/page/2/',
@ -702,6 +758,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Logo of the Day汇集世界各地优秀LOGO作品的站点', 'name' => 'Logo of the Day汇集世界各地优秀LOGO作品的站点',
'color' => '', 'color' => '',
'desc' => 'https://logooftheday.com/', 'desc' => 'https://logooftheday.com/',
@ -726,6 +784,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 5, 'column_id' => 5,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => 'asdasdad1111', 'name' => 'asdasdad1111',
'color' => '', 'color' => '',
'desc' => '7777777', 'desc' => '7777777',
@ -750,6 +810,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 5, 'column_id' => 5,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => 'hjhjhjjh', 'name' => 'hjhjhjjh',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -774,6 +836,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Logo of the Day汇集世界各地优秀LOGO作品的站点', 'name' => 'Logo of the Day汇集世界各地优秀LOGO作品的站点',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -798,6 +862,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'LogoDesignLoveLogo设计技巧分享网', 'name' => 'LogoDesignLoveLogo设计技巧分享网',
'color' => '', 'color' => '',
'desc' => 'LogoDesignLoveLogo设计技巧分享网', 'desc' => 'LogoDesignLoveLogo设计技巧分享网',
@ -822,6 +888,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 11, 'column_id' => 11,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'LogoDesignLoveLogo设计技巧分享网', 'name' => 'LogoDesignLoveLogo设计技巧分享网',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -846,6 +914,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Coolors自动生成配色色板的小工具', 'name' => 'Coolors自动生成配色色板的小工具',
'color' => '', 'color' => '',
'desc' => 'https://coolors.co/', 'desc' => 'https://coolors.co/',
@ -870,6 +940,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Material PaletteMaterial Design专用在线配色工具', 'name' => 'Material PaletteMaterial Design专用在线配色工具',
'color' => '', 'color' => '',
'desc' => 'https://www.materialpalette.com/', 'desc' => 'https://www.materialpalette.com/',
@ -894,6 +966,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Web安全色WEB设计、开发中常用的安全颜色', 'name' => 'Web安全色WEB设计、开发中常用的安全颜色',
'color' => '', 'color' => '',
'desc' => 'https://www.bootcss.com/p/websafecolors/', 'desc' => 'https://www.bootcss.com/p/websafecolors/',
@ -918,6 +992,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'ColorZilla火狐浏览器网页取色器插件', 'name' => 'ColorZilla火狐浏览器网页取色器插件',
'color' => '', 'color' => '',
'desc' => 'https://www.colorzilla.com/', 'desc' => 'https://www.colorzilla.com/',
@ -942,6 +1018,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'Color Palette Generator图片配色工具', 'name' => 'Color Palette Generator图片配色工具',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -966,6 +1044,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'inconfont: 免费提供高度可辨识符号图标', 'name' => 'inconfont: 免费提供高度可辨识符号图标',
'color' => '', 'color' => '',
'desc' => 'https://www.iconfont.cn/', 'desc' => 'https://www.iconfont.cn/',
@ -990,6 +1070,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'inconfont: 免费提供高度可辨识符号图标https://www.iconfont.cn/', 'name' => 'inconfont: 免费提供高度可辨识符号图标https://www.iconfont.cn/',
'color' => '', 'color' => '',
'desc' => 'https://www.iconfont.cn/', 'desc' => 'https://www.iconfont.cn/',
@ -1014,6 +1096,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 3, 'project_id' => 3,
'column_id' => 12, 'column_id' => 12,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 5,
'flow_item_name' => 'start|待处理',
'name' => 'https://www.iconfont.cn/', 'name' => 'https://www.iconfont.cn/',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1038,6 +1122,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '将收集箱的事务进行判断。要立即执行进入Q2列表。非立即执行判断——1.不做删掉、2.稍晚再做进入「稍后做」、3.可做可不做的任务或可能有用的资源进入「Mark」列表', 'name' => '将收集箱的事务进行判断。要立即执行进入Q2列表。非立即执行判断——1.不做删掉、2.稍晚再做进入「稍后做」、3.可做可不做的任务或可能有用的资源进入「Mark」列表',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1062,6 +1148,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '2分钟内能做完贴上2分钟标签进入「2分钟速战」列表。2分钟以上做完的事务进入Q3', 'name' => '2分钟内能做完贴上2分钟标签进入「2分钟速战」列表。2分钟以上做完的事务进入Q3',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1086,6 +1174,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '判断能否一步做完能进入Q4不能打上多步标签进入「项目清单」或将多步骤任务分解成多个一步做完任务进入Q4。', 'name' => '判断能否一步做完能进入Q4不能打上多步标签进入「项目清单」或将多步骤任务分解成多个一步做完任务进入Q4。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1110,6 +1200,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '如果自己做,打上自己做标签(进入「执行清单」);如果别人做,打上别人做标签(进入「等待清单」)。', 'name' => '如果自己做,打上自己做标签(进入「执行清单」);如果别人做,打上别人做标签(进入「等待清单」)。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1134,6 +1226,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 2, 'project_id' => 2,
'column_id' => 2, 'column_id' => 2,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 1,
'flow_item_name' => 'start|待处理',
'name' => '❓❗ 说明:将进度分成多级 'name' => '❓❗ 说明:将进度分成多级
每张卡片为一个项目任务,标签表示任务状况 每张卡片为一个项目任务,标签表示任务状况
@ -1162,6 +1256,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '每天晚上复查整套流程', 'name' => '每天晚上复查整套流程',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1186,6 +1282,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '1.检查「收集箱」是否清空。', 'name' => '1.检查「收集箱」是否清空。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1210,6 +1308,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '2.检查「Mark」是否有条目需要执行转化成行动或项目。', 'name' => '2.检查「Mark」是否有条目需要执行转化成行动或项目。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1234,6 +1334,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '3.检查「项目清单」了解项目进度。', 'name' => '3.检查「项目清单」了解项目进度。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1258,6 +1360,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '4.检查「等待清单」是否有条目需要转化成行动,也就是催促。', 'name' => '4.检查「等待清单」是否有条目需要转化成行动,也就是催促。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1282,6 +1386,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 13, 'column_id' => 13,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '5.检查各清单是否有已完成,完成的、已作废的卡片,立刻删除。', 'name' => '5.检查各清单是否有已完成,完成的、已作废的卡片,立刻删除。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1306,6 +1412,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 14, 'column_id' => 14,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '任何事务或信息,先以最简单的方式记录到“收集箱”。然后判断,贴上标签后,拖动到相应列表里', 'name' => '任何事务或信息,先以最简单的方式记录到“收集箱”。然后判断,贴上标签后,拖动到相应列表里',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1330,6 +1438,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 15, 'column_id' => 15,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '优先级1立即去做的事', 'name' => '优先级1立即去做的事',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1354,6 +1464,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 14, 'column_id' => 14,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '任何事务或信息,先以最简单的方式记录到“收集箱”。然后判断,贴上标签后,拖动到相应列表里', 'name' => '任何事务或信息,先以最简单的方式记录到“收集箱”。然后判断,贴上标签后,拖动到相应列表里',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1378,6 +1490,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 16, 'column_id' => 16,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '优先级2主要的执行清单', 'name' => '优先级2主要的执行清单',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1402,6 +1516,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 17, 'column_id' => 17,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '优先级3存放需要多步骤做的事持续追踪', 'name' => '优先级3存放需要多步骤做的事持续追踪',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1426,6 +1542,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 17, 'column_id' => 17,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '可以为这个多步骤项目单独建一个项目,并把项目的链接放到卡片的详情页里,点击就能跳转进去。', 'name' => '可以为这个多步骤项目单独建一个项目,并把项目的链接放到卡片的详情页里,点击就能跳转进去。',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1450,6 +1568,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 17, 'column_id' => 17,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '活动策划', 'name' => '活动策划',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1474,6 +1594,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 16, 'column_id' => 16,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '填问卷', 'name' => '填问卷',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1498,6 +1620,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 18, 'column_id' => 18,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '存放等待协同的事', 'name' => '存放等待协同的事',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1522,6 +1646,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 18, 'column_id' => 18,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '设计稿反馈', 'name' => '设计稿反馈',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1546,6 +1672,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 18, 'column_id' => 18,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '存放等待协同的事', 'name' => '存放等待协同的事',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1570,6 +1698,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 19, 'column_id' => 19,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '存放稍后做的任务', 'name' => '存放稍后做的任务',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1594,6 +1724,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 19, 'column_id' => 19,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '阅实习生简历', 'name' => '阅实习生简历',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1618,6 +1750,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 20, 'column_id' => 20,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '存放可做可不做的任务,以及各种可能用到的资源', 'name' => '存放可做可不做的任务,以及各种可能用到的资源',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1642,6 +1776,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 4, 'project_id' => 4,
'column_id' => 20, 'column_id' => 20,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 9,
'flow_item_name' => 'start|待处理',
'name' => '团建KTV', 'name' => '团建KTV',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1666,6 +1802,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 21, 'column_id' => 21,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '产品新需求', 'name' => '产品新需求',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1690,6 +1828,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 22, 'column_id' => 22,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '需要调研的需求', 'name' => '需要调研的需求',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1714,6 +1854,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 23, 'column_id' => 23,
'dialog_id' => 17, 'dialog_id' => 17,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '进入交互设计的需求', 'name' => '进入交互设计的需求',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1738,6 +1880,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 25, 'column_id' => 25,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '设计稿(放入设计稿)', 'name' => '设计稿(放入设计稿)',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1762,6 +1906,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 25, 'column_id' => 25,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '提测(放入提测时间规划表)', 'name' => '提测(放入提测时间规划表)',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1786,6 +1932,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 25, 'column_id' => 25,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '发布流程(放入发布流程,应用文案等)', 'name' => '发布流程(放入发布流程,应用文案等)',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1810,6 +1958,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 25, 'column_id' => 25,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '-----上线需求-----(将左边列表中的需求拖动至下方,表示本版本上线需求)', 'name' => '-----上线需求-----(将左边列表中的需求拖动至下方,表示本版本上线需求)',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1834,6 +1984,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 26, 'column_id' => 26,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '将小组一年工作目标拆解,设置出里程碑时间节点。并指派相关责任人。用标签来展示进行状况', 'name' => '将小组一年工作目标拆解,设置出里程碑时间节点。并指派相关责任人。用标签来展示进行状况',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1858,6 +2010,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 27, 'column_id' => 27,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 19,
'flow_item_name' => 'end|已完成',
'name' => '🚴 里程碑 1 需求评审完成,资源准备到位', 'name' => '🚴 里程碑 1 需求评审完成,资源准备到位',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1882,6 +2036,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 27, 'column_id' => 27,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '🚴 里程碑 2 设计完成,进行评审', 'name' => '🚴 里程碑 2 设计完成,进行评审',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1906,6 +2062,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 28, 'column_id' => 28,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '🚴 里程碑 3 产品开发完成,开始提测', 'name' => '🚴 里程碑 3 产品开发完成,开始提测',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1930,6 +2088,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 28, 'column_id' => 28,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '🚴 里程碑 4 测试完成准备线上发布', 'name' => '🚴 里程碑 4 测试完成准备线上发布',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1954,6 +2114,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 28, 'column_id' => 28,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '测试1', 'name' => '测试1',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -1978,6 +2140,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 28, 'column_id' => 28,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '测试2', 'name' => '测试2',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2002,6 +2166,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 28, 'column_id' => 28,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '测试3', 'name' => '测试3',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2026,6 +2192,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 6, 'project_id' => 6,
'column_id' => 29, 'column_id' => 29,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 17,
'flow_item_name' => 'start|待处理',
'name' => '🚴 里程碑 5 市场发布', 'name' => '🚴 里程碑 5 市场发布',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2050,6 +2218,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 21,
'flow_item_name' => 'start|待处理',
'name' => '产品官网设计', 'name' => '产品官网设计',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2074,6 +2244,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 23,
'flow_item_name' => 'end|已完成',
'name' => '首页', 'name' => '首页',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2098,6 +2270,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 23,
'flow_item_name' => 'end|已完成',
'name' => '公司介绍', 'name' => '公司介绍',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2122,6 +2296,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 23,
'flow_item_name' => 'end|已完成',
'name' => '新闻动态', 'name' => '新闻动态',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2146,6 +2322,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 23,
'flow_item_name' => 'end|已完成',
'name' => '产品介绍', 'name' => '产品介绍',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2170,6 +2348,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 23,
'flow_item_name' => 'end|已完成',
'name' => '案例展示', 'name' => '案例展示',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2194,6 +2374,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 21,
'flow_item_name' => 'start|待处理',
'name' => '联系我们', 'name' => '联系我们',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2218,6 +2400,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 32, 'column_id' => 32,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 21,
'flow_item_name' => 'start|待处理',
'name' => '官网新增一级栏目,“招聘信息”', 'name' => '官网新增一级栏目,“招聘信息”',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2242,6 +2426,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 7, 'project_id' => 7,
'column_id' => 33, 'column_id' => 33,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 21,
'flow_item_name' => 'start|待处理',
'name' => '产品官网', 'name' => '产品官网',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',
@ -2266,6 +2452,8 @@ class ProjectTasksTableSeeder extends Seeder
'project_id' => 5, 'project_id' => 5,
'column_id' => 24, 'column_id' => 24,
'dialog_id' => 0, 'dialog_id' => 0,
'flow_item_id' => 13,
'flow_item_name' => 'start|待处理',
'name' => '版本的确定', 'name' => '版本的确定',
'color' => '', 'color' => '',
'desc' => '', 'desc' => '',

View File

@ -16,14 +16,13 @@ class SettingsTableSeeder extends Seeder
{ {
if (\DB::table('settings')->count() > 0) { if (\DB::table('settings')->where('name', 'system')->count() > 0) {
return; return;
} }
\DB::table('settings')->insert(array ( \DB::table('settings')->insert(array (
0 => 0 =>
array ( array (
'id' => 1,
'name' => 'system', 'name' => 'system',
'desc' => '', 'desc' => '',
'setting' => '{"reg":"open","project_invite":"open","login_code":"auto"}', 'setting' => '{"reg":"open","project_invite":"open","login_code":"auto"}',
@ -32,7 +31,6 @@ class SettingsTableSeeder extends Seeder
), ),
1 => 1 =>
array ( array (
'id' => 2,
'name' => 'priority', 'name' => 'priority',
'desc' => '', 'desc' => '',
'setting' => '[{"name":"\\u91cd\\u8981\\u4e14\\u7d27\\u6025","color":"#ED4014","days":1,"priority":1},{"name":"\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#F16B62","days":3,"priority":2},{"name":"\\u7d27\\u6025\\u4e0d\\u91cd\\u8981","color":"#19C919","days":5,"priority":3},{"name":"\\u4e0d\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#2D8CF0","days":0,"priority":4}]', 'setting' => '[{"name":"\\u91cd\\u8981\\u4e14\\u7d27\\u6025","color":"#ED4014","days":1,"priority":1},{"name":"\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#F16B62","days":3,"priority":2},{"name":"\\u7d27\\u6025\\u4e0d\\u91cd\\u8981","color":"#19C919","days":5,"priority":3},{"name":"\\u4e0d\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#2D8CF0","days":0,"priority":4}]',

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,8 @@ services:
php: php:
container_name: "dootask-php-${APP_ID}" container_name: "dootask-php-${APP_ID}"
image: "kuaifan/php:swoole-8.0" image: "kuaifan/php:swoole-8.0"
shm_size: "1024m"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/crontab/crontab.conf:/etc/supervisor/conf.d/crontab.conf - ./docker/crontab/crontab.conf:/etc/supervisor/conf.d/crontab.conf
- ./docker/php/php.conf:/etc/supervisor/conf.d/php.conf - ./docker/php/php.conf:/etc/supervisor/conf.d/php.conf
- ./docker/php/php.ini:/usr/local/etc/php/php.ini - ./docker/php/php.ini:/usr/local/etc/php/php.ini
@ -45,6 +45,8 @@ services:
- php - php
- office - office
- fileview - fileview
- drawio-webapp
- drawio-export
restart: unless-stopped restart: unless-stopped
redis: redis:
@ -80,13 +82,16 @@ services:
office: office:
container_name: "dootask-office-${APP_ID}" container_name: "dootask-office-${APP_ID}"
image: "onlyoffice/documentserver:6.4.2.6" image: "onlyoffice/documentserver:7.0.0.132"
volumes: volumes:
- ./docker/office/data:/var/www/onlyoffice/Data - ./docker/office/data:/var/www/onlyoffice/Data
- ./docker/office/logs:/var/log/onlyoffice - ./docker/office/logs:/var/log/onlyoffice
- ./docker/office/resources/documenteditor/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/main/resources/css/app.css - ./docker/office/resources/documenteditor/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/main/resources/css/app.css
- ./docker/office/resources/presentationeditor/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/main/resources/css/app.css - ./docker/office/resources/presentationeditor/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/main/resources/css/app.css
- ./docker/office/resources/spreadsheeteditor/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/main/resources/css/app.css - ./docker/office/resources/spreadsheeteditor/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/main/resources/css/app.css
- ./docker/office/resources/documenteditor/mobile/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/css/app.css
- ./docker/office/resources/presentationeditor/mobile/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/css/app.css
- ./docker/office/resources/spreadsheeteditor/mobile/css/app.css:/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/css/app.css
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
networks: networks:
@ -96,7 +101,7 @@ services:
fileview: fileview:
container_name: "dootask-fileview-${APP_ID}" container_name: "dootask-fileview-${APP_ID}"
image: "kuaifan/fileview:4.1.0-SNAPSHOT" image: "kuaifan/fileview:4.1.0-SNAPSHOT-RC3"
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
KK_CONTEXT_PATH: "/fileview" KK_CONTEXT_PATH: "/fileview"
@ -105,6 +110,36 @@ services:
ipv4_address: "${APP_IPPR}.7" ipv4_address: "${APP_IPPR}.7"
restart: unless-stopped restart: unless-stopped
drawio-webapp:
container_name: "dootask-drawio-webapp-${APP_ID}"
image: "jgraph/drawio:16.6.1"
volumes:
- ./docker/drawio/webapp/index.html:/usr/local/tomcat/webapps/draw/index.html
- ./docker/drawio/webapp/stencils:/usr/local/tomcat/webapps/draw/stencils
- ./docker/drawio/webapp/js/app.min.js:/usr/local/tomcat/webapps/draw/js/app.min.js
- ./docker/drawio/webapp/js/croppie/croppie.min.css:/usr/local/tomcat/webapps/draw/js/croppie/croppie.min.css
- ./docker/drawio/webapp/js/diagramly/ElectronApp.js:/usr/local/tomcat/webapps/draw/js/diagramly/ElectronApp.js
networks:
extnetwork:
ipv4_address: "${APP_IPPR}.8"
environment:
TZ: "Asia/Shanghai"
depends_on:
- drawio-export
restart: unless-stopped
drawio-export:
container_name: "dootask-drawio-export-${APP_ID}"
image: "jgraph/export-server"
networks:
extnetwork:
ipv4_address: "${APP_IPPR}.9"
environment:
TZ: "Asia/Shanghai"
volumes:
- ./docker/drawio/export/fonts:/usr/share/fonts/drawio
restart: unless-stopped
networks: networks:
extnetwork: extnetwork:
name: "dootask-networks-${APP_ID}" name: "dootask-networks-${APP_ID}"

1
docker/drawio/export/fonts/.gitignore vendored Normal file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1,17 @@
# Change
## js/diagramly/ElectronApp.js
- 隐藏文件中的无用菜单
## js/app.min.js
- 隐藏帮助菜单
- 取消未保存关闭窗口提示
- `EmbedFile.prototype.getTitle=...``EmbedFile.prototype.getTitle=function(){return this.desc.title||(urlParams.title?decodeURIComponent(urlParams.title):"")}`
- `c.insertTemplateEnabled&&!c.isOffline()&&this.addMenuItems(b,["insertTemplate"],d)``c.insertTemplateEnabled&&this.addMenuItems(b,["insertTemplate"],d)`
- `390:270``390:285`
## index.html
- 隐藏加载中的提示

View File

@ -0,0 +1,477 @@
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5" ><![endif]-->
<!DOCTYPE html>
<html>
<head>
<title>Flowchart Maker &amp; Online Diagram Software</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Description" content="diagrams.net is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams">
<meta name="Keywords" content="diagram, online, flow chart, flowchart maker, uml, erd">
<meta itemprop="name" content="diagrams.net - free flowchart maker and diagrams online">
<meta itemprop="description" content="diagrams.net is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship,
org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic
circuit and social network diagrams.">
<meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="msapplication-config" content="images/browserconfig.xml">
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#d89000">
<script type="text/javascript">
window.EXPORT_URL = window.location.origin + "/drawio/export/";
window.DRAWIO_LIGHTBOX_URL = window.location.origin + "/drawio/webapp";
/**
* URL Parameters and protocol description are here:
*
* https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported
*
* Parameters for developers:
*
* - dev=1: For developers only
* - test=1: For developers only
* - export=URL for export: For developers only
* - ignoremime=1: For developers only (see DriveClient.js). Use Cmd-S to override mime.
* - createindex=1: For developers only (see etc/build/README)
* - filesupport=0: For developers only (see Editor.js in core)
* - savesidebar=1: For developers only (see Sidebar.js)
* - pages=1: For developers only (see Pages.js)
* - lic=email: For developers only (see LicenseServlet.java)
* --
* - networkshapes=1: For testing network shapes (temporary)
*/
var urlParams = (function()
{
var result = new Object();
var params = window.location.search.slice(1).split('&');
for (var i = 0; i < params.length; i++)
{
idx = params[i].indexOf('=');
if (idx > 0)
{
result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
}
}
return result;
})();
// Forces CDN caches by passing URL parameters via URL hash
if (window.location.hash != null && window.location.hash.substring(0, 2) == '#P')
{
try
{
urlParams = JSON.parse(decodeURIComponent(window.location.hash.substring(2)));
if (urlParams.hash != null)
{
window.location.hash = urlParams.hash;
}
}
catch (e)
{
// ignore
}
}
// Global variable for desktop
var mxIsElectron = window && window.process && window.process.type;
// Redirects page if required
if (urlParams['dev'] != '1')
{
(function()
{
var proto = window.location.protocol;
if (!mxIsElectron)
{
var host = window.location.host;
// Redirects apex, drive and rt to www
if (host === 'draw.io' || host === 'rt.draw.io' || host === 'drive.draw.io')
{
host = 'www.draw.io';
}
var href = proto + '//' + host + window.location.href.substring(
window.location.protocol.length +
window.location.host.length + 2);
// Redirects if href changes
if (href != window.location.href)
{
window.location.href = href;
}
}
})();
}
/**
* Adds meta tag to the page.
*/
function mxmeta(name, content, httpEquiv)
{
try
{
var s = document.createElement('meta');
if (name != null)
{
s.setAttribute('name', name);
}
s.setAttribute('content', content);
if (httpEquiv != null)
{
s.setAttribute('http-equiv', httpEquiv);
}
var t = document.getElementsByTagName('meta')[0];
t.parentNode.insertBefore(s, t);
}
catch (e)
{
// ignore
}
};
/**
* Synchronously adds scripts to the page.
*/
function mxscript(src, onLoad, id, dataAppKey, noWrite)
{
var defer = onLoad == null && !noWrite;
if ((urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function") ||
onLoad != null || noWrite)
{
var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.setAttribute('defer', 'true');
s.setAttribute('src', src);
if (id != null)
{
s.setAttribute('id', id);
}
if (dataAppKey != null)
{
s.setAttribute('data-app-key', dataAppKey);
}
if (onLoad != null)
{
var r = false;
s.onload = s.onreadystatechange = function()
{
if (!r && (!this.readyState || this.readyState == 'complete'))
{
r = true;
onLoad();
}
};
}
var t = document.getElementsByTagName('script')[0];
if (t != null)
{
t.parentNode.insertBefore(s, t);
}
}
else
{
document.write('<script src="' + src + '"' + ((id != null) ? ' id="' + id +'" ' : '') +
((dataAppKey != null) ? ' data-app-key="' + dataAppKey +'" ' : '') + '></scr' + 'ipt>');
}
};
/**
* Asynchronously adds scripts to the page.
*/
function mxinclude(src)
{
var g = document.createElement('script');
g.type = 'text/javascript';
g.async = true;
g.src = src;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(g, s);
};
/**
* Adds meta tags with application name (depends on offline URL parameter)
*/
(function()
{
var name = 'diagrams.net';
mxmeta('apple-mobile-web-app-title', name);
mxmeta('application-name', name);
if (mxIsElectron)
{
mxmeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy');
}
})();
// Checks for local storage
var isLocalStorage = false;
try
{
isLocalStorage = urlParams['local'] != '1' && typeof(localStorage) != 'undefined';
}
catch (e)
{
// ignored
}
var mxScriptsLoaded = false, mxWinLoaded = false;
function checkAllLoaded()
{
if (mxScriptsLoaded && mxWinLoaded)
{
App.main();
}
};
var t0 = new Date();
// Changes paths for local development environment
if (urlParams['dev'] == '1')
{
// Used to request grapheditor/mxgraph sources in dev mode
var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main';
// Used to request draw.io sources in dev mode
var drawDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main/webapp/';
var geBasePath = drawDevUrl + '/js/grapheditor';
var mxBasePath = mxDevUrl + '/mxgraph';
if (document.location.protocol == 'file:')
{
geBasePath = './js/grapheditor';
mxBasePath = './mxgraph';
drawDevUrl = './';
// Forces includes for dev environment in node.js
mxForceIncludes = true;
}
mxscript(drawDevUrl + 'js/PreConfig.js');
mxscript(drawDevUrl + 'js/diagramly/Init.js');
mxscript(geBasePath + '/Init.js');
mxscript(mxBasePath + '/mxClient.js');
// Adds all JS code that depends on mxClient. This indirection via Devel.js is
// required in some browsers to make sure mxClient.js (and the files that it
// loads asynchronously) are available when the code loaded in Devel.js runs.
mxscript(drawDevUrl + 'js/diagramly/Devel.js');
// Electron
if (mxIsElectron)
{
mxscript('js/diagramly/DesktopLibrary.js');
mxscript('js/diagramly/ElectronApp.js');
}
mxscript(drawDevUrl + 'js/PostConfig.js');
}
else
{
(function()
{
var hostName = window.location.hostname;
// Supported domains are *.draw.io and the packaged version in Quip
var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') ||
(hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net');
function loadAppJS()
{
mxscript('js/app.min.js', function()
{
mxScriptsLoaded = true;
checkAllLoaded();
// Electron
if (mxIsElectron)
{
mxscript('js/diagramly/DesktopLibrary.js', function()
{
mxscript('js/diagramly/ElectronApp.js', function()
{
mxscript('js/extensions.min.js', function()
{
mxscript('js/stencils.min.js', function()
{
mxscript('js/shapes-14-6-5.min.js', function()
{
mxscript('js/PostConfig.js');
});
});
});
});
});
}
else if (!supportedDomain)
{
mxscript('js/PostConfig.js');
}
});
};
if (!supportedDomain || mxIsElectron)
{
mxscript('js/PreConfig.js', loadAppJS);
}
else
{
loadAppJS();
}
})();
}
// Adds basic error handling
window.onerror = function()
{
var status = document.getElementById('geStatus');
if (status != null)
{
status.innerHTML = 'Page could not be loaded. Please try refreshing.';
}
};
</script>
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm">
<link rel="stylesheet" type="text/css" href="js/croppie/croppie.min.css">
<link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
<link rel="preconnect" href="https://storage.googleapis.com">
<link rel="canonical" href="https://app.diagrams.net">
<link rel="manifest" href="images/manifest.json">
<style type="text/css">
body { overflow:hidden; }
div.picker { z-index: 10007; }
.geSidebarContainer .geTitle input {
font-size:8pt;
color:#606060;
}
.geBlock {
display: none;
z-index:-3;
margin:100px;
margin-top:40px;
margin-bottom:30px;
padding:20px;
text-align:center;
min-width:50%;
}
.geBlock h1, .geBlock h2 {
margin-top:0px;
padding-top:0px;
}
.geEditor *:not(.geScrollable)::-webkit-scrollbar {
width:14px;
height:14px;
}
.geEditor ::-webkit-scrollbar-track {
background-clip:padding-box;
border:solid transparent;
border-width:1px;
}
.geEditor ::-webkit-scrollbar-corner {
background-color:transparent;
}
.geEditor ::-webkit-scrollbar-thumb {
background-color:rgba(0,0,0,.1);
background-clip:padding-box;
border:solid transparent;
border-radius:10px;
}
.geEditor ::-webkit-scrollbar-thumb:hover {
background-color:rgba(0,0,0,.4);
}
.geTemplate {
border:1px solid transparent;
display:inline-block;
_display:inline;
vertical-align:top;
border-radius:3px;
overflow:hidden;
font-size:14pt;
cursor:pointer;
margin:5px;
}
.geDialog h2 {
line-height: 1.2;
}
</style>
<!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
<!--[if (IE 9)|(IE 10)]><!-->
<script type="text/vbscript">
Function mxUtilsBinaryToArray(Binary)
Dim i
ReDim byteArray(LenB(Binary))
For i = 1 To LenB(Binary)
byteArray(i-1) = AscB(MidB(Binary, i, 1))
Next
mxUtilsBinaryToArray = byteArray
End Function
</script>
<!--<![endif]-->
</head>
<body class="geEditor">
<div id="geInfo">
<div class="geBlock">
<h1>Flowchart Maker and Online Diagram Software</h1>
<p>
diagrams.net (formerly draw.io) is free online diagram software. You can use it as a flowchart maker, network diagram software, to create UML online, as an ER diagram tool,
to design database schema, to build BPMN online, as a circuit diagram maker, and more. draw.io can import .vsdx, Gliffy&trade; and Lucidchart&trade; files .
</p>
<h2 id="geStatus">Loading...</h2>
<p>
Please ensure JavaScript is enabled.
</p>
</div>
</div>
<script type="text/javascript">
/**
* Main
*/
if (navigator.userAgent != null && navigator.userAgent.toLowerCase().
indexOf(' electron/') >= 0 && typeof process !== 'undefined' && process.versions.electron < 5)
{
// Redirects old Electron app to latest version
var div = document.getElementById('geInfo');
if (div != null)
{
div.innerHTML = '<center><h2>You are using an out of date version of this app.<br>Please download the latest version ' +
'<a href="https://github.com/jgraph/drawio-desktop/releases/latest" target="_blank">here</a>.</h2></center>';
}
}
else
{
if (urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function")
{
window.addEventListener('load', function()
{
mxWinLoaded = true;
checkAllLoaded();
});
}
else
{
App.main();
}
}
</script>
</body>
</html>

12282
docker/drawio/webapp/js/app.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.croppie-container{width:100%;height:100%}.croppie-container .cr-image{z-index:-1;position:absolute;top:0;left:0;transform-origin:0 0;max-height:none;max-width:none}.croppie-container .cr-boundary{position:relative;overflow:hidden;margin:0 auto;z-index:1;width:100%;height:100%}.croppie-container .cr-resizer,.croppie-container .cr-viewport{position:absolute;border:2px solid #fff;margin:auto;top:0;bottom:0;right:0;left:0;box-shadow:0 0 2000px 2000px rgba(0,0,0,.5);z-index:0}.croppie-container .cr-resizer{z-index:2;box-shadow:none;pointer-events:none}.croppie-container .cr-resizer-horisontal,.croppie-container .cr-resizer-vertical{position:absolute;pointer-events:all}.croppie-container .cr-resizer-horisontal::after,.croppie-container .cr-resizer-vertical::after{display:block;position:absolute;box-sizing:border-box;border:1px solid #000;background:#fff;width:10px;height:10px;content:''}.croppie-container .cr-resizer-vertical{bottom:-5px;cursor:row-resize;width:100%;height:10px}.croppie-container .cr-resizer-vertical::after{left:50%;margin-left:-5px}.croppie-container .cr-resizer-horisontal{right:-5px;cursor:col-resize;width:10px;height:100%}.croppie-container .cr-resizer-horisontal::after{top:50%;margin-top:-5px}.croppie-container .cr-original-image{display:none}.croppie-container .cr-vp-circle{border-radius:50%}.croppie-container .cr-overlay{z-index:1;position:absolute;cursor:move;touch-action:none}.croppie-container .cr-slider-wrap{width:75%;margin:15px auto;text-align:center}.croppie-result{position:relative;overflow:hidden}.croppie-result img{position:absolute}.croppie-container .cr-image,.croppie-container .cr-overlay,.croppie-container .cr-viewport{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.cr-slider{-webkit-appearance:none;width:300px;max-width:100%;padding-top:8px;padding-bottom:8px;background-color:transparent}.cr-slider::-webkit-slider-runnable-track{width:100%;height:3px;background:rgba(0,0,0,.5);border:0;border-radius:3px}.cr-slider::-webkit-slider-thumb{-webkit-appearance:none;border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cr-slider:focus{outline:0}.cr-slider::-moz-range-track{width:100%;height:3px;background:rgba(0,0,0,.5);border:0;border-radius:3px}.cr-slider::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cr-slider:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}.cr-slider::-ms-track{width:100%;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}.cr-slider::-ms-fill-lower{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-fill-upper{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:1px}.cr-slider:focus::-ms-fill-lower{background:rgba(0,0,0,.5)}.cr-slider:focus::-ms-fill-upper{background:rgba(0,0,0,.5)}.cr-rotate-controls{position:absolute;bottom:5px;left:5px;z-index:1}.cr-rotate-controls button{border:0;background:0 0}.cr-rotate-controls i:before{display:inline-block;font-style:normal;font-weight:900;font-size:22px}.cr-rotate-l i:before{content:'↺'}.cr-rotate-r i:before{content:'↻'}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

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