mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-12 08:58:11 +00:00
fix: 修复文件协作不提醒的问题
This commit is contained in:
parent
b1ee3fe3cd
commit
9ffa46a878
@ -259,15 +259,15 @@ class File extends AbstractModel
|
||||
//
|
||||
if ($userid === null) {
|
||||
$userid = [$this->userid];
|
||||
if ($this->share == 1) {
|
||||
$builder = WebSocket::select(['userid']);
|
||||
if ($action == 'content') {
|
||||
$builder->wherePath('file/content/' . $this->id);
|
||||
}
|
||||
$userid = array_merge($userid, $builder->pluck('userid')->toArray());
|
||||
} elseif ($this->share == 2) {
|
||||
$userid = array_merge($userid, FileUser::whereFileId($this->id)->pluck('userid')->toArray());
|
||||
$builder = WebSocket::select(['userid']);
|
||||
if ($action == 'content') {
|
||||
$builder->wherePath("/single/file/{$this->id}");
|
||||
} elseif ($this->pid > 0) {
|
||||
$builder->wherePath("/manage/file/{$this->pid}");
|
||||
} else {
|
||||
$builder->wherePath("/manage/file");
|
||||
}
|
||||
$userid = array_merge($userid, $builder->pluck('userid')->toArray());
|
||||
$userid = array_values(array_filter(array_unique($userid)));
|
||||
}
|
||||
if (empty($userid)) {
|
||||
|
||||
@ -145,10 +145,10 @@ class WebSocketService implements WebSocketHandlerInterface
|
||||
$pathOld = $row->path;
|
||||
$row->path = $pathNew;
|
||||
$row->save();
|
||||
if (preg_match("/^file\/content\/\d+$/", $pathOld)) {
|
||||
if (preg_match("/^\/single\/file\/\d+$/", $pathOld)) {
|
||||
$this->pushPath($pathOld);
|
||||
}
|
||||
if (preg_match("/^file\/content\/\d+$/", $pathNew)) {
|
||||
if (preg_match("/^\/single\/file\/\d+$/", $pathNew)) {
|
||||
$this->pushPath($pathNew);
|
||||
}
|
||||
}
|
||||
@ -211,7 +211,7 @@ class WebSocketService implements WebSocketHandlerInterface
|
||||
/** @var WebSocket $item */
|
||||
foreach ($list as $item) {
|
||||
$item->delete();
|
||||
if ($item->path && str_starts_with($item->path, "file/content/")) {
|
||||
if ($item->path && str_starts_with($item->path, "/single/file/")) {
|
||||
$array[$item->path] = $item->path;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
curPath: this.$route.path,
|
||||
transitionName: null,
|
||||
}
|
||||
},
|
||||
@ -57,11 +58,12 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['taskId', 'cacheDrawerOverlay']),
|
||||
...mapState(['userId', 'cacheDrawerOverlay']),
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$route'(To, From) {
|
||||
this.curPath = To.path;
|
||||
if (this.transitionName === null) {
|
||||
this.transitionName = 'app-slide-no';
|
||||
return;
|
||||
@ -70,7 +72,17 @@ export default {
|
||||
return;
|
||||
}
|
||||
this.slideType(To, From);
|
||||
}
|
||||
},
|
||||
|
||||
curPath: {
|
||||
handler(path) {
|
||||
if (this.userId > 0) {
|
||||
path = path.replace(/^\/manage\/file\/\d+\/(\d+)$/, "/single/file/$1")
|
||||
this.$store.dispatch("websocketPath", path)
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
@ -615,6 +615,7 @@ export default {
|
||||
watch: {
|
||||
'$route' (route) {
|
||||
this.curPath = route.path;
|
||||
this.chackPass();
|
||||
},
|
||||
|
||||
userInfo() {
|
||||
@ -662,14 +663,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
curPath: {
|
||||
handler(path) {
|
||||
this.$store.dispatch("websocketPath", path);
|
||||
this.chackPass();
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
|
||||
unreadTotal: {
|
||||
handler(num) {
|
||||
if (this.$Electron) {
|
||||
|
||||
@ -162,16 +162,16 @@ export default {
|
||||
|
||||
wsMsg: {
|
||||
handler(info) {
|
||||
const {type, data} = info;
|
||||
const {type, action, data} = info;
|
||||
switch (type) {
|
||||
case 'path':
|
||||
if (data.path == 'file/content/' + this.fileId) {
|
||||
if (data.path == '/single/file/' + this.fileId) {
|
||||
this.editUser = data.userids;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'file':
|
||||
if (data.action == 'content') {
|
||||
if (action == 'content') {
|
||||
if (this.value && data.id == this.fileId) {
|
||||
$A.modalConfirm({
|
||||
title: "更新提示",
|
||||
|
||||
@ -968,6 +968,7 @@ export default {
|
||||
nodeIntegrationInSubFrames: item.type === 'drawio'
|
||||
},
|
||||
});
|
||||
this.browseFile(0);
|
||||
},
|
||||
|
||||
clickRow(row, column) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user