From 1abcc4f92e9d5b1bedf55b98a534b36d7eb3951e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=AE=E5=85=89=EF=BC=9A=E5=9F=8E=E4=B8=AD=E5=9F=8E?= <806783409@qq.com> Date: Tue, 16 Jun 2020 23:13:27 +0800 Subject: [PATCH] =?UTF-8?q?#I1KQUK=20=E5=BC=80=E6=94=BE=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E7=9C=8B=E7=BC=96=E8=BE=91=E9=A1=B5?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=8F=8Aurl=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E6=9D=83=E9=99=90=E6=97=B6=E4=B8=8D=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/manage/vo/SpaceNewsVo.java | 9 + zyplayer-doc-ui/wiki-ui/.env.development | 4 +- .../wiki-ui/src/common/api/page.js | 9 +- .../src/components/layouts/GlobalLayout.vue | 85 ++---- .../src/components/layouts/OpenLayout.vue | 244 ------------------ .../src/components/layouts/ShareLayout.vue | 131 ++++++++++ zyplayer-doc-ui/wiki-ui/src/main.js | 1 - zyplayer-doc-ui/wiki-ui/src/routes.js | 5 +- .../wiki-ui/src/store/modules/global.js | 4 - .../wiki-ui/src/views/page/Edit.vue | 80 +++--- .../wiki-ui/src/views/page/OpenView.vue | 24 -- .../wiki-ui/src/views/page/Show.vue | 54 ++-- .../wiki-ui/src/views/page/share/Home.vue | 106 ++++++++ .../wiki-ui/src/views/page/share/View.vue | 84 ++++++ .../controller/WikiOpenApiController.java | 86 ++++-- .../controller/WikiPageAuthController.java | 13 +- .../wiki/controller/WikiPageController.java | 68 ++--- .../controller/WikiPageFileController.java | 20 +- .../wiki/controller/vo/WikiPageContentVo.java | 36 +++ .../doc/wiki/service/WikiPageAuthService.java | 107 ++++++++ .../src/main/resources/css/app.791405b2.css | 1 - .../src/main/resources/css/app.9315bc19.css | 1 + .../resources/css/chunk-009efa60.c1509684.css | 1 + ...d19865.css => chunk-27da65ce.aed19865.css} | 0 .../resources/css/chunk-5dc97978.ec6236ec.css | 1 + ...d2b8a1.css => chunk-b30fa2e0.b3d0f39b.css} | 0 .../src/main/resources/doc-wiki.html | 2 +- .../src/main/resources/js/app.11449e0c.js | 1 + .../src/main/resources/js/app.6502b528.js | 1 - .../resources/js/chunk-009efa60.7edbb586.js | 1 + .../resources/js/chunk-27da65ce.a8a04d17.js | 1 + .../resources/js/chunk-2d0d3313.da1cb9ae.js | 1 - ...89a2aabb.js => chunk-2e5083a6.fdc68a2c.js} | 2 +- ...c8b9bcc8.js => chunk-34407190.43641165.js} | 0 ...fb5f2eee.js => chunk-578eb6fe.66e91fc4.js} | 0 .../resources/js/chunk-5a43323e.ed2ce530.js | 1 - .../resources/js/chunk-5dc97978.d4e7d013.js | 1 + ...3c0e04aa.js => chunk-b30fa2e0.99339dd4.js} | 6 +- .../resources/js/chunk-vendors.151c7031.js | 40 --- .../resources/js/chunk-vendors.2a8b20de.js | 40 +++ 40 files changed, 737 insertions(+), 534 deletions(-) delete mode 100644 zyplayer-doc-ui/wiki-ui/src/components/layouts/OpenLayout.vue create mode 100644 zyplayer-doc-ui/wiki-ui/src/components/layouts/ShareLayout.vue delete mode 100644 zyplayer-doc-ui/wiki-ui/src/views/page/OpenView.vue create mode 100644 zyplayer-doc-ui/wiki-ui/src/views/page/share/Home.vue create mode 100644 zyplayer-doc-ui/wiki-ui/src/views/page/share/View.vue create mode 100644 zyplayer-doc-wiki/src/main/java/com/zyplayer/doc/wiki/service/WikiPageAuthService.java delete mode 100644 zyplayer-doc-wiki/src/main/resources/css/app.791405b2.css create mode 100644 zyplayer-doc-wiki/src/main/resources/css/app.9315bc19.css create mode 100644 zyplayer-doc-wiki/src/main/resources/css/chunk-009efa60.c1509684.css rename zyplayer-doc-wiki/src/main/resources/css/{chunk-5a43323e.aed19865.css => chunk-27da65ce.aed19865.css} (100%) create mode 100644 zyplayer-doc-wiki/src/main/resources/css/chunk-5dc97978.ec6236ec.css rename zyplayer-doc-wiki/src/main/resources/css/{chunk-9ece0f4a.17d2b8a1.css => chunk-b30fa2e0.b3d0f39b.css} (100%) create mode 100644 zyplayer-doc-wiki/src/main/resources/js/app.11449e0c.js delete mode 100644 zyplayer-doc-wiki/src/main/resources/js/app.6502b528.js create mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-009efa60.7edbb586.js create mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-27da65ce.a8a04d17.js delete mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-2d0d3313.da1cb9ae.js rename zyplayer-doc-wiki/src/main/resources/js/{chunk-2e5083a6.89a2aabb.js => chunk-2e5083a6.fdc68a2c.js} (93%) rename zyplayer-doc-wiki/src/main/resources/js/{chunk-34407190.c8b9bcc8.js => chunk-34407190.43641165.js} (100%) rename zyplayer-doc-wiki/src/main/resources/js/{chunk-578eb6fe.fb5f2eee.js => chunk-578eb6fe.66e91fc4.js} (100%) delete mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-5a43323e.ed2ce530.js create mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-5dc97978.d4e7d013.js rename zyplayer-doc-wiki/src/main/resources/js/{chunk-9ece0f4a.3c0e04aa.js => chunk-b30fa2e0.99339dd4.js} (76%) delete mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-vendors.151c7031.js create mode 100644 zyplayer-doc-wiki/src/main/resources/js/chunk-vendors.2a8b20de.js diff --git a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/vo/SpaceNewsVo.java b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/vo/SpaceNewsVo.java index 76f0692d..eeec4fd6 100644 --- a/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/vo/SpaceNewsVo.java +++ b/zyplayer-doc-data/src/main/java/com/zyplayer/doc/data/repository/manage/vo/SpaceNewsVo.java @@ -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; + } } diff --git a/zyplayer-doc-ui/wiki-ui/.env.development b/zyplayer-doc-ui/wiki-ui/.env.development index fb7181ed..58e9a01d 100644 --- a/zyplayer-doc-ui/wiki-ui/.env.development +++ b/zyplayer-doc-ui/wiki-ui/.env.development @@ -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 diff --git a/zyplayer-doc-ui/wiki-ui/src/common/api/page.js b/zyplayer-doc-ui/wiki-ui/src/common/api/page.js index ff3ca136..47a193d1 100644 --- a/zyplayer-doc-ui/wiki-ui/src/common/api/page.js +++ b/zyplayer-doc-ui/wiki-ui/src/common/api/page.js @@ -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)}); }, diff --git a/zyplayer-doc-ui/wiki-ui/src/components/layouts/GlobalLayout.vue b/zyplayer-doc-ui/wiki-ui/src/components/layouts/GlobalLayout.vue index 4600f272..89b116d2 100644 --- a/zyplayer-doc-ui/wiki-ui/src/components/layouts/GlobalLayout.vue +++ b/zyplayer-doc-ui/wiki-ui/src/components/layouts/GlobalLayout.vue @@ -4,7 +4,7 @@
- + @@ -47,7 +47,8 @@ + @switchSpace="switchSpacePage" + :spaceId="choiceSpace"> @@ -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); }, } diff --git a/zyplayer-doc-ui/wiki-ui/src/components/layouts/OpenLayout.vue b/zyplayer-doc-ui/wiki-ui/src/components/layouts/OpenLayout.vue deleted file mode 100644 index 170d293f..00000000 --- a/zyplayer-doc-ui/wiki-ui/src/components/layouts/OpenLayout.vue +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - diff --git a/zyplayer-doc-ui/wiki-ui/src/components/layouts/ShareLayout.vue b/zyplayer-doc-ui/wiki-ui/src/components/layouts/ShareLayout.vue new file mode 100644 index 00000000..ac42eaa7 --- /dev/null +++ b/zyplayer-doc-ui/wiki-ui/src/components/layouts/ShareLayout.vue @@ -0,0 +1,131 @@ + + + + + + diff --git a/zyplayer-doc-ui/wiki-ui/src/main.js b/zyplayer-doc-ui/wiki-ui/src/main.js index 35e7f4a2..ee5aff80 100644 --- a/zyplayer-doc-ui/wiki-ui/src/main.js +++ b/zyplayer-doc-ui/wiki-ui/src/main.js @@ -22,7 +22,6 @@ router.beforeEach((to, from, next) => { if (to.name) { document.title = to.name; } - store.commit('global/setFullscreen', !!to.meta.fullscreen); next(); }); diff --git a/zyplayer-doc-ui/wiki-ui/src/routes.js b/zyplayer-doc-ui/wiki-ui/src/routes.js index 2f6a725b..50844a12 100644 --- a/zyplayer-doc-ui/wiki-ui/src/routes.js +++ b/zyplayer-doc-ui/wiki-ui/src/routes.js @@ -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')}, ] } ]; diff --git a/zyplayer-doc-ui/wiki-ui/src/store/modules/global.js b/zyplayer-doc-ui/wiki-ui/src/store/modules/global.js index 0f24741d..847cd976 100644 --- a/zyplayer-doc-ui/wiki-ui/src/store/modules/global.js +++ b/zyplayer-doc-ui/wiki-ui/src/store/modules/global.js @@ -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; - }, } } diff --git a/zyplayer-doc-ui/wiki-ui/src/views/page/Edit.vue b/zyplayer-doc-ui/wiki-ui/src/views/page/Edit.vue index 006cc124..e8460d02 100644 --- a/zyplayer-doc-ui/wiki-ui/src/views/page/Edit.vue +++ b/zyplayer-doc-ui/wiki-ui/src/views/page/Edit.vue @@ -1,11 +1,8 @@