feat: initialize independent Bell product skeleton (#9)

This commit is contained in:
QiuSW
2026-08-12 17:35:49 +08:00
parent be2c1e3c81
commit a5d846a437
31 changed files with 8910 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
root: true,
env: { node: true },
extends: ['plugin:vue/vue3-essential', 'eslint:recommended'],
parserOptions: { parser: '@babel/eslint-parser', requireConfigFile: false },
rules: { 'vue/multi-word-component-names': 'off' }
}
+3
View File
@@ -0,0 +1,3 @@
node_modules/
dist/
*.log
+1
View File
@@ -0,0 +1 @@
module.exports = { presets: ['@vue/cli-plugin-babel/preset'] }
+31
View File
@@ -0,0 +1,31 @@
{
"name": "yovision-bell-ui",
"version": "0.1.0",
"private": true,
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
"lint": "eslint --ext .js,.vue src",
"build:prod": "vue-cli-service build"
},
"dependencies": {
"@element-plus/icons-vue": "2.3.2",
"axios": "1.19.0",
"core-js": "3.50.0",
"element-plus": "2.14.4",
"vue": "3.5.41",
"vue-router": "4.6.4",
"vuex": "4.1.0"
},
"devDependencies": {
"@babel/eslint-parser": "7.29.7",
"@vue/cli-plugin-babel": "5.0.9",
"@vue/cli-plugin-eslint": "5.0.9",
"@vue/cli-service": "5.0.9",
"@vue/compiler-sfc": "3.5.41",
"eslint": "7.32.0",
"eslint-plugin-vue": "9.33.0"
},
"packageManager": "pnpm@9.15.1",
"engines": { "node": "22.22.1", "pnpm": "9.15.1" }
}
+8334
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
<!doctype html>
<html lang="zh-CN">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Bell 预警中心</title></head>
<body><noscript>Bell 需要启用 JavaScript。</noscript><div id="app"></div></body>
</html>
+4
View File
@@ -0,0 +1,4 @@
<template><AppLayout><router-view /></AppLayout></template>
<script setup>
import AppLayout from '../layout/AppLayout.vue'
</script>
+10
View File
@@ -0,0 +1,10 @@
<template>
<main class="page" tabindex="-1">
<header class="page__header"><div><p class="eyebrow">BELL</p><h1>预警工作台</h1><p>Bell 已独立运行,业务模块将按工单顺序启用。</p></div><el-tag type="success">服务就绪</el-tag></header>
<el-row :gutter="16">
<el-col :xs="24" :sm="12" :lg="8"><el-card><template #header>待处理预警</template><strong class="metric">0</strong><p>规则模块启用后显示。</p></el-card></el-col>
<el-col :xs="24" :sm="12" :lg="8"><el-card><template #header>今日事件</template><strong class="metric">0</strong><p>事件入站启用后显示。</p></el-card></el-col>
<el-col :xs="24" :sm="12" :lg="8"><el-card><template #header>运行状态</template><strong class="metric metric--small">独立</strong><p>无需 Sense 或 Brain 在线。</p></el-card></el-col>
</el-row>
</main>
</template>
+9
View File
@@ -0,0 +1,9 @@
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
import './theme.css'
createApp(App).use(store).use(router).use(ElementPlus).mount('#app')
+7
View File
@@ -0,0 +1,7 @@
import { createRouter, createWebHistory } from 'vue-router'
import Dashboard from './Dashboard.vue'
export default createRouter({
history: createWebHistory(),
routes: [{ path: '/', name: 'dashboard', component: Dashboard, meta: { title: '工作台' } }]
})
+3
View File
@@ -0,0 +1,3 @@
import { createStore } from 'vuex'
export default createStore({ state: () => ({ product: 'Bell' }) })
+26
View File
@@ -0,0 +1,26 @@
:root { --bell-accent:#409eff; --bell-bg:#f3f4f7; --bell-surface:#fff; --bell-text:#1f2329; --bell-muted:#6b7280; --bell-stroke:#e5e7eb; }
* { box-sizing:border-box; }
html, body, #app { min-height:100%; margin:0; }
body { font-family:"Segoe UI Variable","Microsoft YaHei",sans-serif; color:var(--bell-text); background:var(--bell-bg); }
.shell { min-height:100vh; display:grid; grid-template-columns:220px minmax(0,1fr); }
.sidebar { background:#263445; color:#fff; padding:16px 12px; }
.brand { display:flex; gap:12px; align-items:center; min-height:48px; padding:0 8px 16px; }
.brand__mark { display:grid; place-items:center; width:36px; height:36px; border-radius:8px; background:var(--bell-accent); font-weight:700; }
.brand small { display:block; color:#cbd5e1; margin-top:2px; }
.nav-item { display:flex; min-height:44px; align-items:center; padding:0 12px; color:#cbd5e1; text-decoration:none; border-radius:6px; }
.nav-item.router-link-active { color:#fff; background:#1f2d3d; }
.workspace { min-width:0; }
.navbar { height:50px; display:flex; align-items:center; justify-content:space-between; padding:0 20px; background:var(--bell-surface); border-bottom:1px solid var(--bell-stroke); }
.navbar__identity { color:var(--bell-muted); }
.tags-view { height:34px; display:flex; align-items:end; padding:0 16px; background:#fff; border-bottom:1px solid var(--bell-stroke); }
.tag-current { padding:6px 12px; border:1px solid var(--bell-stroke); border-bottom:2px solid var(--bell-accent); }
.app-main { padding:20px; }
.page { max-width:1440px; margin:0 auto; outline:none; }
.page__header { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:20px; }
.page__header h1 { margin:0 0 6px; font-size:24px; }
.page__header p { margin:0; color:var(--bell-muted); }
.eyebrow { color:var(--bell-accent)!important; font-size:12px; font-weight:700; letter-spacing:.12em; }
.metric { font-size:36px; font-variant-numeric:tabular-nums; }
.metric--small { font-size:24px; }
@media (max-width:640px) { .shell { grid-template-columns:1fr; } .sidebar { position:static; padding:8px 12px; } .brand { padding-bottom:8px; } .sidebar nav { display:flex; } .workspace { min-width:0; } .app-main { padding:12px; } .page__header { flex-direction:column; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; } }
+13
View File
@@ -0,0 +1,13 @@
<template>
<div class="shell">
<aside class="sidebar" aria-label="主导航">
<div class="brand"><span class="brand__mark">B</span><div><strong>Bell</strong><small>预警中心</small></div></div>
<nav><router-link to="/" class="nav-item">工作台</router-link></nav>
</aside>
<section class="workspace">
<header class="navbar"><span>学校安全预警</span><span class="navbar__identity">未登录</span></header>
<div class="tags-view"><span class="tag-current">工作台</span></div>
<div class="app-main"><slot /></div>
</section>
</div>
</template>
+1
View File
@@ -0,0 +1 @@
import './bootstrap/main'
+10
View File
@@ -0,0 +1,10 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
outputDir: 'dist',
devServer: {
port: 8083,
proxy: { '/api': { target: process.env.BELL_API_ORIGIN || 'http://127.0.0.1:8082' } }
}
})