Compare commits

...

No commits in common. "bdf8cdd8c6153cac60e86b624072ea4c12402a2c" and "5f741bd3a73b595887338c044702e9932a07e9ef" have entirely different histories.

18 changed files with 829 additions and 1034 deletions

View File

@ -1,4 +1,4 @@
# kjdn # portal
## Project setup ## Project setup
``` ```

View File

@ -1,19 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

View File

@ -1,5 +1,5 @@
{ {
"name": "kjdn", "name": "portal",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -8,26 +8,27 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@types/d3": "^7.4.3", "@element-plus/icons-vue": "^2.3.2",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"d3": "^7.9.0", "d3": "^7.9.0",
"element-plus": "^2.13.0", "element-plus": "^2.11.4",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-router": "4" "vue-router": "^4.0.3",
"vuex": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.16", "@typescript-eslint/eslint-plugin": "^5.4.0",
"@babel/eslint-parser": "^7.12.16", "@typescript-eslint/parser": "^5.4.0",
"@types/node": "^25.0.3",
"@typescript-eslint/eslint-plugin": "^8.52.0",
"@typescript-eslint/parser": "^8.52.0",
"@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-typescript": "^5.0.9", "@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0", "@vue/cli-service": "~5.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"typescript": "^5.9.3" "typescript": "~4.5.5"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
@ -36,23 +37,13 @@
}, },
"extends": [ "extends": [
"plugin:vue/vue3-essential", "plugin:vue/vue3-essential",
"eslint:recommended" "eslint:recommended",
"@vue/typescript/recommended"
], ],
"parserOptions": { "parserOptions": {
"parser": "@typescript-eslint/parser", "ecmaVersion": 2020
"ecmaVersion": 2020,
"sourceType": "module"
}, },
"rules": {}, "rules": {}
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.vue"],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser"
}
}
]
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",

View File

@ -9,7 +9,8 @@
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->

View File

