@ -80,6 +80,15 @@
.delete{
color: red;
}
.share{
color: #67C23A;
}
.allow-user{
color: #409EFF;
}
.mode{
color: #E6A23C;
}
#fr-logo{ display: none; }
.fr-popup.fr-active{ z-index: 5 !important; }
.edit-title{
@ -152,6 +161,9 @@
< div class = "time" > < div > 创建人:@{{ item.create_name }}< / div > < div > 最后更新: @{{ item.latest_name }}< / div > < / div >
< div class = "list-tool" >
< div class = "list-tool-item delete" > < el-icon @ click . stop = "deleteaa(item, index)" > < delete / > < / el-icon > < / div >
< div class = "list-tool-item share" > < el-icon @ click . stop = "share(item, index)" > < Share / > < / el-icon > < / div >
< div class = "list-tool-item allow-user" > < el-icon @ click . stop = "allowUser(item, index)" > < Avatar / > < / el-icon > < / div >
< div class = "list-tool-item mode" > < el-icon @ click . stop = "mode(item, index)" > < Operation / > < / el-icon > < / div >
< / div >
< / div >
< el-divider v-if = "notNotebook" >
@ -170,6 +182,62 @@
< / div >
< / el-col >
< / el-row >
{{-- 分享 --}}
< el-dialog v-model = "shareVisible" title = "分享地址" >
< el-link :underline = "false" type = "primary" > @{{ shareUrl }}< / el-link >
< / el-dialog >
{{-- 模式 --}}
< el-dialog v-model = "modeVisible" title = "调整模式" >
< el-radio-group v-model = "updateNotebook.mode" >
< el-radio v-for = "item in modeData" :label = "item.value" > @{{ item.label }}< / el-radio >
< / el-radio-group >
< template # footer >
< span class = "dialog-footer" >
< el-button @ click = "modeVisible = false" > 取消< / el-button >
< el-button type = "primary" @ click = "mode()" >
确认修改
< / el-button >
< / span >
< / template >
< / el-dialog >
{{-- 允许查看 --}}
< el-dialog v-model = "allowVisible" title = "协作人员" >
< div >
< el-select v-model = "waitAddAllowUser" filterable multiple clearable placeholder = "请选择" >
< el-option
v-for="item in adminData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
< / el-select >
< el-button @ click = "addAllowUser" > 添加用户< / el-button >
< / div >
< div >
< el-tag
v-for="(tag, index) in allowUserData"
:key="tag"
class="mx-1"
closable
@close="delAllowUser(index)"
>
< span v-for = "items in adminData" v-if = "items.value == tag" >
@{{ tag }}
< / span >
< / el-tag >
< / div >
< template # footer >
< span class = "dialog-footer" >
< el-button @ click = "allowVisible = false" > 取消< / el-button >
< el-button type = "primary" @ click = "mode()" >
确认修改
< / el-button >
< / span >
< / template >
< / el-dialog >
@endsection
@section('footer')
@ -185,12 +253,54 @@
VueInit.data.page = 0;
VueInit.data.reachBottomDisabled = true;
VueInit.data.notNotebook = false;
VueInit.data.shareVisible = false;
VueInit.data.modeVisible = false;
VueInit.data.allowVisible = false;
VueInit.data.modeData = {!! json_encode(\Plugins\Notebook\Enums\NotebookEnumMode::mapping()) !!};
VueInit.data.adminData = {!! json_encode(\App\Model\Base\Administrators::getSelectData('name')) !!};
VueInit.data.adminData.push({value:"*",label:'全部用户'})
VueInit.data.shareUrl = "";
VueInit.data.updateNotebook = "";
VueInit.data.allowUserData = [];
VueInit.data.waitAddAllowUser = [];
VueInit.methods.searchNotebook = function () {
this.page = 1;
this.getList();
};
VueInit.methods.mode = function (item, index) {
if (!item) {
this.update(this.updateNotebook);
this.modeVisible = false;
return;
}
this.modeVisible = true;
this.updateNotebook = item;
};
VueInit.methods.allowUser = function (item, index) {
this.allowVisible = true;
this.updateNotebook = item;
if (item.allow_see) {
this.allowUserData = item.allow_see.split(',');
}
console.log(this.allowUserData);
};
VueInit.methods.addAllowUser = function () {
if (this.waitAddAllowUser.length > 0) {
console.log(this.waitAddAllowUser);
this.allowUserData.push(...this.waitAddAllowUser);
this.waitAddAllowUser = []
}
console.log(this.allowUserData, this.waitAddAllowUser, 111)
};
VueInit.methods.delAllowUser = function (index) {
this.allowUserData.splice(index, 1);
console.log(this.allowUserData)
};
VueInit.methods.titleChange = function (){
this.noteBookVersion++;
}
@ -281,25 +391,33 @@
});
}
VueInit.methods.update = function (){
let upVersion = this.noteBookVersion;
if(this.noteBookUpVersion === upVersion){
return;
VueInit.methods.update = function (data){
let upVersion;
if (!data) {
upVersion = this.noteBookVersion;
if(this.noteBookUpVersion === upVersion){
return;
}
}
this.currentNotebook.update_time = this.toTime();
data = data ? data : this.currentNotebook;
data.update_time = this.toTime();
axios({
url: "update",
method: 'post',
data: this.currentNotebook
data: data
}).then(({ data:res }) => {
if(res.code !== 200){
this.$message.warning(res.msg);
}else{
this.currentNotebook .update_time = this.toTime();
data .update_time = this.toTime();
this.$notify.success("文档已同步");
}
});
this.noteBookUpVersion = upVersion;
if (upVersion){
this.noteBookUpVersion = upVersion;
}
}
VueInit.methods.toTime = function () {
var date = new Date();//时间戳为10位需*1000,时间戳为13位的话不需乘1000
@ -367,5 +485,10 @@
})
}
VueInit.methods.share = function (item,index){
this.shareVisible = true;
this.shareUrl = `http://www.baidu.com/${item.id}`;
}
< / script >
@endsection