框架源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.5 KiB

4 years ago
  1. # main
  2. ## Project setup
  3. ```
  4. yarn install
  5. ```
  6. ### Compiles and hot-reloads for development
  7. ```
  8. yarn serve
  9. ```
  10. ### Compiles and minifies for production
  11. ```
  12. yarn build
  13. ```
  14. ### Lints and fixes files
  15. ```
  16. yarn lint
  17. ```
  18. ### Customize configuration
  19. See [Configuration Reference](https://cli.vuejs.org/config/).
  20. {
  21. type:"message",
  22. payload:{
  23. appId:"app_1",
  24. data:{},
  25. description:"",
  26. level:"",
  27. title:""
  28. }
  29. }
  30. ### 如何根据配置文件配置主界面
  31. manifest.json文件中配置当前界面方案schema字段,如果是空突就填 "KT",如果是轻步就 "QB"
  32. ```json
  33. {
  34. "wsUrl": "",
  35. "whitelist": [],
  36. "appIds": {
  37. "ZXZH": "HCZXZH"
  38. },
  39. "schema": "QB"
  40. }
  41. ```
  42. tis/schema 新建界面方案 eg:kt_layouts
  43. ```javascript
  44. export default {
  45. "Login": () => import(/* webpackChunkName: "LoginKT" */"../../components/LoginKT"),
  46. "StatusBar": () => import(/* webpackChunkName: "StatusBar" */"../../components/StatusBar"),
  47. "SiderMenu": () => import(/* webpackChunkName: "SiderMenu" */"../../components/SiderMenu"),
  48. "Footer": () => import(/* webpackChunkName: "Footer" */"../../components/Footer"),
  49. "NavBar": () => import(/* webpackChunkName: "NavBar" */"../../components/NavBar"),
  50. "AppBar": () => import(/* webpackChunkName: "AppBar" */"../../components/AppBar"),
  51. "WidgetsPanel": () => import(/* webpackChunkName: "WidgetsPanel" */"../../components/WidgetsPanel"),
  52. "WidgetsView": () => import(/* webpackChunkName: "WidgetsView" */"../../components/WidgetsView"),
  53. "Widget": () => import(/* webpackChunkName: "Widget" */"../../components/Widget"),
  54. "WidgetDR": () => import(/* webpackChunkName: "WidgetDR" */"../../components/WidgetDR"),
  55. "AppView": () => import(/* webpackChunkName: "AppView" */"../../components/AppView"),
  56. "AppsPanel": () => import(/* webpackChunkName: "AppsPanel" */"../../components/AppsPanel"),
  57. "TaskKanban": () => import(/* webpackChunkName: "TaskKanban" */"../../components/TaskKanban"),
  58. "SettingSys": () => import(/* webpackChunkName: "SettingSys" */"../../components/SettingSys"),
  59. "NotificationWhole": () => import(/* webpackChunkName: "NotificationWhole" */"../../components/NotificationWhole"),
  60. "HistoricalNews": () => import(/* webpackChunkName: "HistoricalNews" */"../../components/HistoricalNews"),
  61. "SearchBox": () => import(/* webpackChunkName: "SearchBox" */"../../components/SearchBox"),
  62. "locationArtificial": () => import(/* webpackChunkName: "locationArtificial" */"../../components/locationArtificial"),
  63. "MessageBox": () => import(/* webpackChunkName: "MessageBox" */"../../components/MessageBox"),
  64. "ToListMail": () => import(/* webpackChunkName: "ToListMail" */"../../components/ToListMail")
  65. };
  66. ```
  67. main.js进行界面方案引入,组件均为异步组件,所以不必担心资源加载多或重复的问题
  68. ```javascript
  69. import KT_layouts from "./tis/schema/kt_layouts";
  70. import QB_layouts from "./tis/schema/qb_layouts";
  71. ```
  72. 将界面方案配置到schema对象中
  73. ```javascript
  74. const schema = {
  75. "KT": KT_layouts,
  76. "QB": QB_layouts
  77. };
  78. ```
  79. config配置中配置对应的界面方案
  80. ```javascript
  81. config.schema = manifest.schema || "QB"; //默认轻步方案
  82. config.layouts = schema[`${manifest.schema}`];
  83. ```
  84. #### notice
  85. 注意界面方案的key值几处出现的地方必须保持一致。 "KT"、"QB"
  86. #增加主题
  87. xx即为主题变量,eg:空突主题xx为kt,蓝色主题xx为blue
  88. ## 框架主题
  89. theme-chalk文件夹中增加 index-xx.css
  90. ## 应用主题
  91. tis-ui文件夹下新建theme-xx文件夹,theme-xx文件夹下新建index.css,index.css即为index-xx.css