@ -1,15 +1,7 @@
<template> <template>
<div id="app">
<router-view/> <router-view/>
</div>
</template> </template>
<script>
export default {
name: 'App'
}
</script>
<style> <style>
#app { #app {
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
@ -21,17 +13,14 @@ export default {
nav { nav {
padding: 30px; padding: 30px;
background-color: #f5f5f5;
} }
nav a { nav a {
font-weight: bold; font-weight: bold;
color: #2c3e50; color: #2c3e50;
text-decoration: none;
margin: 0 10px;
} }
nav a.router-link-exact-active { nav a.router-link-exact-active {
color: #409eff; color: #42b983;
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<header class="topbar"> <header class="topbar" :class="{ 'light-theme': isLightTheme }">
<!-- 左侧品牌 --> <!-- 左侧品牌 -->
<router-link to="/" class="brand"> <router-link to="/" class="brand">
<div class="brand-mark"></div> <div class="brand-mark"></div>
@ -10,7 +10,7 @@
<div class="nav-wrap"> <div class="nav-wrap">
<div class="nav-list" role="navigation" aria-label="主导航"> <div class="nav-list" role="navigation" aria-label="主导航">
<router-link to="/" class="nav-item" :class="{ 'is-active': $route.name === 'home' }">首页</router-link> <router-link to="/" class="nav-item" :class="{ 'is-active': $route.name === 'home' }">首页</router-link>
<router-link to="/news-policy" class="nav-item" :class="{ 'is-active': $route.name === 'news-policy' || $route.name === 'news-policy-detail' }">新闻政策</router-link> <router-link to="/news-policy" class="nav-item" :class="{ 'is-active': $route.name === 'news-policy' }">新闻政策</router-link>
<router-link to="/smart-qa" class="nav-item" :class="{ 'is-active': $route.name === 'smart-qa' }">智慧问答</router-link> <router-link to="/smart-qa" class="nav-item" :class="{ 'is-active': $route.name === 'smart-qa' }">智慧问答</router-link>
<router-link to="/tech-resources" class="nav-item" :class="{ 'is-active': $route.name === 'tech-resources' }">科技资源</router-link> <router-link to="/tech-resources" class="nav-item" :class="{ 'is-active': $route.name === 'tech-resources' }">科技资源</router-link>
<router-link to="/talent-profile" class="nav-item" :class="{ 'is-active': $route.name === 'talent-profile' }">人才画像</router-link> <router-link to="/talent-profile" class="nav-item" :class="{ 'is-active': $route.name === 'talent-profile' }">人才画像</router-link>
@ -21,12 +21,20 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
// import { computed } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
//
const isLightTheme = computed(() => {
return route.name !== 'home' && route.name !== 'login'
})
</script> </script>
<style scoped> <style scoped>
/* ===== 顶栏 ===== */ /* ===== 顶栏 ===== */
/* 顶部整行:左右两端布局 - 浅色风格 */ /* 顶部整行:左右两端布局 */
.topbar { .topbar {
position: fixed; position: fixed;
top: 0; top: 0;
@ -38,9 +46,16 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
pointer-events: auto; pointer-events: auto;
background: #ffffff; background: rgba(8, 26, 43, 0.95);
border-bottom: 1px solid #e4e7ed; backdrop-filter: blur(10px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); border-bottom: 1px solid rgba(130, 196, 255, 0.15);
transition: all 0.3s ease;
}
.topbar.light-theme {
background: rgba(255, 255, 255, 0.95);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
} }
/* 左侧品牌区 */ /* 左侧品牌区 */
@ -48,13 +63,12 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 14px; gap: 14px;
color: #409eff; color: #cfe8ff;
text-decoration: none; text-decoration: none;
transition: opacity 0.2s ease;
} }
.brand:hover { .light-theme .brand {
opacity: 0.85; color: #2c3e50;
} }
.brand-mark { .brand-mark {
@ -62,13 +76,17 @@
height: 6px; height: 6px;
border-radius: 4px; border-radius: 4px;
background: #49b0ff; background: #49b0ff;
box-shadow: 0 0 8px rgba(73, 176, 255, 0.5); box-shadow: 0 0 12px #49b0ff;
} }
.brand-text { .brand-text {
font-size: 20px; font-size: 20px;
letter-spacing: 0.5px; letter-spacing: 0.5px;
font-weight: 500; opacity: 0.95;
}
.light-theme .brand-text {
opacity: 1;
} }
/* 右侧胶囊导航条:纯 divflex 布局 */ /* 右侧胶囊导航条:纯 divflex 布局 */
@ -77,8 +95,9 @@
align-items: flex-end; align-items: flex-end;
gap: 16px; gap: 16px;
padding: 10px 10px 10px 18px; padding: 10px 10px 10px 18px;
min-width: 720px; min-width: 720px; /* 让条看起来更长一些,可按需调整 */
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
cursor: pointer;
} }
/* 菜单区:居中对齐、等间距 */ /* 菜单区:居中对齐、等间距 */
@ -94,21 +113,41 @@
.nav-item { .nav-item {
position: relative; position: relative;
padding: 6px 2px; padding: 6px 2px;
color: #606266; color: #ffffff;
font-size: 16px; font-size: 16px;
letter-spacing: 0.5px; letter-spacing: 0.5px;
transition: color 0.2s ease; transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
display: inline-block; display: inline-block;
} }
.nav-item:hover { .nav-item:hover {
color: #409eff; color: #d7ecff;
text-shadow: 0 0 10px rgba(144, 210, 255, 0.5);
cursor: pointer;
} }
.nav-item.is-active { .nav-item.is-active {
color: #8fd3ff;
font-weight: 600;
text-shadow: 0 0 10px rgba(150, 210, 255, 0.85);
}
/* 浅色主题样式 */
.light-theme .nav-item {
color: #606266;
text-shadow: none;
}
.light-theme .nav-item:hover {
color: #409eff;
text-shadow: none;
}
.light-theme .nav-item.is-active {
color: #409eff; color: #409eff;
font-weight: 600; font-weight: 600;
text-shadow: none;
} }
</style> </style>

9
src/jsx.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
declare global {
namespace JSX {
interface IntrinsicElements {
[elem: string]: unknown
}
}
}
export {}

View File

@ -1,11 +0,0 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
const app = createApp(App)
app.use(router)
app.use(ElementPlus)
app.mount('#app')

View File

@ -1,11 +1,18 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import store from './store'
// Element Plus
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App) const app = createApp(App)
app.use(router) // 注册所有图标
app.use(ElementPlus) for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.mount('#app') app.component(key, component)
}
app.use(store).use(router).use(ElementPlus).mount('#app')

View File

