No description
This repository has been archived on 2026-06-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Vue 54.2%
  • JavaScript 34.1%
  • SCSS 11.3%
  • CSS 0.3%
Find a file
2024-11-28 17:14:49 +08:00
build feat: entity列表(部分)、css架构更改 2021-12-14 16:42:45 +08:00
public fix: 实体部分接口版本修改 2024-11-28 15:33:16 +08:00
src fix: 还原实体界面修改 2024-11-28 17:14:49 +08:00
test CN-1728 fix: 动态调整y轴起点 2024-11-14 19:55:57 +08:00
typings feat: 时间选择器本地 支持时区 2021-06-18 14:35:29 +08:00
.env init 2021-06-07 18:35:16 +08:00
.env.development init 2021-06-07 18:35:16 +08:00
.env.production init 2021-06-07 18:35:16 +08:00
.eslintrc.js feat: 优化单测模拟数据格式,避免eslint报错提示造成卡顿 2023-02-17 15:28:43 +08:00
.gitignore fix: 轨迹追踪页面添加国际化 2024-03-05 10:44:43 +08:00
.gitlab-ci.yml Update .gitlab-ci.yml file 2023-10-07 09:18:47 +00:00
babel.config.js fix: 执行lint 2022-12-08 16:09:46 +08:00
Dockerfile fix: 修改nginx镜像 2024-06-17 18:32:04 +08:00
jest.config.js CN-1375 fix: 编写高级搜索器自动化测试用例 2023-12-22 17:59:44 +08:00
nginx_server.conf CN-1563 feat: 轨迹地图部分代码 2024-02-28 10:21:16 +08:00
package-lock.json CN-1548 feat: 修复关系图临时节点不对的问题 2024-06-14 15:48:23 +08:00
package.json CN-1735 fix: 修复各折线图有时候首尾点错误地等于0的问题 2024-11-13 17:54:58 +08:00
postcss.config.js feat: dashboard定义 2022-07-06 21:08:12 +08:00
README.md fix: 实体代码整理 2022-03-27 13:04:47 +08:00
vue.config.js CN-1592 feat: 部分css重构内容 2024-03-26 17:06:32 +08:00
webpack.config.js CN-1551 feat: 升级element-ui版本 2024-02-02 18:13:11 +08:00

Cyber Narrator(CN)

安装

npm install

开发环境

npm run serve

生产环境

npm run build

Lints

npm run lint

技术选型

1.VUE3

2.基础UI库

项目UI设计与NEZHA相似度较高考虑到工作量、学习成本结合NEZHA的体验选用element-plus

3.图表组件库

图表echarts5.0
地图amCharts4
拖拽 & ResizeVue-grid-layout  https://jbaysolutions.github.io/vue-grid-layout/guide/

4.响应式方案

lib-flexible + postcss-px2rem-exclude + 媒体查询
lib-flexible 将px自动转为rempostcss-px2rem-exclude 避免将ui库的css转换媒体查询根据不同屏幕大小使用不同的root font size

5.工具

lodash库该库包含大部分常用工具方法包括数组操作、函数功能扩展、对象操作等且高性能、一致。开发中应该优先使用该库的方法
https://www.lodashjs.com/

开发规范 & 要求

1.语义化

  • 所有命名要求使用语义化英文,意思表达清晰、准确
  • 除如IP、SNMP这类特殊名词外避免将单词缩略简写
  • 禁用汉语拼音

2.命名

多个单词时,应该以高阶的 (通常是一般化描述的) 单词开头,以描述性的修饰词结尾
egSearchButtonClear.vue 反例:ClearSearchButton.vue

  • 文件夹
    使用小写,单词间使用连字符-连接,或使用驼峰格式
    egright-boxrightBox

  • VUE组件文件
    使用大写开头的驼峰格式
    egAssetBox.vue

  • JS/CSS/SCSS/png等
    使用小写,单词间使用连字符-连接
    egtable-common.scss

  • JS标识符 使用小写开头的驼峰格式
    egconst tableTitle = 'Role'

  • CLASS
    使用BEM规范命名 B__E--M其中B名称必须是唯一的
    BEM具体内容见 http://getbem.com/introduction/

推荐阅读
VUE官方风格指南 https://v3.cn.vuejs.org/style-guide/

3.开发

  • 功能开发之初应考虑未来复用的可能性,将可能复用的功能代码提取为组件或使用混入,合理暴露参数、插槽,降低耦合;时间紧迫时优先级放后

  • 性能
    1.组件销毁前注意解绑挂载在window对象和其他组件实例上的事件
    2.减少能够触发浏览器回流、重绘的代码,必须使用时将使用次数尽量减少
    触发回流、重绘的js函数
    offsetTop、offsetLeft、offsetWidth、offsetHeight scrollTop、scrollLeft、scrollWidth、scrollHeight clientTop、clientLeft、clientWidth、clientHeight getComputedStyle() getBoundingClientRect()
    需要使用js修改style时一次性赋值而不是分为多次
    eg
    const el = document.getElementById('el')
    el.style.cssText += 'border-left: 1px; border-right: 2px; padding: 5px;';
    反例:
    const el = document.getElementById('el')
    el.style.padding = 'xxx'
    el.style.margin = 'xxx'
    el.style.border = 'xxx'

  • 布局
    避免使用float视情况使用position建议使用flex和grid