|
@@ -1,64 +1,142 @@
|
|
<template>
|
|
<template>
|
|
<div :class="prefixCls" class="w-full h-full">
|
|
<div :class="prefixCls" class="w-full h-full">
|
|
- <div
|
|
|
|
- class="w-full py-4 sm:max-w-540px md:max-w-720px lg:max-w-960px xl:max-w-1140px 2xl:max-w-1600px mx-auto"
|
|
|
|
- >
|
|
|
|
- <nav class="flex justify-between items-center">
|
|
|
|
- <span
|
|
|
|
- ><h2 class="text-3xl text-white m-0">{{ title }}</h2></span
|
|
|
|
- >
|
|
|
|
- <a-button @click="$router.push('/login')" ghost>登录</a-button>
|
|
|
|
- </nav>
|
|
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- class="container w-full py-4 sm:max-w-540px md:max-w-720px lg:max-w-960px xl:max-w-1140px 2xl:max-w-1600px mx-auto"
|
|
|
|
- >
|
|
|
|
- <div class="flex flex-col h-full">
|
|
|
|
- <section class="content flex h-full">
|
|
|
|
- <div class="rounded-md bg-white h-full left-menu">
|
|
|
|
- <Tree
|
|
|
|
- v-if="treeData && treeData.length"
|
|
|
|
- :tree-data="treeData"
|
|
|
|
- :replace-fields="replaceFields"
|
|
|
|
- :default-expand-all="true"
|
|
|
|
- @select="onSelect"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div class="rounded-md bg-white h-full right-menu">
|
|
|
|
- <header class="border-b">
|
|
|
|
- <div class="flex justify-between p-4">
|
|
|
|
- <div>
|
|
|
|
- <span class="text-xl">{{ detail.name }}</span>
|
|
|
|
- <span class="text-xl ml-3 font-medium">{{ detail.code2 }}</span>
|
|
|
|
|
|
+ <div class="container mx-auto w-full h-full">
|
|
|
|
+ <div class="w-full py-4">
|
|
|
|
+ <nav class="flex justify-between items-center">
|
|
|
|
+ <span
|
|
|
|
+ ><h2 class="text-3xl text-white m-0">{{ title }}</h2></span
|
|
|
|
+ >
|
|
|
|
+ <a-button @click="$router.push('/login')" ghost>登录</a-button>
|
|
|
|
+ </nav>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="section w-full py-4">
|
|
|
|
+ <div class="flex flex-col h-full">
|
|
|
|
+ <section class="content flex h-full">
|
|
|
|
+ <div class="rounded-md bg-white h-full left-menu">
|
|
|
|
+ <ul class="list-none p-0 m-0" v-if="treeData && treeData.length">
|
|
|
|
+ <li
|
|
|
|
+ class="p-4 rounded-md main"
|
|
|
|
+ :class="{ active: treeData[0] && treeData[0].id === activeId }"
|
|
|
|
+ >
|
|
|
|
+ <div class="flex justify-between items-center relative">
|
|
|
|
+ <span>{{ treeData[0] && treeData[0].name }}</span>
|
|
|
|
+ <span
|
|
|
|
+ class="flex items-center"
|
|
|
|
+ :class="treeData[0] && treeData[0].id === activeId ? 'fade-down' : 'fade-up'"
|
|
|
|
+ >
|
|
|
|
+ <Icon
|
|
|
|
+ icon="fluent:chevron-up-20-filled"
|
|
|
|
+ :size="18"
|
|
|
|
+ @click="changeActiveId(treeData[0].id)"
|
|
|
|
+ />
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ <div class="ml-2 active-content">
|
|
|
|
+ <Tree
|
|
|
|
+ v-if="treeData[0] && treeData[0].id === activeId"
|
|
|
|
+ :tree-data="treeData[0].children || []"
|
|
|
|
+ :replace-fields="replaceFields"
|
|
|
|
+ :default-expand-all="true"
|
|
|
|
+ @select="onSelect"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- <a-button type="success" pre-icon="ic:outline-file-download" @click="uploadExecl"
|
|
|
|
- >下载</a-button
|
|
|
|
|
|
+ <li
|
|
|
|
+ class="p-4 rounded-md main"
|
|
|
|
+ :class="{ active: treeData[1] && treeData[1].id === activeId }"
|
|
>
|
|
>
|
|
- </div>
|
|
|
|
- </header>
|
|
|
|
- <section class="pdf-content">
|
|
|
|
- <iframe
|
|
|
|
- v-if="showPdf"
|
|
|
|
- :src="pdfUrl"
|
|
|
|
- frameborder="0"
|
|
|
|
- width="100%"
|
|
|
|
- height="100%"
|
|
|
|
- class="rounded-b-md"
|
|
|
|
- ></iframe>
|
|
|
|
- <div
|
|
|
|
- v-if="detail.name && !detail.pdfData.fid"
|
|
|
|
- class="h-full flex justify-center items-center text-2xl"
|
|
|
|
- >暂未上传可供预览的pdf文件</div
|
|
|
|
- >
|
|
|
|
- </section>
|
|
|
|
- </div>
|
|
|
|
- </section>
|
|
|
|
- <footer class="relative">
|
|
|
|
- <p class="m-0 p-0 text-right text-light-blue-50 footer-content"
|
|
|
|
- >主办单位:广东省交通运输工程造价事务中心<span class="px-2">|</span
|
|
|
|
- >技术支持:珠海纵横创新软件有限公司</p
|
|
|
|
- >
|
|
|
|
- </footer>
|
|
|
|
|
|
+ <div class="flex justify-between items-center relative">
|
|
|
|
+ <span>{{ treeData[1] && treeData[1].name }}</span>
|
|
|
|
+ <span
|
|
|
|
+ class="flex items-center"
|
|
|
|
+ :class="treeData[1] && treeData[1].id === activeId ? 'fade-down' : 'fade-up'"
|
|
|
|
+ >
|
|
|
|
+ <Icon
|
|
|
|
+ icon="fluent:chevron-up-20-filled"
|
|
|
|
+ :size="18"
|
|
|
|
+ @click="changeActiveId(treeData[1].id)"
|
|
|
|
+ />
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ <div class="ml-2 active-content">
|
|
|
|
+ <Tree
|
|
|
|
+ v-if="treeData[1] && treeData[1].id === activeId"
|
|
|
|
+ :tree-data="treeData[1].children || []"
|
|
|
|
+ :replace-fields="replaceFields"
|
|
|
|
+ :default-expand-all="true"
|
|
|
|
+ @select="onSelect"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <li
|
|
|
|
+ class="p-4 rounded-md main"
|
|
|
|
+ :class="{ active: treeData[2] && treeData[2].id === activeId }"
|
|
|
|
+ >
|
|
|
|
+ <div class="flex justify-between items-center relative">
|
|
|
|
+ <span>{{ treeData[2] && treeData[2].name }}</span>
|
|
|
|
+ <span
|
|
|
|
+ class="flex items-center"
|
|
|
|
+ :class="treeData[2] && treeData[2].id === activeId ? 'fade-down' : 'fade-up'"
|
|
|
|
+ >
|
|
|
|
+ <Icon
|
|
|
|
+ icon="fluent:chevron-up-20-filled"
|
|
|
|
+ :size="18"
|
|
|
|
+ @click="changeActiveId(treeData[2].id)"
|
|
|
|
+ />
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ <div class="ml-2 active-content">
|
|
|
|
+ <Tree
|
|
|
|
+ v-if="treeData[2] && treeData[2].id === activeId"
|
|
|
|
+ :tree-data="treeData[2].children || []"
|
|
|
|
+ :replace-fields="replaceFields"
|
|
|
|
+ :default-expand-all="true"
|
|
|
|
+ @select="onSelect"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="rounded-md bg-white h-full right-menu">
|
|
|
|
+ <header class="border-b">
|
|
|
|
+ <div class="flex justify-between p-4">
|
|
|
|
+ <div>
|
|
|
|
+ <span class="text-xl">{{ detail.name }}</span>
|
|
|
|
+ <span class="text-xl ml-3 font-medium">{{ detail.code2 }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <a-button
|
|
|
|
+ v-show="showExcelDownload"
|
|
|
|
+ type="success"
|
|
|
|
+ pre-icon="ic:outline-file-download"
|
|
|
|
+ @click="uploadExecl"
|
|
|
|
+ >下载</a-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </header>
|
|
|
|
+ <section class="pdf-content">
|
|
|
|
+ <iframe
|
|
|
|
+ v-if="showPdf"
|
|
|
|
+ :src="pdfUrl"
|
|
|
|
+ frameborder="0"
|
|
|
|
+ width="100%"
|
|
|
|
+ height="100%"
|
|
|
|
+ class="rounded-b-md"
|
|
|
|
+ ></iframe>
|
|
|
|
+ <div
|
|
|
|
+ v-if="detail.name && !detail.pdfData.fid"
|
|
|
|
+ class="h-full flex justify-center items-center text-2xl"
|
|
|
|
+ >暂未上传可供预览的pdf文件</div
|
|
|
|
+ >
|
|
|
|
+ </section>
|
|
|
|
+ </div>
|
|
|
|
+ </section>
|
|
|
|
+ <footer class="relative">
|
|
|
|
+ <p class="m-0 p-0 text-right text-light-blue-50 footer-content"
|
|
|
|
+ >主办单位:广东省交通运输工程造价事务中心<span class="px-2">|</span
|
|
|
|
+ >技术支持:珠海纵横创新软件有限公司</p
|
|
|
|
+ >
|
|
|
|
+ </footer>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -72,6 +150,7 @@
|
|
import { TreeRow } from '/#/tree'
|
|
import { TreeRow } from '/#/tree'
|
|
import { Tree } from 'ant-design-vue'
|
|
import { Tree } from 'ant-design-vue'
|
|
import { downloadByUrl } from '/@/utils/file/download'
|
|
import { downloadByUrl } from '/@/utils/file/download'
|
|
|
|
+ import { Icon } from '/@/components/Icon'
|
|
import { useGlobSetting } from '/@/hooks/setting'
|
|
import { useGlobSetting } from '/@/hooks/setting'
|
|
interface ATreeRow extends TreeRow {
|
|
interface ATreeRow extends TreeRow {
|
|
showUpload: boolean
|
|
showUpload: boolean
|
|
@@ -79,11 +158,13 @@
|
|
export default {
|
|
export default {
|
|
name: 'Preview',
|
|
name: 'Preview',
|
|
components: {
|
|
components: {
|
|
- Tree
|
|
|
|
|
|
+ Tree,
|
|
|
|
+ Icon
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
const globSetting = useGlobSetting()
|
|
const globSetting = useGlobSetting()
|
|
const treeData = ref<TreeResultModel[]>([])
|
|
const treeData = ref<TreeResultModel[]>([])
|
|
|
|
+ const activeId = ref('')
|
|
const row = ref<ATreeRow>({
|
|
const row = ref<ATreeRow>({
|
|
id: '',
|
|
id: '',
|
|
parentId: '',
|
|
parentId: '',
|
|
@@ -170,6 +251,13 @@
|
|
() => 'http://sj.6jlzf.cn/static' + detail.value.pdfData.filepath
|
|
() => 'http://sj.6jlzf.cn/static' + detail.value.pdfData.filepath
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ const changeActiveId = (id: string) => {
|
|
|
|
+ if (id === activeId.value) {
|
|
|
|
+ activeId.value = ''
|
|
|
|
+ } else {
|
|
|
|
+ activeId.value = id
|
|
|
|
+ }
|
|
|
|
+ }
|
|
const { prefixCls } = useDesign('preview')
|
|
const { prefixCls } = useDesign('preview')
|
|
const replaceFields = { children: 'children', title: 'name', key: 'id' }
|
|
const replaceFields = { children: 'children', title: 'name', key: 'id' }
|
|
return {
|
|
return {
|
|
@@ -182,7 +270,9 @@
|
|
uploadExecl,
|
|
uploadExecl,
|
|
title: computed(() => globSetting?.title ?? ''),
|
|
title: computed(() => globSetting?.title ?? ''),
|
|
showExcelDownload,
|
|
showExcelDownload,
|
|
- detail
|
|
|
|
|
|
+ detail,
|
|
|
|
+ activeId,
|
|
|
|
+ changeActiveId
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -193,7 +283,7 @@
|
|
|
|
|
|
.@{prefix-cls} {
|
|
.@{prefix-cls} {
|
|
background: url('../../../assets/images/bg.png');
|
|
background: url('../../../assets/images/bg.png');
|
|
- .container {
|
|
|
|
|
|
+ .section {
|
|
height: calc(100% - 4.25rem);
|
|
height: calc(100% - 4.25rem);
|
|
.content {
|
|
.content {
|
|
height: calc(100% - 22px);
|
|
height: calc(100% - 22px);
|
|
@@ -201,6 +291,24 @@
|
|
flex: 0 0 25%;
|
|
flex: 0 0 25%;
|
|
max-width: 25%;
|
|
max-width: 25%;
|
|
overflow: auto auto;
|
|
overflow: auto auto;
|
|
|
|
+ .main.active {
|
|
|
|
+ background-color: #e6eefe;
|
|
|
|
+ }
|
|
|
|
+ .main:hover {
|
|
|
|
+ background-color: #e3ebfa;
|
|
|
|
+ }
|
|
|
|
+ .active-content {
|
|
|
|
+ max-height: calc(100vh - 14rem - 36px - 24px);
|
|
|
|
+ overflow: auto;
|
|
|
|
+ }
|
|
|
|
+ .fade-up {
|
|
|
|
+ transform: rotate(0);
|
|
|
|
+ transition: all 0.5s;
|
|
|
|
+ }
|
|
|
|
+ .fade-down {
|
|
|
|
+ transform: rotate(180deg);
|
|
|
|
+ transition: all 0.5s;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.right-menu {
|
|
.right-menu {
|
|
flex: 0 0 75%;
|
|
flex: 0 0 75%;
|