@ -1,53 +0,0 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import HomeIndex from '@/views/HomeIndex.vue'
import NewsPolicyIndex from '@/views/NewsPolicy/NewsPolicyIndex.vue'
import PolicyDetail from '@/views/NewsPolicy/PolicyDetail.vue'
import SmartQAIndex from '@/views/SmartQA/SmartQAIndex.vue'
import TechResourcesIndex from '@/views/TechResources/TechResourcesIndex.vue'
import TalentProfileIndex from '@/views/TalentProfile/TalentProfileIndex.vue'
import UserLoginIndex from '@/views/UserLogin/UserLoginIndex.vue'
const routes = [
{
path: '/',
name: 'home',
component: HomeIndex
},
{
path: '/news-policy',
name: 'news-policy',
component: NewsPolicyIndex
},
{
path: '/news-policy/detail/:id',
name: 'news-policy-detail',
component: PolicyDetail
},
{
path: '/smart-qa',
name: 'smart-qa',
component: SmartQAIndex
},
{
path: '/tech-resources',
name: 'tech-resources',
component: TechResourcesIndex
},
{
path: '/talent-profile',
name: 'talent-profile',
component: TalentProfileIndex
},
{
path: '/login',
name: 'login',
component: UserLoginIndex
}
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router

53
src/router/index.ts Normal file
View File

@ -0,0 +1,53 @@
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import HomeIndex from "@/views/HomeIndex.vue";
import NewsPolicyIndex from "@/views/NewsPolicy/NewsPolicyIndex.vue";
import PolicyDetail from "@/views/NewsPolicy/PolicyDetail.vue";
import SmartQAIndex from "@/views/SmartQA/SmartQAIndex.vue";
import TechResourcesIndex from "@/views/TechResources/TechResourcesIndex.vue";
import TalentProfileIndex from "@/views/TalentProfile/TalentProfileIndex.vue";
import UserLoginIndex from "@/views/UserLogin/UserLoginIndex.vue";
const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "home",
component: HomeIndex,
},
{
path: "/news-policy",
name: "news-policy",
component: NewsPolicyIndex,
},
{
path: "/news-policy/detail/:id",
name: "news-policy-detail",
component: PolicyDetail,
},
{
path: "/smart-qa",
name: "smart-qa",
component: SmartQAIndex,
},
{
path: "/tech-resources",
name: "tech-resources",
component: TechResourcesIndex,
},
{
path: "/talent-profile",
name: "talent-profile",
component: TalentProfileIndex,
},
{
path: "/login",
name: "login",
component: UserLoginIndex,
},
];
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes,
});
export default router;

17
src/shims-vue.d.ts vendored
View File

@ -1,5 +1,22 @@
/* eslint-disable */
declare module '*.vue' { declare module '*.vue' {
import type { DefineComponent } from 'vue' import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any> const component: DefineComponent<{}, {}, any>
export default component export default component
} }
declare module '@vue/runtime-core' {
export interface GlobalComponents {
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
ElButton: typeof import('element-plus')['ElButton']
ElIcon: typeof import('element-plus')['ElIcon']
ElDivider: typeof import('element-plus')['ElDivider']
ElEmpty: typeof import('element-plus')['ElEmpty']
ElPopover: typeof import('element-plus')['ElPopover']
}
}
declare module 'd3' {
export * from 'd3'
}

14
src/store/index.ts Normal file
View File

@ -0,0 +1,14 @@
import { createStore } from 'vuex'
export default createStore({
state: {
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
}
})

View File

@ -4,6 +4,7 @@
<div class="bg"></div> <div class="bg"></div>
<!-- 顶部导航 --> <!-- 顶部导航 -->
<!-- 顶部导航 div + flex -->
<header class="topbar"> <header class="topbar">
<!-- 左侧品牌 --> <!-- 左侧品牌 -->
<div class="brand"> <div class="brand">

View File

@ -223,6 +223,7 @@ const renderNetworkGraph = () => {
// //
const triangleCount = Math.floor(length / 15) // 15 const triangleCount = Math.floor(length / 15) // 15
const spacing = length / triangleCount
// //
for (let i = 0; i < triangleCount; i++) { for (let i = 0; i < triangleCount; i++) {
@ -252,6 +253,7 @@ const renderNetworkGraph = () => {
}) })
// //
const rOuter = (d: any) => d.type === 'center' ? 50 : 35
const rContent = (d: any) => d.type === 'center' ? 45 : 30 const rContent = (d: any) => d.type === 'center' ? 45 : 30
const bandH = (d: any) => d.type === 'center' ? 22 : 18 // 1/4~1/3 const bandH = (d: any) => d.type === 'center' ? 22 : 18 // 1/4~1/3
const fontSize = (d: any) => d.type === 'center' ? 13 : 11 const fontSize = (d: any) => d.type === 'center' ? 13 : 11

View File

@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
"target": "esnext", "target": "esnext",
"module": "esnext", "module": "esnext",
"strict": false, "strict": true,
"jsx": "preserve", "jsx": "preserve",
"moduleResolution": "node", "moduleResolution": "node",
"skipLibCheck": true, "skipLibCheck": true,

View File

@ -1,5 +1,5 @@
const { defineConfig } = require('@vue/cli-service') import { defineConfig } from "@vue/cli-service";
module.exports = defineConfig({ export default defineConfig({
transpileDependencies: true, transpileDependencies: true,
publicPath: './' lintOnSave: false, // 关闭ESLint检查
}) });

1509
yarn.lock

File diff suppressed because it is too large Load Diff