wiki附件展示大小,用户名展示,其他展示优化

This commit is contained in:
暮光:城中城
2020-12-27 14:25:38 +08:00
parent bd2d08c9ff
commit 64572e52ef
13 changed files with 66 additions and 10 deletions

View File

@@ -2,8 +2,8 @@
ENV = 'development'
# base api
# VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
# VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -33,9 +33,10 @@
<el-header>
<!--<el-switch v-model="isCollapse" ></el-switch>-->
<i class="el-icon-menu icon-collapse" @click="leftCollapse = !leftCollapse"></i>
<span class="header-right-user-name">{{userSelfInfo.userName}}</span>
<el-popover placement="bottom" width="600" trigger="click" v-model="userMessagePopVisible">
<el-badge :is-dot="haveNotReadUserMessage" slot="reference" style="line-height: 20px;margin-right: 20px;">
<i class="el-icon-bell head-icon" @click="loadUserMessageList" style="margin-right: 0;"></i>
<el-badge :is-dot="haveNotReadUserMessage" slot="reference" style="line-height: 20px;margin: 0 15px;">
<i class="el-icon-bell head-icon" @click="loadUserMessageIfPopVisible" style="margin-right: 0;"></i>
</el-badge>
<div style="margin-bottom: 10px;">
<span style="font-size: 14px;font-weight: bold;">通知</span>
@@ -206,6 +207,7 @@
wikiPageList:[],
wikiPage: {},
wikiPageExpandedKeys: [],
userSelfInfo: {},
// 升级信息
upgradeInfo: {},
userMessageList: [],
@@ -224,6 +226,7 @@
mounted: function () {
this.loadSpaceList();
this.loadUserMessageList();
this.getSelfUserInfo();
this.checkSystemUpgrade();
},
methods: {
@@ -275,6 +278,11 @@
this.doGetPageList(null);
});
},
loadUserMessageIfPopVisible() {
if (!this.userMessagePopVisible) {
this.loadUserMessageList();
}
},
loadUserMessageList() {
userApi.getUserMessageList(this.userMsgParam).then(res => {
this.userMessageList = res.data || [];
@@ -427,6 +435,11 @@
location.reload();
});
},
getSelfUserInfo() {
userApi.getSelfUserInfo().then(json=>{
this.userSelfInfo = json.data;
});
},
getSpaceInfo(spaceId) {
for (let i = 0; i < this.spaceList.length; i++) {
if (this.spaceList[i].id == spaceId) {
@@ -506,6 +519,7 @@
.el-header {
background-color: #1D4E89 !important;
}
.header-right-user-name{color: #fff;padding-right: 5px;}
.el-header {color: #333; line-height: 40px; text-align: right;height: 40px !important;}
.icon-collapse{float: left;font-size: 25px;color: #aaa;margin-top: 8px;cursor: pointer;}
.icon-collapse:hover{color: #eee;}

View File

@@ -6,8 +6,8 @@
<div class="wiki-title">{{wikiPage.name}}</div>
<div class="wiki-author">
<div>
<span class="create-user-time">创建{{wikiPage.createUserName}} {{wikiPage.createTime}}</span>
<span v-show="wikiPage.updateUserName">修改{{wikiPage.updateUserName}} {{wikiPage.updateTime}}</span>
<span v-if="wikiPage.updateUserName">{{wikiPage.updateUserName}}  {{wikiPage.updateTime}} 修改</span>
<span v-else class="create-user-time">{{wikiPage.createUserName}}  {{wikiPage.createTime}} 创建</span>
<div style="float: right;">
<el-button type="text" icon="el-icon-chat-line-round" @click="showCommentWiki" style="margin-right: 10px;">评论</el-button>
<el-upload v-if="wikiPageAuth.canUploadFile==1"
@@ -41,6 +41,9 @@
</template>
</el-table-column>
<el-table-column prop="createUserName" label="创建人"></el-table-column>
<el-table-column label="文件大小">
<template slot-scope="scope">{{computeFileSize(scope.row.fileSize)}}</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="180px"></el-table-column>
<el-table-column prop="downloadNum" label="下载次数" width="80px"></el-table-column>
<el-table-column label="操作" width="100px" v-if="wikiPageAuth.canUploadFile==1">
@@ -426,6 +429,28 @@
this.pageHistoryChoice = {};
this.pageHistoryList.forEach(item => item.loading = 0);
},
computeFileSize(fileSize) {
if (!fileSize) {
return '-';
}
let size = "";
if (fileSize < 0.1 * 1024) {
size = fileSize.toFixed(2) + "B"
} else if (fileSize < 0.1 * 1024 * 1024) {
size = (fileSize / 1024).toFixed(2) + "KB"
} else if (fileSize < 0.1 * 1024 * 1024 * 1024) {
size = (fileSize / (1024 * 1024)).toFixed(2) + "MB"
} else {
size = (fileSize / (1024 * 1024 * 1024)).toFixed(2) + "GB"
}
let sizeStr = size + "";
let index = sizeStr.indexOf(".");
let dou = sizeStr.substr(index + 1, 2);
if (dou == "00") {
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
}
return size;
},
loadPageDetail(pageId) {
this.clearHistory();
pageApi.pageDetail({id: pageId}).then(json => {