# 公共(通用)规范

基于该业务组件库,规范写法的最佳实践要点如下:(务必遵守)

# 要点1

  • 如下代码:无论是组件视图的引入还是js相关的引入(除了库的js),这些依赖的引入方式都要写以根目录触发的相对路径地址,
  • 比如@bizCp代表src/BizCompFactory,(好处:不同模块之前要复制依赖,直接复制粘贴即可,不用改路径)
  • 具体别名配置参考项目webpack配置信息 mixureSecure
import introPanel from '@bizCp/hlta-superForm/src/modules/intro-panel'
import tForm from '@bizCp/hlta-superForm/src/modules/together-form'

import {
  hlta_SetCompsRadioGroup_muliPropertys,
  hlta_SetCompsSelectTreeData,
  hlta_SetComps_general_initOptdata,
  hlta_SetCompsCheckGroup_checkAll,
  hlta_BackDictValueArr,
  RecombineCollectionToTree,
  hlta_SetCustomComps_general_initOptdata,
  DisableTreeDataOtherBranch,
  ReEnableTreeDataAllBranch,
  hlta_SetCompsCheckGroup_onValues,
} from '@bizCp/hlta-Utils'
import feedBack from '@/scopes/project/projectProcess/modulePart/feedBack/feedBackRead.vue'
import implementPlan from '@/scopes/project/projectProcess/modulePart/implementPlan/implementPlanRead.vue'
import Vue from 'vue'
import _ from 'lodash'
import item from '@/scopes/core/workTable/workTablePage/modulePart/page/part/item'
import taDrawerCtrl from '@bizCp/hlta-Utils/lib/mineStoreExt/modules/taFrame.js'
import activeJoin from '@/scopes/project/projectProcess/modulePart/activeJoin/activeJoin'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

# 要点2

  • 模块目录结构组织如下: mixureSecure
  • 文件名称写法
  1. 编辑/新增 页面 统一写成 [业务名]Info.vue
  2. 查看 页面 统一写成 [业务名]View.vue
  3. 可复用模块 页面 统一写成 [业务名]Search.vue
  4. 模块主页 统一写成 [业务名].vue
  • 路由写法
  1. 只写入模块主页的地址即可

# 要点3

  • 如果遇到某个模块需要做操作和数据上的缓存和记忆功能,直接用vue的keep-alive方案,包裹视图进行自行控制,自由处理。 (具体用法baidu)

# 要点4

每个vue页面的name一定要写
1

# 要点5

  • ta404ui模块目录结构如下: mixureSecure
Last Updated: 5/23/2023, 9:32:09 AM