#I1KQUK 开放地址首页展示优化,优化查看编辑页展示及url参数,无权限时不展示对应按钮

This commit is contained in:
暮光:城中城
2020-06-16 23:13:27 +08:00
parent 0451b9319c
commit 1abcc4f92e
40 changed files with 737 additions and 534 deletions

View File

@@ -3,6 +3,7 @@ package com.zyplayer.doc.data.repository.manage.vo;
import java.util.Date;
public class SpaceNewsVo {
private String space;
private Long spaceId;
private Long pageId;
private Integer zanNum;
@@ -103,4 +104,12 @@ public class SpaceNewsVo {
public void setSpaceId(Long spaceId) {
this.spaceId = spaceId;
}
public String getSpace() {
return space;
}
public void setSpace(String space) {
this.space = space;
}
}

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

@@ -63,14 +63,17 @@ export default {
return request({url: '/zyplayer-doc-wiki/page/zan/update', method: 'post', data: Qs.stringify(data)});
},
openPageDetail: data => {
return request({url: 'zyplayer-doc-wiki/open-api/page/detail', method: 'post', data: Qs.stringify(data)});
return request({url: '/zyplayer-doc-wiki/open-api/page/detail', method: 'post', data: Qs.stringify(data)});
},
openPageList: data => {
return request({url: 'zyplayer-doc-wiki/open-api/page/list', method: 'post', data: Qs.stringify(data)});
return request({url: '/zyplayer-doc-wiki/open-api/page/list', method: 'post', data: Qs.stringify(data)});
},
openSpaceInfo: data => {
return request({url: 'zyplayer-doc-wiki/open-api/space/info', method: 'post', data: Qs.stringify(data)});
return request({url: '/zyplayer-doc-wiki/open-api/space/info', method: 'post', data: Qs.stringify(data)});
},
openPageNews: data => {
return request({url: '/zyplayer-doc-wiki/open-api/page/news', method: 'post', data: Qs.stringify(data)});
},
xxxxxxxxxxxx: data => {
return request({url: 'update', method: 'post', data: Qs.stringify(data)});
},

View File

@@ -4,7 +4,7 @@
<el-aside v-show="leftCollapse">
<div style="padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;">
<div style="margin-bottom: 10px;">
<el-select v-model="choiceSpace" @change="spaceChangeEvents" filterable placeholder="选择空间" style="width: 100%;">
<el-select :value="choiceSpace" @change="spaceChangeEvents" filterable placeholder="选择空间" style="width: 100%;">
<el-option-group label="">
<el-option key="0" label="创建空间" value="0"></el-option>
<el-option key="-1" label="空间管理" value="-1"></el-option>
@@ -47,7 +47,8 @@
<el-main style="padding: 0;">
<router-view @loadPageList="loadPageList"
@changeExpandedKeys="changeWikiPageExpandedKeys"
@switchSpace="switchSpacePage">
@switchSpace="switchSpacePage"
:spaceId="choiceSpace">
</router-view>
</el-main>
</el-container>
@@ -166,11 +167,8 @@
{min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur'}
],
},
nowClickPath: {
id: '',
path: '',
},
// 依据目录树存储的map全局对象
nowPageId: '',
// 依据目录树存储的map全局对象
treePathDataMap: new Map(),
// 搜索的输入内容
searchKeywords: "",
@@ -183,9 +181,6 @@
}
},
computed: {
fullscreen () {
return this.$store.state.global.fullscreen;
}
},
mounted: function () {
this.loadSpaceList();
@@ -197,12 +192,8 @@
this.doGetPageList(param.parentId, param.node);
},
createWiki() {
if (this.nowClickPath.spaceId > 0) {
var param = {
spaceId: this.nowClickPath.spaceId,
parentId: this.nowClickPath.parentId, path: this.nowClickPath.path
};
this.$router.push({path: '/page/edit', query: param});
if (this.choiceSpace > 0) {
this.$router.push({path: '/page/edit', query: {parentId: this.nowPageId}});
} else {
this.$message.warning("请先选择或创建空间");
}
@@ -219,8 +210,8 @@
},
handleNodeClick(data) {
console.log("点击节点:", data);
this.nowClickPath = {spaceId: this.nowClickPath.spaceId, pageId: data.id, parentId: data.id, path: data.path};
this.$router.push({path: '/page/show', query: this.nowClickPath});
this.nowPageId = data.id;
this.$router.push({path: '/page/show', query: {pageId: data.id}});
},
handleNodeExpand(node) {
if (node.children.length > 0 && node.children[0].needLoad) {
@@ -249,7 +240,7 @@
return data.name.indexOf(value) !== -1;
},
showOpenSpace(space) {
let routeUrl = this.$router.resolve({path: '/page/openView', query: {space: space}});
let routeUrl = this.$router.resolve({path: '/page/share/home', query: {space: space}});
window.open(routeUrl.href, '_blank');
},
editSpaceInfo(row) {
@@ -273,22 +264,21 @@
},
spaceChangeEvents(data) {
if (data == 0) {
// 新建空间
this.newSpaceForm = {id: '', name: '', spaceExplain: '', treeLazyLoad: 0, openDoc: 0, uuid: '', type: 1};
this.choiceSpace = this.nowClickPath.spaceId;
this.newSpaceDialogVisible = true;
} else if (data == -1) {
// 使得选择的空间展示不变
this.choiceSpace = this.nowClickPath.spaceId;
// 管理空间
this.manageSpaceDialogVisible = true;
} else {
// 切换空间,重新初始化当前点击项,防止创建保存到之前点击的空间下去了
this.nowClickPath = {spaceId: data};
for (var i = 0; i < this.spaceList.length; i++) {
this.choiceSpace = data;
for (let i = 0; i < this.spaceList.length; i++) {
if (this.spaceList[i].id == data) {
this.nowSpaceShow = this.spaceList[i];
break;
}
}
this.nowPageId = '';
this.doGetPageList(null);
this.$router.push({path: '/home', query: {spaceId: data}});
}
@@ -296,18 +286,18 @@
loadSpaceList() {
pageApi.spaceList({}).then(json => {
this.spaceList = json.data || [];
var spaceOptions = [];
for (var i = 0; i < this.spaceList.length; i++) {
let spaceOptions = [];
for (let i = 0; i < this.spaceList.length; i++) {
spaceOptions.push({
label: this.spaceList[i].name, value: this.spaceList[i].id
});
}
this.spaceOptions = spaceOptions;
if (this.spaceList.length > 0) {
var spaceId = this.spaceList[0].id;
let spaceId = this.spaceList[0].id;
this.nowSpaceShow = this.spaceList[0];
this.nowClickPath = {spaceId: spaceId};
this.choiceSpace = spaceId;
this.nowPageId = '';
this.doGetPageList(null);
// TODO 在首页时跳转
try {
@@ -321,53 +311,30 @@
});
},
doGetPageList(parentId, node) {
var nodePath = "";
if (!!node) {
nodePath = node.nodePath || "/";
if (!nodePath.endsWith("/")) {
nodePath += "/";
}
} else {
nodePath = "/";
}
var param = {spaceId: this.nowClickPath.spaceId, parentId: parentId || 0};
let param = {spaceId: this.choiceSpace, parentId: parentId || 0};
if (this.nowSpaceShow.treeLazyLoad == 0) {
param.parentId = null;
}
pageApi.pageList(param).then(json => {
var result = json.data || [];
var pathIndex = [];
let result = json.data || [];
let pathIndex = [];
if (this.nowSpaceShow.treeLazyLoad == 0) {
pathIndex = result;
} else {
for (var i = 0; i < result.length; i++) {
var item = result[i];
for (let i = 0; i < result.length; i++) {
let item = result[i];
item.parentId = item.parentId || 0;
item.children = [{label: '', needLoad: true}];// 初始化一个对象,点击展开时重新查询加载
pathIndex.push(item);
}
}
this.createNodePath(pathIndex, nodePath);
if (parentId > 0) {
node.children = pathIndex;
} else {
this.wikiPageList = pathIndex;
//this.lastClickNode = {};
}
});
},
createNodePath(node, nodePath) {
if (!nodePath.endsWith("/")) {
nodePath += "/";
}
for (var i = 0; i < node.length; i++) {
var item = node[i];
item.nodePath = nodePath + item.name;
if (!!item.children && item.children.length > 0) {
this.createNodePath(item.children, item.nodePath);
}
}
},
userSettingDropdown(command) {
console.log("command:" + command);
if (command == 'userSignOut') {
@@ -390,7 +357,7 @@
onNewSpaceSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = {
let param = {
id: this.newSpaceForm.id,
name: this.newSpaceForm.name,
type: this.newSpaceForm.type,
@@ -407,7 +374,6 @@
label: json.data.name, value: json.data.id
});
this.nowSpaceShow = json.data;
this.nowClickPath = {spaceId: json.data.id};
this.choiceSpace = json.data.id;
this.doGetPageList(null);
}
@@ -439,7 +405,6 @@
return;
}
this.choiceSpace = spaceId;
this.nowClickPath.spaceId = spaceId;
this.doGetPageList(null);
},
}

View File

@@ -1,244 +0,0 @@
<template>
<div>
<el-container style="height: 100%;">
<el-aside width="280px" style="height: 100%;background-color: #fafafa;" v-show="leftCollapse">
<div class="logo">{{nowSpaceShow.name}}</div>
<div style="padding: 0 10px 50px 10px;">
<el-input v-model="searchKeywords" @keyup.enter.native="searchByKeywords" placeholder="搜索文档" style="margin: 10px 0;">
<el-button slot="append" icon="el-icon-search" v-on:click="searchByKeywords"></el-button>
</el-input>
<el-tree :props="defaultProps" :data="wikiPageList" @node-click="handleNodeClick"
ref="wikiPageTree" :filter-node-method="filterPageNode" highlight-current
:expand-on-click-node="false" :default-expanded-keys="wikiPageExpandedKeys"
node-key="id"
style="background-color: #fafafa;">
</el-tree>
<!--请手下留情别删我(^)给我一个露脸的机会我长的不碍眼的-->
<div class="build-info">本文档使用<span @click="aboutDialogVisible = true">zyplayer-doc</span>构建</div>
</div>
</el-aside>
<el-container>
<el-main class="doc-body-box">
<el-row type="border-card" v-show="rightContentType == 0">
<div style="margin-top: 30px;color: #666; text-align: center; font-size: 30px;">欢迎使用在线文档</div>
<div style="margin-top: 30px;color: #666; text-align: center;">
{{nowSpaceShow.name}}
<span v-show="nowSpaceShow.spaceExplain && nowSpaceShow.spaceExplain.length > 0"> · {{nowSpaceShow.spaceExplain}}</span>
</div>
</el-row>
<el-row type="border-card" v-show="rightContentType == 1">
<i class="el-icon-menu icon-collapse" @click="leftCollapse = !leftCollapse"></i>
<div style="max-width: 950px;margin: 0 auto;">
<div class="wiki-title">{{wikiPage.name}}</div>
<div class="wiki-author">
<span v-show="!wikiPage.updateTime">创建时间{{wikiPage.createTime}}</span>
<span v-show="wikiPage.updateTime">最后修改{{wikiPage.updateTime}}</span>
</div>
<div class="wiki-files">
<el-table v-show="pageFileList.length > 0" :data="pageFileList" border style="width: 100%; margin-bottom: 5px;">
<el-table-column label="文件名">
<template slot-scope="scope">
<a target="_blank" :href="scope.row.fileUrl">{{scope.row.fileName}}</a>
</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>
</div>
<div class="wiki-content w-e-text">
<div v-html="pageContent.content"></div>
</div>
</div>
</el-row>
</el-main>
</el-container>
</el-container>
<!--关于弹窗-->
<el-dialog title="关于zyplayer-doc-wiki" :visible.sync="aboutDialogVisible" width="600px">
<el-form>
<el-form-item label="项目地址:">
<a target="_blank" href="https://gitee.com/zyplayer/zyplayer-doc">zyplayer-doc</a>
</el-form-item>
<el-form-item label="开发人员:">
<a target="_blank" href="http://zyplayer.com">暮光城中城</a>
</el-form-item>
<el-form-item label="">
欢迎加群讨论QQ群号466363173欢迎提交需求欢迎使用和加入开发
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import pageApi from '../../common/api/page'
export default {
data() {
return {
leftCollapse: true,
aboutDialogVisible: false,
rightContentLoading: false,
rightContentType: 0,// 右侧显示类型0=欢迎页 1=文章内容 2=编辑或新增文章
pathIndex: [],
defaultProps: {
children: 'children',
label: 'name'
},
// 空间搜索相关
nowSpaceShow: {},
// 搜索的输入内容
searchKeywords: "",
lastClickNode: {},
// 页面展示相关
wikiPageList:[],
wikiPage: {},
wikiPageExpandedKeys: [],
pageContent: {},
pageFileList: [],
// 页面跳转相关
parentPath: {},
}
},
beforeRouteUpdate(to, from, next) {
this.initQueryParam(to);
next();
},
mounted: function () {
this.initQueryParam(this.$route);
this.getSpaceInfo();
this.doGetPageList(null);
},
methods: {
filterPageNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
handleNodeClick(data) {
this.rightContentType = 1;
if (this.lastClickNode.id == data.id) {
return;
}
console.log("点击节点:", data);
this.lastClickNode = data;
this.nowClickPath = {pageId: this.lastClickNode.id, space: this.parentPath.space};
this.$router.push({path: '/page/openView', query: this.nowClickPath});
},
loadPageDetail(pageId) {
this.rightContentType = 1;
let param = {pageId: pageId, space: this.parentPath.space};
pageApi.openPageDetail(param).then(json => {
let wikiPage = json.data.wikiPage || {};
wikiPage.selfZan = json.data.selfZan || 0;
this.wikiPage = wikiPage;
this.pageContent = json.data.pageContent || {};
this.pageFileList = json.data.fileList || [];
});
},
searchByKeywords() {
this.$refs.wikiPageTree.filter(this.searchKeywords);
},
doGetPageList() {
let nodePath = "/";
let param = {space: this.parentPath.space};
pageApi.openPageList(param).then(json => {
let pathIndex = json.data || [];
this.createNodePath(pathIndex, nodePath);
this.wikiPageList = pathIndex;
this.lastClickNode = {};
});
},
getSpaceInfo() {
let param = {space: this.parentPath.space};
pageApi.openSpaceInfo(param).then(json => {
this.nowSpaceShow = json.data;
});
},
createNodePath(node, nodePath) {
if (!nodePath.endsWith("/")) {
nodePath += "/";
}
for (let i = 0; i < node.length; i++) {
let item = node[i];
item.nodePath = nodePath + item.name;
if (!!item.children && item.children.length > 0) {
this.createNodePath(item.children, item.nodePath);
}
}
},
initQueryParam(to) {
this.parentPath = {space: to.query.space, pageId: to.query.pageId};
if (!!this.parentPath.pageId) {
this.loadPageDetail(this.parentPath.pageId);
}
},
}
};
</script>
<style scoped>
html,body,#app {margin: 0; padding: 0; height: 100%;}
pre{margin: 0;white-space: pre-wrap;font-size: 14px; font-family: auto;}
.el-menu {box-sizing: border-box;border-right: 0;margin-right: 3px;}
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
.doc-body-box{
overflow-x: hidden;overflow-y: auto;width: 100%;
padding: 10px;border-left: 1px solid #f1f1f1; box-sizing: border-box;
}
.el-tree{margin-right: 3px;}
.logo{
/*background: #409EFF; cursor: pointer;*/
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{float: left;font-size: 25px;color: #aaa;cursor: pointer;position: fixed;}
.icon-collapse:hover{color: #ccc;}
.wiki-title{font-size: 20px;text-align: center;}
.wiki-author{font-size: 14px;color: #888;padding: 20px 0;height: 40px;line-height: 40px;}
.wiki-content{font-size: 14px;}
.wiki-content.w-e-text{overflow-y: auto;}
.upload-page-file .el-upload-list{display: none;}
.is-link{color: #1e88e5;cursor: pointer;}
/*编辑框高度*/
#newPageContentDiv .w-e-text-container{height: 600px !important;}
/*评论*/
.comment-box .head{
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{
position: fixed;bottom: 0;left: 0;background: #fafafa;width: 280px;text-align: center;
padding: 5px 0;color: #aaa;font-size: 12px;
}
.build-info span{color: #4183c4;cursor: pointer;}
/* S-JSON展示的样式 */
pre.json {
display: block;
padding: 9.5px;
margin: 0 0 0 10px;
font-size: 12px;
line-height: 1.38461538;
color: #333;
word-break: break-all;
word-wrap: break-word;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
}
pre.json .canvas{font:10pt georgia;background-color:#ececec;color:#000000;border:1px solid #cecece;}
pre.json .object-brace{color:#00aa00;font-weight:bold;}
pre.json .array-brace{color:#0033ff;font-weight:bold;}
pre.json .property-name{color:#cc0000;font-weight:bold;}
pre.json .string{color:#007777;}
pre.json .number{color:#aa00aa;}
pre.json .boolean{color:#0000ff;}
pre.json .function{color:#aa6633;text-decoration:initial;}
pre.json .null{color:#0000ff;}
pre.json .comma{color:#000000;font-weight:bold;}
pre.json .annotation{color:#aaa;}
pre img{cursor: pointer;}
/* E-JSON展示的样式 */
</style>

View File

@@ -0,0 +1,131 @@
<template>
<div style="height: 100%;">
<el-container>
<el-aside width="300px" style="background-color: #fafafa;" v-show="leftCollapse">
<div class="logo">{{nowSpaceShow.name}}</div>
<div style="padding: 10px;box-sizing: border-box;background: #fafafa;">
<el-input v-model="searchKeywords" @keyup.enter.native="searchByKeywords" placeholder="搜索文档" style="margin: 10px 0;">
<el-button slot="append" icon="el-icon-search" v-on:click="searchByKeywords"></el-button>
</el-input>
<el-tree :props="defaultProps" :data="wikiPageList" @node-click="handleNodeClick"
ref="wikiPageTree" :filter-node-method="filterPageNode" highlight-current
:expand-on-click-node="false" :default-expanded-keys="wikiPageExpandedKeys"
node-key="id"
style="background-color: #fafafa;padding-bottom: 30px;">
</el-tree>
<!--请手下留情别删我(^)给我一个露脸的机会我长的不碍眼的-->
<div class="build-info">本文档使用<span @click="aboutDialogVisible = true">zyplayer-doc</span>构建</div>
</div>
</el-aside>
<el-container>
<el-main class="doc-body-box">
<router-view></router-view>
</el-main>
</el-container>
</el-container>
<!--关于弹窗-->
<el-dialog title="关于zyplayer-doc-wiki" :visible.sync="aboutDialogVisible" width="600px">
<el-form>
<el-form-item label="项目地址:">
<a target="_blank" href="https://gitee.com/zyplayer/zyplayer-doc">zyplayer-doc</a>
</el-form-item>
<el-form-item label="开发人员:">
<a target="_blank" href="http://zyplayer.com">暮光城中城</a>
</el-form-item>
<el-form-item label="">
欢迎加群讨论QQ群号466363173欢迎提交需求欢迎使用和加入开发
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import pageApi from '../../common/api/page'
export default {
data() {
return {
leftCollapse: true,
aboutDialogVisible: false,
defaultProps: {
children: 'children',
label: 'name'
},
// 空间搜索相关
spaceUuid: '',
nowPageId: '',
nowSpaceShow: {},
// 搜索的输入内容
searchKeywords: "",
// 页面展示相关
wikiPageList:[],
wikiPageExpandedKeys: [],
}
},
mounted: function () {
this.spaceUuid = this.$route.query.space || '';
this.getSpaceInfo();
this.doGetPageList(null);
},
methods: {
filterPageNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
handleNodeClick(data) {
if (this.nowPageId == data.id) {
return;
}
console.log("点击节点:", data);
this.nowPageId = data.id;
this.$router.push({path: '/page/share/view', query: {pageId: data.id, space: this.spaceUuid}});
},
searchByKeywords() {
this.$refs.wikiPageTree.filter(this.searchKeywords);
},
doGetPageList() {
pageApi.openPageList({space: this.spaceUuid}).then(json => {
this.wikiPageList = json.data || [];
this.nowPageId = '';
});
},
getSpaceInfo() {
pageApi.openSpaceInfo({space: this.spaceUuid}).then(json => {
this.nowSpaceShow = json.data;
});
},
}
};
</script>
<style scoped>
html,body,#app {margin: 0; padding: 0; height: 100%;}
pre{margin: 0;white-space: pre-wrap;font-size: 14px; font-family: auto;}
.el-menu {box-sizing: border-box;border-right: 0;margin-right: 3px;}
.el-header {background-color: #409EFF; color: #333; line-height: 40px; text-align: right;height: 40px !important;}
.doc-body-box{
overflow-x: hidden;overflow-y: auto;width: 100%;
padding: 10px;border-left: 1px solid #f1f1f1; box-sizing: border-box;
}
.el-tree{margin-right: 3px;}
.logo{
/*background: #409EFF; cursor: pointer;*/
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{float: left;font-size: 25px;color: #aaa;cursor: pointer;position: fixed;}
.icon-collapse:hover{color: #ccc;}
/*评论*/
.comment-box .head{
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{
position: fixed;bottom: 0;left: 0;background: #fafafa;width: 240px;text-align: center;
padding: 5px 0;color: #aaa;font-size: 12px;
}
.build-info span{color: #4183c4;cursor: pointer;}
</style>

View File

@@ -22,7 +22,6 @@ router.beforeEach((to, from, next) => {
if (to.name) {
document.title = to.name;
}
store.commit('global/setFullscreen', !!to.meta.fullscreen);
next();
});

View File

@@ -1,5 +1,5 @@
import GlobalLayout from './components/layouts/GlobalLayout'
import OpenLayout from './components/layouts/OpenLayout'
import OpenLayout from './components/layouts/ShareLayout'
let routes = [
{path: '/', redirect: '/home'},
@@ -23,7 +23,8 @@ let routes = [
name: '页面管理',
component: OpenLayout,
children: [
{path: '/page/openView', name: 'WIKI-内容展示', component: () => import('@/views/page/OpenView')},
{path: '/page/share/home', name: 'WIKI-开放文档', component: () => import('@/views/page/share/Home')},
{path: '/page/share/view', name: 'WIKI-内容展示', component: () => import('@/views/page/share/View')},
]
}
];

View File

@@ -2,7 +2,6 @@ export default {
namespaced: true,
state: {
pageTabNameMap: {},
fullscreen: false,
},
getters: {
getPageTabNameMap(state) {
@@ -15,8 +14,5 @@ export default {
sameObj[item.key] = item.val;
state.pageTabNameMap = sameObj;
},
setFullscreen(state, val) {
state.fullscreen = val;
},
}
}

View File

@@ -1,11 +1,8 @@
<template>
<div style="padding: 10px;" class="page-edit-vue">
<el-row type="border-card">
<div style="margin-bottom: 10px;padding: 10px;" v-if="wikiPage.id > 0">
编辑{{parentPath.path}}
</div>
<div style="margin-bottom: 10px;padding: 10px;" v-else>
父级{{parentPath.path || '/'}} 
<div style="margin-bottom: 10px;padding: 10px;" v-if="!pageId">
父级{{parentWikiPage.name || '/'}} 
<el-tooltip class="item" content="在根目录创建文档">
<el-button type="text" @click="changeToRootPath" style="padding: 0 10px;">根目录</el-button>
</el-tooltip>
@@ -24,14 +21,19 @@
import pageApi from '../../common/api/page'
export default {
props: ['spaceId'],
data() {
return {
editor: {},
// 编辑相关
newPageTitle: "",
parentPath: {},
wikiPage: {},
parentWikiPage: {},
isUnlock: false,
// 页面ID有值代表编辑
pageId: '',
// 父级,有值代表在此父级新建文档
parentId: '',
};
},
destroyed: function () {
@@ -54,17 +56,15 @@
},
methods: {
changeToRootPath() {
this.parentPath = {spaceId: this.parentPath.spaceId};
// 没有父级,就是在根目录创建
this.parentId = '';
this.parentWikiPage = {};
},
unlockPage() {
// 防止各种事件重复调这个接口,只需要调一次就好了
if (this.isUnlock) {
return;
}
this.isUnlock = true;
var param = {pageId: this.parentPath.pageId};
pageApi.pageUnlock(param).then(() => {
});
if (this.isUnlock) return;
this.isUnlock = true;
pageApi.pageUnlock({pageId: this.pageId});
},
createWikiCancel() {
this.$confirm('确定要取消编辑吗?您编辑的内容将不会被保存哦~', '提示', {
@@ -77,37 +77,34 @@
});
},
createWikiSave(saveAfter) {
// 修改内容时强制不能修改父路径,只能在目录上拖动修改
var parentId = (this.wikiPage.id > 0) ? '' : this.parentPath.parentId;
if (!this.newPageTitle) {
this.$message.warning("标题不能为空");
return;
}
var preview = this.editor.txt.text();
var param = {
spaceId: this.parentPath.spaceId,
// 修改内容时强制不能修改父路径,只能在目录上拖动修改
let parentId = (this.pageId > 0) ? '' : this.parentId;
let param = {
spaceId: this.spaceId,
parentId: parentId,
id: this.wikiPage.id,
name: this.newPageTitle,
content: this.editor.txt.html(),
preview: preview,
preview: this.editor.txt.text(),
};
pageApi.updatePage(param).then(json => {
this.$message.success("保存成功!");
// 重新加载左侧列表,跳转到展示页面
this.$emit('loadPageList');
this.parentPath.pageId = json.data.id;
this.pageId = json.data.id;
if (saveAfter == 1) {
this.$router.push({path: '/page/show', query: this.parentPath});
this.$router.push({path: '/page/show', query: {pageId: this.pageId}});
} else {
this.loadPageDetail(this.parentPath.pageId);
this.loadPageDetail(this.pageId);
}
});
},
loadPageDetail(pageId) {
this.rightContentType = 1;
var param = {id: pageId};
pageApi.pageDetail(param).then(json => {
pageApi.pageDetail({id: pageId}).then(json => {
this.wikiPage = json.data.wikiPage || {};
this.pageContent = json.data.pageContent || {};
this.pageFileList = json.data.fileList || [];
@@ -116,6 +113,12 @@
this.editor.txt.html(this.pageContent.content || "");
});
},
loadParentPageDetail(pageId) {
if (!pageId) return;
pageApi.pageDetail({id: pageId}).then(json => {
this.parentWikiPage = json.data.wikiPage || {};
});
},
cleanPage() {
this.wikiPage = {};
this.pageContent = {};
@@ -126,18 +129,12 @@
}
},
initQueryParam(to) {
this.parentPath = {
spaceId: to.query.spaceId, pageId: to.query.pageId,
parentId: to.query.parentId, path: to.query.path
};
if (!!this.parentPath.pageId) {
this.loadPageDetail(this.parentPath.pageId);
} else {
this.cleanPage();
}
let param = {pageId: this.parentPath.pageId};
pageApi.pageLock(param).then(json => {
if (json.errCode !== 200) {
// pageId和parentId二选一传了pageId代表编辑页面否则代表新建页面
this.pageId = to.query.pageId;
this.parentId = to.query.parentId;
if (!!this.pageId) {
this.loadPageDetail(this.pageId);
pageApi.pageLock({pageId: this.pageId}).catch(json => {
let that = this;
this.$alert(json.errMsg || '未知错误', '错误', {
confirmButtonText: '确定',
@@ -145,8 +142,11 @@
that.$router.back();
}
});
}
});
});
} else {
this.loadParentPageDetail(this.parentId);
this.cleanPage();
}
},
initEditor() {
this.editor = new WangEditor('#newPageContentDiv');

View File

@@ -1,24 +0,0 @@
<template>
<div class="page-open-view-vue">
</div>
</template>
<script>
export default {
data() {
return {};
},
beforeRouteUpdate(to, from, next) {
},
mounted: function () {
},
methods: {}
}
</script>
<style>
</style>

View File

@@ -9,16 +9,17 @@
创建{{wikiPage.createUserName}} {{wikiPage.createTime}}  
<span v-show="wikiPage.updateUserName">修改{{wikiPage.updateUserName}} {{wikiPage.updateTime}}</span>
<div style="float: right;">
<el-upload class="upload-page-file" :action="uploadFileUrl"
<el-upload v-if="wikiPageAuth.canUploadFile==1"
class="upload-page-file" :action="uploadFileUrl"
:with-credentials="true"
:on-success="uploadFileSuccess" :on-error="uploadFileError"
name="files" show-file-list multiple :data="uploadFormData" :limit="999"
style="display: inline;margin-right: 10px;">
<el-button type="text" icon="el-icon-upload">上传附件</el-button>
</el-upload>
<el-button type="text" icon="el-icon-edit" v-on:click="editWiki">编辑</el-button>
<el-button type="text" icon="el-icon-setting" v-on:click="editWikiAuth">权限设置</el-button>
<el-button type="text" icon="el-icon-delete" v-on:click="deleteWikiPage">删除</el-button>
<el-button v-if="wikiPageAuth.canEdit==1" type="text" icon="el-icon-edit" @click="editWiki">编辑</el-button>
<el-button v-if="wikiPageAuth.canConfigAuth==1" type="text" icon="el-icon-setting" @click="editWikiAuth">权限设置</el-button>
<el-button v-if="wikiPageAuth.canDelete==1" type="text" icon="el-icon-delete" @click="deleteWikiPage">删除</el-button>
</div>
</div>
</div>
@@ -32,7 +33,7 @@
<el-table-column prop="createUserName" label="创建人"></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">
<el-table-column label="操作" width="100px" v-if="wikiPageAuth.canUploadFile==1">
<template slot-scope="scope">
<el-button size="small" v-on:click="deletePageFile(scope.row)">删除</el-button>
</template>
@@ -146,6 +147,7 @@
return {
// 页面展示相关
wikiPage: {},
wikiPageAuth: {},
pageContent: {},
pageFileList: [],
selfUserId: 0,
@@ -173,22 +175,12 @@
},
mounted: function () {
this.initQueryParam(this.$route);
if (!!this.parentPath.pageId) {
// 延迟设置展开的目录edit比app先初始化
setTimeout(() => {
if (!!this.parentPath.spaceId) {
// 调用父方法切换选择的空间
this.$emit('switchSpace', this.parentPath.spaceId);
}
this.$emit('changeExpandedKeys', this.parentPath.pageId);
}, 500);
}
},
methods: {
editWiki() {
var param = {pageId: this.parentPath.pageId};
pageApi.pageLock(param).then(() => {
this.$router.push({path: '/page/edit', query: this.parentPath});
this.$router.push({path: '/page/edit', query: {pageId: this.parentPath.pageId}});
});
},
getSearchUserList(query) {
@@ -269,23 +261,32 @@
}).catch(()=>{});
},
loadPageDetail(pageId) {
this.rightContentType = 1;
var param = {id: pageId};
pageApi.pageDetail(param).then(json => {
var wikiPage = json.data.wikiPage || {};
wikiPage.selfZan = json.data.selfZan || 0;
let result = json.data || {};
var wikiPage = result.wikiPage || {};
wikiPage.selfZan = result.selfZan || 0;
this.wikiPage = wikiPage;
this.pageContent = json.data.pageContent || {};
this.pageFileList = json.data.fileList || [];
this.selfUserId = json.data.selfUserId || 0;
this.pageContent = result.pageContent || {};
this.pageFileList = result.fileList || [];
this.selfUserId = result.selfUserId || 0;
this.uploadFormData = {pageId: this.wikiPage.id};
this.parentPath.spaceId = wikiPage.spaceId;
this.wikiPageAuth = {
canEdit: result.canEdit,
canDelete: result.canDelete,
canUploadFile: result.canUploadFile,
canConfigAuth: result.canConfigAuth,
};
// 修改标题
document.title = wikiPage.name || '页面展示';
document.title = wikiPage.name || 'WIKI-内容展示';
// 修改最后点击的项,保证刷新后点击编辑能展示编辑的项
// if (!this.lastClickNode.id) {
// this.lastClickNode = {id: wikiPage.id, nodePath: wikiPage.name};
// }
// 调用父方法切换选择的空间
this.$emit('switchSpace', this.wikiPage.spaceId);
// 调用父方法展开目录树
this.$emit('changeExpandedKeys', pageId);
});
this.loadCommentList(pageId);
},
@@ -395,10 +396,7 @@
return color;
},
initQueryParam(to) {
this.parentPath = {
spaceId: to.query.spaceId, pageId: to.query.pageId,
parentId: to.query.parentId, path: to.query.path
};
this.parentPath = {pageId: to.query.pageId};
if (!!this.parentPath.pageId) {
this.loadPageDetail(this.parentPath.pageId);
}

View File

@@ -0,0 +1,106 @@
<template>
<div style="padding: 10px;" class="page-share-home-vue">
<div style="max-width: 800px;margin: 0 auto;">
<div v-if="spacePageNews.length <= 0" class="empty-news">暂无数据</div>
<div v-else class="line-box" v-for="item in spacePageNews">
<div class="line-title">
<span class="text-link">{{item.createUserName}}</span> 发布于 <span class="text-link">{{item.spaceName}}</span>
</div>
<div class="page-preview-box">
<div class="page-preview-title" v-on:click="showPageDetail(item)" v-html="item.pageTitle"></div>
<div class="page-preview-content" v-html="item.previewContent"></div>
<div>
<span><img src="../../../assets/img/zan.png" class="zan-img"> {{item.zanNum}} </span>
<span><i class="el-icon-view view-img"></i> {{item.viewNum}} </span>
<span>{{item.updateTime||item.createTime}}</span>
</div>
</div>
</div>
<div class="page-info-box">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-sizes="[20, 50, 100]"
:page-size="20"
:current-page="searchParam.pageNum"
layout="prev, pager, next, jumper, sizes, total"
:total="totalCount"
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import pageApi from '../../../common/api/page'
export default {
data() {
return {
totalCount: 0,
searchParam: {
spaceId: '',
newsType: 1,
pageNum: 1,
pageSize: 20,
},
spacePageNews: [],
};
},
beforeRouteUpdate(to, from, next) {
this.initQueryParam(to);
next();
},
mounted: function () {
this.initQueryParam(this.$route);
},
methods: {
getSpacePageNews() {
pageApi.openPageNews(this.searchParam).then(json => {
this.spacePageNews = json.data || [];
this.totalCount = json.total;
});
},
handleSizeChange(val) {
this.searchParam.pageSize = val;
this.getSpacePageNews();
},
showPageDetail(row) {
this.nowClickPath = {space: row.space, pageId: row.pageId};
this.$router.push({path: '/page/share/view', query: this.nowClickPath});
},
handleCurrentChange(val) {
this.searchParam.pageNum = val;
this.getSpacePageNews();
},
initQueryParam(to) {
this.searchParam = {
space: to.query.space,
newsType: 1,
pageNum: 1,
pageSize: 20,
};
if (!!this.searchParam.space) {
this.getSpacePageNews();
}
},
}
}
</script>
<style>
.page-share-home-vue .empty-news{text-align: center;padding: 100px;}
.page-share-home-vue .text-link {
color: #444;
}
.page-share-home-vue .line-box{color: #666;border-bottom: 1px solid #eee;padding: 20px 0;}
.page-share-home-vue .line-title{font-size: 14px;}
.page-share-home-vue .page-preview-box{}
.page-share-home-vue .page-preview-title{cursor: pointer;font-size: 20px;margin: 10px 0 5px 0;color: #3a8ee6;}
.page-share-home-vue .page-preview-content{font-size: 16px;margin-bottom: 5px;}
.page-share-home-vue .zan-img{vertical-align: middle;margin-top: -3px;}
.page-share-home-vue .view-img{font-size: 16px;color: #666;}
.page-share-home-vue .page-info-box{text-align: right;margin: 20px 0 50px 0;}
</style>

View File

@@ -0,0 +1,84 @@
<template>
<div class="page-share-view-vue">
<el-row type="border-card">
<div style="max-width: 950px;margin: 0 auto;">
<div class="wiki-title">{{wikiPage.name}}</div>
<div class="wiki-author">
<span v-show="!wikiPage.updateTime">创建时间{{wikiPage.createTime}}</span>
<span v-show="wikiPage.updateTime">最后修改{{wikiPage.updateTime}}</span>
</div>
<div class="wiki-files">
<el-table v-show="pageFileList.length > 0" :data="pageFileList" border
style="width: 100%; margin-bottom: 5px;">
<el-table-column label="文件名">
<template slot-scope="scope">
<a target="_blank" :href="scope.row.fileUrl">{{scope.row.fileName}}</a>
</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>
</div>
<div class="wiki-content w-e-text">
<div v-html="pageContent.content"></div>
</div>
</div>
</el-row>
</div>
</template>
<script>
import pageApi from '../../../common/api/page'
export default {
data() {
return {
spaceUuid: '',
nowPageId: '',
// 页面展示相关
wikiPage: {},
pageContent: {},
pageFileList: [],
};
},
beforeRouteUpdate(to, from, next) {
this.initQueryParam(to);
next();
},
mounted() {
this.initQueryParam(this.$route);
},
methods: {
loadPageDetail(pageId) {
let param = {pageId: pageId, space: this.spaceUuid};
pageApi.openPageDetail(param).then(json => {
let wikiPage = json.data.wikiPage || {};
wikiPage.selfZan = json.data.selfZan || 0;
this.wikiPage = wikiPage;
this.pageContent = json.data.pageContent || {};
this.pageFileList = json.data.fileList || [];
document.title = wikiPage.name || 'WIKI-内容展示';
});
},
initQueryParam(to) {
this.spaceUuid = to.query.space;
this.nowPageId = to.query.pageId;
if (!!this.nowPageId) {
this.loadPageDetail(this.nowPageId);
}
},
}
}
</script>
<style>
.page-share-view-vue .wiki-title{font-size: 20px;text-align: center;}
.page-share-view-vue .wiki-author{font-size: 14px;color: #888;padding: 20px 0;height: 40px;line-height: 40px;}
.page-share-view-vue .wiki-content{font-size: 14px;}
.page-share-view-vue .wiki-content.w-e-text{overflow-y: auto;}
.page-share-view-vue .upload-page-file .el-upload-list{display: none;}
.page-share-view-vue .is-link{color: #1e88e5;cursor: pointer;}
</style>

View File

@@ -2,12 +2,17 @@ package com.zyplayer.doc.wiki.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.core.json.ResponseJson;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageContent;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.repository.manage.mapper.WikiPageContentMapper;
import com.zyplayer.doc.data.repository.manage.param.SearchByEsParam;
import com.zyplayer.doc.data.repository.manage.vo.SpaceNewsVo;
import com.zyplayer.doc.data.service.manage.WikiPageContentService;
import com.zyplayer.doc.data.service.manage.WikiPageFileService;
import com.zyplayer.doc.data.service.manage.WikiPageService;
@@ -15,6 +20,7 @@ import com.zyplayer.doc.data.service.manage.WikiSpaceService;
import com.zyplayer.doc.wiki.controller.vo.WikiPageContentVo;
import com.zyplayer.doc.wiki.controller.vo.WikiPageVo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.dozer.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,28 +52,62 @@ public class WikiOpenApiController {
@Resource
WikiPageFileService wikiPageFileService;
@Resource
WikiPageContentMapper wikiPageContentMapper;
@Resource
Mapper mapper;
@PostMapping("/space/info")
public ResponseJson<WikiSpace> spaceInfo(String space) {
UpdateWrapper<WikiSpace> wrapper = new UpdateWrapper<>();
wrapper.eq("uuid", space);
wrapper.eq("del_flag", 0);
WikiSpace wikiSpace = wikiSpaceService.getOne(wrapper);
// 不存在或未开放
if (wikiSpace == null || wikiSpace.getOpenDoc() != 1) {
WikiSpace wikiSpace = this.getWikiSpace(space);
if (wikiSpace == null) {
return DocResponseJson.warn("未找到该文档");
}
return DocResponseJson.ok(wikiSpace);
}
@PostMapping("/page/news")
public ResponseJson<List<WikiPageVo>> news(SearchByEsParam param, String space) {
WikiSpace wikiSpace = this.getWikiSpace(space);
if (wikiSpace == null) {
return DocResponseJson.warn("未找到该文档");
}
String keywords = param.getKeywords();
if (StringUtils.isNotBlank(keywords)) {
param.setKeywords("%" + keywords + "%");
}
// 分页查询
param.setSpaceIds(Collections.singletonList(wikiSpace.getId()));
PageHelper.startPage(param.getPageNum(), param.getPageSize(), true);
List<SpaceNewsVo> spaceNewsVoList = wikiPageContentMapper.getNewsList(param);
PageInfo<SpaceNewsVo> pageListPageInfo = new PageInfo<>(spaceNewsVoList);
if (CollectionUtils.isNotEmpty(spaceNewsVoList)) {
spaceNewsVoList.forEach(val -> {
val.setSpace(wikiSpace.getUuid());
val.setSpaceName(wikiSpace.getName());
String preview = val.getPreviewContent();
if (preview != null) {
if (preview.length() > 200) {
preview = preview.substring(0, 200);
}
if (keywords != null) {
preview = preview.replace(keywords, "<span style=\"color:red\">" + keywords + "</span>");
}
}
val.setPreviewContent(preview);
String pageTitle = val.getPageTitle();
if (pageTitle != null && keywords != null) {
pageTitle = pageTitle.replace(keywords, "<span style=\"color:red\">" + keywords + "</span>");
}
val.setPageTitle(pageTitle);
});
}
return DocResponseJson.ok(pageListPageInfo);
}
@PostMapping("/page/list")
public ResponseJson<List<WikiPageVo>> list(String space) {
UpdateWrapper<WikiSpace> wrapperSpace = new UpdateWrapper<>();
wrapperSpace.eq("uuid", space);
WikiSpace wikiSpace = wikiSpaceService.getOne(wrapperSpace);
// 不存在或未开放
if (wikiSpace == null || wikiSpace.getOpenDoc() != 1) {
WikiSpace wikiSpace = this.getWikiSpace(space);
if (wikiSpace == null) {
return DocResponseJson.warn("未找到该文档");
}
QueryWrapper<WikiPage> wrapper = new QueryWrapper<>();
@@ -88,11 +128,8 @@ public class WikiOpenApiController {
@PostMapping("/page/detail")
public ResponseJson<WikiPageContentVo> detail(String space, Long pageId) {
UpdateWrapper<WikiSpace> wrapperSpace = new UpdateWrapper<>();
wrapperSpace.eq("uuid", space);
WikiSpace wikiSpace = wikiSpaceService.getOne(wrapperSpace);
// 不存在或未开放
if (wikiSpace == null || wikiSpace.getOpenDoc() != 1) {
WikiSpace wikiSpace = this.getWikiSpace(space);
if (wikiSpace == null) {
return DocResponseJson.warn("未找到该文档");
}
WikiPage wikiPageSel = wikiPageService.getById(pageId);
@@ -138,5 +175,22 @@ public class WikiOpenApiController {
}
}
}
/**
* 获取空间信息
* @param space
* @return
*/
private WikiSpace getWikiSpace(String space) {
QueryWrapper<WikiSpace> wrapperSpace = new QueryWrapper<>();
wrapperSpace.eq("uuid", space);
wrapperSpace.eq("del_flag", 0);
WikiSpace wikiSpace = wikiSpaceService.getOne(wrapperSpace);
// 不存在或未开放
if (wikiSpace == null || wikiSpace.getOpenDoc() != 1) {
return null;
}
return wikiSpace;
}
}

View File

@@ -13,6 +13,7 @@ import com.zyplayer.doc.data.service.manage.*;
import com.zyplayer.doc.wiki.controller.vo.UserPageAuthVo;
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
import com.zyplayer.doc.wiki.service.WikiPageAuthService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,6 +50,8 @@ public class WikiPageAuthController {
UserAuthService userAuthService;
@Resource
AuthInfoService authInfoService;
@Resource
WikiPageAuthService wikiPageAuthService;
@PostMapping("/assign")
public ResponseJson<List<WikiPageZan>> assign(Long pageId, String authList) {
@@ -61,13 +64,9 @@ public class WikiPageAuthController {
// if (SpaceType.isPublic(wikiSpaceSel.getType())) {
// return DocResponseJson.warn("公共空间不需要编辑权限");
// }
if (!SpaceType.isPersonal(wikiSpaceSel.getType())) {
return DocResponseJson.warn("只有个人空间才可以编辑权限");
}
if (!Objects.equals(currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
if (!DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_AUTH_MANAGE.getName(), DocAuthConst.WIKI + pageId)) {
return DocResponseJson.warn("您不是创建人或没有权限修改");
}
String canConfigAuth = wikiPageAuthService.canConfigAuth(wikiSpaceSel, pageId, currentUser.getUserId());
if (canConfigAuth != null) {
return DocResponseJson.warn(canConfigAuth);
}
List<String> authNameList = Stream.of(WikiAuthType.values()).map(WikiAuthType::getName).collect(Collectors.toList());
QueryWrapper<AuthInfo> queryWrapper = new QueryWrapper<>();

View File

@@ -14,7 +14,6 @@ import com.zyplayer.doc.data.repository.manage.mapper.WikiPageContentMapper;
import com.zyplayer.doc.data.repository.manage.mapper.WikiPageMapper;
import com.zyplayer.doc.data.repository.manage.param.SearchByEsParam;
import com.zyplayer.doc.data.repository.manage.vo.SpaceNewsVo;
import com.zyplayer.doc.data.repository.support.consts.DocAuthConst;
import com.zyplayer.doc.data.service.elasticsearch.entity.EsWikiPage;
import com.zyplayer.doc.data.service.elasticsearch.service.EsWikiPageService;
import com.zyplayer.doc.data.service.elasticsearch.support.EsPage;
@@ -24,7 +23,7 @@ import com.zyplayer.doc.data.utils.CacheUtil;
import com.zyplayer.doc.wiki.controller.vo.WikiPageContentVo;
import com.zyplayer.doc.wiki.controller.vo.WikiPageVo;
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
import com.zyplayer.doc.wiki.service.WikiPageAuthService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.dozer.Mapper;
@@ -68,6 +67,8 @@ public class WikiPageController {
@Resource
WikiPageMapper wikiPageMapper;
@Resource
WikiPageAuthService wikiPageAuthService;
@Resource
Mapper mapper;
@Autowired(required = false)
EsWikiPageService esWikiPageService;
@@ -133,6 +134,15 @@ public class WikiPageController {
vo.setFileList(pageFiles);
vo.setSelfZan((pageZan != null) ? 1 : 0);
vo.setSelfUserId(currentUser.getUserId());
// 上传附件、编辑、权限设置、删除 的权限
String canEdit = wikiPageAuthService.canEdit(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
String canDelete = wikiPageAuthService.canDelete(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
String canUploadFile = wikiPageAuthService.canUploadFile(wikiSpaceSel, wikiPageSel.getId(), currentUser.getUserId());
String canConfigAuth = wikiPageAuthService.canConfigAuth(wikiSpaceSel, wikiPageSel.getId(), currentUser.getUserId());
vo.setCanEdit((canEdit == null) ? 1 : 0);
vo.setCanDelete((canDelete == null) ? 1 : 0);
vo.setCanUploadFile((canUploadFile == null) ? 1 : 0);
vo.setCanConfigAuth((canConfigAuth == null) ? 1 : 0);
// 高并发下会有覆盖问题,但不重要~
Integer viewNum = Optional.ofNullable(wikiPageSel.getViewNum()).orElse(0);
WikiPage wikiPageUp = new WikiPage();
@@ -149,20 +159,11 @@ public class WikiPageController {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
Long id = wikiPage.getId();
WikiPage wikiPageSel = wikiPageService.getById(id);
if (wikiPageSel == null || Objects.equals(wikiPageSel.getEditType(), 1)) {
return DocResponseJson.warn("当前页面不允许编辑!");
}
// 编辑权限判断
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间不允许调用接口获取文章
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有权限修改该空间的文章!");
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.EDIT_PAGE.getName(), DocAuthConst.WIKI + id);
if (!pageAuth) {
return DocResponseJson.warn("您没有修改该文章的权限!");
}
String canEdit = wikiPageAuthService.canEdit(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
if (canEdit != null) {
return DocResponseJson.warn(canEdit);
}
WikiPage wikiPageUp = new WikiPage();
wikiPageUp.setId(wikiPage.getId());
@@ -178,20 +179,11 @@ public class WikiPageController {
public ResponseJson<Object> delete(Long pageId) {
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
WikiPage wikiPageSel = wikiPageService.getById(pageId);
if (wikiPageSel == null || Objects.equals(wikiPageSel.getEditType(), 1)) {
return DocResponseJson.warn("当前页面不允许编辑!");
}
// 删除权限判断
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间不允许调用接口获取文章
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有权限修改该空间的文章!");
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.DELETE_PAGE.getName(), DocAuthConst.WIKI + pageId);
if (!pageAuth) {
return DocResponseJson.warn("您没有删除该文章的权限!");
}
String canDelete = wikiPageAuthService.canDelete(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
if (canDelete != null) {
return DocResponseJson.warn(canDelete);
}
// 执行删除
WikiPage wikiPage = new WikiPage();
@@ -220,20 +212,11 @@ public class WikiPageController {
Long pageId = wikiPage.getId();
if (pageId != null && pageId > 0) {
WikiPage wikiPageSel = wikiPageService.getById(pageId);
if (wikiPageSel == null || Objects.equals(wikiPageSel.getEditType(), 1)) {
return DocResponseJson.warn("当前页面不允许编辑!");
}
// 编辑权限判断
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间不允许调用接口获取文章
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有权限修改该空间的文章!");
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.EDIT_PAGE.getName(), DocAuthConst.WIKI + pageId);
if (!pageAuth) {
return DocResponseJson.warn("您没有修改该文章的权限!");
}
String canEdit = wikiPageAuthService.canEdit(wikiSpaceSel, wikiPageSel.getEditType(), wikiPageSel.getId(), currentUser.getUserId());
if (canEdit != null) {
return DocResponseJson.warn(canEdit);
}
wikiPage.setSpaceId(null);
wikiPage.setEditType(null);
@@ -250,6 +233,9 @@ public class WikiPageController {
wikiPageContentService.update(pageContent, wrapper);
} else {
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPage.getSpaceId());
if (wikiSpaceSel == null) {
return DocResponseJson.warn("未找到指定的空间!");
}
// 空间不是自己的
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有权限新增该空间的文章!");

View File

@@ -8,12 +8,10 @@ import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.repository.support.consts.DocAuthConst;
import com.zyplayer.doc.data.service.manage.WikiPageFileService;
import com.zyplayer.doc.data.service.manage.WikiPageService;
import com.zyplayer.doc.data.service.manage.WikiSpaceService;
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
import com.zyplayer.doc.wiki.service.WikiPageAuthService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
@@ -41,6 +39,8 @@ public class WikiPageFileController {
WikiSpaceService wikiSpaceService;
@Resource
WikiPageService wikiPageService;
@Resource
WikiPageAuthService wikiPageAuthService;
// @PostMapping("/list")
// public ResponseJson<List<WikiPageFile>> list(WikiPageFile wikiPageFile) {
@@ -70,16 +70,10 @@ public class WikiPageFileController {
}
WikiPage wikiPageSel = wikiPageService.getById(pageId);
WikiSpace wikiSpaceSel = wikiSpaceService.getById(wikiPageSel.getSpaceId());
// 私人空间
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
return DocResponseJson.warn("您没有该空间的文件上传权限!");
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUser.getUserId(), wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_FILE_UPLOAD.getName(), DocAuthConst.WIKI + pageId);
if (!pageAuth) {
return DocResponseJson.warn("您没有修改该文章附件的权限!");
}
// 权限判断
String canUploadFile = wikiPageAuthService.canUploadFile(wikiSpaceSel, pageId, currentUser.getUserId());
if (canUploadFile != null) {
return DocResponseJson.warn(canUploadFile);
}
if (id != null && id > 0) {
wikiPageFile.setUpdateUserId(currentUser.getUserId());

View File

@@ -12,6 +12,10 @@ public class WikiPageContentVo {
private List<WikiPageFile> fileList;
private Integer selfZan;
private Long selfUserId;
private Integer canEdit;
private Integer canDelete;
private Integer canUploadFile;
private Integer canConfigAuth;
public WikiPage getWikiPage() {
return wikiPage;
@@ -52,4 +56,36 @@ public class WikiPageContentVo {
public void setSelfUserId(Long selfUserId) {
this.selfUserId = selfUserId;
}
public Integer getCanEdit() {
return canEdit;
}
public void setCanEdit(Integer canEdit) {
this.canEdit = canEdit;
}
public Integer getCanDelete() {
return canDelete;
}
public void setCanDelete(Integer canDelete) {
this.canDelete = canDelete;
}
public Integer getCanConfigAuth() {
return canConfigAuth;
}
public void setCanConfigAuth(Integer canConfigAuth) {
this.canConfigAuth = canConfigAuth;
}
public Integer getCanUploadFile() {
return canUploadFile;
}
public void setCanUploadFile(Integer canUploadFile) {
this.canUploadFile = canUploadFile;
}
}

View File

@@ -0,0 +1,107 @@
package com.zyplayer.doc.wiki.service;
import com.zyplayer.doc.data.config.security.DocUserUtil;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.repository.support.consts.DocAuthConst;
import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Service
public class WikiPageAuthService {
/**
* 是否具有编辑权限
* @param wikiSpaceSel
* @param editType
* @param pageId
* @param currentUserId
* @return
*/
public String canEdit(WikiSpace wikiSpaceSel, Integer editType, Long pageId, Long currentUserId) {
if (wikiSpaceSel == null || Objects.equals(editType, 1)) {
return "当前页面不允许编辑!";
}
// 私人空间不允许调用接口获取文章
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
return "您没有权限修改该空间的文章!";
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.EDIT_PAGE.getName(), DocAuthConst.WIKI + pageId);
if (!pageAuth) {
return "您没有修改该文章的权限!";
}
}
return null;
}
/**
* 是否具有权限编辑权限
* @param wikiSpaceSel
* @param pageId
* @param currentUserId
* @return
*/
public String canConfigAuth(WikiSpace wikiSpaceSel, Long pageId, Long currentUserId) {
if (!SpaceType.isPersonal(wikiSpaceSel.getType())) {
return "只有个人空间才可以编辑权限";
}
if (!Objects.equals(currentUserId, wikiSpaceSel.getCreateUserId())) {
if (!DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_AUTH_MANAGE.getName(), DocAuthConst.WIKI + pageId)) {
return "您不是创建人或没有权限修改";
}
}
return null;
}
/**
* 是否具有附件上传权限
* @param wikiSpaceSel
* @param pageId
* @param currentUserId
* @return
*/
public String canUploadFile(WikiSpace wikiSpaceSel, Long pageId, Long currentUserId) {
// 私人空间
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
return "您没有该空间的文件上传权限!";
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.PAGE_FILE_UPLOAD.getName(), DocAuthConst.WIKI + pageId);
if (!pageAuth) {
return "您没有修改该文章附件的权限!";
}
}
return null;
}
/**
* 是否具有删除权限
* @param wikiSpaceSel
* @param editType
* @param pageId
* @param currentUserId
* @return
*/
public String canDelete(WikiSpace wikiSpaceSel, Integer editType, Long pageId, Long currentUserId) {
if (wikiSpaceSel == null || Objects.equals(editType, 1)) {
return "当前页面不允许编辑!";
}
// 私人空间不允许调用接口获取文章
if (SpaceType.isOthersPrivate(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
return "您没有权限修改该空间的文章!";
}
// 空间不是自己的,也没有权限
if (SpaceType.isOthersPersonal(wikiSpaceSel.getType(), currentUserId, wikiSpaceSel.getCreateUserId())) {
boolean pageAuth = DocUserUtil.haveCustomAuth(WikiAuthType.DELETE_PAGE.getName(), DocAuthConst.WIKI + pageId);
if (!pageAuth) {
return "您没有删除该文章的权限!";
}
}
return null;
}
}

View File

@@ -1 +0,0 @@
body,html{margin:0;padding:0}#app,.el-container,.el-menu,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}#app[data-v-3c4b46a4],body[data-v-3c4b46a4],html[data-v-3c4b46a4]{margin:0;padding:0;height:100%}pre[data-v-3c4b46a4]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-3c4b46a4]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-3c4b46a4]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-3c4b46a4]{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-3c4b46a4]{margin-right:3px}.logo[data-v-3c4b46a4]{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-3c4b46a4]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-3c4b46a4]:hover{color:#ccc}.wiki-title[data-v-3c4b46a4]{font-size:20px;text-align:center}.wiki-author[data-v-3c4b46a4]{font-size:14px;color:#888;padding:20px 0;height:40px;line-height:40px}.wiki-content[data-v-3c4b46a4]{font-size:14px}.wiki-content.w-e-text[data-v-3c4b46a4]{overflow-y:auto}.upload-page-file .el-upload-list[data-v-3c4b46a4]{display:none}.is-link[data-v-3c4b46a4]{color:#1e88e5;cursor:pointer}#newPageContentDiv .w-e-text-container[data-v-3c4b46a4]{height:600px!important}.comment-box .head[data-v-3c4b46a4]{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-3c4b46a4]{position:fixed;bottom:0;left:0;background:#fafafa;width:280px;text-align:center;padding:5px 0;color:#aaa;font-size:12px}.build-info span[data-v-3c4b46a4]{color:#4183c4;cursor:pointer}pre.json[data-v-3c4b46a4]{display:block;padding:9.5px;margin:0 0 0 10px;font-size:12px;line-height:1.38461538;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre.json .canvas[data-v-3c4b46a4]{font:10pt georgia;background-color:#ececec;color:#000;border:1px solid #cecece}pre.json .object-brace[data-v-3c4b46a4]{color:#0a0;font-weight:700}pre.json .array-brace[data-v-3c4b46a4]{color:#03f;font-weight:700}pre.json .property-name[data-v-3c4b46a4]{color:#c00;font-weight:700}pre.json .string[data-v-3c4b46a4]{color:#077}pre.json .number[data-v-3c4b46a4]{color:#a0a}pre.json .boolean[data-v-3c4b46a4]{color:#00f}pre.json .function[data-v-3c4b46a4]{color:#a63;text-decoration:initial}pre.json .null[data-v-3c4b46a4]{color:#00f}pre.json .comma[data-v-3c4b46a4]{color:#000;font-weight:700}pre.json .annotation[data-v-3c4b46a4]{color:#aaa}pre img[data-v-3c4b46a4]{cursor:pointer}

View File

@@ -0,0 +1 @@
body,html{margin:0;padding:0}#app,.el-container,.el-menu,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}#app[data-v-3799a29f],body[data-v-3799a29f],html[data-v-3799a29f]{margin:0;padding:0;height:100%}pre[data-v-3799a29f]{margin:0;white-space:pre-wrap;font-size:14px;font-family:auto}.el-menu[data-v-3799a29f]{-webkit-box-sizing:border-box;box-sizing:border-box;border-right:0;margin-right:3px}.el-header[data-v-3799a29f]{background-color:#409eff;color:#333;line-height:40px;text-align:right;height:40px!important}.doc-body-box[data-v-3799a29f]{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-3799a29f]{margin-right:3px}.logo[data-v-3799a29f]{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-3799a29f]{float:left;font-size:25px;color:#aaa;cursor:pointer;position:fixed}.icon-collapse[data-v-3799a29f]:hover{color:#ccc}.comment-box .head[data-v-3799a29f]{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-3799a29f]{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-3799a29f]{color:#4183c4;cursor:pointer}

View File

@@ -0,0 +1 @@
.page-share-view-vue .wiki-title{font-size:20px;text-align:center}.page-share-view-vue .wiki-author{font-size:14px;color:#888;padding:20px 0;height:40px;line-height:40px}.page-share-view-vue .wiki-content{font-size:14px}.page-share-view-vue .wiki-content.w-e-text{overflow-y:auto}.page-share-view-vue .upload-page-file .el-upload-list{display:none}.page-share-view-vue .is-link{color:#1e88e5;cursor:pointer}

View File

@@ -0,0 +1 @@
.page-share-home-vue .empty-news{text-align:center;padding:100px}.page-share-home-vue .text-link{color:#444}.page-share-home-vue .line-box{color:#666;border-bottom:1px solid #eee;padding:20px 0}.page-share-home-vue .line-title{font-size:14px}.page-share-home-vue .page-preview-title{cursor:pointer;font-size:20px;margin:10px 0 5px 0;color:#3a8ee6}.page-share-home-vue .page-preview-content{font-size:16px;margin-bottom:5px}.page-share-home-vue .zan-img{vertical-align:middle;margin-top:-3px}.page-share-home-vue .view-img{font-size:16px;color:#666}.page-share-home-vue .page-info-box{text-align:right;margin:20px 0 50px 0}

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-0741282a.1750663f.css rel=prefetch><link href=css/chunk-2e5083a6.33baba58.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-578eb6fe.83c6d32d.css rel=prefetch><link href=css/chunk-5a43323e.aed19865.css rel=prefetch><link href=css/chunk-9ece0f4a.17d2b8a1.css rel=prefetch><link href=js/chunk-0741282a.586dcd09.js rel=prefetch><link href=js/chunk-2d0d3313.da1cb9ae.js rel=prefetch><link href=js/chunk-2d207ece.d3a941b6.js rel=prefetch><link href=js/chunk-2e5083a6.89a2aabb.js rel=prefetch><link href=js/chunk-32cc5643.85244eab.js rel=prefetch><link href=js/chunk-34407190.c8b9bcc8.js rel=prefetch><link href=js/chunk-578eb6fe.fb5f2eee.js rel=prefetch><link href=js/chunk-5a43323e.ed2ce530.js rel=prefetch><link href=js/chunk-9ece0f4a.3c0e04aa.js rel=prefetch><link href=css/app.791405b2.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.6502b528.js rel=preload as=script><link href=js/chunk-vendors.151c7031.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.791405b2.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.151c7031.js></script><script src=js/app.6502b528.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-0741282a.1750663f.css rel=prefetch><link href=css/chunk-27da65ce.aed19865.css rel=prefetch><link href=css/chunk-2e5083a6.33baba58.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-578eb6fe.83c6d32d.css rel=prefetch><link href=css/chunk-5dc97978.ec6236ec.css rel=prefetch><link href=css/chunk-b30fa2e0.b3d0f39b.css rel=prefetch><link href=js/chunk-009efa60.7edbb586.js rel=prefetch><link href=js/chunk-0741282a.586dcd09.js rel=prefetch><link href=js/chunk-27da65ce.a8a04d17.js rel=prefetch><link href=js/chunk-2d207ece.d3a941b6.js rel=prefetch><link href=js/chunk-2e5083a6.fdc68a2c.js rel=prefetch><link href=js/chunk-32cc5643.85244eab.js rel=prefetch><link href=js/chunk-34407190.43641165.js rel=prefetch><link href=js/chunk-578eb6fe.66e91fc4.js rel=prefetch><link href=js/chunk-5dc97978.d4e7d013.js rel=prefetch><link href=js/chunk-b30fa2e0.99339dd4.js rel=prefetch><link href=css/app.9315bc19.css rel=preload as=style><link href=css/chunk-vendors.43fc3011.css rel=preload as=style><link href=js/app.11449e0c.js rel=preload as=script><link href=js/chunk-vendors.2a8b20de.js rel=preload as=script><link href=css/chunk-vendors.43fc3011.css rel=stylesheet><link href=css/app.9315bc19.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.2a8b20de.js></script><script src=js/app.11449e0c.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

View File

@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-009efa60"],{a190:function(e,a,t){},da3f:function(e,a,t){"use strict";var i=t("a190"),s=t.n(i);s.a},f33f:function(e,a,t){"use strict";t.r(a);var i=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"page-share-view-vue"},[t("el-row",{attrs:{type:"border-card"}},[t("div",{staticStyle:{"max-width":"950px",margin:"0 auto"}},[t("div",{staticClass:"wiki-title"},[e._v(e._s(e.wikiPage.name))]),t("div",{staticClass:"wiki-author"},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.wikiPage.updateTime,expression:"!wikiPage.updateTime"}]},[e._v("创建时间:"+e._s(e.wikiPage.createTime))]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.wikiPage.updateTime,expression:"wikiPage.updateTime"}]},[e._v("最后修改:"+e._s(e.wikiPage.updateTime))])]),t("div",{staticClass:"wiki-files"},[t("el-table",{directives:[{name:"show",rawName:"v-show",value:e.pageFileList.length>0,expression:"pageFileList.length > 0"}],staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.pageFileList,border:""}},[t("el-table-column",{attrs:{label:"文件名"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("a",{attrs:{target:"_blank",href:a.row.fileUrl}},[e._v(e._s(a.row.fileName))])]}}])}),t("el-table-column",{attrs:{prop:"createTime",label:"创建时间",width:"180px"}}),t("el-table-column",{attrs:{prop:"downloadNum",label:"下载次数",width:"80px"}})],1)],1),t("div",{staticClass:"wiki-content w-e-text"},[t("div",{domProps:{innerHTML:e._s(e.pageContent.content)}})])])])],1)},s=[],n=(t("b0c0"),t("0a79")),o={data:function(){return{spaceUuid:"",nowPageId:"",wikiPage:{},pageContent:{},pageFileList:[]}},beforeRouteUpdate:function(e,a,t){this.initQueryParam(e),t()},mounted:function(){this.initQueryParam(this.$route)},methods:{loadPageDetail:function(e){var a=this,t={pageId:e,space:this.spaceUuid};n["a"].openPageDetail(t).then((function(e){var t=e.data.wikiPage||{};t.selfZan=e.data.selfZan||0,a.wikiPage=t,a.pageContent=e.data.pageContent||{},a.pageFileList=e.data.fileList||[],document.title=t.name||"WIKI-内容展示"}))},initQueryParam:function(e){this.spaceUuid=e.query.space,this.nowPageId=e.query.pageId,this.nowPageId&&this.loadPageDetail(this.nowPageId)}}},l=o,r=(t("da3f"),t("2877")),d=Object(r["a"])(l,i,s,!1,null,null,null);a["default"]=d.exports}}]);

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d3313"],{"5c5d":function(e,n,t){"use strict";t.r(n);var u=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"page-open-view-vue"})},o=[],c={data:function(){return{}},beforeRouteUpdate:function(e,n,t){},mounted:function(){},methods:{}},a=c,i=t("2877"),s=Object(i["a"])(a,u,o,!1,null,null,null);n["default"]=s.exports}}]);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5dc97978"],{"68aa":function(e,a,t){"use strict";var s=t("a99d"),i=t.n(s);i.a},"6c9a":function(e,a){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAqFBMVEX///9wcHBwcHBwcHBwcHB8fHxwcHB6enpwcHCDg4NwcHB8fHx6enqSkpJ8fHxycnJwcHDp6el2dnZwcHD////39/f19fXz8/Pw8PDr6+vn5+fj4+PZ2dnX19fHx8fExMS9vb20tLSrq6uhoaGenp6MjIyKioqDg4N8fHx6enp4eHh0dHRycnKZmZmOjo6KioqDg4OAgIB/f396enp4eHh2dnZycnJwcHDyRjyJAAAALXRSTlMAETNEVWZmd3eIiJmqu7u7u93d3e7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u6OCyV0AAAAi0lEQVQYGXXBRwKCMBAF0B9Q7Io6RJGo2LAEu8zc/2YuyCILfQ/4R8k5gK+zy0v4TilZeAZb2rTCSMHp3bV+jeJpDEDFIvagSRtNJAro2vHjSo4owOYzNlTTAoDnGZNjLABOFkzOagigWiecUW3fBNB/L5+33GgiSksFQE1YPkUlciwuETxhox3ghy8Wng9K1E9YIwAAAABJRU5ErkJggg=="},"6d37":function(e,a,t){"use strict";t.r(a);var s=function(){var e=this,a=e.$createElement,s=e._self._c||a;return s("div",{staticClass:"page-share-home-vue",staticStyle:{padding:"10px"}},[s("div",{staticStyle:{"max-width":"800px",margin:"0 auto"}},[e.spacePageNews.length<=0?s("div",{staticClass:"empty-news"},[e._v("暂无数据")]):e._l(e.spacePageNews,(function(a){return s("div",{staticClass:"line-box"},[s("div",{staticClass:"line-title"},[s("span",{staticClass:"text-link"},[e._v(e._s(a.createUserName))]),e._v(" 发布于 "),s("span",{staticClass:"text-link"},[e._v(e._s(a.spaceName))])]),s("div",{staticClass:"page-preview-box"},[s("div",{staticClass:"page-preview-title",domProps:{innerHTML:e._s(a.pageTitle)},on:{click:function(t){return e.showPageDetail(a)}}}),s("div",{staticClass:"page-preview-content",domProps:{innerHTML:e._s(a.previewContent)}}),s("div",[s("span",[s("img",{staticClass:"zan-img",attrs:{src:t("6c9a")}}),e._v(" "+e._s(a.zanNum)+" ")]),s("span",[s("i",{staticClass:"el-icon-view view-img"}),e._v(" "+e._s(a.viewNum)+" ")]),s("span",[e._v(e._s(a.updateTime||a.createTime))])])])])})),s("div",{staticClass:"page-info-box"},[s("el-pagination",{attrs:{"page-sizes":[20,50,100],"page-size":20,"current-page":e.searchParam.pageNum,layout:"prev, pager, next, jumper, sizes, total",total:e.totalCount},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],2)])},i=[],n=t("0a79"),c={data:function(){return{totalCount:0,searchParam:{spaceId:"",newsType:1,pageNum:1,pageSize:20},spacePageNews:[]}},beforeRouteUpdate:function(e,a,t){this.initQueryParam(e),t()},mounted:function(){this.initQueryParam(this.$route)},methods:{getSpacePageNews:function(){var e=this;n["a"].openPageNews(this.searchParam).then((function(a){e.spacePageNews=a.data||[],e.totalCount=a.total}))},handleSizeChange:function(e){this.searchParam.pageSize=e,this.getSpacePageNews()},showPageDetail:function(e){this.nowClickPath={space:e.space,pageId:e.pageId},this.$router.push({path:"/page/share/view",query:this.nowClickPath})},handleCurrentChange:function(e){this.searchParam.pageNum=e,this.getSpacePageNews()},initQueryParam:function(e){this.searchParam={space:e.query.space,newsType:1,pageNum:1,pageSize:20},this.searchParam.space&&this.getSpacePageNews()}}},u=c,r=(t("68aa"),t("2877")),p=Object(r["a"])(u,s,i,!1,null,null,null);a["default"]=p.exports},a99d:function(e,a,t){}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long