diff --git a/src/api/daikin/base.ts b/src/api/daikin/base.ts index 32e1df1..46595e4 100755 --- a/src/api/daikin/base.ts +++ b/src/api/daikin/base.ts @@ -617,7 +617,7 @@ export interface work { * 外部系统-情报列表 * http://127.0.0.1:8811/openApi/article/externalList */ -export async function externalList(params: work) { +export async function externalList(params: any) { return http.get('/article/externalList', { params }) } /** diff --git a/src/assets/images/beijq.png b/src/assets/images/beijq.png new file mode 100644 index 0000000..3234e0d Binary files /dev/null and b/src/assets/images/beijq.png differ diff --git a/src/assets/images/fzqiet3.png b/src/assets/images/fzqiet3.png new file mode 100644 index 0000000..2441657 Binary files /dev/null and b/src/assets/images/fzqiet3.png differ diff --git a/src/assets/images/yjtt@2x.png b/src/assets/images/yjtt@2x.png new file mode 100644 index 0000000..337767e Binary files /dev/null and b/src/assets/images/yjtt@2x.png differ diff --git a/src/router/index.ts b/src/router/index.ts index 13ca7f2..fefd287 100755 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -71,7 +71,7 @@ const router = createRouter({ component: () => import('@/views/extermal/news/index.vue') }, { - path: '/external/infoa/:id/:type', + path: '/external/infoa/:id?/:type?', name: 'DetailInfoa', component: () => import('@/views/extermal/Article/Detaila.vue') }, diff --git a/src/views/extermal/Article/Detail.vue b/src/views/extermal/Article/Detail.vue index 23debdb..28e9692 100755 --- a/src/views/extermal/Article/Detail.vue +++ b/src/views/extermal/Article/Detail.vue @@ -9,12 +9,20 @@ import { useDate } from '@/views/home/hooks/useDate' import { NBreadcrumb, NBreadcrumbItem } from 'naive-ui' import { pageType } from '@/stores/modules/pages' -const { push } = useRouter() +const { push, replace } = useRouter() const route = useRoute() const { day, week } = useDate() const pages = pageType() -const newId = ref(); -const scale = ref(1.5); +const newId = ref() +const scale = ref(1) +const imgW = ref('auto') +const pageInfo = reactive({ + currentPage: 1, + pageSize: 10, + type: '1', + total: 10 +}) +const listData = ref([]) async function setModule(codes: any) { const moduleCode = codes @@ -40,7 +48,8 @@ const toList = (nb) => { pages.page.cate = '8' pages.page.title = '重要通知' } - push({ name: 'DetailInfoList' }) + replace(`/external/info/${nb === 7 ? 'news' : 'info'}`) + // push({ name: 'DetailInfoList' }) } const SideNews = [ @@ -82,21 +91,36 @@ async function getArticleP(page: any) { pLenght = total / 10 } +const state = ref({}) +const type = ref('') watchEffect(() => { - const { id } = route.params + const { id } = route.params as any if (!id) return - newId.value = id as string; - scale.value = id === '701' ? 2 : 1.5 + newId.value = id as string + scale.value = id === '701' ? 2 : ['778', '840', '887'].includes(id) ? 1.5 : 1 + imgW.value = id !== '1241' ? '100%' : 'auto' getArticleP(1) getArticle(1) getData() }) -const state = ref({}) async function getData() { const { id } = route.params if (!id) return - + if (id == 'news' || id == 'info') { + const { rows, total } = await externalList({ + pageNum: pageInfo.currentPage, + pageSize: pageInfo.pageSize, + type: pageInfo.type, + cate: id === 'news' ? '7' : '8' + }) + type.value = id == 'news' ? 'News' : '重要通知' + pageInfo.total = total + listData.value = rows + return + } + listData.value = [] + type.value = '' const { data } = await externalInfo(id as string) data.tagColor = data.tag === '紧急' ? '#e60e0e' : '#2cba06' @@ -108,6 +132,16 @@ function unescapeHTML(html: string) { const doc = new DOMParser().parseFromString(html, 'text/html') return doc.documentElement.textContent } +const handleSizeChange = (e) => { + pageInfo.pageSize = e + pageInfo.currentPage = 1 + getData() +} + +const handleCurrentChange = (e) => { + pageInfo.currentPage = e + getData() +}