文档展示样式优化

This commit is contained in:
sswiki
2023-09-26 19:53:51 +08:00
parent 75577350ba
commit 252d8d23e1
10 changed files with 90 additions and 81 deletions

View File

@@ -9,7 +9,7 @@
<el-header v-if="storeDisplay.showHeader">
<RightHeader ref="rightHeaderRef"/>
</el-header>
<el-main style="padding: 0; border-left: 1px solid #dcdfe6">
<el-main style="padding: 0;">
<router-view/>
</el-main>
</el-container>

View File

@@ -57,9 +57,6 @@
<a-menu-item @click="rename(node,data)">
<IconParkEditTwo class="el-icon"/> 重命名
</a-menu-item>
<a-menu-item @click="deleteWikiPage(data.shareStatus)">
<IconParkDelete class="el-icon"/> 删除
</a-menu-item>
<a-sub-menu title="移动文档">
<template #icon><IconParkIntersection/></template>
<a-menu-item @click="openMoveMenu(false)">
@@ -72,6 +69,9 @@
<a-menu-item v-if="data.editorType !== 0" @click="openTemplateCreate(data.shareStatus !== undefined)">
<IconParkPageTemplate/> 设为模板
</a-menu-item>
<a-menu-item @click="deleteWikiPage(data.shareStatus)">
<IconParkDelete class="el-icon"/> 删除
</a-menu-item>
</a-menu>
</template>
</a-dropdown>

View File

