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

@@ -84,6 +84,11 @@ public class WikiPageFile implements Serializable {
*/ */
private Integer downloadNum; private Integer downloadNum;
/**
* 文件大小
*/
private Long fileSize;
public Long getId() { public Long getId() {
return id; return id;
} }
@@ -194,4 +199,12 @@ public class WikiPageFile implements Serializable {
public void setDownloadNum(Integer downloadNum) { public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum; this.downloadNum = downloadNum;
} }
public Long getFileSize() {
return fileSize;
}
public void setFileSize(Long fileSize) {
this.fileSize = fileSize;
}
} }

View File

@@ -13,6 +13,9 @@ ALTER TABLE `wiki_page_history`
DROP COLUMN `content`, DROP COLUMN `content`,
ADD COLUMN `git_commit_id` varchar(50) NULL COMMENT 'git提交记录ID'; ADD COLUMN `git_commit_id` varchar(50) NULL COMMENT 'git提交记录ID';
ALTER TABLE `wiki_page_file`
ADD COLUMN `file_size` bigint NULL COMMENT '文件大小';
-- ------------------------全新的库------------------------ -- ------------------------全新的库------------------------
/* /*
Navicat Premium Data Transfer Navicat Premium Data Transfer

View File

@@ -2,8 +2,8 @@
ENV = 'development' ENV = 'development'
# base api # base api
# VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/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_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

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

View File

@@ -6,8 +6,8 @@
<div class="wiki-title">{{wikiPage.name}}</div> <div class="wiki-title">{{wikiPage.name}}</div>
<div class="wiki-author"> <div class="wiki-author">
<div> <div>
<span class="create-user-time">创建{{wikiPage.createUserName}} {{wikiPage.createTime}}</span> <span v-if="wikiPage.updateUserName">{{wikiPage.updateUserName}}  {{wikiPage.updateTime}} 修改</span>
<span v-show="wikiPage.updateUserName">修改{{wikiPage.updateUserName}} {{wikiPage.updateTime}}</span> <span v-else class="create-user-time">{{wikiPage.createUserName}}  {{wikiPage.createTime}} 创建</span>
<div style="float: right;"> <div style="float: right;">
<el-button type="text" icon="el-icon-chat-line-round" @click="showCommentWiki" style="margin-right: 10px;">评论</el-button> <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" <el-upload v-if="wikiPageAuth.canUploadFile==1"
@@ -41,6 +41,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createUserName" label="创建人"></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="createTime" label="创建时间" width="180px"></el-table-column>
<el-table-column prop="downloadNum" label="下载次数" width="80px"></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"> <el-table-column label="操作" width="100px" v-if="wikiPageAuth.canUploadFile==1">
@@ -426,6 +429,28 @@
this.pageHistoryChoice = {}; this.pageHistoryChoice = {};
this.pageHistoryList.forEach(item => item.loading = 0); 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) { loadPageDetail(pageId) {
this.clearHistory(); this.clearHistory();
pageApi.pageDetail({id: pageId}).then(json => { pageApi.pageDetail({id: pageId}).then(json => {

View File

@@ -167,6 +167,7 @@ public class WikiPageFileController {
e.printStackTrace(); e.printStackTrace();
return DocResponseJson.warn("保存文件失败"); return DocResponseJson.warn("保存文件失败");
} }
wikiPageFile.setFileSize(file.getSize());
wikiPageFile.setUuid(simpleUUID); wikiPageFile.setUuid(simpleUUID);
wikiPageFile.setFileUrl(path); wikiPageFile.setFileUrl(path);
wikiPageFile.setFileName(fileName); wikiPageFile.setFileName(fileName);

View File

@@ -1 +1 @@
::-webkit-scrollbar{width:6px;height:9px;-webkit-appearance:none}::-webkit-scrollbar-thumb{background:#ddd;border-radius:10px}::-webkit-scrollbar-track-piece{background:#eee}body,html{margin:0;padding:0}#app,.el-container,.el-menu,.global-layout-vue,body,html{height:100%}.el-header{background-color:#1d4e89!important;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}.head-icon{margin-right:15px;font-size:16px;cursor:pointer;color:#fff}.header-user-message .page-info-box{text-align:right;margin-top:10px}#app[data-v-8f7ddbbc],body[data-v-8f7ddbbc],html[data-v-8f7ddbbc]{margin:0;padding:0;height:100%}pre[data-v-8f7ddbbc]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-8f7ddbbc]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-8f7ddbbc]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-8f7ddbbc]{overflow-x:hidden;overflow-y:auto;width:100%;padding:10px;border-left:1px solid #f1f1f1;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tree[data-v-8f7ddbbc]{margin-right:3px}.logo[data-v-8f7ddbbc]{border-bottom:1px solid #f1f1f1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:5px 10px;width:260px;height:40px;line-height:40px;font-size:25px;color:#666;text-align:center}.icon-collapse[data-v-8f7ddbbc]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-8f7ddbbc]:hover{color:#ccc}.comment-box .head[data-v-8f7ddbbc]{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.build-info[data-v-8f7ddbbc]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-8f7ddbbc]{color:#4183c4;cursor:pointer} ::-webkit-scrollbar{width:6px;height:9px;-webkit-appearance:none}::-webkit-scrollbar-thumb{background:#ddd;border-radius:10px}::-webkit-scrollbar-track-piece{background:#eee}body,html{margin:0;padding:0}#app,.el-container,.el-menu,.global-layout-vue,body,html{height:100%}.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}.head-icon{margin-right:15px;font-size:16px;cursor:pointer;color:#fff}.header-user-message .page-info-box{text-align:right;margin-top:10px}#app[data-v-8f7ddbbc],body[data-v-8f7ddbbc],html[data-v-8f7ddbbc]{margin:0;padding:0;height:100%}pre[data-v-8f7ddbbc]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-8f7ddbbc]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-8f7ddbbc]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-8f7ddbbc]{overflow-x:hidden;overflow-y:auto;width:100%;padding:10px;border-left:1px solid #f1f1f1;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tree[data-v-8f7ddbbc]{margin-right:3px}.logo[data-v-8f7ddbbc]{border-bottom:1px solid #f1f1f1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:5px 10px;width:260px;height:40px;line-height:40px;font-size:25px;color:#666;text-align:center}.icon-collapse[data-v-8f7ddbbc]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-8f7ddbbc]:hover{color:#ccc}.comment-box .head[data-v-8f7ddbbc]{float:left;background-color:#ccc;border-radius:50%;margin-right:10px;width:45px;height:45px;line-height:45px;text-align:center;color:#fff}.build-info[data-v-8f7ddbbc]{position:fixed;bottom:0;left:0;background:#fafafa;width:240px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-8f7ddbbc]{color:#4183c4;cursor:pointer}

View File

@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-wiki.png><title>WIKI文档管理系统</title><link href=css/chunk-009efa60.c1509684.css rel=prefetch><link href=css/chunk-07e56bb7.1d52bb38.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-34407190.57bbfb51.css rel=prefetch><link href=css/chunk-4b763d50.edd147c5.css rel=prefetch><link href=css/chunk-5544a2b8.17d2b8a1.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=js/chunk-009efa60.dbe73c24.js rel=prefetch><link href=js/chunk-07e56bb7.ca7575bc.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2d20f55a.217546ad.js rel=prefetch><link href=js/chunk-32cc5643.fcf57a84.js rel=prefetch><link href=js/chunk-34407190.69ced152.js rel=prefetch><link href=js/chunk-4b763d50.e8bf0362.js rel=prefetch><link href=js/chunk-5544a2b8.774dc497.js rel=prefetch><link href=js/chunk-578c28a7.54a578cc.js rel=prefetch><link href=js/chunk-5dc97978.1238356c.js rel=prefetch><link href=css/app.d1dc89b9.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.1467f310.js rel=preload as=script><link href=js/chunk-vendors.4d2ae4cf.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.d1dc89b9.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-wiki-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.4d2ae4cf.js></script><script src=js/app.1467f310.js></script></body></html> <!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-wiki.png><title>WIKI文档管理系统</title><link href=css/chunk-009efa60.c1509684.css rel=prefetch><link href=css/chunk-32cc5643.5a5b2ca1.css rel=prefetch><link href=css/chunk-33457f32.88156f9e.css rel=prefetch><link href=css/chunk-34407190.57bbfb51.css rel=prefetch><link href=css/chunk-4b763d50.edd147c5.css rel=prefetch><link href=css/chunk-5544a2b8.17d2b8a1.css rel=prefetch><link href=css/chunk-578c28a7.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=js/chunk-009efa60.dbe73c24.js rel=prefetch><link href=js/chunk-2d207ece.20edf665.js rel=prefetch><link href=js/chunk-2d20f55a.217546ad.js rel=prefetch><link href=js/chunk-32cc5643.fcf57a84.js rel=prefetch><link href=js/chunk-33457f32.670d1b18.js rel=prefetch><link href=js/chunk-34407190.69ced152.js rel=prefetch><link href=js/chunk-4b763d50.e8bf0362.js rel=prefetch><link href=js/chunk-5544a2b8.774dc497.js rel=prefetch><link href=js/chunk-578c28a7.54a578cc.js rel=prefetch><link href=js/chunk-5dc97978.1238356c.js rel=prefetch><link href=css/app.3d0d405b.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.4dd6b6f6.js rel=preload as=script><link href=js/chunk-vendors.4d2ae4cf.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.3d0d405b.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-wiki-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.4d2ae4cf.js></script><script src=js/app.4dd6b6f6.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long