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 08b1e307..90b9c5bd 100644 --- a/zyplayer-doc-ui/wiki-ui/src/components/layouts/GlobalLayout.vue +++ b/zyplayer-doc-ui/wiki-ui/src/components/layouts/GlobalLayout.vue @@ -24,15 +24,22 @@
- 空间目录 - - - + 空间目录 + + + @@ -55,24 +62,36 @@ @node-expand="handleNodeExpand" @node-drop="handlePageDrop"> @@ -212,6 +231,9 @@ let userMessagePopVisible = ref(false); let userMsgTotalCount = ref(0); let userMsgParam = ref({sysType: 2, pageNum: 1, pageSize: 20,}); let rightAsideWidth = ref(300); +let optionStatus = ref(false); +let optionPageId = ref(''); +let optionLock = ref(false); onMounted(() => { loadSpaceList() @@ -222,6 +244,32 @@ const loadPageList = (param) => { param = param || {} doGetPageList(param.parentId, param.node) } +const pageInfoLock = () => { + optionLock.value = true +} +const pageInfoUnlock = (keepLock) => { + console.log(optionLock.value) + if (optionLock.value === true){ + if (!keepLock){ + optionLock.value = false + } + return true + } + return false +} +const changeNodeOptionStatus = (param,type) => { + if (type > 0){ + optionPageId.value = param.id + optionStatus.value = true + } + if (type < 0 ){ + optionPageId.value = param.id + optionStatus.value = false + } + if (type === 0 && optionPageId.value === param.id && optionStatus.value){ + return true + } +} const turnLeftCollapse = () => { leftCollapse.value = !leftCollapse.value setTimeout(() => { @@ -237,8 +285,10 @@ const turnLeftCollapse = () => { nowPageId.value = 0 } if (choiceSpace.value > 0) { - pageApi.updatePage({spaceId: choiceSpace.value,parentId: nowPageId.value,editorType:editorType,name:'未命名',content:'',preview:''}) + pageApi.updatePage({spaceId: choiceSpace.value,parentId: nowPageId.value,editorType:editorType,name:'新建文档',content:'',preview:''}) .then((json) => { + doGetPageList(null) + ElMessage.success('创建成功') router.push({ path: '/page/edit', query: {parentId: nowPageId.value, pageId: json.data.id} @@ -281,12 +331,18 @@ const searchByKeywordsNewPage = () => { window.open(routeUrl.href, '_blank') } const handleNodeClick = (data) => { - // console.log('点击节点:', data, nowPageId.value) + //console.log('点击节点:', data, nowPageId.value) + if (pageInfoUnlock()){ + return + } nowPageId.value = data.id router.push({path: '/page/show', query: {pageId: data.id}}) handleNodeExpand(data) } const handleNodeExpand = (node) => { + if (pageInfoUnlock(true)){ + return + } if ( node.children && node.children.length > 0 && @@ -297,6 +353,9 @@ const handleNodeExpand = (node) => { } } const handlePageDrop = (draggingNode, dropNode, dropType, ev) => { + if (pageInfoUnlock(true)){ + return + } console.log('tree drop: ', draggingNode.data, dropNode.data, dropType) // 'prev'、'inner'、'next' // before、after、inner 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 a7a076c8..bfb99329 100644 --- a/zyplayer-doc-ui/wiki-ui/src/views/page/Edit.vue +++ b/zyplayer-doc-ui/wiki-ui/src/views/page/Edit.vue @@ -1,37 +1,19 @@