@@ -6,7 +6,7 @@
<el-button @click="turnLeftCollapse" v-if="storeDisplay.showMenu" text :icon="ElIconFold" class="fold-btn"></el-button>
<el-button @click="turnLeftCollapse" v-else text :icon="ElIconExpand" class="fold-btn"></el-button>
</div>
<div class="title-time-box">
<div v-if="storeDisplay.currentPage === 'view'" class="title-time-box">
<div class="title">
<span class="text">{{storePage.pageInfo.name || ''}}</span>
</div>
@@ -16,36 +16,38 @@
</el-col>
<el-col :span="12" style="text-align: right;">
<div class="header-action-box">
<el-tooltip v-if="storePage.pageAuth.canEdit === 1" content="编辑文档">
<el-button class="hover-button" @click="editWiki" text><IconParkEdit size="18"/></el-button>
</el-tooltip>
<el-tooltip content="文档沟通">
<el-button class="hover-button" @click="showCommentWiki" text><IconParkCommunication size="18"/></el-button>
</el-tooltip>
<UserMessagePopover/>
<a-dropdown trigger="click" placement="bottom" overlayClassName="header-action-more-dropdown">
<span style="line-height: 60px;display:inline-block;margin: 0 12px;">
<template v-if="storeDisplay.currentPage === 'view'">
<el-tooltip v-if="storePage.pageAuth.canEdit === 1" content="编辑文档">
<el-button class="hover-button" @click="editWiki" text><IconParkEdit size="18"/></el-button>
</el-tooltip>
<el-tooltip content="文档沟通">
<el-button class="hover-button" @click="showCommentWiki" text><IconParkCommunication size="18"/></el-button>
</el-tooltip>
<UserMessagePopover/>
<a-dropdown trigger="click" placement="bottom" overlayClassName="header-action-more-dropdown">
<span style="line-height: 60px;display:inline-block;margin: 0 8px;">
<el-button :icon="ElIconMoreFilled" class="hover-button" text></el-button>
</span>
<template #overlay>
<a-menu>
<a-menu-item @click="editWikiAuth" v-if="storePage.pageAuth.canConfigAuth === 1"><el-icon><ElIconSCheck/></el-icon> 权限设置</a-menu-item>
<a-menu-item @click="showOpenPage" v-if="storeSpace.spaceInfo.openDoc === 1"><el-icon><ElIconShare/></el-icon> 查看开放文档</a-menu-item>
<a-menu-item @click="showMobileView" v-if="storeSpace.spaceInfo.openDoc === 1"><el-icon><ElIconMobilePhone/></el-icon> 手机端查看</a-menu-item>
<a-menu-item @click="exportWord"><el-icon><ElIconDownload/></el-icon>导出为Word</a-menu-item>
<a-menu-divider />
<a-menu-item @click="deleteWikiPage" v-if="storePage.pageAuth.canDelete === 1" class="delete"><el-icon><ElIconDelete/></el-icon> 删除</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<template #overlay>
<a-menu>
<a-menu-item @click="editWikiAuth" v-if="storePage.pageAuth.canConfigAuth === 1"><el-icon><ElIconSCheck/></el-icon> 权限设置</a-menu-item>
<a-menu-item @click="showOpenPage" v-if="storeSpace.spaceInfo.openDoc === 1"><el-icon><ElIconShare/></el-icon> 查看开放文档</a-menu-item>
<a-menu-item @click="showMobileView" v-if="storeSpace.spaceInfo.openDoc === 1"><el-icon><ElIconMobilePhone/></el-icon> 手机端查看</a-menu-item>
<a-menu-item @click="exportWord"><el-icon><ElIconDownload/></el-icon>导出为Word</a-menu-item>
<a-menu-divider />
<a-menu-item @click="deleteWikiPage" v-if="storePage.pageAuth.canDelete === 1" class="delete"><el-icon><ElIconDelete/></el-icon> 删除</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</template>
<a-dropdown trigger="click" placement="bottom" overlayClassName="header-action-user-dropdown">
<span style="line-height: 60px;display:inline-block;">
<el-button :icon="ElIconUser" class="hover-button" text></el-button>
<el-button :icon="ElIconUserFilled" class="hover-button" text></el-button>
</span>
<template #overlay>
<a-menu>
<a-menu-item @click="showConsole">控制台</a-menu-item>
<a-menu-item @click="showAbout">关于</a-menu-item>
<a-menu-item @click="showConsole">控制台</a-menu-item>
<a-menu-divider />
<a-menu-item @click="userSignOut">退出登录</a-menu-item>
</a-menu>
@@ -73,7 +75,7 @@ import {
Download as ElIconDownload,
MoreFilled as ElIconMoreFilled,
Setting as ElIconSetting,
User as ElIconUser,
UserFilled as ElIconUserFilled,
} from '@element-plus/icons-vue'
import {
Star as IconParkStar,
@@ -94,11 +96,11 @@ import MobileQrScanDialog from '@/views/page/show/MobileQrScanDialog.vue'
import AboutDialog from "@/views/common/AboutDialog.vue"
import UserMessagePopover from "./UserMessagePopover.vue"
let router = useRouter();
let storePage = useStorePageData();
let storeDisplay = useStoreDisplay();
let storeUser = useStoreUserData();
let storeSpace = useStoreSpaceData();
const emit = defineEmits(['collapse']);
let turnLeftCollapse = () => {

View File

@@ -3,13 +3,13 @@
<el-button :icon="ElIconPlus" text class="add-menu-dropdown-btn"></el-button>
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="createWiki(1,props.funcId)">
<IconDocument fill="#498ba7"/> 创建富文本
<a-menu-item key="1" @click="createWiki(1, props.funcId)">
<IconParkWord fill="#498ba7"/> 创建富文本
</a-menu-item>
<a-menu-item key="2" @click="createWiki(2,props.funcId)">
<IconParkWord fill="#558ff2"/> 创建Markdown
<a-menu-item key="2" @click="createWiki(2, props.funcId)">
<IconDocument fill="#558ff2"/> 创建Markdown
</a-menu-item>
<a-menu-item key="0" @click="createWiki(0,props.funcId)">
<a-menu-item key="0" @click="createWiki(0, props.funcId)">
<FolderOpen fill="#ffd149"/> 创建文件夹
</a-menu-item>
<a-menu-item key="4" @click="createWikiByTemplate(props.funcId)">

View File

@@ -3,7 +3,6 @@
<div style="margin-bottom: 5px">
<el-select :model-value="choiceSpace" filterable placeholder="选择空间" @change="spaceChangeEvents" style="width: 100%">
<el-option-group label="" v-if="!props.readOnly">
<el-option :key="0" label="创建空间" :value="0"></el-option>
<el-option :key="-1" label="空间管理" :value="-1"></el-option>
</el-option-group>
<el-option-group label=""></el-option-group>

View File

@@ -10,7 +10,9 @@ export const useStoreDisplay = defineStore('wikiDisplay', {
commentActiveTab: 'comment',
showMenu: true,
rightAsideWidth: 300,
showHeader:true
showHeader:true,
// 当前页面 view、space
currentPage: '',
}
},
})

View File

