no message
This commit is contained in:
parent
34ad840f2d
commit
c56c6c72ae
@ -325,8 +325,8 @@ class FileController extends AbstractController
|
|||||||
//
|
//
|
||||||
$file->size = $content->size;
|
$file->size = $content->size;
|
||||||
$file->save();
|
$file->save();
|
||||||
|
$file->pushContentChange();
|
||||||
//
|
//
|
||||||
$content->content = $content->formatContent($file->type, $content->content);
|
|
||||||
return Base::retSuccess('保存成功', $content);
|
return Base::retSuccess('保存成功', $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Exceptions\ApiException;
|
use App\Exceptions\ApiException;
|
||||||
|
use App\Module\Base;
|
||||||
|
use App\Tasks\PushTask;
|
||||||
|
use Hhxsv5\LaravelS\Swoole\Task\Task;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class File
|
* Class File
|
||||||
@ -155,6 +159,35 @@ class File extends AbstractModel
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送内容发生变化消息
|
||||||
|
*/
|
||||||
|
public function pushContentChange()
|
||||||
|
{
|
||||||
|
$userid = [$this->userid];
|
||||||
|
if ($this->share == 1) {
|
||||||
|
$userid = array_merge($userid, WebSocket::wherePath('file/content/' . $this->id)->pluck('userid')->toArray());
|
||||||
|
} elseif ($this->share == 2) {
|
||||||
|
$userid = array_merge($userid, FileUser::whereFileId($this->id)->pluck('userid')->toArray());
|
||||||
|
}
|
||||||
|
//
|
||||||
|
$userid = array_values(array_filter(array_unique($userid)));
|
||||||
|
$params = [
|
||||||
|
'ignoreFd' => Request::header('fd'),
|
||||||
|
'userid' => $userid,
|
||||||
|
'msg' => [
|
||||||
|
'type' => 'fileContentChange',
|
||||||
|
'data' => [
|
||||||
|
'id' => $this->id,
|
||||||
|
'nickname' => User::nickname(),
|
||||||
|
'time' => Base::time()
|
||||||
|
],
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$task = new PushTask($params, false);
|
||||||
|
Task::deliver($task);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文件并检测权限
|
* 获取文件并检测权限
|
||||||
* @param $id
|
* @param $id
|
||||||
|
@ -265,6 +265,19 @@ class User extends AbstractModel
|
|||||||
return $user->userid;
|
return $user->userid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我的昵称
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function nickname()
|
||||||
|
{
|
||||||
|
$user = self::authInfo();
|
||||||
|
if (!$user) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return $user->nickname;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户身份认证(获取用户信息)
|
* 用户身份认证(获取用户信息)
|
||||||
* @param null $identity 判断身份
|
* @param null $identity 判断身份
|
||||||
|
@ -12,14 +12,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<div :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
|
<div v-if="showIcon" :class="['avatar-box', userId === userid || user.online ? 'online' : '']" :style="boxStyle">
|
||||||
<em :style="spotStyle"></em>
|
<em :style="spotStyle"></em>
|
||||||
<EAvatar v-if="showImg" :src="user.userimg" :size="avatarSize"/>
|
<EAvatar v-if="showImg" :src="user.userimg" :size="avatarSize"/>
|
||||||
<EAvatar v-else :size="avatarSize" class="avatar-text">
|
<EAvatar v-else :size="avatarSize" class="avatar-text">
|
||||||
<span :style="spotStyle">{{nickname}}</span>
|
<span :style="spotStyle">{{nickname}}</span>
|
||||||
</EAvatar>
|
</EAvatar>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showName" class="avatar-name">{{user.nickname}}</div>
|
<div v-if="showName" class="avatar-name" :style="nameStyle">{{user.nickname}}</div>
|
||||||
</div>
|
</div>
|
||||||
</ETooltip>
|
</ETooltip>
|
||||||
</template>
|
</template>
|
||||||
@ -37,6 +37,10 @@
|
|||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 'default'
|
default: 'default'
|
||||||
},
|
},
|
||||||
|
showIcon: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
showName: {
|
showName: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@ -90,6 +94,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
nameStyle() {
|
||||||
|
const {showIcon} = this;
|
||||||
|
if (!showIcon) {
|
||||||
|
return {
|
||||||
|
paddingLeft: 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
avatarSize() {
|
avatarSize() {
|
||||||
let {borderWitdh, size} = this
|
let {borderWitdh, size} = this
|
||||||
if (size === 'default') size = 32;
|
if (size === 'default') size = 32;
|
||||||
|
@ -123,6 +123,16 @@ export default {
|
|||||||
if (data.path == 'file/content/' + this.fileId) {
|
if (data.path == 'file/content/' + this.fileId) {
|
||||||
this.editUser = data.userids;
|
this.editUser = data.userids;
|
||||||
}
|
}
|
||||||
|
} else if (type == 'fileContentChange') {
|
||||||
|
if (this.parentShow && data.id == this.fileId) {
|
||||||
|
$A.modalConfirm({
|
||||||
|
title: "更新提示",
|
||||||
|
content: '团队成员(' + data.nickname + ')更新了内容,<br/>更新时间:' + $A.formatDate("Y-m-d H:i:s", data.time) + '。<br/><br/>点击【确定】加载最新内容。',
|
||||||
|
onOk: () => {
|
||||||
|
this.getContent();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
@ -207,8 +217,6 @@ export default {
|
|||||||
}).then(({data, msg}) => {
|
}).then(({data, msg}) => {
|
||||||
$A.messageSuccess(msg);
|
$A.messageSuccess(msg);
|
||||||
this.loadIng--;
|
this.loadIng--;
|
||||||
this.contentDetail = data.content;
|
|
||||||
this.updateBak();
|
|
||||||
this.$store.dispatch("saveFile", {
|
this.$store.dispatch("saveFile", {
|
||||||
id: this.fileId,
|
id: this.fileId,
|
||||||
size: data.size,
|
size: data.size,
|
||||||
|
@ -80,7 +80,13 @@
|
|||||||
</EDropdownMenu>
|
</EDropdownMenu>
|
||||||
</EDropdown>
|
</EDropdown>
|
||||||
<div class="file-icon">
|
<div class="file-icon">
|
||||||
<i v-if="item.share" class="taskfont"></i>
|
<template v-if="item.share">
|
||||||
|
<UserAvatar v-if="item.userid != userId" :userid="item.userid" class="share-avatar" :size="20"/>
|
||||||
|
<div v-else class="share-icon">
|
||||||
|
<i v-if="item.share == 1" class="taskfont" :title="$L('所有人')"></i>
|
||||||
|
<i v-else class="taskfont" :title="$L('指定成员')"></i>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item._edit" class="file-input">
|
<div v-if="item._edit" class="file-input">
|
||||||
<Input
|
<Input
|
||||||
@ -179,6 +185,11 @@ export default {
|
|||||||
this.editHeight = window.innerHeight - 40;
|
this.editHeight = window.innerHeight - 40;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
activated() {
|
||||||
|
this.$store.dispatch("websocketPath", "file");
|
||||||
|
this.getFileList();
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userId', 'userInfo', 'files']),
|
...mapState(['userId', 'userInfo', 'files']),
|
||||||
|
|
||||||
@ -222,28 +233,23 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
pid: {
|
pid() {
|
||||||
handler() {
|
this.getFileList();
|
||||||
this.getFileList();
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
|
|
||||||
editShow: {
|
|
||||||
handler(val) {
|
|
||||||
if (val) {
|
|
||||||
this.editShowNum++;
|
|
||||||
this.$store.dispatch("websocketPath", "file/content/" + this.editInfo.id)
|
|
||||||
} else {
|
|
||||||
this.$store.dispatch("websocketPath", "file")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tableMode(val) {
|
tableMode(val) {
|
||||||
this.$store.state.method.setStorage("fileTableMode", val)
|
this.$store.state.method.setStorage("fileTableMode", val)
|
||||||
}
|
},
|
||||||
|
|
||||||
|
editShow(val) {
|
||||||
|
if (val) {
|
||||||
|
this.editShowNum++;
|
||||||
|
this.$store.dispatch("websocketPath", "file/content/" + this.editInfo.id);
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch("websocketPath", "file");
|
||||||
|
this.getFileList();
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -290,6 +296,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
return h('div', {
|
||||||
|
class: 'file-nbox'
|
||||||
|
}, [
|
||||||
|
h('div', {
|
||||||
|
class: 'file-name ' + row.type,
|
||||||
|
}, array),
|
||||||
|
]);
|
||||||
} else {
|
} else {
|
||||||
// 编辑
|
// 编辑
|
||||||
array.push(h('QuickEdit', {
|
array.push(h('QuickEdit', {
|
||||||
@ -317,16 +330,42 @@ export default {
|
|||||||
}, [
|
}, [
|
||||||
h('AutoTip', row.name)
|
h('AutoTip', row.name)
|
||||||
]));
|
]));
|
||||||
|
//
|
||||||
|
const iconArray = [];
|
||||||
|
if (row.share) {
|
||||||
|
if (row.share == 1) {
|
||||||
|
iconArray.push(h('i', {
|
||||||
|
class: 'taskfont',
|
||||||
|
domProps: {
|
||||||
|
title: this.$L('所有人'),
|
||||||
|
innerHTML: ''
|
||||||
|
},
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
iconArray.push(h('i', {
|
||||||
|
class: 'taskfont',
|
||||||
|
domProps: {
|
||||||
|
title: this.$L('指定成员'),
|
||||||
|
innerHTML: ''
|
||||||
|
},
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return h('div', {
|
||||||
|
class: 'file-nbox'
|
||||||
|
}, [
|
||||||
|
h('div', {
|
||||||
|
class: 'file-name ' + row.type,
|
||||||
|
}, array),
|
||||||
|
iconArray
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
return h('div', {
|
|
||||||
class: 'file-name ' + row.type
|
|
||||||
}, array);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$L('大小'),
|
title: this.$L('大小'),
|
||||||
key: 'size',
|
key: 'size',
|
||||||
width: 120,
|
width: 110,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
render: (h, {row}) => {
|
render: (h, {row}) => {
|
||||||
@ -339,7 +378,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: this.$L('类型'),
|
title: this.$L('类型'),
|
||||||
key: 'type',
|
key: 'type',
|
||||||
width: 120,
|
width: 110,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
render: (h, {row}) => {
|
render: (h, {row}) => {
|
||||||
@ -351,6 +390,23 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: this.$L('所有者'),
|
||||||
|
key: 'userid',
|
||||||
|
width: 130,
|
||||||
|
resizable: true,
|
||||||
|
sortable: true,
|
||||||
|
render: (h, {row}) => {
|
||||||
|
return h('UserAvatar', {
|
||||||
|
props: {
|
||||||
|
size: 18,
|
||||||
|
userid: row.userid,
|
||||||
|
showIcon: false,
|
||||||
|
showName: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: this.$L('最后修改'),
|
title: this.$L('最后修改'),
|
||||||
key: 'updated_at',
|
key: 'updated_at',
|
||||||
|
86
resources/assets/sass/pages/page-file.scss
vendored
86
resources/assets/sass/pages/page-file.scss
vendored
@ -235,34 +235,46 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.file-name {
|
.file-nbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-right: 26px;
|
.file-name {
|
||||||
&:before {
|
flex: 1;
|
||||||
flex-shrink: 0;
|
width: 0;
|
||||||
content: "";
|
display: flex;
|
||||||
width: 18px;
|
align-items: center;
|
||||||
height: 18px;
|
position: relative;
|
||||||
background-repeat: no-repeat;
|
margin-right: 46px;
|
||||||
background-size: contain;
|
&:before {
|
||||||
margin-right: 8px;
|
flex-shrink: 0;
|
||||||
|
content: "";
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
&.folder:before {
|
||||||
|
background-image: url("../images/file/folder.svg");
|
||||||
|
}
|
||||||
|
&.document:before {
|
||||||
|
background-image: url("../images/file/document.svg");
|
||||||
|
}
|
||||||
|
&.mind:before {
|
||||||
|
background-image: url("../images/file/mind.svg");
|
||||||
|
}
|
||||||
|
&.sheet:before {
|
||||||
|
background-image: url("../images/file/sheet.svg");
|
||||||
|
}
|
||||||
|
&.flow:before {
|
||||||
|
background-image: url("../images/file/flow.svg");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.folder:before {
|
.taskfont {
|
||||||
background-image: url("../images/file/folder.svg");
|
color: #aaaaaa;
|
||||||
}
|
font-size: 16px;
|
||||||
&.document:before {
|
margin: 0 3px;
|
||||||
background-image: url("../images/file/document.svg");
|
|
||||||
}
|
|
||||||
&.mind:before {
|
|
||||||
background-image: url("../images/file/mind.svg");
|
|
||||||
}
|
|
||||||
&.sheet:before {
|
|
||||||
background-image: url("../images/file/sheet.svg");
|
|
||||||
}
|
|
||||||
&.flow:before {
|
|
||||||
background-image: url("../images/file/flow.svg");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,23 +357,31 @@
|
|||||||
background-size: contain;
|
background-size: contain;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
position: relative;
|
position: relative;
|
||||||
.taskfont {
|
.share-icon,
|
||||||
|
.share-avatar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 0;
|
||||||
bottom: -2px;
|
bottom: 0;
|
||||||
font-size: 18px;
|
background-color: #9ACD7B;
|
||||||
color: #ffffff;
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transform: scale(0.9);
|
||||||
|
.taskfont {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
&.shear {
|
&.shear {
|
||||||
opacity: 0.38;
|
opacity: 0.38;
|
||||||
}
|
}
|
||||||
&.folder .file-icon {
|
&.folder .file-icon {
|
||||||
background-image: url("../images/file/folder.svg");
|
background-image: url("../images/file/folder.svg");
|
||||||
.taskfont {
|
|
||||||
right: 6px;
|
|
||||||
bottom: 2px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
&.document .file-icon {
|
&.document .file-icon {
|
||||||
background-image: url("../images/file/document.svg");
|
background-image: url("../images/file/document.svg");
|
||||||
|
6
resources/assets/sass/taskfont.scss
vendored
6
resources/assets/sass/taskfont.scss
vendored
@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'taskfont'; /* Project id 2583385 */
|
font-family: 'taskfont'; /* Project id 2583385 */
|
||||||
src: url('//at.alicdn.com/t/font_2583385_s6r5dbjuxi.woff2?t=1625128084843') format('woff2'),
|
src: url('//at.alicdn.com/t/font_2583385_vbi15jduv0n.woff2?t=1625644968453') format('woff2'),
|
||||||
url('//at.alicdn.com/t/font_2583385_s6r5dbjuxi.woff?t=1625128084843') format('woff'),
|
url('//at.alicdn.com/t/font_2583385_vbi15jduv0n.woff?t=1625644968453') format('woff'),
|
||||||
url('//at.alicdn.com/t/font_2583385_s6r5dbjuxi.ttf?t=1625128084843') format('truetype');
|
url('//at.alicdn.com/t/font_2583385_vbi15jduv0n.ttf?t=1625644968453') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.taskfont {
|
.taskfont {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user