Compare commits

..

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

18 changed files with 1035 additions and 830 deletions

View File

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

19
jsconfig.json Normal file
View File

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

View File

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

View File

@ -1,21 +1,20 @@
<!DOCTYPE html>
<html lang="">
<head>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<style>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<style>
body {
margin: 0;
padding: 0;

View File

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

View File

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

9
src/jsx.d.ts vendored
View File

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

11
src/main.js Normal file
View File

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

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

@ -0,0 +1,53 @@
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

View File

@ -1,53 +0,0 @@
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,22 +1,5 @@
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
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'
}

View File

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

View File

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

View File

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

View File

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

View File

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

1511
yarn.lock

File diff suppressed because it is too large Load Diff