@@ -1,26 +1,26 @@
<template>
<div style="height: 100%" class="page-edit-vue">
<el-row class="fake-header">
<el-col :span="1">
<el-col style="flex: 0 0 45px;" class="collapse-box">
<el-button @click="turnLeftCollapse" v-if="storeDisplay.showMenu" text :icon="ElIconFold" class="fold-btn"></el-button>
<el-button @click="turnLeftCollapse" v-else text :icon="ElIconExpand" class="fold-btn"></el-button>
</el-col>
<el-col :span="18" style="text-align: left">
<el-col style="flex: 1 1 auto;">
<el-input v-if="wikiPageEdit.editorType===2" v-model="wikiPageEdit.pageTitle" :maxlength="40" placeholder="请输入标题" class="page-title-input" ></el-input>
</el-col>
<el-col :span="5" class="title-info-view-right">
<el-button type="primary" @click="createWikiSave(1)" size="large" :icon="ElIconDocumentChecked">保存</el-button>
<el-button @click="createWikiCancel" size="large" :icon="ElIconBack" style="margin-right: 5px">取消</el-button>
<el-col style="flex: 0 0 180px;text-align: right;">
<el-button type="primary" @click="createWikiSave(1)" :icon="ElIconDocumentChecked">保存</el-button>
<el-button @click="createWikiCancel" :icon="ElIconBack" style="margin-right: 5px">取消</el-button>
</el-col>
</el-row>
<div style="box-sizing: border-box;background: #f5f5f5;overflow: hidden">
<div v-show="wikiPageEdit.editorType === 2" style="padding: 0 10px 10px 10px; background: #fff">
<div v-show="wikiPageEdit.editorType === 2" style="padding: 10px; background: #fff">
<mavonEditor
ref="mavonEditorRef"
v-model="markdownContent"
:toolbars="toolbars"
:externalLink="false"
style="height: calc(100vh - 155px)"
style="height: calc(100vh - 100px);z-index: 1;"
@save="createWikiSave(0)"
@imgAdd="addMarkdownImage"
placeholder="请录入文档内容"
@@ -312,33 +312,44 @@ const initEditor = () => {
}
</style>
<style lang="scss" scoped>
.fake-header{
color: #333;
height: 60px !important;
border-bottom: 0.5px solid #eaeaea;
.fold-btn {
padding: 28px 19px;
line-height: 28px;
color: #3d3a3a !important;
font-size: 18px;
}
.page-title-input {
margin-top: 10px;
margin-left: 5px;
width: 99%;
height: 50px;
}
.title-info-view-right {
text-align: right;
margin-top: 10px;
font-size: 14px;
color: #454343;
.split {
padding:0 4px;
}
}
<style lang="scss">
.fake-header {
color: #333;
height: 60px !important;
line-height: 60px !important;
border-bottom: 0.5px solid #eaeaea;
.fold-btn {
font-size: 18px;
padding: 4px 10px;
margin-left: 6px;
color: #888 !important;
}
.page-title-input {
padding: 0 6px;
width: 100%;
font-size: 20px;
border-bottom: 1px solid #ddd;
.el-input__wrapper {
border: 0;
box-shadow: unset;
}
}
.title-info-view-right {
text-align: right;
margin-top: 10px;
font-size: 14px;
color: #454343;
.split {
padding: 0 4px;
}
}
}
.page-edit-vue {
.page-content-editor {
ol {
@@ -414,13 +425,6 @@ const initEditor = () => {
padding: 10px 0;
}
.page-edit-vue .page-title-input {
padding-bottom: 10px;
margin-left: 5px;
margin-right: 5px;
width: 50%;
}
.page-edit-vue .markdown-body table {
display: table;
}

View File

@@ -5,6 +5,7 @@
<el-row>
<el-col :span="navigationList.length > 0 ? 18 : 24">
<div style="max-width: 1000px; margin: 0 auto; padding-left: 10px">
<div class="wiki-title" ref="wikiTitleRef">{{ storePage.pageInfo.name }}</div>
<div ref="pageContentRef" class="wiki-page-content">
<div v-html="pageShowDetail" class="markdown-body" v-if="wikiPage.editorType == 2" v-highlight></div>
<div v-html="pageShowDetail" class="wang-editor-body" v-else></div>
@@ -138,6 +139,7 @@ onBeforeRouteUpdate((to) => {
initQueryParam(to);
});
onMounted(() => {
storeDisplay.currentPage = 'view';
initQueryParam(route);
});

View File

@@ -150,7 +150,7 @@ defineExpose({setTitle,setPageId, setHtml, getPageData});
.wang-editor-box .wang-editor-content {
padding: 20px 0;
overflow: auto;
height: calc(100vh - 156px);
height: calc(100vh - 140px);
}
.wang-editor-box .w-e-bar-item {
height: 39px;

View File

@@ -1,9 +1,5 @@
<template>
<div style="min-height: 100%;" class="space-manage-vue">
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding: 20px 10px">
<el-breadcrumb-item>WIKI文档</el-breadcrumb-item>
<el-breadcrumb-item>空间管理</el-breadcrumb-item>
</el-breadcrumb>
<div style="max-width: 1200px;margin: 0 auto;background: #fff;padding: 20px;min-height: 100%;box-sizing: border-box;">
<div style="text-align: right; margin-bottom: 10px">
<span style="float: left; line-height: 40px">
@@ -112,6 +108,7 @@ import userApi from '../../assets/api/user'
import CreateSpace from '../../components/space/CreateSpace'
import {useStoreSpaceData}from '@/store/spaceData'
import {useStorePageData}from '@/store/pageData'
import {useStoreDisplay} from "@/store/wikiDisplay";
let spaceListLoading = ref(false);
let spaceOptions = ref([]);
@@ -132,9 +129,12 @@ let userSetting = ref({wiki_only_show_favorite: 0,});
let route = useRoute();
let router = useRouter();
let storeDisplay = useStoreDisplay();
let storePage = useStorePageData();
let storeSpace = useStoreSpaceData();
onMounted(() => {
storeDisplay.currentPage = 'space';
loadSpaceList()
getSelfUserInfo()
getSpaceSettingList()