本地告警页面
Go to file Use this template
龚皓 b02b125dad 高度调整等高 2024-10-22 13:50:24 +08:00
.vscode 本地告警页面V0 2024-09-04 16:23:57 +08:00
public jsmpeg组件包 2024-10-18 11:04:03 +08:00
src 高度调整等高 2024-10-22 13:50:24 +08:00
.gitignore 本地告警页面V0 2024-09-04 16:23:57 +08:00
LICENSE Initial commit 2024-09-04 16:19:19 +08:00
README.md readme更新 2024-09-04 16:48:23 +08:00
env.d.ts 本地告警页面V0 2024-09-04 16:23:57 +08:00
index.html 导入静态jsmpeg文件 2024-10-18 11:04:55 +08:00
package-lock.json npm增加jsmpeg包导入失败没用 2024-10-18 11:05:46 +08:00
package.json npm增加jsmpeg包导入失败没用 2024-10-18 11:05:46 +08:00
tsconfig.app.json 本地告警页面V0 2024-09-04 16:23:57 +08:00
tsconfig.json 本地告警页面V0 2024-09-04 16:23:57 +08:00
tsconfig.node.json 本地告警页面V0 2024-09-04 16:23:57 +08:00
vite.config.ts dayjs-config 2024-09-30 15:39:50 +08:00

README.md

local_alert

本地告警页面

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

依赖包

    "axios": "^1.7.3",
    "echarts": "^5.5.1",
    "element-plus": "^2.7.8",
    "file-saver": "^2.0.5",
    "http-proxy-middleware": "^3.0.0",
    "jszip": "^3.10.1",
    "qs": "^6.12.3",
    "vue": "^3.4.29",
    "vue-router": "^4.4.0"
  • axios:异步
  • echarts:图标盘
  • element-plus: 组件
  • file-saver: 文件加载
  • http-proxy-middleware: 请求跨域
  • jszip:下载打包
  • qs:静态资源请求
  • vue:框架
  • vue-router:路由

目录结构

卷 文档 的文件夹 PATH 列表
卷序列号为 8BA4-D80A
D:\JAVA\DEMO\TURING\ALARM\ALARM_DEV\ALARM_MANAGERMENT
│  .gitignore
│  dist.zip
│  env.d.ts
│  index.html
│  package-lock.json
│  package.json
│  README.md
│  tree.txt
│  tsconfig.app.json
│  tsconfig.json
│  tsconfig.node.json
│  vite.config.ts
│  vite.config.ts.timestamp-1722563872625-dafa6df9d3ee1.mjs
│  
├─.vscode
│      extensions.json
│      
├─dist
│  │  icon.ico
│  │  index.html
│  │  login-bg.jpg
│  │  logo.png
│  │  
│  └─assets
│          index-ChTHFsuW.css
│          index-DvIh3OSh.js
│          
├─node_modules
│                  
├─public
│      icon.ico
│      login-bg.jpg
│      logo.png
│      
└─src
    │  App.vue
    │  main.ts
    │  
    ├─components
    │      DemoPart.vue
    │      Layout.vue
    │      
    ├─html
    │      DeepFlow.vue
    │      DemoToHK.vue
    │      Flow.vue
    │      Login.vue
    │      PassFlow.vue
    │      Point.vue
    │      
    ├─router
    │      index.ts
    │      
    ├─static
    │      login-bg.jpg
    │      logo.png
    │      
    └─utils
            axios-config.ts
            misc.ts
            store.ts
            Superbox.ts
            type.ts

Src文件说明

目录分解

└─src
    │  App.vue
    │  main.ts
    │  
    ├─components
    │      DemoPart.vue
    │      Layout.vue
    │      
    ├─html
    │      DeepFlow.vue
    │      DemoToHK.vue
    │      Flow.vue
    │      Login.vue
    │      PassFlow.vue
    │      Point.vue
    │      
    ├─router
    │      index.ts
    │      
    ├─static
    │      login-bg.jpg
    │      logo.png
    │      
    └─utils
            axios-config.ts
            misc.ts
            store.ts
            Superbox.ts
            type.ts

根目录

└─src
    │  App.vue
    │  main.ts
    ├─components
    ├─html
    ├─router
    ├─static
    └─utils

App.vue(关键)

  • 在index.html中可见
    <div id="app"></div>

页面的app为页面主体框架结构所有组件仿照类似嵌套方式申明和使用其下囊括页面布局的其他页面和子页面组件 相当于整体布局的一个载体(根父组件)

<template>
  <div id="app">
      <router-view></router-view>
  </div>
</template>

<script lang="ts">
import { provide } from 'vue';

export default {
  name: 'App',
  // setup() {
  		//定义响应式数据
  // }
};
</script>

<style scoped>
/* 添加你的样式 */
</style>

作为父页面不可避免需要向其下子组件传递参数可通过导入vue中的provide方法直接传递多层次的子组件信息子组件inject获取信息当然在vue3中数据的变化需要用reactive包裹数据创建响应式变化。

main.ts(关键)

对于app组件的挂载和改改父组件的依赖使用和申明需要在这里定义使用当一些新的外部组件引用逻辑正确但是显示异常可检查是否在根文件中引用

路由Route

└─src
    ├─router
    │      index.ts
  • 看门狗(to,form,next)
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
const routes = [
  {
  	    path: '/',
    	name: '',
    	component: ,
    	children: []
  
  }
const router = createRouter({
  history: createWebHashHistory(),
  routes
});
router.beforeEach((to, from, next) => {
  const token = localStorage.getItem('token');
  if (to.matched.some(record => record.meta.requiresAuth) && !token) {
    next({ name: 'Login' });
  } else {
    next();
  }
});
export default router;

组件页面

Layout.vue