update
parent
d80d0988d2
commit
9ceffc71f9
|
|
@ -117,12 +117,17 @@ export interface ArticlePageReq {
|
||||||
type?: string
|
type?: string
|
||||||
// 分类 1-外部环境 2-竞争对手 3-供方动向 4-大金集团 5-中国据点 6-调达本部 7-news 8-重要通知
|
// 分类 1-外部环境 2-竞争对手 3-供方动向 4-大金集团 5-中国据点 6-调达本部 7-news 8-重要通知
|
||||||
cate?: String
|
cate?: String
|
||||||
position: String
|
position?: String
|
||||||
|
keyword?: String
|
||||||
}
|
}
|
||||||
export async function getArticlePage(params: ArticlePageReq) {
|
export async function getArticlePage(params: ArticlePageReq) {
|
||||||
// return openApiRequest({ url: '/article/getPage', params })
|
// return openApiRequest({ url: '/article/getPage', params })
|
||||||
return http.get('/article/getPage', { params })
|
return http.get('/article/getPage', { params })
|
||||||
}
|
}
|
||||||
|
export async function getSearchGlobal(params: ArticlePageReq) {
|
||||||
|
// return openApiRequest({ url: '/article/getPage', params })
|
||||||
|
return http.get('/app/search', { params })
|
||||||
|
}
|
||||||
|
|
||||||
export async function getArticleList(params: ArticlePageReq) {
|
export async function getArticleList(params: ArticlePageReq) {
|
||||||
// return openApiRequest({ url: '/article/getList', params })
|
// return openApiRequest({ url: '/article/getList', params })
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,32 @@
|
||||||
<template>
|
<template>
|
||||||
<input type="text" placeholder="请输入搜索内容" @keydown.enter="keyDown" v-model="search"
|
<input
|
||||||
class="h-full w-full text-#fff text-18px pl30px pr54px placeholder-#fff" />
|
type="text"
|
||||||
<img src="@/assets/images/icon-search.svg" @click="clickThis" class="w22px h22px absolute right-24px top-50% -translate-y-50%" />
|
placeholder="请输入搜索内容"
|
||||||
|
@keydown.enter="keyDown"
|
||||||
|
v-model="search"
|
||||||
|
class="h-full w-full text-#fff text-18px pl30px pr54px placeholder-#fff"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
src="@/assets/images/icon-search.svg"
|
||||||
|
@click="clickThis"
|
||||||
|
class="w22px h22px absolute right-24px top-50% -translate-y-50%"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import { searchStore } from '@/stores/modules/search'
|
import { searchStore } from '@/stores/modules/search'
|
||||||
const searchS = searchStore()
|
const searchS = searchStore()
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
const keyDown = (e) => {
|
const keyDown = (e) => {
|
||||||
if(e.key ==='Enter'&&search.value)
|
if (e.key === 'Enter' && search.value) {
|
||||||
{
|
searchS.setArticle(search.value)
|
||||||
searchS.search.content = search.value
|
|
||||||
push({ name: 'Search' })
|
push({ name: 'Search' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const clickThis = () => {
|
const clickThis = () => {
|
||||||
if(search.value)
|
if (search.value) {
|
||||||
{
|
searchS.setArticle(search.value)
|
||||||
searchS.search.content = search.value
|
|
||||||
push({ name: 'Search' })
|
push({ name: 'Search' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const searchStore = defineStore('search', () => {
|
export const searchStore = defineStore('search', () => {
|
||||||
const search = ref({
|
const search = ref({
|
||||||
content:''
|
content: '',
|
||||||
|
time: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
function setArticle(data: { content: string }){
|
function setArticle(data: string) {
|
||||||
search.value = data
|
search.value.content = data
|
||||||
|
search.value.time = new Date().getTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
return { search, setArticle }
|
return { search, setArticle }
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
@ -70,7 +70,6 @@ async function getArticle(page: any) {
|
||||||
cate: '7'
|
cate: '7'
|
||||||
}
|
}
|
||||||
const { rows, total } = await externalList(pasr)
|
const { rows, total } = await externalList(pasr)
|
||||||
console.log('🚀 ~ file: Detail.vue:46 ~ rows:', rows)
|
|
||||||
newsList.value = rows || []
|
newsList.value = rows || []
|
||||||
newLength = total / 10
|
newLength = total / 10
|
||||||
}
|
}
|
||||||
|
|
@ -154,9 +153,7 @@ const handleCurrentChange = (e) => {
|
||||||
<div style="width: 400px" class="flex items-end absolute">
|
<div style="width: 400px" class="flex items-end absolute">
|
||||||
<!-- <img src="../images/ͼƬ1.png" alt=""> -->
|
<!-- <img src="../images/ͼƬ1.png" alt=""> -->
|
||||||
<div v-if="false">
|
<div v-if="false">
|
||||||
<span style="font-size: 20px; margin-top: -50px"
|
<span style="font-size: 20px; margin-top: -50px">大金空调调达本部HOMEPAGE</span>
|
||||||
>大金空调调达本部HOMEPAGE</span
|
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
class=""
|
class=""
|
||||||
style="font-size: 18px; margin-left: 5px"
|
style="font-size: 18px; margin-left: 5px"
|
||||||
|
|
@ -170,9 +167,7 @@ const handleCurrentChange = (e) => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w300px -mr-1px flex flex-col shrink-0">
|
<div class="w300px -mr-1px flex flex-col shrink-0">
|
||||||
<div class="text-20px text-#fff font-600 mt6px">
|
<div class="text-20px text-#fff font-600 mt6px">大金中国调达本部 HOMEPAGE</div>
|
||||||
大金中国调达本部 HOMEPAGE
|
|
||||||
</div>
|
|
||||||
<!-- @dblclick="toggle" -->
|
<!-- @dblclick="toggle" -->
|
||||||
<img src="@/assets/images/logo.png" class="w197px h44px mt14px" />
|
<img src="@/assets/images/logo.png" class="w197px h44px mt14px" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -198,9 +193,7 @@ const handleCurrentChange = (e) => {
|
||||||
<div class="main flex-1 rd-32px pt60px mt22px page-wrap">
|
<div class="main flex-1 rd-32px pt60px mt22px page-wrap">
|
||||||
<div class="absolute text-white top-18px left-30px">
|
<div class="absolute text-white top-18px left-30px">
|
||||||
<n-breadcrumb separator=">">
|
<n-breadcrumb separator=">">
|
||||||
<n-breadcrumb-item @click="push({ name: 'external' })">
|
<n-breadcrumb-item @click="push({ name: 'external' })"> 外部首页</n-breadcrumb-item>
|
||||||
外部首页</n-breadcrumb-item
|
|
||||||
>
|
|
||||||
<n-breadcrumb-item> {{ type || state.title }}</n-breadcrumb-item>
|
<n-breadcrumb-item> {{ type || state.title }}</n-breadcrumb-item>
|
||||||
</n-breadcrumb>
|
</n-breadcrumb>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -211,10 +204,7 @@ const handleCurrentChange = (e) => {
|
||||||
class="q-wrapper relative flex-1 text-#142142 flex flex-col bg-#fff p30px pl80px h-full"
|
class="q-wrapper relative flex-1 text-#142142 flex flex-col bg-#fff p30px pl80px h-full"
|
||||||
v-if="listData.length"
|
v-if="listData.length"
|
||||||
>
|
>
|
||||||
<img
|
<img src="../images/beijq.png" class="absolute bottom-0 left-0 right-0 z w-full" />
|
||||||
src="../images/beijq.png"
|
|
||||||
class="absolute bottom-0 left-0 right-0 z w-full"
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
class="mt8px cursor-pointer flex flex-wrap flex-col p15px pl20px text-18px max-w-100%"
|
class="mt8px cursor-pointer flex flex-wrap flex-col p15px pl20px text-18px max-w-100%"
|
||||||
>
|
>
|
||||||
|
|
@ -237,10 +227,7 @@ const handleCurrentChange = (e) => {
|
||||||
class="text-#fff bg-red p5px text-16px rounded-5px mr-5px badge-24"
|
class="text-#fff bg-red p5px text-16px rounded-5px mr-5px badge-24"
|
||||||
>置顶</span
|
>置顶</span
|
||||||
>
|
>
|
||||||
<span
|
<span class="no-underline" :style="i.isRead === 2 ? 'color:#0058E5' : ''">
|
||||||
class="no-underline"
|
|
||||||
:style="i.isRead === 2 ? 'color:#0058E5' : ''"
|
|
||||||
>
|
|
||||||
{{ i.title }}
|
{{ i.title }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -279,10 +266,7 @@ const handleCurrentChange = (e) => {
|
||||||
<div class="mb-26px" v-for="item in SideNews" :key="item.key">
|
<div class="mb-26px" v-for="item in SideNews" :key="item.key">
|
||||||
<AppBlock class="h410px">
|
<AppBlock class="h410px">
|
||||||
<div class="box h-full">
|
<div class="box h-full">
|
||||||
<div
|
<div class="box-title flex items-center" @click="toList(item.cate)">
|
||||||
class="box-title flex items-center"
|
|
||||||
@click="toList(item.cate)"
|
|
||||||
>
|
|
||||||
<span class="flex-1">{{ item.name }}</span>
|
<span class="flex-1">{{ item.name }}</span>
|
||||||
<span>❯</span>
|
<span>❯</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -311,9 +295,7 @@ const handleCurrentChange = (e) => {
|
||||||
>置顶</span
|
>置顶</span
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
:style="
|
:style="i.isRead === 2 ? 'color:#0058E5;font-weight:bolb' : ''"
|
||||||
i.isRead === 2 ? 'color:#0058E5;font-weight:bolb' : ''
|
|
||||||
"
|
|
||||||
:title="i.title"
|
:title="i.title"
|
||||||
>{{ i.title }}</span
|
>{{ i.title }}</span
|
||||||
>
|
>
|
||||||
|
|
@ -459,7 +441,8 @@ const handleCurrentChange = (e) => {
|
||||||
font-size: 16px !important;
|
font-size: 16px !important;
|
||||||
}
|
}
|
||||||
span > img {
|
span > img {
|
||||||
width: v-bind(imgW);
|
// width: v-bind(imgW);
|
||||||
|
width: auto;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
p > img {
|
p > img {
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,7 @@ import AppBlock from '@/components/AppBlock.vue'
|
||||||
import AppNewsBox from '@/components/AppNewsBox.vue'
|
import AppNewsBox from '@/components/AppNewsBox.vue'
|
||||||
import Layout from './components/Layout.vue'
|
import Layout from './components/Layout.vue'
|
||||||
import DetailNews from './DetailNews.vue'
|
import DetailNews from './DetailNews.vue'
|
||||||
import {
|
import { getArticleDetail, getArticlePage, getManagerDetail } from '@/api/daikin/base'
|
||||||
getArticleDetail,
|
|
||||||
getArticlePage,
|
|
||||||
getManagerDetail
|
|
||||||
} from '@/api/daikin/base'
|
|
||||||
import { message } from '@/utils/message'
|
import { message } from '@/utils/message'
|
||||||
|
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
|
|
@ -105,8 +101,7 @@ async function getPageLists(page) {
|
||||||
const handleNeiScoll = () => {
|
const handleNeiScoll = () => {
|
||||||
const container = neiScoll.value
|
const container = neiScoll.value
|
||||||
if (container) {
|
if (container) {
|
||||||
const isAtBottom =
|
const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
|
||||||
container.scrollHeight - container.scrollTop === container.clientHeight
|
|
||||||
if (isAtBottom) {
|
if (isAtBottom) {
|
||||||
if (neiPum < neiLength) {
|
if (neiPum < neiLength) {
|
||||||
++neiPum
|
++neiPum
|
||||||
|
|
@ -118,8 +113,7 @@ const handleNeiScoll = () => {
|
||||||
const handlewaiScoll = () => {
|
const handlewaiScoll = () => {
|
||||||
const container = waiScoll.value
|
const container = waiScoll.value
|
||||||
if (container) {
|
if (container) {
|
||||||
const isAtBottom =
|
const isAtBottom = container.scrollHeight - container.scrollTop === container.clientHeight
|
||||||
container.scrollHeight - container.scrollTop === container.clientHeight
|
|
||||||
if (isAtBottom) {
|
if (isAtBottom) {
|
||||||
if (waiPum < waiLength) {
|
if (waiPum < waiLength) {
|
||||||
++waiPum
|
++waiPum
|
||||||
|
|
@ -152,10 +146,7 @@ const handlewaiScoll = () => {
|
||||||
<div class="page-side">
|
<div class="page-side">
|
||||||
<AppBlock class="h-400px">
|
<AppBlock class="h-400px">
|
||||||
<div class="box h-full">
|
<div class="box h-full">
|
||||||
<div
|
<div class="box-title flex items-center" @click="push({ name: 'IntelligenceWithin' })">
|
||||||
class="box-title flex items-center"
|
|
||||||
@click="push({ name: 'IntelligenceWithin' })"
|
|
||||||
>
|
|
||||||
<span class="flex-1">社内情报</span>
|
<span class="flex-1">社内情报</span>
|
||||||
<span>❯</span>
|
<span>❯</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -170,16 +161,8 @@ const handlewaiScoll = () => {
|
||||||
size="h20px"
|
size="h20px"
|
||||||
/> -->
|
/> -->
|
||||||
<div class="flex" @click="toDetail2(i)">
|
<div class="flex" @click="toDetail2(i)">
|
||||||
<img
|
<img v-if="i.tag === 'New'" src="../../../assets/images/NEW3.gif" class="h20px" />
|
||||||
v-if="i.tag === 'New'"
|
<img v-if="i.tag === '紧急'" src="../../../assets/images/jj.gif" class="h20px" />
|
||||||
src="../../../assets/images/NEW3.gif"
|
|
||||||
class="h20px"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
v-if="i.tag === '紧急'"
|
|
||||||
src="../../../assets/images/jj.gif"
|
|
||||||
class="h20px"
|
|
||||||
/>
|
|
||||||
<div class="ml5px leading-4.5 max-w300px overflow-ellipsis">
|
<div class="ml5px leading-4.5 max-w300px overflow-ellipsis">
|
||||||
{{ i.title }}
|
{{ i.title }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -193,10 +176,7 @@ const handlewaiScoll = () => {
|
||||||
<div class="page-side">
|
<div class="page-side">
|
||||||
<AppBlock class="h-400px">
|
<AppBlock class="h-400px">
|
||||||
<div class="box h-full">
|
<div class="box h-full">
|
||||||
<div
|
<div class="box-title flex items-center" @click="push({ name: 'IntelligenceOutside' })">
|
||||||
class="box-title flex items-center"
|
|
||||||
@click="push({ name: 'IntelligenceOutside' })"
|
|
||||||
>
|
|
||||||
<span class="flex-1">社外情报</span>
|
<span class="flex-1">社外情报</span>
|
||||||
<span>❯</span>
|
<span>❯</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -212,16 +192,8 @@ const handlewaiScoll = () => {
|
||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
<div class="flex" @click="toDetail2(i)">
|
<div class="flex" @click="toDetail2(i)">
|
||||||
<img
|
<img v-if="i.tag === 'New'" src="../../../assets/images/NEW3.gif" class="h20px" />
|
||||||
v-if="i.tag === 'New'"
|
<img v-if="i.tag === '紧急'" src="../../../assets/images/jj.gif" class="h20px" />
|
||||||
src="../../../assets/images/NEW3.gif"
|
|
||||||
class="h20px"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
v-if="i.tag === '紧急'"
|
|
||||||
src="../../../assets/images/jj.gif"
|
|
||||||
class="h20px"
|
|
||||||
/>
|
|
||||||
<div class="ml5px leading-4.5 max-w300px overflow-ellipsis">
|
<div class="ml5px leading-4.5 max-w300px overflow-ellipsis">
|
||||||
{{ i.title }}
|
{{ i.title }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,12 @@ import { useUserStore } from '@/stores/modules/user'
|
||||||
import HomeHead from '@/views/home/components/HomeHead.vue'
|
import HomeHead from '@/views/home/components/HomeHead.vue'
|
||||||
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
|
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
|
||||||
import { useDate } from '@/views/home/hooks/useDate'
|
import { useDate } from '@/views/home/hooks/useDate'
|
||||||
import { getArticlePage } from '@/api/daikin/base'
|
import { getArticlePage, getSearchGlobal } from '@/api/daikin/base'
|
||||||
import { noticeld } from '@/stores/modules/noticeId'
|
import { noticeld } from '@/stores/modules/noticeId'
|
||||||
import { searchStore } from '@/stores/modules/search'
|
import { searchStore } from '@/stores/modules/search'
|
||||||
import { message } from '@/utils/message'
|
import { message } from '@/utils/message'
|
||||||
|
import { NPopover } from 'naive-ui'
|
||||||
|
|
||||||
const store = noticeld()
|
const store = noticeld()
|
||||||
const store2 = useUserStore()
|
const store2 = useUserStore()
|
||||||
const searchS = searchStore()
|
const searchS = searchStore()
|
||||||
|
|
@ -17,30 +19,157 @@ const route = useRoute()
|
||||||
const listData = ref()
|
const listData = ref()
|
||||||
const flg = ref()
|
const flg = ref()
|
||||||
let keywords = ref()
|
let keywords = ref()
|
||||||
|
const pageInfo = reactive({
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
})
|
||||||
|
// App_Article 外部情报模块,App_Market 市况汇率,App_data_platform 数据平台, App_BCP BCP模块, App_CSR 碳中和模块,App_Quality 品质模块,App_Lab Lab模块,App_Database DatabBase模块
|
||||||
|
const codeType = {
|
||||||
|
App_Article: '外部情报', //分内部情报 和 外部情报
|
||||||
|
App_Market: '市况汇率', //返回下文件大小 fileCommon.fileSize
|
||||||
|
App_data_platform: '数据平台', //返回文件大小 fileCommon.fileSize
|
||||||
|
App_BCP: 'BCP模块', //返回文件大小 fileCommon.fileSize
|
||||||
|
App_CSR: '碳中和模块', //返回文件大小 fileCommon.fileSize
|
||||||
|
App_Quality: '品质模块', //返回文件大小 fileCommon.fileSize
|
||||||
|
App_Lab: 'Lab模块', //返回文件大小 fileCommon.fileSize
|
||||||
|
App_Database: 'DatabBase模块', //返回文件大小 fileCommon.fileSize
|
||||||
|
App_News: '新闻模块'
|
||||||
|
}
|
||||||
|
const loading = ref(true)
|
||||||
async function getSearchList() {
|
async function getSearchList() {
|
||||||
const keyword = keywords.value
|
loading.value = true
|
||||||
const { rows } = await getArticlePage({ pageNum: 1, pageSize: 100, type: 2, position: 'search', keyword } as any);
|
const keyword = searchS.search.content
|
||||||
|
// const { rows } = await getArticlePage({ pageNum: 1, pageSize: 100, type: 2, position: 'search', keyword } as any);
|
||||||
|
const { rows, total } = await getSearchGlobal({
|
||||||
|
pageNum: pageInfo.currentPage,
|
||||||
|
pageSize: pageInfo.pageSize,
|
||||||
|
keyword
|
||||||
|
} as any).catch((e) => {
|
||||||
|
loading.value = false
|
||||||
|
listData.value = []
|
||||||
|
})
|
||||||
listData.value = rows
|
listData.value = rows
|
||||||
|
setTimeout(() => {
|
||||||
|
loading.value = false
|
||||||
|
}, 300)
|
||||||
|
pageInfo.total = total
|
||||||
}
|
}
|
||||||
watchSyncEffect(()=>{
|
watchEffect(() => {
|
||||||
keywords.value = searchS.search.content
|
searchS.search.time
|
||||||
// console.log(keywords.value)
|
getSearchList(searchS.search.content)
|
||||||
getSearchList()
|
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
|
||||||
getSearchList()
|
const codePath = {
|
||||||
flg.value = store2.user.isReview > 0
|
App_Article: {
|
||||||
console.log(flg.value,store2.user.isReview)
|
path: '/intelligence/outside/',
|
||||||
|
modulePath: '/Home/intelligence'
|
||||||
|
},
|
||||||
|
App_Market: {
|
||||||
|
path: '/Home/market',
|
||||||
|
modulePath: '/Home/market'
|
||||||
|
},
|
||||||
|
App_data_platform: {
|
||||||
|
path: '/Home/cd',
|
||||||
|
modulePath: '/Home/cd'
|
||||||
|
},
|
||||||
|
App_BCP: {
|
||||||
|
path: '/Home/bcp',
|
||||||
|
modulePath: '/Home/bcp'
|
||||||
|
},
|
||||||
|
// '碳中和模块',
|
||||||
|
App_CSR: {
|
||||||
|
path: '/Home/csr',
|
||||||
|
modulePath: '/Home/csr'
|
||||||
|
},
|
||||||
|
// '品质模块',
|
||||||
|
App_Quality: {
|
||||||
|
path: '/Home/quality',
|
||||||
|
modulePath: '/Home/quality'
|
||||||
|
},
|
||||||
|
// 'Lab模块',
|
||||||
|
App_Lab: {
|
||||||
|
path: '/Home/diffspace',
|
||||||
|
modulePath: '/Home/diffspace'
|
||||||
|
},
|
||||||
|
// 'DatabBase模块'
|
||||||
|
App_Database: {
|
||||||
|
path: '/DataBase',
|
||||||
|
modulePath: '/DataBase'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const clickItem = (item) => {
|
||||||
|
const { id, filePath, isSelect, moduleCode, fileCommon = {} } = item
|
||||||
|
console.log('🚀 ~ file: index.vue:104 ~ item:', item)
|
||||||
|
|
||||||
|
if (isSelect === 1) {
|
||||||
|
downloads({ fileCommon, filePath })
|
||||||
|
} else {
|
||||||
|
message.info('您没有权限查看!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloads = (data: any = {}) => {
|
||||||
|
const { fileCommon, filePath } = data
|
||||||
|
if ((fileCommon?.fileSize || 0) > 25 * 1024 * 1024) {
|
||||||
|
message.info('正在下载中,请稍等~')
|
||||||
|
downloadFile(filePath)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (filePath) {
|
||||||
|
window.open(filePath, '_blank')
|
||||||
|
} else {
|
||||||
|
message.info('没有可预览文件!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function downloadFile(url: any) {
|
||||||
|
fetch(url)
|
||||||
|
.then((response) => response.blob())
|
||||||
|
.then((blob) => {
|
||||||
|
const downloadUrl = URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = downloadUrl
|
||||||
|
link.download = getFileNameFromUrl(url)
|
||||||
|
link.click()
|
||||||
})
|
})
|
||||||
const clickTo=(obj)=>{
|
|
||||||
// console.log(obj)
|
|
||||||
if(obj.isSelect===1){
|
|
||||||
push(`${route.path}/${obj.id}`)
|
|
||||||
}
|
}
|
||||||
else{
|
function getFileNameFromUrl(url: string) {
|
||||||
message.info("您没有权限查看!")
|
console.log(
|
||||||
|
'🚀 ~ file: index.vue:107 ~ getFileNameFromUrl ~ getFileNameFromUrl:',
|
||||||
|
getFileNameFromUrl
|
||||||
|
)
|
||||||
|
const lastSlashIndex = url.lastIndexOf('/')
|
||||||
|
if (lastSlashIndex !== -1) {
|
||||||
|
return url.substring(lastSlashIndex + 1)
|
||||||
|
} else {
|
||||||
|
return 'Invalid URL'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const goModule = (item, type) => {
|
||||||
|
const { moduleCode, id } = item
|
||||||
|
const { modulePath, path } = codePath[moduleCode]
|
||||||
|
if (modulePath) {
|
||||||
|
if (type === 'module') {
|
||||||
|
push(modulePath)
|
||||||
|
} else {
|
||||||
|
push(path + id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSizeChange = (e) => {
|
||||||
|
pageInfo.pageSize = e
|
||||||
|
pageInfo.currentPage = 1
|
||||||
|
getSearchList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// const handleCurrentChange = (e) => {
|
||||||
|
// pageInfo.currentPage = e
|
||||||
|
// getSearchList()
|
||||||
|
// }
|
||||||
|
const fileSize = 24 * 1024 * 1024
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -56,24 +185,98 @@ const clickTo=(obj)=>{
|
||||||
<div class="text-18px">{{ week }}</div>
|
<div class="text-18px">{{ week }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px">
|
<div class="q-wrapper flex-1 mt30px text-#142142 flex flex-col bg-#fff p30px">
|
||||||
|
<div class="h-800px mt-30px relative" v-if="listData && listData.length > 0">
|
||||||
|
<el-table
|
||||||
<div v-if="listData&&listData.length>0" v-for="i in listData" :key="i"
|
v-loading="loading"
|
||||||
class="mt8px cursor-pointer flex items-center p15px pl20px text-18px max-w-805px">
|
:data="listData"
|
||||||
<span class="truncate flex-1 w0 text-#142142 hover:underline " @click=" clickTo(i)">{{ i.title }}</span>
|
style="width: 100%; margin-bottom: 20px"
|
||||||
<span class="shrink-0 ml38px text-#808696">{{ i.createTime }}</span>
|
row-key="id"
|
||||||
<!-- <span v-if="flg" class="ml20px text-#808696 text-16px">来自: {{ i.publishName }}</span> -->
|
border
|
||||||
|
default-expand-all
|
||||||
|
:header-cell-style="{
|
||||||
|
background: '#2A7BF7',
|
||||||
|
color: '#fff',
|
||||||
|
height: '70px',
|
||||||
|
lineHeight: '60px',
|
||||||
|
textAlign: 'center',
|
||||||
|
'font-size': '24px'
|
||||||
|
}"
|
||||||
|
:cell-style="{
|
||||||
|
'text-align': 'center',
|
||||||
|
'overflow-y': 'auto',
|
||||||
|
height: '60px'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-table-column prop="moduleName" label="模块名称" width="150">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span class="text-16px">{{ codeType[row.moduleCode] }}</span>
|
||||||
|
<!-- <n-popover trigger="hover" placement="top-start">
|
||||||
|
<template #trigger>
|
||||||
|
</template>
|
||||||
|
<span>点击进入 {{ codeType[row.moduleCode] }}</span>
|
||||||
|
</n-popover> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="title" label="标题" show-overflow-tooltip> </el-table-column>
|
||||||
|
<el-table-column label="部门" prop="departName" show-overflow-tooltip width="150" />
|
||||||
|
<el-table-column prop="userName" label="发布人" show-overflow-tooltip width="150" />
|
||||||
|
<el-table-column label="发布日期" prop="createTime" show-overflow-tooltip width="220" />
|
||||||
|
<el-table-column label="操作" width="270">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div class="">
|
||||||
|
<div class="inline-block">
|
||||||
|
<el-button
|
||||||
|
v-if="row.moduleCode === 'App_Article'"
|
||||||
|
style="color: #000"
|
||||||
|
@click="goModule(row, path)"
|
||||||
|
>详情
|
||||||
|
</el-button>
|
||||||
|
<template v-else>
|
||||||
|
<n-popover
|
||||||
|
v-if="(row.fileCommon?.fileSize || 0) > fileSize"
|
||||||
|
trigger="hover"
|
||||||
|
placement="top-start"
|
||||||
|
>
|
||||||
|
<template #trigger>
|
||||||
|
<el-button style="color: #000" @click="clickItem(row)">预览</el-button>
|
||||||
|
</template>
|
||||||
|
<span>该文件超过25MB,无法进行预览,点击进行下载!</span>
|
||||||
|
</n-popover>
|
||||||
|
<el-button v-else style="color: #000" @click="clickItem(row)">预览</el-button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" class="ml-16px" @click="goModule(row, 'module')">
|
||||||
|
进入模块</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="absolute bottom-20px left-50% translate-x-[-50%] z-11">
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
v-model:current-page="pageInfo.currentPage"
|
||||||
|
v-model:page-size="pageInfo.pageSize"
|
||||||
|
layout="prev, pager, next, total,jumper,->"
|
||||||
|
:total="pageInfo.total"
|
||||||
|
@current-change="getSearchList"
|
||||||
|
/>
|
||||||
|
<!-- @size-change="handleSizeChange" -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="w-full h-hull">
|
<div v-else class="w-full h-hull">
|
||||||
<el-empty :image-size="200" />
|
<el-empty :image-size="300" description="搜索结果为空~" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
:deep(.el-empty__description) {
|
||||||
|
p {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.top {
|
.top {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 30px;
|
right: 30px;
|
||||||
|
|
@ -86,7 +289,7 @@ const clickTo=(obj)=>{
|
||||||
|
|
||||||
.q-wrapper {
|
.q-wrapper {
|
||||||
border-radius: 18px;
|
border-radius: 18px;
|
||||||
border: 1px solid #E7EBF5;
|
border: 1px solid #e7ebf5;
|
||||||
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
|
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
&::after {
|
&::after {
|
||||||
|
|
@ -102,4 +305,5 @@ const clickTo=(obj)=>{
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue