Commit 882f2d5f by York

first push

parents
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
{
"recommendations": ["Vue.volar"]
}
# emergency-project
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
## Type Support for `.vue` Imports in TS
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
## Customize configuration
See [Vite Configuration Reference](https://vite.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Type-Check, Compile and Minify for Production
```sh
npm run build
```
/// <reference types="vite/client" />
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "emergency-project",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --build"
},
"dependencies": {
"element-plus": "^2.9.1",
"pinia": "^2.3.0",
"swiper": "^11.1.15",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@tsconfig/node22": "^22.0.0",
"@types/node": "^22.10.2",
"@vitejs/plugin-vue": "^5.2.1",
"@vue/tsconfig": "^0.7.0",
"autoprefixer": "^10.4.20",
"npm-run-all2": "^7.0.2",
"postcss": "^8.4.49",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.3",
"vite": "^6.0.5",
"vite-plugin-vue-devtools": "^7.6.8",
"vue-tsc": "^2.1.10"
}
}
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
<!-- 代码已包含 CSS:使用 TailwindCSS , 安装 TailwindCSS 后方可看到布局样式效果 -->
<template>
<div class="min-h-screen bg-gray-50">
<!-- 顶部横幅 -->
<header class="bg-white shadow">
<div class="container mx-auto px-4 h-20 flex items-center">
<img
src="https://ai-public.mastergo.com/ai/img_res/38fd70bdc77f4305c862a0962f46c48c.jpg"
alt="国徽"
class="h-14 mr-4"
/>
<div class="flex-1 flex items-center justify-between">
<h1 class="text-2xl font-bold text-black">
太原市互联网应急指挥和举报中心
</h1>
<div class="relative w-[360px]">
<el-input
v-model="searchQuery"
class="!rounded-full"
placeholder="搜索新闻、通知、政策文件..."
:prefix-icon="Search"
/>
</div>
</div>
</div>
</header>
<!-- 主导航 -->
<nav class="bg-blue-800 text-white">
<div class="container mx-auto px-4">
<ul class="flex space-x-8 h-14">
<li
v-for="(item, index) in navItems"
:key="index"
class="flex items-center cursor-pointer hover:bg-blue-700 px-4"
:class="{ 'bg-blue-700': activeNav === index }"
@click="navigateTo(index)"
>
{{ item }}
</li>
</ul>
</div>
</nav>
<router-view></router-view>
<!-- 页脚 -->
<footer class="bg-gray-800 text-gray-300 mt-10">
<div class="container mx-auto px-4 py-10 w-[1440px]">
<div class="grid grid-cols-2 gap-8">
<div>
<h3 class="text-lg font-medium mb-4">联系我们</h3>
<div class="space-y-2">
<p>地址:山西省太原市迎泽区迎泽大街 369 号</p>
<p>电话:0351-12345678</p>
<p>邮箱:contact@tynet.gov.cn</p>
</div>
</div>
<div>
<h3 class="text-lg font-medium mb-4">关注我们</h3>
<div class="flex space-x-4">
<el-icon class="text-2xl"><Message /></el-icon>
<el-icon class="text-2xl"><Share /></el-icon>
<el-icon class="text-2xl"><Link /></el-icon>
</div>
</div>
</div>
<div class="mt-8 pt-8 border-t border-gray-700 text-center">
<p>Copyright © 2024 太原市互联网应急指挥和举报中心 版权所有</p>
<p class="mt-2">晋ICP备12345678号-1 | 晋公网安备 14010002000001号</p>
</div>
</div>
</footer>
</div>
</template>
<script setup>
import { ref } from "vue";
import { Swiper, SwiperSlide } from "swiper/vue";
import { Pagination, Autoplay } from "swiper/modules";
import { useRouter } from "vue-router";
import {
VideoPlay,
Message,
Share,
Link,
Search,
Document,
} from "@element-plus/icons-vue";
const router = useRouter();
const swiperModules = [Pagination, Autoplay];
const searchQuery = ref("");
const activeNav = ref(0);
const navItems = ["首页", "新闻热点", "太原新闻", "山西新闻", "通知公告"];
function navigateTo(index) {
const routes = [
{ path: "/home/home" },
{ path: "/home/news" },
{ path: "/home/tynews" },
{ path: "/home/sxnews" },
{ path: "/home/announcements" },
];
router.push(routes[index].path).catch((err) => {});
activeNav.value = index;
}
const hotNews = [
{
title: '太原市获评"2023年度网络安全示范城市"',
date: "2024-01-13",
},
{
title: "我市开展网络安全专项整治行动",
date: "2024-01-12",
},
{
title: "太原互联网企业助力乡村振兴",
date: "2024-01-11",
},
];
const videoNews = [
{
title: "2024太原网络安全周开幕式",
cover:
"https://ai-public.mastergo.com/ai/img_res/c127709d932c688f0fd802b468fbeb1b.jpg",
},
{
title: "太原智慧城市建设成果展示",
cover:
"https://ai-public.mastergo.com/ai/img_res/04b4d2ca1d91d73dac6a0f4316b13165.jpg",
},
];
</script>
<style scoped>
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;
--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;
--vt-c-indigo: #2c3e50;
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
--vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}
/* semantic color variables for this project */
:root {
--color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute);
--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);
--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);
--section-gap: 160px;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute);
--color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1);
--color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2);
}
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
font-weight: normal;
}
body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition:
color 0.5s,
background-color 0.5s;
line-height: 1.6;
font-family:
Inter,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
@import "./base.css";
@import "./tailwin.css";
#app {
/* max-width: 1440px; */
margin: 0 auto;
/* padding: 2rem; */
font-weight: normal;
}
a,
.green {
text-decoration: none;
color: hsla(160, 100%, 37%, 1);
transition: 0.4s;
padding: 3px;
}
@media (hover: hover) {
a:hover {
background-color: hsla(160, 100%, 37%, 0.2);
}
}
@media() {
body {
display: flex;
place-items: center;
}
#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}
@tailwind base;
@tailwind components;
@tailwind utilities;
<template>
<div></div>
</template>
<script>
export default {
setup() {
return {};
},
};
</script>
<style lang="scss" scoped></style>
import "./assets/main.css";
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus"; //导入element-plus所有模块和功能
import "element-plus/dist/index.css"; //导入element-plus所有的全局CSS样式
const app = createApp(App);
app.use(createPinia());
app.use(router);
app.use(ElementPlus);
app.mount("#app");
import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/home/home/HomeView.vue";
import News from "../views/home/hotnews/News.vue";
import TaiyuanNews from "../views/home/tynews/TaiyuanNews.vue";
import ShanxiNews from "../views/home/sxnews/ShanxiNews.vue";
import Announcements from "../views/home/announcements/Announcements.vue";
import PyHome from "../views/py/PyHome.vue";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/home/home",
name: "home",
component: HomeView,
},
{
path: "/home/news",
name: "News",
component: News,
},
{
path: "/home/tynews",
name: "TyNews",
component: TaiyuanNews,
},
{
path: "/home/sxnews",
name: "SxNews",
component: ShanxiNews,
},
{
path: "/home/announcements",
name: "Announcements",
component: Announcements,
},
{
path: "/py",
name: "PyHome",
component: PyHome,
},
],
});
export default router;
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
return { count, doubleCount, increment }
})
<!-- 代码已包含 CSS:使用 TailwindCSS , 安装 TailwindCSS 后方可看到布局样式效果 -->
<template>
<div class="min-h-screen bg-gray-50">
<div class="w-[1440px] mx-auto px-4 py-8">
<!-- 公告列表 -->
<div class="bg-white rounded-lg shadow-sm">
<el-table
:data="currentPageData"
style="width: 100%"
:header-cell-style="{ background: '#f8f9fa' }"
>
<el-table-column label="标题" min-width="400">
<template #default="{ row }">
<div class="flex items-center">
<el-icon v-if="row.isTop" class="mr-2 text-red-500">
<Top />
</el-icon>
<span :class="{ 'text-red-500': row.isTop }">{{
row.title
}}</span>
<el-tag v-if="row.isNew" size="small" type="danger" class="ml-2"
></el-tag
>
</div>
</template>
</el-table-column>
<el-table-column prop="category" label="类别" width="120">
<template #default="{ row }">
<el-tag :type="row.categoryType" size="small">{{
row.category
}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="department" label="发布部门" width="150" />
<el-table-column prop="date" label="发布时间" width="180" />
<el-table-column label="操作" width="100" fixed="right">
<template #default="{ row }">
<el-button
type="primary"
link
size="small"
class="!rounded-button whitespace-nowrap"
@click="viewDetail(row)"
>
查看详情
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="flex justify-center p-4">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:total="filteredData.length"
:page-sizes="[10, 20, 30, 50]"
layout="total, sizes, prev, pager, next, jumper"
/>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, computed } from "vue";
import { Top } from "@element-plus/icons-vue";
interface Announcement {
id: number;
title: string;
category: string;
categoryType: "" | "success" | "warning" | "info";
department: string;
date: string;
isTop: boolean;
isNew: boolean;
}
const currentPage = ref(1);
const pageSize = ref(10);
const announcements: Announcement[] = [
{
id: 1,
title: "关于 2024 年度科技创新项目申报工作的通知",
category: "重要通知",
categoryType: "warning",
department: "科技创新部",
date: "2024-01-15 14:30",
isTop: true,
isNew: true,
},
{
id: 2,
title: "2024 年春节放假安排及工作调整说明",
category: "公告",
categoryType: "info",
department: "人力资源部",
date: "2024-01-14 16:45",
isTop: true,
isNew: true,
},
{
id: 3,
title: "关于开展 2023 年度员工满意度调查的通知",
category: "普通通知",
categoryType: "",
department: "综合管理部",
date: "2024-01-13 09:15",
isTop: false,
isNew: false,
},
{
id: 4,
title: "公司新版办公系统上线试运行通知",
category: "系统通知",
categoryType: "success",
department: "信息技术部",
date: "2024-01-12 11:20",
isTop: false,
isNew: true,
},
{
id: 5,
title: "2023 年度优秀员工表彰大会通知",
category: "重要通知",
categoryType: "warning",
department: "人力资源部",
date: "2024-01-11 15:30",
isTop: false,
isNew: false,
},
{
id: 6,
title: "关于组织开展消防安全培训的通知",
category: "普通通知",
categoryType: "",
department: "安全管理部",
date: "2024-01-10 13:45",
isTop: false,
isNew: false,
},
{
id: 7,
title: "2024 年第一季度经营工作会议通知",
category: "重要通知",
categoryType: "warning",
department: "经营管理部",
date: "2024-01-09 10:00",
isTop: false,
isNew: false,
},
{
id: 8,
title: "公司新版企业文化手册发布通知",
category: "公告",
categoryType: "info",
department: "企业文化部",
date: "2024-01-08 16:20",
isTop: false,
isNew: false,
},
{
id: 9,
title: "关于开展年度健康体检工作的通知",
category: "普通通知",
categoryType: "",
department: "人力资源部",
date: "2024-01-07 14:15",
isTop: false,
isNew: false,
},
{
id: 10,
title: "公司新版薪酬福利制度实施通知",
category: "重要通知",
categoryType: "warning",
department: "人力资源部",
date: "2024-01-06 09:30",
isTop: false,
isNew: false,
},
{
id: 11,
title: "关于加强办公场所节能降耗工作的通知",
category: "普通通知",
categoryType: "",
department: "行政管理部",
date: "2024-01-05 11:40",
isTop: false,
isNew: false,
},
{
id: 12,
title: "2024 年度培训计划发布通知",
category: "公告",
categoryType: "info",
department: "人力资源部",
date: "2024-01-04 15:50",
isTop: false,
isNew: false,
},
];
const filteredData = computed(() => announcements);
const currentPageData = computed(() => {
const start = (currentPage.value - 1) * pageSize.value;
const end = start + pageSize.value;
return filteredData.value.slice(start, end);
});
const viewDetail = (row: Announcement) => {
// 查看详情逻辑
console.log("查看详情:", row);
};
</script>
<style scoped>
.el-input :deep(.el-input__wrapper) {
box-shadow: none !important;
}
.el-table :deep(th.el-table__cell) {
font-weight: 600;
}
</style>
<!-- 代码已包含 CSS:使用 TailwindCSS , 安装 TailwindCSS 后方可看到布局样式效果 -->
<template>
<div class="min-h-screen bg-gray-50">
<div class="container mx-auto px-4 py-8 w-[1440px]">
<div class="flex gap-6">
<div class="flex-1">
<div class="bg-white rounded-lg shadow-sm">
<div
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"
>
<div class="w-32 h-32 flex-shrink-0 overflow-hidden rounded-lg">
<img
:src="news.image"
:alt="news.title"
class="w-full h-full object-cover"
/>
</div>
<div class="flex-grow px-6">
<h2
class="text-lg font-semibold mb-2 group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ news.title }}
</h2>
<p class="text-gray-600 text-sm line-clamp-2">
{{ news.summary }}
</p>
<div class="mt-3 flex items-center space-x-4">
<span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Clock /></el-icon>
{{ news.time }}
</span>
<span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><Document /></el-icon>
{{ news.source }}
</span>
<span class="text-sm text-gray-500 flex items-center">
<el-icon class="mr-1"><View /></el-icon>
{{ news.views }}
</span>
</div>
</div>
<div class="w-24 flex-shrink-0 text-right">
<el-tag
:type="news.category.type"
size="small"
class="whitespace-nowrap"
>
{{ news.category.name }}
</el-tag>
</div>
</div>
</div>
<div class="flex justify-center mt-8">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:total="total"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
<div class="w-80 flex-shrink-0 space-y-6">
<!-- 本地新闻 -->
<div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-blue-500"><Location /></el-icon>
本地新闻
</h2>
<div class="space-y-4">
<div
v-for="(item, index) in localNews"
:key="index"
class="group cursor-pointer"
>
<div class="h-32 mb-2 overflow-hidden rounded-lg">
<img
:src="item.image"
:alt="item.title"
class="w-full h-full object-cover"
/>
</div>
<div
class="text-sm font-medium group-hover:text-blue-600 line-clamp-2 text-black"
>
{{ item.title }}
</div>
</div>
</div>
</div>
<!-- 通知公告 -->
<div class="bg-white rounded-lg shadow-sm p-4">
<h2 class="text-xl font-bold mb-4 flex items-center text-black">
<el-icon class="mr-2 text-orange-500"><Bell /></el-icon>
通知公告
</h2>
<div class="space-y-3">
<div
v-for="(item, index) in announcements"
:key="index"
class="flex items-center space-x-2 group cursor-pointer"
>
<el-tag size="small" :type="item.type">{{ item.tag }}</el-tag>
<span
class="text-sm group-hover:text-blue-600 flex-1 line-clamp-1 text-black"
>{{ item.title }}</span
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import {
Clock,
Document,
View,
Star,
Location,
Bell,
ArrowRight,
} from "@element-plus/icons-vue";
const currentPage = ref(1);
const pageSize = ref(10);
const total = ref(100);
const handleSizeChange = (val: number) => {
pageSize.value = val;
};
const handleCurrentChange = (val: number) => {
currentPage.value = val;
};
const newsList = ref([
{
title: "国务院常务会议:部署进一步优化营商环境的政策措施",
summary:
"会议强调要持续优化营商环境,激发市场主体活力,促进经济持续健康发展。会议通过了《关于进一步优化营商环境的实施意见》,提出了一系列具体措施。",
image:
"https://ai-public.mastergo.com/ai/img_res/7008561e2575928d48be3eb6abb45ed5.jpg",
time: "2024-01-15 14:30",
source: "新华网",
views: "12,458",
category: { name: "时政", type: "danger" },
},
{
title: "科技创新引领未来:量子计算研究获重大突破",
summary:
"中国科学家在量子计算领域取得重大突破,成功实现了72量子比特的量子优势验证,为未来量子计算的实用化奠定了重要基础。",
image:
"https://ai-public.mastergo.com/ai/img_res/2e87bb273492cc07fca2c54839b12c72.jpg",
time: "2024-01-15 10:15",
source: "科技日报",
views: "8,932",
category: { name: "科技", type: "primary" },
},
{
title: "全国医疗改革新政策出台:提升基层医疗服务能力",
summary:
"国家卫健委发布新政策,加强基层医疗机构建设,推进分级诊疗制度落实,提高基层医疗服务水平,让群众就医更便利。",
image:
"https://ai-public.mastergo.com/ai/img_res/4e1300130f5ddc4b058201ce0863e853.jpg",
time: "2024-01-15 09:00",
source: "健康时报",
views: "15,674",
category: { name: "民生", type: "success" },
},
{
title: "2024年春节消费预测:文旅市场将迎来开门红",
summary:
"随着假期临近,文旅部门预计今年春节期间国内旅游人次将突破4亿,旅游收入有望超过5000亿元,文旅市场将迎来强劲复苏。",
image:
"https://ai-public.mastergo.com/ai/img_res/00343eaf70fed629fbaa7ab9f692eb8d.jpg",
time: "2024-01-14 16:45",
source: "经济观察报",
views: "9,876",
category: { name: "财经", type: "warning" },
},
{
title: "教育部发布新规:加强中小学生心理健康教育",
summary:
"教育部近日印发《关于加强中小学生心理健康教育的指导意见》,要求各地建立健全学生心理健康教育体系,预防和干预学生心理问题。",
image:
"https://ai-public.mastergo.com/ai/img_res/a2b931119f927fa4e1b42724d9f274ef.jpg",
time: "2024-01-14 14:20",
source: "中国教育报",
views: "11,234",
category: { name: "教育", type: "info" },
},
{
title: "教育部发布新规:加强中小学生心理健康教育",
summary:
"教育部近日印发《关于加强中小学生心理健康教育的指导意见》,要求各地建立健全学生心理健康教育体系,预防和干预学生心理问题。",
image:
"https://ai-public.mastergo.com/ai/img_res/a2b931119f927fa4e1b42724d9f274ef.jpg",
time: "2024-01-14 14:20",
source: "中国教育报",
views: "11,234",
category: { name: "教育", type: "info" },
},
]);
const hotNews = ref([
{
title: "AI 技术在医疗领域取得重大突破:精准诊断率提升 35%",
views: "28.5万",
},
{ title: "2024 全球经济展望:新兴市场或成增长主引擎", views: "25.3万" },
{ title: "环保新政出台:到 2025 年可再生能源占比将达 30%", views: "22.1万" },
{
title: "第五代移动通信技术实现全域覆盖,用户体验显著提升",
views: "19.8万",
},
{
title: "首届全球数字经济博览会将在深圳举办,聚焦前沿科技",
views: "18.2万",
},
]);
const localNews = ref([
{
title: "城市地铁 12 号线正式开通,打通南北交通大动脉",
image:
"https://ai-public.mastergo.com/ai/img_res/3d43624529823eeaf292c07dcd59244d.jpg",
},
{
title: "市中心文化广场改造完工,将举办系列文化活动",
image:
"https://ai-public.mastergo.com/ai/img_res/449f75b182bd83a315e2e9e85d2b33b7.jpg",
},
]);
const announcements = ref([
{
title: "关于举办 2024 年春季人才招聘会的通知",
tag: "招聘",
type: "success",
},
{ title: "2024 年度市政府工作报告公开征求意见", tag: "公示", type: "info" },
{ title: "关于开展春节期间文化惠民活动的通知", tag: "活动", type: "warning" },
{ title: "2024 年度重点民生工程项目公示", tag: "公示", type: "info" },
{ title: "关于调整部分公交线路的通知", tag: "出行", type: "danger" },
]);
</script>
<style scoped>
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.line-clamp-1 {
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: "class",
corePlugins: {
preflight: false
},
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
theme: {
extend: {
colors: {
bg_color: "var(--el-bg-color)",
primary: "var(--el-color-primary)",
text_color_primary: "var(--el-text-color-primary)",
text_color_regular: "var(--el-text-color-regular)",
text_color_000: '#000',
text_color_333: '#333',
text_color_666: '#666',
text_color_999: '#999'
}
},
// 自定义字体(思源)
fontFamily: {
'SourceHanSansCN-Bold': "var(--font-bold)",
'SourceHanSansCN-Medium': "var(--font-medium)",
'SourceHanSansCN-Light': "var(--font-light)",
'SourceHanSansCN-Normal': "var(--font-normal)",
'SourceHanSansCN-Heavy': "var(--font-heavy)",
'SourceHanSansCN-Regular': "var(--font-regular)",
'SourceHanSansCN-Extra-light': "var(--font-extra-light)",
}
}
};
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"paths": {
"@/*": ["./src/*"]
}
}
}
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
}
{
"extends": "@tsconfig/node22/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
],
"compilerOptions": {
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]
}
}
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueDevTools from "vite-plugin-vue-devtools";
// https://vite.dev/config/
export default defineConfig({
plugins: [vue(), vueDevTools()],
server: {
// 是否开启 https
https: false,
// 端口号
port: 8080,
host: "0.0.0.0",
// 本地跨域代理 https://cn.vitejs.dev/config/server-options.html#server-proxy
proxy: {
"/api": {
// target: "http://localhost:8081",
// target: "http://172.16.70.52:8081",
target: "http://192.168.19.247:8081",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
},
"/jeeplus": {
target: "ws://192.168.1.205:8081", // 线上服务器websocket地址
ws: true,
changeOrigin: true,
},
},
cors: true,
},
// resolve: {
// alias: {
// "@": fileURLToPath(new URL("./src", import.meta.url)),
// },
// },
});
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