Commit e20fe9fb by 吴春元

fix: 修复TypeScript类型检查错误并优化代码

refactor: 重构新闻列表组件和留言管理功能

style: 清理无用代码并统一代码格式

chore: 删除dist.zip文件

perf: 优化导航栏过滤逻辑和图片引用方式
parent 59814493
File deleted
...@@ -141,7 +141,9 @@ ...@@ -141,7 +141,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config"; import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config";
import { import {
Clock, Clock,
...@@ -169,9 +171,9 @@ const handleCurrentChange = (val: number) => { ...@@ -169,9 +171,9 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
}; };
const newsList = ref([]); const newsList = ref<any>([]);
const tyNews = ref([]); const tyNews = ref<any>([]);
const announcements = ref([]); const announcements = ref<any>([]);
getTyNewsList(3, 1); getTyNewsList(3, 1);
...@@ -183,7 +185,7 @@ function getTyNewsList(pageSize: number, pageNo: number) { ...@@ -183,7 +185,7 @@ function getTyNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -205,7 +207,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -205,7 +207,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -228,7 +230,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -228,7 +230,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div v-if="item.contentType == 'pyzq'" class="absolute right-10 top-0"> <div v-if="item.contentType == 'pyzq'" class="absolute right-10 top-0">
<!-- transform旋转45度 --> <!-- transform旋转45度 -->
<img :src="yyIcon" class="w-[85px] h-[85px] object-contain transform rotate-[-20deg]" alt="谣言标识" /> <img src="@/assets/imgs/yy-icon.png" class="w-[85px] h-[85px] object-contain transform rotate-[-20deg]" alt="谣言标识" />
</div> </div>
<div class="mt-3 flex items-center space-x-4"> <div class="mt-3 flex items-center space-x-4">
...@@ -249,12 +249,15 @@ import { ...@@ -249,12 +249,15 @@ import {
Bell, Bell,
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, pyzq, qwfb, zjjd, flfg } from "@/utils/config"; import { baseImageUrl, pyzq, qwfb, zjjd, flfg } from "@/utils/config";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { ca } from "element-plus/es/locales.mjs"; import { ca } from "element-plus/es/locales.mjs";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
import yyIcon from "@/assets/imgs/yy-icon.png"; // import yyIcon from "@/assets/imgs/yy-icon.png";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
...@@ -288,11 +291,11 @@ const handleCurrentChange = (val: number) => { ...@@ -288,11 +291,11 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
}; };
const list0 = ref([]); const list0 = ref<any[]>([]);
const list = ref([]); const list = ref<any[]>([]);
const list1 = ref([]); const list1 = ref<any[]>([]);
const list2 = ref([]); const list2 = ref<any[]>([]);
const list3 = ref([]); const list3 = ref<any[]>([]);
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
getList0(); getList0();
...@@ -315,7 +318,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -315,7 +318,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -335,7 +338,7 @@ function getList0() { ...@@ -335,7 +338,7 @@ function getList0() {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -355,7 +358,7 @@ function getList1() { ...@@ -355,7 +358,7 @@ function getList1() {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -375,7 +378,7 @@ function getList2() { ...@@ -375,7 +378,7 @@ function getList2() {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -395,7 +398,7 @@ function getList3() { ...@@ -395,7 +398,7 @@ function getList3() {
pageSize: 2, pageSize: 2,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
......
...@@ -152,13 +152,12 @@ const data = { ...@@ -152,13 +152,12 @@ const data = {
}; };
getTab(data).then((res: any) => { getTab(data).then((res: any) => {
console.log(res);
const data: any[] = res.data.rows; const data: any[] = res.data.rows;
// //用data内的categorySort排序 // //用data内的categorySort排序
data.sort((a, b) => a.categorySort - b.categorySort); data.sort((a, b) => a.categorySort - b.categorySort);
//将data内id等于“1876561611942682626”的数据过滤不在navItems.value中显示(轮播图和后台设置的不显示标签的新闻分类) data.unshift({ categoryTitle: "首页", categoryId: "999999", categoryDescrip: "" });
data.unshift({ categoryTitle: "首页", categoryId: "999" }); //item.categoryDescrip 等于1的不显示
const filterData = data.filter((item) => item.categoryDisplay !== "disable"); const filterData = data.filter((item) => item.categoryDescrip != '1');
navItems.value = filterData; navItems.value = filterData;
setNactiveNav(navItems.value); setNactiveNav(navItems.value);
}); });
......
...@@ -80,7 +80,9 @@ import { ...@@ -80,7 +80,9 @@ import {
Collection, Collection,
Search, Search,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
//@ts-ignore
import { HLW_LH_PYPT } from "@/utils/config"; import { HLW_LH_PYPT } from "@/utils/config";
//@ts-ignore
import { getTab } from "@/api/home/home"; import { getTab } from "@/api/home/home";
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
class="w-full h-full object-cover object-top" class="w-full h-full object-cover object-top"
alt="banner" alt="banner"
/> --> /> -->
<img :src="wmyhsHeaderBg" class="w-full h-full object-cover object-top" /> <img src="@/assets/imgs/wmyhs-header-bg.jpg" class="w-full h-full object-cover object-top" />
<div class="absolute inset-0 bg-gradient-to-r from-blue-900/80 via-blue-900/30 to-transparent"></div> <div class="absolute inset-0 bg-gradient-to-r from-blue-900/80 via-blue-900/30 to-transparent"></div>
</div> </div>
...@@ -127,7 +127,7 @@ import { useRouter } from "vue-router"; ...@@ -127,7 +127,7 @@ import { useRouter } from "vue-router";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import Footer from "@/components/footer.vue"; import Footer from "@/components/footer.vue";
// 引入背景图片 // 引入背景图片
import wmyhsHeaderBg from "@/assets/imgs/wmyhs-header-bg.jpg"; // import wmyhsHeaderBg from "@/assets/imgs/wmyhs-header-bg.jpg";
const router = useRouter(); const router = useRouter();
......
...@@ -8,28 +8,23 @@ ...@@ -8,28 +8,23 @@
<!-- 列表区域 --> <!-- 列表区域 -->
<div class="bg-white rounded-lg shadow-sm"> <div class="bg-white rounded-lg shadow-sm">
<div class="divide-y divide-gray-200"> <div class="divide-y divide-gray-200">
<div <div v-for="item in tableData" :key="item.id" class="p-4 hover:bg-gray-50 transition-colors">
v-for="item in tableData"
:key="item.id"
class="p-4 hover:bg-gray-50 transition-colors"
>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
<div class="flex items-center mb-1"> <div class="flex items-center mb-1">
<h3 <h3
class="text-black hover:text-blue-600 cursor-pointer text-lg font-medium truncate mr-2 line-clamp-2" class="text-black hover:text-blue-600 cursor-pointer text-lg font-medium truncate mr-2 line-clamp-2"
@click="goToDetail(item.id)" @click="goToDetail(item.id)">
>
{{ item.contentTitle }} {{ item.contentTitle }}
</h3> </h3>
</div> </div>
<div class="flex items-center text-sm text-gray-500"> <div class="flex items-center text-sm text-gray-500">
<span class="mr-4">发布人:{{ item.contentAuthor }}</span> <span class="mr-4">发布人:{{ item.contentAuthor }}</span>
<span class="mr-4" <span class="mr-4">发布时间:{{ item.contentDatetime }}</span>
>发布时间:{{ item.contentDatetime }}</span
>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -40,55 +35,41 @@ ...@@ -40,55 +35,41 @@
</div> </div>
<!-- 分页 --> <!-- 分页 -->
<div class="flex justify-center mt-8"> <div class="flex justify-center mt-8">
<el-pagination <el-pagination v-model:current-page="pageNo" v-model:page-size="pageSize" background :total="total"
v-model:current-page="pageNo" :page-sizes="[10, 20, 30, 40]" layout="prev, pager, next" @size-change="handleSizeChange"
v-model:page-size="pageSize" @current-change="handleCurrentChange" />
background
:total="total"
:page-sizes="[10, 20, 30, 40]"
layout="prev, pager, next"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
</div> </div>
<div class="w-80 flex-shrink-0 space-y-6"> <div class="w-80 flex-shrink-0 space-y-6">
<!-- 本地新闻 --> <!-- 本地新闻 -->
<div class="bg-white rounded-lg shadow-sm p-4"> <div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Location /></el-icon> <el-icon class="mr-2 text-blue-500">
<Location />
</el-icon>
太原新闻 太原新闻
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in tyNews" :key="index" class="group cursor-pointer"
v-for="(item, index) in tyNews" @click="goToDetail(item.id)">
:key="index" <div v-if="item.images != null" class="h-32 mb-2 overflow-hidden rounded-lg">
class="group cursor-pointer" <img :src="item.images" :alt="item.title" class="w-full h-full object-cover" />
@click="goToDetail(item.id)"
>
<div
v-if="item.images != null"
class="h-32 mb-2 overflow-hidden rounded-lg"
>
<img
:src="item.images"
:alt="item.title"
class="w-full h-full object-cover"
/>
</div> </div>
<div <div class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black">
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</div> </div>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -98,29 +79,29 @@ ...@@ -98,29 +79,29 @@
<!-- 通知公告 --> <!-- 通知公告 -->
<div class="bg-white rounded-lg shadow-sm p-4"> <div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Bell /></el-icon> <el-icon class="mr-2 text-blue-500">
<Bell />
</el-icon>
通知公告 通知公告
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in announcements" :key="index" class="group cursor-pointer"
v-for="(item, index) in announcements" @click="goToDetail(item)">
:key="index" <div class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black">
class="group cursor-pointer"
@click="getToDetail(item)"
>
<div
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</div> </div>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -143,9 +124,12 @@ import { ...@@ -143,9 +124,12 @@ import {
Bell, Bell,
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
//@ts-ignore
import { baseImageUrl, rdxw, sxxw, tzgg, tyxw } from "@/utils/config"; import { baseImageUrl, rdxw, sxxw, tzgg, tyxw } from "@/utils/config";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -156,9 +140,9 @@ const noticeType = ref(""); ...@@ -156,9 +140,9 @@ const noticeType = ref("");
const pageNo = ref(1); const pageNo = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const total = ref(100); const total = ref(100);
const tableData = ref([]); const tableData = ref<any[]>([]);
const tyNews = ref([]); const tyNews = ref<any[]>([]);
const announcements = ref([]); const announcements = ref<any[]>([]);
const breadcrumbItems = ref([ const breadcrumbItems = ref([
{ title: "首页", path: "/home/home" }, { title: "首页", path: "/home/home" },
{ title: "通知公告" }, { title: "通知公告" },
...@@ -184,7 +168,7 @@ function getTyNewsList(pageSize: number, pageNo: number) { ...@@ -184,7 +168,7 @@ function getTyNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -218,7 +202,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -218,7 +202,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -240,7 +224,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -240,7 +224,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
total.value = data.total; total.value = data.total;
...@@ -252,15 +236,19 @@ function getList(pageSize: number, pageNo: number) { ...@@ -252,15 +236,19 @@ function getList(pageSize: number, pageNo: number) {
.el-input :deep(.el-input__wrapper) { .el-input :deep(.el-input__wrapper) {
box-shadow: 0 0 0 1px #e5e7eb inset; box-shadow: 0 0 0 1px #e5e7eb inset;
} }
.el-input :deep(.el-input__wrapper.is-focus) { .el-input :deep(.el-input__wrapper.is-focus) {
box-shadow: 0 0 0 1px #409eff inset; box-shadow: 0 0 0 1px #409eff inset;
} }
.el-select :deep(.el-input__wrapper) { .el-select :deep(.el-input__wrapper) {
box-shadow: 0 0 0 1px #e5e7eb inset; box-shadow: 0 0 0 1px #e5e7eb inset;
} }
.el-select :deep(.el-input__wrapper.is-focus) { .el-select :deep(.el-input__wrapper.is-focus) {
box-shadow: 0 0 0 1px #409eff inset; box-shadow: 0 0 0 1px #409eff inset;
} }
.el-date-editor :deep(.el-range-separator) { .el-date-editor :deep(.el-range-separator) {
color: #606266; color: #606266;
} }
......
...@@ -8,19 +8,14 @@ ...@@ -8,19 +8,14 @@
/> --> /> -->
<div class="mb-6"> <div class="mb-6">
<el-breadcrumb :separator-icon="ArrowRight"> <el-breadcrumb :separator-icon="ArrowRight">
<el-breadcrumb-item :to="{ path: '/home/home' }" <el-breadcrumb-item :to="{ path: '/home/home' }">首页</el-breadcrumb-item>
>首页</el-breadcrumb-item <el-breadcrumb-item v-if="route.query.type != '0'" :to="{
>
<el-breadcrumb-item
v-if="route.query.type != '0'"
:to="{
path: '/home/news', path: '/home/news',
query: { query: {
categoryTitle: route.query.categoryTitle, categoryTitle: route.query.categoryTitle,
categoryId: route.query.categoryId, categoryId: route.query.categoryId,
}, },
}" }">{{ route.query.categoryTitle }}
>{{ route.query.categoryTitle }}
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item>详情</el-breadcrumb-item> <el-breadcrumb-item>详情</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
...@@ -35,15 +30,21 @@ ...@@ -35,15 +30,21 @@
<div class="flex items-center text-gray-600 mb-6 space-x-4"> <div class="flex items-center text-gray-600 mb-6 space-x-4">
<div class="flex items-center"> <div class="flex items-center">
<el-icon><User /></el-icon> <el-icon>
<User />
</el-icon>
<span class="ml-1">{{ details.author }}</span> <span class="ml-1">{{ details.author }}</span>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<el-icon><Clock /></el-icon> <el-icon>
<Clock />
</el-icon>
<span class="ml-1">{{ details.date }}</span> <span class="ml-1">{{ details.date }}</span>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<el-icon><View /></el-icon> <el-icon>
<View />
</el-icon>
<span class="ml-1">阅读 {{ details.hit }}</span> <span class="ml-1">阅读 {{ details.hit }}</span>
</div> </div>
</div> </div>
...@@ -56,29 +57,28 @@ ...@@ -56,29 +57,28 @@
<!-- 通知公告 --> <!-- 通知公告 -->
<div class="bg-white rounded-lg shadow-sm p-4"> <div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Bell /></el-icon> <el-icon class="mr-2 text-blue-500">
<Bell />
</el-icon>
通知公告 通知公告
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in announcements" :key="index" class="group cursor-pointer" @click="">
v-for="(item, index) in announcements" <div class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black">
:key="index"
class="group cursor-pointer"
@click="getToDetail(item)"
>
<div
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</div> </div>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -88,39 +88,33 @@ ...@@ -88,39 +88,33 @@
<!-- 热点新闻 --> <!-- 热点新闻 -->
<div class="bg-white rounded-lg shadow-sm p-6"> <div class="bg-white rounded-lg shadow-sm p-6">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="text-red-500 mr-2"><Star /></el-icon> <el-icon class="text-red-500 mr-2">
<Star />
</el-icon>
热点新闻 热点新闻
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in hotNews" :key="index" class="group cursor-pointer"
v-for="(item, index) in hotNews" @click="itemTyClick(item)">
:key="index" <div v-if="item.images != null" class="relative h-40 mb-2 overflow-hidden rounded-lg">
class="group cursor-pointer" <img :src="item.images" :alt="item.contentTitle"
@click="itemTyClick(item)" class="w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-300" />
>
<div
v-if="item.images != null"
class="relative h-40 mb-2 overflow-hidden rounded-lg"
>
<img
:src="item.images"
:alt="item.contentTitle"
class="w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-300"
/>
</div> </div>
<h3 <h3 class="text-base font-medium group-hover:text-blue-600 text-black">
class="text-base font-medium group-hover:text-blue-600 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</h3> </h3>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -130,39 +124,31 @@ ...@@ -130,39 +124,31 @@
<!-- 本地新闻 --> <!-- 本地新闻 -->
<div class="bg-white rounded-lg shadow-sm p-3"> <div class="bg-white rounded-lg shadow-sm p-3">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Location /></el-icon> <el-icon class="mr-2 text-blue-500">
<Location />
</el-icon>
太原新闻 太原新闻
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in tyNews" :key="index" class="group cursor-pointer" @click="">
v-for="(item, index) in tyNews" <div v-if="item.images != null" class="h-32 mb-2 overflow-hidden rounded-lg">
:key="index" <img :src="item.images" class="w-full h-full object-cover" />
class="group cursor-pointer"
@click="getToDetail(item)"
>
<div
v-if="item.images != null"
class="h-32 mb-2 overflow-hidden rounded-lg"
>
<img
:src="item.images"
:alt="item.title"
class="w-full h-full object-cover"
/>
</div> </div>
<div <div class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black">
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</div> </div>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -188,8 +174,11 @@ import { ...@@ -188,8 +174,11 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
//@ts-ignore
import { getHit } from "@/api/home/news/list"; import { getHit } from "@/api/home/news/list";
//@ts-ignore
import { getNewsDetail } from "@/api/home/news/details"; import { getNewsDetail } from "@/api/home/news/details";
//@ts-ignore
import { import {
baseImageUrl, baseImageUrl,
XW_RD_ID, XW_RD_ID,
...@@ -197,16 +186,19 @@ import { ...@@ -197,16 +186,19 @@ import {
SX_XW_ID, SX_XW_ID,
TZ_GG_ID, TZ_GG_ID,
tyxw, tyxw,
//@ts-ignore
} from "@/utils/config"; } from "@/utils/config";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const hotNews = ref([]); const hotNews = ref<any>([]);
const announcements = ref([]); const announcements = ref<any>([]);
const tyNews = ref([]); const tyNews = ref<any>([]);
getHotsNewsList(5, 1); getHotsNewsList(5, 1);
...@@ -218,7 +210,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) { ...@@ -218,7 +210,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -238,7 +230,7 @@ function getTyNewsList(pageSize: number, pageNo: number) { ...@@ -238,7 +230,7 @@ function getTyNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -268,7 +260,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -268,7 +260,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -280,7 +272,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -280,7 +272,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
}); });
} }
const details = ref({}); const details = ref<any>({});
//统计点击数量 //统计点击数量
getHit(route.query.id); getHit(route.query.id);
...@@ -305,9 +297,8 @@ function getNewsDetails(id: any) { ...@@ -305,9 +297,8 @@ function getNewsDetails(id: any) {
const data = { const data = {
id: id, id: id,
}; };
getNewsDetail(data).then((res) => { getNewsDetail(data).then((res: any) => {
details.value = res.data; details.value = res.data;
console.log(details.value);
}); });
} }
</script> </script>
......
...@@ -233,7 +233,8 @@ ...@@ -233,7 +233,8 @@
</el-tooltip> </el-tooltip>
<div class="absolute right-10 top-0"> <div class="absolute right-10 top-0">
<!-- transform旋转45度 --> <!-- transform旋转45度 -->
<img :src="yyIcon" class="w-[85px] h-[85px] object-contain transform rotate-[-20deg]" alt="谣言标识" /> <img src="@/assets/imgs/yy-icon.png"
class="w-[85px] h-[85px] object-contain transform rotate-[-20deg]" alt="谣言标识" />
</div> </div>
</div> </div>
<p class="mt-1 text-sm text-gray-500 line-clamp-2"> <p class="mt-1 text-sm text-gray-500 line-clamp-2">
...@@ -315,7 +316,7 @@ import "swiper/css/navigation"; ...@@ -315,7 +316,7 @@ import "swiper/css/navigation";
import { getLink } from "@/api/home/home"; import { getLink } from "@/api/home/home";
// @ts-ignore // @ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
import yyIcon from "@/assets/imgs/yy-icon.png"; // import yyIcon from "@/assets/imgs/yy-icon.png";
// @ts-ignore // @ts-ignore
import { import {
...@@ -327,6 +328,7 @@ import { ...@@ -327,6 +328,7 @@ import {
yjjblbt, yjjblbt,
pyzq, pyzq,
qwfb, qwfb,
//@ts-ignore
} from "@/utils/config"; } from "@/utils/config";
import jbzqBg from "@/assets/imgs/jbzq-bg.png"; import jbzqBg from "@/assets/imgs/jbzq-bg.png";
import pyptBg from "@/assets/imgs/pypt-bg.png"; import pyptBg from "@/assets/imgs/pypt-bg.png";
...@@ -339,6 +341,7 @@ interface NewsItem { ...@@ -339,6 +341,7 @@ interface NewsItem {
categoryTitle?: string; categoryTitle?: string;
contentTitle: string; contentTitle: string;
contentDescription: string; contentDescription: string;
contentSource: string;
contentDatetime: string; contentDatetime: string;
contentHit: number; contentHit: number;
contentImg?: string; contentImg?: string;
...@@ -370,13 +373,13 @@ const handleClick = (index: number, entry: QuickEntry) => { ...@@ -370,13 +373,13 @@ const handleClick = (index: number, entry: QuickEntry) => {
router.push({ path: "/home/jb" }); router.push({ path: "/home/jb" });
break; break;
case 1: case 1:
const wmHomePageUrl = router.resolve({ name: "wm" }).href;
window.open(wmHomePageUrl, "_blank");
break;
case 2:
const pyHomePageUrl = router.resolve({ name: "PyHome" }).href; const pyHomePageUrl = router.resolve({ name: "PyHome" }).href;
window.open(pyHomePageUrl, "_blank"); window.open(pyHomePageUrl, "_blank");
break; break;
case 2:
const wmHomePageUrl = router.resolve({ name: "wm" }).href;
window.open(wmHomePageUrl, "_blank");
break;
} }
// 处理点击事件 // 处理点击事件
}; };
......
...@@ -210,7 +210,9 @@ ...@@ -210,7 +210,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config"; import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config";
import { import {
Clock, Clock,
...@@ -222,6 +224,7 @@ import { ...@@ -222,6 +224,7 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
import { watch } from "vue"; import { watch } from "vue";
...@@ -246,10 +249,10 @@ const handleCurrentChange = (val: number) => { ...@@ -246,10 +249,10 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
}; };
const newsList = ref([]); const newsList = ref<any>([]);
const tyNews = ref([]); const tyNews = ref<any>([]);
const announcements = ref([]); const announcements = ref<any>([]);
const hotNews = ref([]); const hotNews = ref<any>([]);
getHotsNewsList(3, 1); getHotsNewsList(3, 1);
...@@ -261,7 +264,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) { ...@@ -261,7 +264,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -282,7 +285,7 @@ function getTyNewsList(pageSize: number, pageNo: number) { ...@@ -282,7 +285,7 @@ function getTyNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -303,7 +306,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -303,7 +306,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -334,7 +337,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -334,7 +337,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
......
...@@ -7,26 +7,14 @@ ...@@ -7,26 +7,14 @@
<div class="flex gap-6"> <div class="flex gap-6">
<div class="flex-1"> <div class="flex-1">
<div class="bg-white rounded-lg shadow-sm"> <div class="bg-white rounded-lg shadow-sm">
<div <div v-for="(news, index) in newsList" :key="index"
v-for="(news, index) in newsList"
:key="index"
class="group p-4 flex items-start border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer" class="group p-4 flex items-start border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer"
@click="getToDetail(news)" @click="getToDetail(news)">
> <div v-if="news.images != null" class="w-32 h-32 flex-shrink-0 overflow-hidden rounded-lg">
<div <el-image class="w-full h-full object-cover" :src="news.images" fit="fill" />
v-if="news.images != null"
class="w-32 h-32 flex-shrink-0 overflow-hidden rounded-lg"
>
<el-image
class="w-full h-full object-cover"
:src="news.images"
fit="fill"
/>
</div> </div>
<div class="flex-grow px-6"> <div class="flex-grow px-6">
<h2 <h2 class="text-lg font-semibold mb-2 group-hover:text-blue-600 line-clamp-2 text-black">
class="text-lg font-semibold mb-2 group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ news.contentTitle }} {{ news.contentTitle }}
</h2> </h2>
<p class="text-gray-600 text-sm line-clamp-2"> <p class="text-gray-600 text-sm line-clamp-2">
...@@ -34,7 +22,9 @@ ...@@ -34,7 +22,9 @@
</p> </p>
<div class="mt-3 flex items-center space-x-4"> <div class="mt-3 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ news.contentDatetime }} {{ news.contentDatetime }}
</span> </span>
<!-- <span class="text-sm text-gray-500 flex items-center"> <!-- <span class="text-sm text-gray-500 flex items-center">
...@@ -42,7 +32,9 @@ ...@@ -42,7 +32,9 @@
{{ news.contentTags }} {{ news.contentTags }}
</span> --> </span> -->
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ news.contentHit }} 阅读 {{ news.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -59,55 +51,40 @@ ...@@ -59,55 +51,40 @@
</div> </div>
</div> </div>
<div class="flex justify-center mt-8"> <div class="flex justify-center mt-8">
<el-pagination <el-pagination v-model:current-page="pageNo" v-model:page-size="pageSize" background :total="total"
v-model:current-page="pageNo" :page-sizes="[10, 20, 30, 40]" layout="prev, pager, next" @size-change="handleSizeChange"
v-model:page-size="pageSize" @current-change="handleCurrentChange" />
background
:total="total"
:page-sizes="[10, 20, 30, 40]"
layout="prev, pager, next"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
</div> </div>
<div class="w-80 flex-shrink-0 space-y-6"> <div class="w-80 flex-shrink-0 space-y-6">
<!-- 本地新闻 --> <!-- 本地新闻 -->
<div class="bg-white rounded-lg shadow-sm p-4"> <div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Location /></el-icon> <el-icon class="mr-2 text-blue-500">
<Location />
</el-icon>
太原新闻 太原新闻
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in tyNews" :key="index" class="group cursor-pointer" @click="getToDetail(item)">
v-for="(item, index) in tyNews" <div v-if="item.images != null" class="h-32 mb-2 overflow-hidden rounded-lg">
:key="index" <img :src="item.images" :alt="item.title" class="w-full h-full object-cover" />
class="group cursor-pointer"
@click="getToDetail(item)"
>
<div
v-if="item.images != null"
class="h-32 mb-2 overflow-hidden rounded-lg"
>
<img
:src="item.images"
:alt="item.title"
class="w-full h-full object-cover"
/>
</div> </div>
<div <div class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black">
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</div> </div>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -117,29 +94,29 @@ ...@@ -117,29 +94,29 @@
<!-- 通知公告 --> <!-- 通知公告 -->
<div class="bg-white rounded-lg shadow-sm p-4"> <div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black"> <h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Bell /></el-icon> <el-icon class="mr-2 text-blue-500">
<Bell />
</el-icon>
通知公告 通知公告
</h2> </h2>
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in announcements" :key="index" class="group cursor-pointer"
v-for="(item, index) in announcements" @click="getToDetail(item)">
:key="index" <div class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black">
class="group cursor-pointer"
@click="getToDetail(item)"
>
<div
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.contentTitle }} {{ item.contentTitle }}
</div> </div>
<div class="mt-1 flex items-center space-x-4"> <div class="mt-1 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon> <el-icon class="mr-1">
<Clock />
</el-icon>
{{ item.contentDatetime }} {{ item.contentDatetime }}
</span> </span>
<span class="text-sm text-gray-500 flex items-center"> <span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon> <el-icon class="mr-1">
<View />
</el-icon>
{{ item.contentHit }} 阅读 {{ item.contentHit }} 阅读
</span> </span>
</div> </div>
...@@ -153,7 +130,9 @@ ...@@ -153,7 +130,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from "vue"; import { ref, watch } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config"; import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config";
import { import {
Clock, Clock,
...@@ -165,6 +144,7 @@ import { ...@@ -165,6 +144,7 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -189,9 +169,9 @@ const handleCurrentChange = (val: number) => { ...@@ -189,9 +169,9 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(route.query.searchQuery, pageSize.value, pageNo.value); getList(route.query.searchQuery, pageSize.value, pageNo.value);
}; };
const newsList = ref([]); const newsList = ref<any>([]);
const tyNews = ref([]); const tyNews = ref<any>([]);
const announcements = ref([]); const announcements = ref<any>([]);
getTyNewsList(5, 1); getTyNewsList(5, 1);
...@@ -203,7 +183,7 @@ function getTyNewsList(pageSize: number, pageNo: number) { ...@@ -203,7 +183,7 @@ function getTyNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -225,7 +205,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -225,7 +205,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -257,7 +237,7 @@ function getList(searchQuery: any, pageSize: number, pageNo: number) { ...@@ -257,7 +237,7 @@ function getList(searchQuery: any, pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
...@@ -296,6 +276,7 @@ function getToDetail(item: any) { ...@@ -296,6 +276,7 @@ function getToDetail(item: any) {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
.line-clamp-1 { .line-clamp-1 {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
......
...@@ -144,7 +144,9 @@ ...@@ -144,7 +144,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, rdxw, sxxw, tzgg } from "@/utils/config"; import { baseImageUrl, rdxw, sxxw, tzgg } from "@/utils/config";
import { import {
Clock, Clock,
...@@ -156,6 +158,7 @@ import { ...@@ -156,6 +158,7 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -178,10 +181,9 @@ const handleCurrentChange = (val: number) => { ...@@ -178,10 +181,9 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
}; };
const newsList = ref([]); const newsList = ref<any>([]);
const hotNews = ref<any>([]);
const hotNews = ref([]); const announcements = ref<any>([]);
const announcements = ref([]);
getHotsNewsList(5, 1); getHotsNewsList(5, 1);
...@@ -193,7 +195,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) { ...@@ -193,7 +195,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
hotNews.value = rowsList; hotNews.value = rowsList;
...@@ -210,7 +212,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -210,7 +212,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -233,7 +235,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -233,7 +235,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
......
...@@ -145,7 +145,9 @@ ...@@ -145,7 +145,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config"; import { baseImageUrl, rdxw, tyxw, tzgg } from "@/utils/config";
import { import {
Clock, Clock,
...@@ -157,6 +159,7 @@ import { ...@@ -157,6 +159,7 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -179,10 +182,9 @@ const handleCurrentChange = (val: number) => { ...@@ -179,10 +182,9 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
}; };
const newsList = ref([]); const newsList = ref<any>([]);
const hotNews = ref<any>([]);
const hotNews = ref([]); const announcements = ref<any>([]);
const announcements = ref([]);
getHotsNewsList(5, 1); getHotsNewsList(5, 1);
...@@ -194,7 +196,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) { ...@@ -194,7 +196,7 @@ function getHotsNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
hotNews.value = rowsList; hotNews.value = rowsList;
...@@ -211,7 +213,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) { ...@@ -211,7 +213,7 @@ function getTzGgNewsList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -234,7 +236,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -234,7 +236,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
......
...@@ -333,6 +333,7 @@ ...@@ -333,6 +333,7 @@
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import cityData from "@/assets/city.json"; import cityData from "@/assets/city.json";
//@ts-ignore
import { getUpdateForm, uploadFile } from "@/api/jb/jb"; import { getUpdateForm, uploadFile } from "@/api/jb/jb";
import Footer from "@/components/footer.vue"; import Footer from "@/components/footer.vue";
...@@ -590,7 +591,7 @@ function contentImghandleRemove(file: any, fileList: any) { ...@@ -590,7 +591,7 @@ function contentImghandleRemove(file: any, fileList: any) {
// 提交表单 // 提交表单
function submitForm() { function submitForm() {
formRef.value.validate((valid) => { formRef.value.validate((valid: boolean) => {
if (valid) { if (valid) {
// 验证验证码 // 验证验证码
if (form.captcha.toUpperCase() !== captchaText.value) { if (form.captcha.toUpperCase() !== captchaText.value) {
...@@ -674,7 +675,7 @@ const captchaText = ref<string>(""); ...@@ -674,7 +675,7 @@ const captchaText = ref<string>("");
const captchaImage = ref<string>(""); const captchaImage = ref<string>("");
function refreshCaptcha() { function refreshCaptcha() {
const captcha = generateCaptcha(); const captcha: any = generateCaptcha();
captchaText.value = captcha.text; captchaText.value = captcha.text;
captchaImage.value = captcha.image; captchaImage.value = captcha.image;
} }
......
...@@ -3,13 +3,10 @@ ...@@ -3,13 +3,10 @@
<template> <template>
<div class="min-h-screen bg-gray-50"> <div class="min-h-screen bg-gray-50">
<div <div
class="bg-[url('@/assets/imgs/tyjb-bg.png')] bg-cover bg-center h-[240px] flex items-center justify-center text-[65px] font-bold text-white" class="bg-[url('@/assets/imgs/tyjb-bg.png')] bg-cover bg-center h-[240px] flex items-center justify-center text-[65px] font-bold text-white">
>
太原市互联网应急指挥和举报中心 太原市互联网应急指挥和举报中心
</div> </div>
<div <div class="mt-5 w-[1250px] m-auto flex flex-col items-center justify-center">
class="mt-5 w-[1250px] m-auto flex flex-col items-center justify-center"
>
<div class="con"> <div class="con">
<div class="con1"> <div class="con1">
<ul> <ul>
...@@ -23,58 +20,34 @@ ...@@ -23,58 +20,34 @@
</li> </li>
<div class="line1"></div> <div class="line1"></div>
<br /> <br />
<li <li class="bg-[#00000011]" style="padding-top: 20px; padding-bottom: 10px">
class="bg-[#00000011]" <a :href="inject('VITE_12377_URL')" target="_blank"><img
style="padding-top: 20px; padding-bottom: 10px" src="https://www.sxgov.cn/templateRes/202312/08/50291/50043/logo12377.jpg" /></a>
>
<a :href="inject('VITE_12377_URL')" target="_blank"
><img
src="https://www.sxgov.cn/templateRes/202312/08/50291/50043/logo12377.jpg"
/></a>
<h1> <h1>
<a :href="inject('VITE_12377_URL')" target="_blank" <a :href="inject('VITE_12377_URL')" target="_blank">中央网信办举报中心官网违法和不良信息举报入口</a>
>中央网信办举报中心官网违法和不良信息举报入口</a
>
</h1> </h1>
</li> </li>
<br /> <br />
<li <li class="bg-[#00000011]" style="padding-top: 20px; padding-bottom: 10px">
class="bg-[#00000011]" <a :href="inject('VITE_SXGOV_URL')" target="_blank"><img
style="padding-top: 20px; padding-bottom: 10px" src="//www.sxgov.cn/templateRes/202301/05/50196/50122/jubaosx21.jpg" /></a>
>
<a :href="inject('VITE_SXGOV_URL')" target="_blank"
><img
src="//www.sxgov.cn/templateRes/202301/05/50196/50122/jubaosx21.jpg"
/></a>
<h1> <h1>
<a :href="inject('VITE_SXGOV_URL')" target="_blank" <a :href="inject('VITE_SXGOV_URL')" target="_blank">山西省互联网应急指挥和举报中心举报入口</a>
>山西省互联网应急指挥和举报中心举报入口</a
>
</h1> </h1>
</li> </li>
<br /> <br />
<li <li class="bg-[#00000011]" style="padding-top: 0px; padding-bottom: 10px">
class="bg-[#00000011]"
style="padding-top: 0px; padding-bottom: 10px"
>
<h1 class="cursor-pointer"> <h1 class="cursor-pointer">
<!-- <a <!-- <a
href="http://oa.wangxinban.cn/jb/#/Home/Home?agencyID=52340bbb-f782-4886-02c4-08d9605acd8c&agencyName=太原市网信" href="http://oa.wangxinban.cn/jb/#/Home/Home?agencyID=52340bbb-f782-4886-02c4-08d9605acd8c&agencyName=太原市网信"
target="_blank" target="_blank"
>太原市互联网违法和不良信息举报平台</a >太原市互联网违法和不良信息举报平台</a
> --> > -->
<a target="_blank" @click="handleClick" <a target="_blank" @click="handleClick">太原市互联网违法和不良信息举报平台</a>
>太原市互联网违法和不良信息举报平台</a
>
</h1> </h1>
<h3>太原市互联网举报电话:{{ inject("VITE_PHONE") }}</h3> <h3>太原市互联网举报电话:{{ inject("VITE_PHONE") }}</h3>
<h3>太原市互联网举报邮箱:{{ inject("VITE_EMAIL") }}</h3> <h3>太原市互联网举报邮箱:{{ inject("VITE_EMAIL") }}</h3>
<el-button <el-button class="botton" type="primary" size="big" @click="handleClick">
class="botton"
type="primary"
size="big"
@click="handleClick"
>
我要举报 我要举报
</el-button> </el-button>
</li> </li>
...@@ -86,7 +59,9 @@ ...@@ -86,7 +59,9 @@
</ul> </ul>
</div> </div>
<ul> <ul>
<li><h1>一、受理举报范围</h1></li> <li>
<h1>一、受理举报范围</h1>
</li>
<li>山西属地网站中出现的以下信息:</li> <li>山西属地网站中出现的以下信息:</li>
<li>1、反对宪法所确定的基本原则的;</li> <li>1、反对宪法所确定的基本原则的;</li>
<li>2、危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;</li> <li>2、危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;</li>
...@@ -97,7 +72,9 @@ ...@@ -97,7 +72,9 @@
<li>7、散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;</li> <li>7、散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;</li>
<li>8、侮辱或者诽谤他人,侵害他人合法权益的;</li> <li>8、侮辱或者诽谤他人,侵害他人合法权益的;</li>
<li>9、含有法律、行政法规禁止的其他内容的。</li> <li>9、含有法律、行政法规禁止的其他内容的。</li>
<li><h1>二、注意事项</h1></li> <li>
<h1>二、注意事项</h1>
</li>
<li>1、请您根据受理举报范围进行举报。</li> <li>1、请您根据受理举报范围进行举报。</li>
<li>2、请您自觉遵守中华人民共和国宪法和法律。</li> <li>2、请您自觉遵守中华人民共和国宪法和法律。</li>
<li> <li>
...@@ -154,6 +131,7 @@ function handleClick() { ...@@ -154,6 +131,7 @@ function handleClick() {
.min-h-screen { .min-h-screen {
min-height: 1024px; min-height: 1024px;
} }
.con { .con {
width: 1050px; width: 1050px;
margin: 0px auto; margin: 0px auto;
...@@ -161,12 +139,14 @@ function handleClick() { ...@@ -161,12 +139,14 @@ function handleClick() {
padding-bottom: 10px; padding-bottom: 10px;
box-shadow: 0px 0px 9.9px 0.1px rgba(5, 157, 254, 0.32); box-shadow: 0px 0px 9.9px 0.1px rgba(5, 157, 254, 0.32);
} }
.con1 { .con1 {
width: 1050px; width: 1050px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
padding-top: 5px; padding-top: 5px;
} }
.con1 ul { .con1 ul {
text-align: center; text-align: center;
} }
...@@ -183,6 +163,7 @@ function handleClick() { ...@@ -183,6 +163,7 @@ function handleClick() {
line-height: 280%; line-height: 280%;
font-weight: bold; font-weight: bold;
} }
.con1 h5 { .con1 h5 {
font-size: 18px; font-size: 18px;
line-height: 220%; line-height: 220%;
...@@ -196,18 +177,21 @@ function handleClick() { ...@@ -196,18 +177,21 @@ function handleClick() {
border-bottom: 1px solid rgba(5, 157, 254, 0.56); border-bottom: 1px solid rgba(5, 157, 254, 0.56);
margin: 20px auto; margin: 20px auto;
} }
.con1 li { .con1 li {
text-align: center; text-align: center;
line-height: 180%; line-height: 180%;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.con li { .con li {
font-size: 18px; font-size: 18px;
line-height: 240%; line-height: 240%;
text-indent: 2em; text-indent: 2em;
list-style: none; list-style: none;
} }
.con1 h1 { .con1 h1 {
font-size: 18px; font-size: 18px;
color: #ca0000; color: #ca0000;
...@@ -215,6 +199,7 @@ function handleClick() { ...@@ -215,6 +199,7 @@ function handleClick() {
margin: 0; margin: 0;
line-height: 180%; line-height: 180%;
} }
.con1 h1 a { .con1 h1 a {
color: #ca0000; color: #ca0000;
font-weight: bold; font-weight: bold;
...@@ -224,21 +209,25 @@ function handleClick() { ...@@ -224,21 +209,25 @@ function handleClick() {
font-size: 18px; font-size: 18px;
color: #ca0000; color: #ca0000;
} }
.con1 h2 a { .con1 h2 a {
color: #ca0000; color: #ca0000;
font-weight: bold; font-weight: bold;
} }
.con1 li { .con1 li {
text-align: center; text-align: center;
line-height: 180%; line-height: 180%;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.con1 h3 { .con1 h3 {
font-size: 18px; font-size: 18px;
color: #ca0000; color: #ca0000;
font-weight: normal; font-weight: normal;
} }
.con h1 { .con h1 {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
...@@ -258,6 +247,7 @@ function handleClick() { ...@@ -258,6 +247,7 @@ function handleClick() {
/* text-indent: 2em; */ /* text-indent: 2em; */
/* list-style: none; */ /* list-style: none; */
} }
.botton { .botton {
width: 150px; width: 150px;
padding: 8px 10px; padding: 8px 10px;
...@@ -271,6 +261,7 @@ function handleClick() { ...@@ -271,6 +261,7 @@ function handleClick() {
font-weight: 700; font-weight: 700;
letter-spacing: 0.1em; letter-spacing: 0.1em;
} }
#footer { #footer {
width: 100vh; width: 100vh;
/* height: 200px; */ /* height: 200px; */
...@@ -280,6 +271,7 @@ function handleClick() { ...@@ -280,6 +271,7 @@ function handleClick() {
background-color: #ffffff; background-color: #ffffff;
margin-top: 40px; margin-top: 40px;
} }
/* iframe { /* iframe {
overflow-clip-margin: content-box !important; overflow-clip-margin: content-box !important;
overflow: clip !important; overflow: clip !important;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
//@ts-ignore
import { pyzq, qwfb, zjjd, flfg } from "@/utils/config"; import { pyzq, qwfb, zjjd, flfg } from "@/utils/config";
import NewsList from "@/components/py/NewsList.vue"; import NewsList from "@/components/py/NewsList.vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
......
...@@ -220,19 +220,24 @@ import { ...@@ -220,19 +220,24 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
//@ts-ignore
import { getHit } from "@/api/home/news/list"; import { getHit } from "@/api/home/news/list";
//@ts-ignore
import { getNewsDetail } from "@/api/home/news/details"; import { getNewsDetail } from "@/api/home/news/details";
//@ts-ignore
import { baseImageUrl, pyzq, qwfb, zjjd, flfg } from "@/utils/config"; import { baseImageUrl, pyzq, qwfb, zjjd, flfg } from "@/utils/config";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const details = ref({}); const details = ref<any>({});
const list0 = ref([]); const list0 = ref<any>([]);
const list1 = ref([]); const list1 = ref<any>([]);
const list2 = ref([]); const list2 = ref<any>([]);
const list3 = ref([]); const list3 = ref<any>([]);
getList0(3, 1); getList0(3, 1);
getList1(3, 1); getList1(3, 1);
...@@ -247,7 +252,7 @@ function getList0(pageSize: number, pageNo: number) { ...@@ -247,7 +252,7 @@ function getList0(pageSize: number, pageNo: number) {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -266,7 +271,7 @@ function getList1(pageSize: number, pageNo: number) { ...@@ -266,7 +271,7 @@ function getList1(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -294,7 +299,7 @@ function getList2(pageSize: number, pageNo: number) { ...@@ -294,7 +299,7 @@ function getList2(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -314,7 +319,7 @@ function getList3(pageSize: number, pageNo: number) { ...@@ -314,7 +319,7 @@ function getList3(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -345,7 +350,7 @@ function getNewsDetails(id: any) { ...@@ -345,7 +350,7 @@ function getNewsDetails(id: any) {
const data = { const data = {
id: id, id: id,
}; };
getNewsDetail(data).then((res) => { getNewsDetail(data).then((res: any) => {
details.value = res.data; details.value = res.data;
console.log(details.value); console.log(details.value);
}); });
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
//@ts-ignore
import { pyzq, qwfb, zjjd, flfg } from "@/utils/config"; import { pyzq, qwfb, zjjd, flfg } from "@/utils/config";
import NewsList from "@/components/py/NewsList.vue"; import NewsList from "@/components/py/NewsList.vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</el-tooltip> </el-tooltip>
<div class="absolute right-10 top-0"> <div class="absolute right-10 top-0">
<!-- transform旋转45度 --> <!-- transform旋转45度 -->
<img :src="yyIcon" class="w-[85px] h-[85px] object-contain transform rotate-[-20deg]" <img src="@/assets/imgs/yy-icon.png" class="w-[85px] h-[85px] object-contain transform rotate-[-20deg]"
alt="谣言标识" /> alt="谣言标识" />
</div> </div>
</div> </div>
...@@ -316,10 +316,13 @@ import "swiper/css"; ...@@ -316,10 +316,13 @@ import "swiper/css";
import "swiper/css/pagination"; import "swiper/css/pagination";
import "swiper/css/autoplay"; import "swiper/css/autoplay";
import "swiper/css/navigation"; import "swiper/css/navigation";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, lhpylbt, dtsy, zjjd, pyzq, flfg, qwfb } from "@/utils/config"; import { baseImageUrl, lhpylbt, dtsy, zjjd, pyzq, flfg, qwfb } from "@/utils/config";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import yyIcon from "@/assets/imgs/yy-icon.png"; //@ts-ignore
// import yyIcon from "@/assets/imgs/yy-icon.png";
const pyList = ref<any[]>([]); const pyList = ref<any[]>([]);
const qwList = ref<any[]>([]); const qwList = ref<any[]>([]);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
//@ts-ignore
import { baseImageUrl, pyzq, qwfb, zjjd, flfg } from "@/utils/config"; import { baseImageUrl, pyzq, qwfb, zjjd, flfg } from "@/utils/config";
import NewsList from "@/components/py/NewsList.vue"; import NewsList from "@/components/py/NewsList.vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
......
...@@ -55,10 +55,13 @@ ...@@ -55,10 +55,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed } from "vue"; import { ref, computed } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, dtsy } from "@/utils/config"; import { baseImageUrl, dtsy } from "@/utils/config";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { ArrowRight } from "@element-plus/icons-vue"; import { ArrowRight } from "@element-plus/icons-vue";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -66,7 +69,7 @@ const route = useRoute(); ...@@ -66,7 +69,7 @@ const route = useRoute();
const pageNo = ref(1); const pageNo = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const total = ref(0); const total = ref(0);
const newsList = ref([]); const newsList = ref<any[]>([]);
const breadcrumbItems = ref([ const breadcrumbItems = ref([
{ title: "首页", path: "/py/pyhome" }, { title: "首页", path: "/py/pyhome" },
...@@ -93,7 +96,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -93,7 +96,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
//@ts-ignore
import { pyzq, qwfb, zjjd, flfg } from "@/utils/config"; import { pyzq, qwfb, zjjd, flfg } from "@/utils/config";
import NewsList from "@/components/py/NewsList.vue"; import NewsList from "@/components/py/NewsList.vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
......
...@@ -213,7 +213,9 @@ ...@@ -213,7 +213,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from "vue"; import { ref, watch } from "vue";
//@ts-ignore
import { getNewsList } from "@/api/home/news/list"; import { getNewsList } from "@/api/home/news/list";
//@ts-ignore
import { baseImageUrl, qwfb, pyzq, zjjd, flfg } from "@/utils/config"; import { baseImageUrl, qwfb, pyzq, zjjd, flfg } from "@/utils/config";
import { import {
Clock, Clock,
...@@ -225,6 +227,7 @@ import { ...@@ -225,6 +227,7 @@ import {
ArrowRight, ArrowRight,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -249,13 +252,11 @@ const handleCurrentChange = (val: number) => { ...@@ -249,13 +252,11 @@ const handleCurrentChange = (val: number) => {
pageNo.value = val; pageNo.value = val;
getList(route.query.searchQuery, pageSize.value, pageNo.value); getList(route.query.searchQuery, pageSize.value, pageNo.value);
}; };
const newsList = ref([]); const newsList = ref<any[]>([]);
const tyNews = ref([]); const list0 = ref<any[]>([]);
const announcements = ref([]); const list1 = ref<any[]>([]);
const list0 = ref([]); const list2 = ref<any[]>([]);
const list1 = ref([]); const list3 = ref<any[]>([]);
const list2 = ref([]);
const list3 = ref([]);
getList0(); getList0();
getList1(); getList1();
getList2(); getList2();
...@@ -270,7 +271,7 @@ function getList0() { ...@@ -270,7 +271,7 @@ function getList0() {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -290,7 +291,7 @@ function getList1() { ...@@ -290,7 +291,7 @@ function getList1() {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -310,7 +311,7 @@ function getList2() { ...@@ -310,7 +311,7 @@ function getList2() {
pageSize: 3, pageSize: 3,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -330,7 +331,7 @@ function getList3() { ...@@ -330,7 +331,7 @@ function getList3() {
pageSize: 2, pageSize: 2,
pageNo: 1, pageNo: 1,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
rowsList.forEach((item: any) => { rowsList.forEach((item: any) => {
...@@ -363,7 +364,7 @@ function getList(searchQuery: any, pageSize: number, pageNo: number) { ...@@ -363,7 +364,7 @@ function getList(searchQuery: any, pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getNewsList(datas).then((response) => { getNewsList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
......
...@@ -163,6 +163,7 @@ import { ...@@ -163,6 +163,7 @@ import {
Message, Message,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
//@ts-ignore
import { getHotList as rawGetHotList, getRecoverList as rawGetRecoverList } from "@/api/wm/wm"; import { getHotList as rawGetHotList, getRecoverList as rawGetRecoverList } from "@/api/wm/wm";
// 热点留言列表项接口 // 热点留言列表项接口
......
...@@ -188,9 +188,12 @@ ...@@ -188,9 +188,12 @@
import { ref, onMounted, getCurrentInstance, watch } from "vue"; import { ref, onMounted, getCurrentInstance, watch } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { Warning, ArrowRight, Message } from "@element-plus/icons-vue"; import { Warning, ArrowRight, Message } from "@element-plus/icons-vue";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
//@ts-ignore
import { getWantMessage, uploadFile } from "@/api/wm/wm"; import { getWantMessage, uploadFile } from "@/api/wm/wm";
import { ElMessageBox } from "element-plus"; import { ElMessageBox } from "element-plus";
//@ts-ignore
import { baseImageUrl } from "@/utils/config"; import { baseImageUrl } from "@/utils/config";
// const { proxy } = getCurrentInstance(); // const { proxy } = getCurrentInstance();
...@@ -200,11 +203,11 @@ const breadcrumbItems = ref([ ...@@ -200,11 +203,11 @@ const breadcrumbItems = ref([
{ title: "我要留言" }, { title: "我要留言" },
]); ]);
const captchaText = ref(""); const captchaText = ref<any>("");
const captchaImage = ref(""); const captchaImage = ref<any>("");
const fileList = ref([]); const fileList = ref([]);
const uploadRef = ref(); const uploadRef = ref();
const formData = ref({ const formData = ref<any>({
name: "", name: "",
title: "", title: "",
content: "", content: "",
...@@ -214,7 +217,7 @@ const formData = ref({ ...@@ -214,7 +217,7 @@ const formData = ref({
}); });
const refreshCaptcha = () => { const refreshCaptcha = () => {
const captcha = generateCaptcha(); const captcha: any = generateCaptcha();
captchaText.value = captcha.text; captchaText.value = captcha.text;
captchaImage.value = captcha.image; captchaImage.value = captcha.image;
}; };
...@@ -300,7 +303,7 @@ const handleSubmit = () => { ...@@ -300,7 +303,7 @@ const handleSubmit = () => {
// }); // });
// 提交表单 // 提交表单
getWantMessage(formData.value).then((res) => { getWantMessage(formData.value).then((res: any) => {
ElMessage({ ElMessage({
message: "提交成功", message: "提交成功",
type: "success", type: "success",
......
...@@ -159,8 +159,10 @@ import { ...@@ -159,8 +159,10 @@ import {
DataBoard, DataBoard,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
import { ref } from "vue"; import { ref } from "vue";
//@ts-ignore
import { getMessageDetail } from "@/api/wm/wm"; import { getMessageDetail } from "@/api/wm/wm";
//引入VueOfficeDocx组件 //引入VueOfficeDocx组件
import VueOfficeDocx from "@vue-office/docx"; import VueOfficeDocx from "@vue-office/docx";
...@@ -183,10 +185,10 @@ const breadcrumbItems2 = ref([ ...@@ -183,10 +185,10 @@ const breadcrumbItems2 = ref([
{ title: "详情", path: "" }, { title: "详情", path: "" },
]); ]);
const detail = ref({}); const detail = ref<any>({});
// 获取留言详情 // 获取留言详情
getMessageDetail(route.query.id).then((res) => { getMessageDetail(route.query.id).then((res: any) => {
detail.value = res.data; detail.value = res.data;
}); });
......
...@@ -7,26 +7,19 @@ ...@@ -7,26 +7,19 @@
<!-- 搜索框 --> <!-- 搜索框 -->
<div class="relative"> <div class="relative">
<input <input type="text" v-model="searchText" placeholder="搜索留言"
type="text"
v-model="searchText"
placeholder="搜索留言"
class="w-[300px] h-8 pl-4 pr-10 rounded-lg border-none bg-white shadow-sm focus:ring-2 focus:ring-blue-500 text-sm" class="w-[300px] h-8 pl-4 pr-10 rounded-lg border-none bg-white shadow-sm focus:ring-2 focus:ring-blue-500 text-sm"
@keyup.enter="handleSearch" @keyup.enter="handleSearch" />
/> <el-icon class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400">
<el-icon class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400" <Search />
><Search </el-icon>
/></el-icon>
</div> </div>
</div> </div>
<!-- 留言列表 --> <!-- 留言列表 -->
<div class="space-y-4"> <div class="space-y-4">
<div <div v-for="(item, index) in hotList" :key="index"
v-for="(item, index) in hotList"
:key="index"
class="bg-white rounded-lg shadow-sm p-6 transition-all duration-300 hover:shadow-lg hover:scale-[1.01] cursor-pointer" class="bg-white rounded-lg shadow-sm p-6 transition-all duration-300 hover:shadow-lg hover:scale-[1.01] cursor-pointer"
@click="clickList(item.id)" @click="clickList(item.id)">
>
<!-- <h2 class="text-lg font-medium text-gray-900 mb-3"> <!-- <h2 class="text-lg font-medium text-gray-900 mb-3">
{{ item.title }} {{ item.title }}
</h2> --> </h2> -->
...@@ -35,15 +28,12 @@ ...@@ -35,15 +28,12 @@
<h3 class="text-lg font-medium text-gray-900 line-clamp-2"> <h3 class="text-lg font-medium text-gray-900 line-clamp-2">
{{ item.title }} {{ item.title }}
</h3> </h3>
<span <span :class="[
:class="[
'px-3 py-1 rounded-full text-sm', 'px-3 py-1 rounded-full text-sm',
item.replyStatus === '1' item.replyStatus === '1'
? 'bg-green-50 text-green-600' ? 'bg-green-50 text-green-600'
: 'bg-orange-50 text-orange-600', : 'bg-orange-50 text-orange-600',
]" ]">{{ item.replyStatus === "1" ? "已回复" : "未回复" }}</span>
>{{ item.replyStatus === "1" ? "已回复" : "未回复" }}</span
>
</div> </div>
<p class="text-gray-600 mb-4 leading-relaxed line-clamp-3"> <p class="text-gray-600 mb-4 leading-relaxed line-clamp-3">
...@@ -57,16 +47,9 @@ ...@@ -57,16 +47,9 @@
</div> </div>
<!-- 分页 --> <!-- 分页 -->
<div class="flex justify-center mt-8"> <div class="flex justify-center mt-8">
<el-pagination <el-pagination v-model:current-page="pageNo" v-model:page-size="pageSize" background :total="total"
v-model:current-page="pageNo" :page-sizes="[10, 20, 30, 40]" layout="prev, pager, next" @size-change="handleSizeChange"
v-model:page-size="pageSize" @current-change="handleCurrentChange" />
background
:total="total"
:page-sizes="[10, 20, 30, 40]"
layout="prev, pager, next"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
</div> </div>
</template> </template>
...@@ -74,7 +57,9 @@ ...@@ -74,7 +57,9 @@
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { Search, ArrowRight } from "@element-plus/icons-vue"; import { Search, ArrowRight } from "@element-plus/icons-vue";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
//@ts-ignore
import { getHotList } from "@/api/wm/wm"; import { getHotList } from "@/api/wm/wm";
import { onMounted } from "vue"; import { onMounted } from "vue";
...@@ -83,7 +68,7 @@ const route = useRoute(); ...@@ -83,7 +68,7 @@ const route = useRoute();
const searchText = ref(); const searchText = ref();
const pageNo = ref(1); const pageNo = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const hotList = ref([]); const hotList = ref<any[]>([]);
const total = ref(0); const total = ref(0);
const handleSizeChange = (val: number) => { const handleSizeChange = (val: number) => {
...@@ -108,7 +93,6 @@ onMounted(() => { ...@@ -108,7 +93,6 @@ onMounted(() => {
getList(pageSize.value, pageNo.value); getList(pageSize.value, pageNo.value);
}); });
// watch route.query.keywords
watch( watch(
() => route.query.keywords, () => route.query.keywords,
(newVal) => { (newVal) => {
...@@ -119,19 +103,16 @@ watch( ...@@ -119,19 +103,16 @@ watch(
//获取新闻热点列表 //获取新闻热点列表
function getList(pageSize: number, pageNo: number) { function getList(pageSize: number, pageNo: number) {
// if (route.query.keywords) {
// searchText.value = route.query.keywords;
// console.log(route.query.keywords);
// }
const datas = { const datas = {
title: searchText.value, title: searchText.value,
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getHotList(datas).then((response) => { getHotList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
hotList.value = rowsList; hotList.value = rowsList;
total.value = data.total;
}); });
} }
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<template> <template>
<div class="mx-auto w-[1440px] px-4 py-0 mb-10"> <div class="mx-auto w-[1440px] px-4 py-0 mb-10">
<bread-crumb <bread-crumb :breadcrumbItems="route.query.pathType == '-1' ? breadcrumbItems2 : breadcrumbItems" />
:breadcrumbItems="
route.query.pathType == '-1' ? breadcrumbItems2 : breadcrumbItems
"
/>
<!-- 主要内容卡片 --> <!-- 主要内容卡片 -->
<div class="rounded-lg bg-white p-6 shadow-sm"> <div class="rounded-lg bg-white p-6 shadow-sm">
...@@ -16,9 +12,7 @@ ...@@ -16,9 +12,7 @@
东湖新区排水管网改造工程环境污染问题 东湖新区排水管网改造工程环境污染问题
</h1> </h1>
<div class="flex items-center space-x-4 text-sm text-gray-500"> <div class="flex items-center space-x-4 text-sm text-gray-500">
<span <span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700">
class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700"
>
已回复 已回复
</span> </span>
<span>留言人: 李**</span> <span>留言人: 李**</span>
...@@ -35,35 +29,25 @@ ...@@ -35,35 +29,25 @@
<br />建议加强监管力度,落实各项防尘措施,保障居民生活环境。 <br />建议加强监管力度,落实各项防尘措施,保障居民生活环境。
</p> </p>
<!-- 附件区域 --> <!-- 附件区域 -->
<div <div v-if="attachments.length > 0" class="mt-1 border-t border-gray-200 pt-3">
v-if="attachments.length > 0"
class="mt-1 border-t border-gray-200 pt-3"
>
<h3 class="mb-3 text-sm font-medium text-gray-900 weight-bold"> <h3 class="mb-3 text-sm font-medium text-gray-900 weight-bold">
附件: 附件:
</h3> </h3>
<div class="space-y-1"> <div class="space-y-1">
<div <div v-for="(file, index) in attachments" :key="index"
v-for="(file, index) in attachments"
:key="index"
class="group flex cursor-pointer items-center rounded-md p-1 hover:bg-gray-50" class="group flex cursor-pointer items-center rounded-md p-1 hover:bg-gray-50"
@click="handlePreview(file)" @click="handlePreview(file)">
>
<el-icon class="mr-2 text-gray-400" color="blue"> <el-icon class="mr-2 text-gray-400" color="blue">
<Document <Document v-if="
v-if="
file.type === 'pdf' || file.type === 'pdf' ||
file.type === 'doc' || file.type === 'doc' ||
file.type === 'docx' file.type === 'docx'
" " />
/> <Picture v-else-if="
<Picture
v-else-if="
file.type === 'jpg' || file.type === 'jpg' ||
file.type === 'png' || file.type === 'png' ||
file.type === 'jpeg' file.type === 'jpeg'
" " />
/>
<Grid v-else-if="file.type === 'xlsx'" /> <Grid v-else-if="file.type === 'xlsx'" />
</el-icon> </el-icon>
<span class="text-sm text-gray-600 group-hover:text-blue-600">{{ <span class="text-sm text-gray-600 group-hover:text-blue-600">{{
...@@ -74,41 +58,20 @@ ...@@ -74,41 +58,20 @@
</div> </div>
</div> </div>
<!-- 预览弹窗 --> <!-- 预览弹窗 -->
<el-dialog <el-dialog custom-class="preview-dialog" v-model="previewVisible" :title="currentFile?.name" destroy-on-close
custom-class="preview-dialog" style="margin-top: 10vh; width: 80%">
v-model="previewVisible"
:title="currentFile?.name"
destroy-on-close
style="margin-top: 10vh; width: 80%"
>
<div style="min-height: 75vh"> <div style="min-height: 75vh">
<img <img class="center-block h-full w-full object-contain" v-if="
class="center-block h-full w-full object-contain"
v-if="
currentFile?.type === 'jpg' || currentFile?.type === 'jpg' ||
currentFile?.type === 'png' || currentFile?.type === 'png' ||
currentFile?.type === 'jpeg' currentFile?.type === 'jpeg'
" " :src="currentFile.url" style="height: 75vh" />
:src="currentFile.url"
style="height: 75vh"
/>
<vue-office-pdf <vue-office-pdf v-if="currentFile?.type === 'pdf'" class="h-full w-full min-h-[600px]" :src="currentFile.url"
v-if="currentFile?.type === 'pdf'" style="height: 75vh" />
class="h-full w-full min-h-[600px]" <vue-office-docx v-if="currentFile?.type === 'doc' || currentFile?.type === 'docx'" :src="currentFile.url"
:src="currentFile.url" style="height: 75vh" />
style="height: 75vh" <vue-office-excel v-if="currentFile?.type === 'xlsx'" :src="currentFile.url" style="height: 75vh" />
/>
<vue-office-docx
v-if="currentFile?.type === 'doc' || currentFile?.type === 'docx'"
:src="currentFile.url"
style="height: 75vh"
/>
<vue-office-excel
v-if="currentFile?.type === 'xlsx'"
:src="currentFile.url"
style="height: 75vh"
/>
<!-- <vue-office-pptx <!-- <vue-office-pptx
v-if="currentFile?.type === 'ppt'" v-if="currentFile?.type === 'ppt'"
:src="currentFile.url" :src="currentFile.url"
...@@ -146,8 +109,10 @@ import { ...@@ -146,8 +109,10 @@ import {
DataBoard, DataBoard,
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
import { ref } from "vue"; import { ref } from "vue";
//@ts-ignore
import { getMessageDetail } from "@/api/wm/wm"; import { getMessageDetail } from "@/api/wm/wm";
//引入VueOfficeDocx组件 //引入VueOfficeDocx组件
import VueOfficeDocx from "@vue-office/docx"; import VueOfficeDocx from "@vue-office/docx";
...@@ -171,7 +136,7 @@ const breadcrumbItems2 = ref([ ...@@ -171,7 +136,7 @@ const breadcrumbItems2 = ref([
]); ]);
// 获取留言详情 // 获取留言详情
getMessageDetail(route.query.id).then((res) => {}); getMessageDetail(route.query.id).then((res: any) => { });
interface FileItem { interface FileItem {
name: string; name: string;
......
...@@ -72,14 +72,16 @@ ...@@ -72,14 +72,16 @@
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import { Search, ArrowRight } from "@element-plus/icons-vue"; import { Search, ArrowRight } from "@element-plus/icons-vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
//@ts-ignore
import { getRecoverList } from "@/api/wm/wm"; import { getRecoverList } from "@/api/wm/wm";
const router = useRouter(); const router = useRouter();
const searchText = ref(""); const searchText = ref("");
const pageNo = ref(1); const pageNo = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const recoverList = ref([]); const recoverList = ref<any[]>([]);
const total = ref(0); const total = ref(0);
const handleSizeChange = (val: number) => { const handleSizeChange = (val: number) => {
...@@ -104,7 +106,7 @@ function getList(pageSize: number, pageNo: number) { ...@@ -104,7 +106,7 @@ function getList(pageSize: number, pageNo: number) {
pageSize: pageSize, pageSize: pageSize,
pageNo: pageNo, pageNo: pageNo,
}; };
getRecoverList(datas).then((response) => { getRecoverList(datas).then((response: any) => {
const data = response.data; const data = response.data;
const rowsList = data.rows; const rowsList = data.rows;
recoverList.value = rowsList; recoverList.value = rowsList;
......
...@@ -8,23 +8,16 @@ ...@@ -8,23 +8,16 @@
</div> </div>
<!-- 回复列表 --> <!-- 回复列表 -->
<div> <div>
<div <div v-for="(item, index) in displayItems" :key="index"
v-for="(item, index) in displayItems" class="bg-white rounded-lg p-6 mb-4 shadow-sm hover:shadow-md transition-shadow" @click="clickList(item)">
:key="index"
class="bg-white rounded-lg p-6 mb-4 shadow-sm hover:shadow-md transition-shadow"
@click="clickList(item.id)"
>
<div class="flex justify-between items-start mb-3"> <div class="flex justify-between items-start mb-3">
<h3 class="text-lg font-medium text-gray-900">{{ item.title }}</h3> <h3 class="text-lg font-medium text-gray-900">{{ item.title }}</h3>
<span <span :class="[
:class="[
'px-3 py-1 rounded-full text-sm', 'px-3 py-1 rounded-full text-sm',
item.status === '已处理' item.status === '已处理'
? 'bg-green-50 text-green-600' ? 'bg-green-50 text-green-600'
: 'bg-orange-50 text-orange-600', : 'bg-orange-50 text-orange-600',
]" ]">{{ item.status }}</span>
>{{ item.status }}</span
>
</div> </div>
<p class="text-gray-600 mb-4">{{ item.content }}</p> <p class="text-gray-600 mb-4">{{ item.content }}</p>
<div class="text-sm text-gray-400">{{ item.time }}</div> <div class="text-sm text-gray-400">{{ item.time }}</div>
...@@ -33,14 +26,8 @@ ...@@ -33,14 +26,8 @@
<!-- 分页 --> <!-- 分页 -->
<div class="flex justify-center mt-8"> <div class="flex justify-center mt-8">
<el-pagination <el-pagination v-model:current-page="currentPage" :page-size="pageSize" :total="totalItems" :pager-count="5"
v-model:current-page="currentPage" layout="prev, pager, next" class="!rounded-button" />
:page-size="pageSize"
:total="totalItems"
:pager-count="5"
layout="prev, pager, next"
class="!rounded-button"
/>
</div> </div>
</div> </div>
</template> </template>
...@@ -49,6 +36,7 @@ ...@@ -49,6 +36,7 @@
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import { Search, ArrowRight } from "@element-plus/icons-vue"; import { Search, ArrowRight } from "@element-plus/icons-vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
//@ts-ignore
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue"; import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
const router = useRouter(); const router = useRouter();
...@@ -59,62 +47,25 @@ const breadcrumbItems = ref([ ...@@ -59,62 +47,25 @@ const breadcrumbItems = ref([
{ title: "首页", path: "/wm/wmhome" }, { title: "首页", path: "/wm/wmhome" },
{ title: "搜索结果" }, { title: "搜索结果" },
]); ]);
const allItems = [ const allItems = ref<any[]>([]);
{ const totalItems = computed(() => allItems.value.length);
title: "关于东湖公园设施改善的回复",
content:
"感谢您的建议。我局已安排相关部门实地考察,将在东湖公园增设 25 组休闲椅和 10 处遮阳凉亭,预计本月内完工。",
time: "2024-12-27 09:41",
status: "已处理",
},
{
title: "关于龙泉山交通问题的回复",
content:
"关于龙泉山拥堵问题,我们已制定改善方案:1. 优化信号灯配时;2. 增设潮汐车道;3. 加强交通疏导。预计一周内见效。",
time: "2024-12-02 12:24",
status: "已处理",
},
{
title: "关于金融大厦停车问题的回复",
content:
"金融大厦地下停车场扩建工程已列入今年重点项目,将新增车位 600 个,预计 6 月完工。",
time: "2024-12-02 12:24",
status: "已处理",
},
{
title: "关于市民广场交通设施的回复",
content:
"我们将对市民广场周边道路进行优化:1. 新增人行天桥;2. 扩建非机动车道;3. 增设智能红绿灯。预计两周内完成。",
time: "2024-12-02 12:24",
status: "未处理",
},
{
title: "关于青山湖环境整治的回复",
content:
"青山湖环境整治工程已启动,包括水质净化、垃圾清理、绿化提升等多项工作,预计三个月内完成。",
time: "2024-12-02 12:24",
status: "未处理",
},
];
const totalItems = computed(() => allItems.length);
const displayItems = computed(() => { const displayItems = computed(() => {
const start = (currentPage.value - 1) * pageSize.value; const start = (currentPage.value - 1) * pageSize.value;
const filtered = allItems.filter( const filtered = allItems.value.filter(
(item) => (item: any) =>
item.title.includes(searchText.value) || item.title.includes(searchText.value) ||
item.content.includes(searchText.value) item.content.includes(searchText.value)
); );
return filtered.slice(start, start + pageSize.value); return filtered.slice(start, start + pageSize.value);
}); });
function clickList(id: number) { function clickList(item: any) {
router.push({ router.push({
path: "/wm/recoverdetail", path: "/wm/recoverdetail",
query: { query: {
title: "搜索结果", title: "搜索结果",
pathType: "/wm/search", pathType: "/wm/search",
id: id, id: item.id,
}, },
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment