daikins/.svn/pristine/0f/0fe7ff274c47cf0d5c29fbe3d04...

279 lines
7.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<script setup lang="ts">
import { RouterView } from "vue-router";
import { useUserStore } from "@/stores/modules/user";
import { getCateTreePage, download, getActCateFileList, getBPCActList } from "@/api/daikin/base";
import { databaseld } from "@/stores/modules/database";
import DataBaseHead from "./components/DataBaseHead.vue";
import { useMessage } from 'naive-ui'
const message = useMessage()
const { push } = useRouter();
const store = useUserStore();
const database = databaseld();
const activeMenuKey = ref();
const route = useRoute()
let idx = ref(0);
const rowData = ref();
const tableData = ref([]);
const srcType = ref()
let subTitle = ref();
let type = ref();
function getLastSubstring(str: string): string {
const lastIndex = str.lastIndexOf('.');
if (lastIndex !== -1) {
return str.substring(lastIndex + 1);
} else {
return '';
}
}
const getId = async (id) => {
const { rows } = await getActCateFileList({ cateId: id })
console.log(rows);
rowData.value = rows
}
const showDetail = (row) => {
sessionStorage.setItem("title", row.title);
console.log(row.content);
sessionStorage.setItem("content", row.content)
push({name: "bcpDetail"})
}
const download = async (row, key)=>{
// console.log(row)
if(!row) return
if(row.isSelect===2){
message.error("没有访问权限")
return
}
let filePath = row[key]
if(!filePath) {
message.info("没有可预览文件!")
return
}
srcType.value = getLastSubstring(filePath)
if(['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'].includes(srcType.value)){
// src.value = filePath
// pdfShow.value = true
filePath='https://view.xdocin.com/view?src='+filePath
const screenWidth = window.screen.width;
const screenHeight = window.screen.height;
window.open(filePath, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0)
}
else{
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
}
}
function getFileName(url) {
if (!url) return "";
let lastSplashIndex = url.lastIndexOf("/");
let lastDotIndex = url.lastIndexOf(".");
return url.slice(lastSplashIndex + 1, lastDotIndex);
}
// const {currentPage,pageSize} = pageInfo
// if(!prop.cateId) return
// const {rows,total} = await cateFileList({cateId:prop.cateId,pageNum:currentPage,pageSize})
// pageInfo.total =total
// tableData.value = rows
const getList = async (obj) => {
const {currentPage,pageSize} = pageInfo
const {rows, total} = await getBPCActList({...obj, pageNum:currentPage,pageSize});
tableData.value = rows;
pageInfo.total = total
}
const pageInfo = reactive({
currentPage:1,
pageSize:13,
total:10
})
onMounted(() => {
subTitle.value = route.query.title;
console.log(subTitle.value,9999999999999)
type.value = route.query.type;
getList({moduleId: 1})
});
const lazyState = computed(() => [pageInfo.currentPage])
watch(
() => unref(lazyState),
async (v) => {
getList({moduleId: 1})
},
{ immediate: true, deep: true },
)
const handleSizeChange=(e)=>{
console.log(e)
}
const handleCurrentChange=(e)=>{
console.log(e)
}
function unescapeHTML(html: string) {
if (!html) return "";
const doc = new DOMParser().parseFromString(html, "text/html");
return doc.documentElement.textContent;
}
</script>
<template>
<div class="page w-1920px h-1080px flex">
<div class="main flex-1 pb15px pt0px relative">
<DataBaseHead :subTitle="subTitle" />
<div class="w-full h-1px bg-#507FFD mt50px rd-b-20px"></div>
<div class="w-full h-95%">
<div class="bg-#fff rd-15px px30px pt30px w-full h930px">
<div
class="rd-15px w-full h870px"
style="box-shadow: 1px 2px 26px -3px #cdcccc"
>
<div class="p30px relative h790px">
<table
class="history w-full text-center text-16px border-spacing-0"
>
<thead
style="
background-color: #e7edff;
color: #0a0a0a;
height: 50px;
width: 220px;
border: 1px solid #417bef;
"
>
<tr class="text-20px leading-50px">
<th>
日期
</th>
<th class="wrap">
情报内容
</th>
<th>
风险评估
</th>
<!-- <th>
上传时间
</th> -->
</tr>
</thead>
<tbody >
<tr v-for="(it, index) in tableData" :key="index">
<td
>
<span :title="it.createTime" @click="showDetail(it)"> {{ it.createTime }}</span>
</td>
<td class="wrap h50px">
<div :title="unescapeHTML(it.content )" class="download wrap" @click="download(it, 'filePath')">{{unescapeHTML(it.content )}}</div>
</td>
<td class="h50px"><span class="download" @click="download(it, 'briefingPath')">{{it.riskEstimation}}</span></td>
<td
>
<!-- <span > {{ it.createTime }}</span> -->
</td>
</tr>
</tbody>
</table>
<div class="float-right absolute bottom-20px right-30px">
<el-pagination v-model:current-page="pageInfo.currentPage" v-model:page-size="pageInfo.pageSize"
layout="prev, pager, next, jumper" :total="pageInfo.total"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<style scoped lang="less">
.page {
font-family: "PingFang SC";
user-select: none;
background-image: none;
background-color: #cacaca;
background-position: 0 0;
background-repeat: no-repeat;
background-size: cover;
color: #3b3b3b;
line-height: 1;
}
.download {
cursor: pointer;
}
.download:hover {
color: #00E4FF;
}
.nav {
&::before {
top: -48px;
}
.child:hover {
text-decoration: underline;
}
.childs:hover {
text-decoration: underline;
}
&::after {
bottom: -49px;
transform: rotate(-90deg);
}
&.active {
color: #002fa7;
background-color: #e6ecff;
a {
color: #002fa7;
}
&::before,
&::after {
opacity: 1;
}
}
&.actives {
padding: 0px !important;
color: #002fa7;
background-color: #f5f8ff;
a {
color: #002fa7;
}
&::before,
&::after {
opacity: 1;
}
.onActive {
background-color: #e6ecff;
border-radius: 32px 0 0 32px;
padding: 24px 36px 24px 36px;
}
}
}
.main {
width: 100%;
height: 95%;
background-color: #4877fb;
}
&::-webkit-scrollbar {
display: none;
scrollbar-width: none;
}
.wrap{
width: 420px; //设置需要固定的宽度
white-space: nowrap; //不换行
text-overflow: ellipsis; //超出部分用....代替
overflow: hidden; //超出隐藏
}
</style>