zyf-model-engine 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/index.cjs +293 -0
  2. package/index.d.mts +1 -0
  3. package/index.d.ts +1 -0
  4. package/index.mjs +21645 -0
  5. package/package.json +29 -99
  6. package/style.css +1 -0
  7. package/types/components/CSvgIcon/components/SvgPathIcon.vue.d.ts +9 -0
  8. package/types/components/CSvgIcon/defaultIcons.d.ts +23 -0
  9. package/types/components/CSvgIcon/index.vue.d.ts +30 -0
  10. package/types/components/Empty/index.vue.d.ts +16 -0
  11. package/types/components/Overflow/index.vue.d.ts +11 -0
  12. package/types/components/UtilsMenu/components/BaseInfo/index.vue.d.ts +122 -0
  13. package/types/components/UtilsMenu/components/Card/index.vue.d.ts +42 -0
  14. package/types/components/UtilsMenu/components/ComInfo/index.vue.d.ts +128 -0
  15. package/types/components/UtilsMenu/components/Config/index.vue.d.ts +8 -0
  16. package/types/components/UtilsMenu/components/Cutting/clipping.d.ts +56 -0
  17. package/types/components/UtilsMenu/components/Cutting/index.vue.d.ts +128 -0
  18. package/types/components/UtilsMenu/components/Measure/index.vue.d.ts +122 -0
  19. package/types/components/UtilsMenu/components/Measure/interface/index.d.ts +5 -0
  20. package/types/components/UtilsMenu/components/Measure/measure.d.ts +106 -0
  21. package/types/components/UtilsMenu/components/ModelTree/index.vue.d.ts +875 -0
  22. package/types/components/UtilsMenu/components/ModelTree/interface/index.d.ts +19 -0
  23. package/types/components/UtilsMenu/components/ModelTree/utils/index.d.ts +13 -0
  24. package/types/components/UtilsMenu/components/Roam/index.vue.d.ts +125 -0
  25. package/types/components/UtilsMenu/components/SubMenu/index.vue.d.ts +18 -0
  26. package/types/components/UtilsMenu/index.vue.d.ts +15 -0
  27. package/types/components/UtilsMenu/interface/index.d.ts +129 -0
  28. package/types/index-dxf.vue.d.ts +15 -0
  29. package/types/index.d.ts +209 -0
  30. package/types/index.vue.d.ts +18 -0
  31. package/types/libs/CFace.d.ts +16 -0
  32. package/types/libs/CLabel.d.ts +13 -0
  33. package/types/libs/CLine.d.ts +49 -0
  34. package/types/libs/CText.d.ts +17 -0
  35. package/types/libs/MathUtils.d.ts +26 -0
  36. package/types/libs/ViewCube.d.ts +21 -0
  37. package/types/libs/materials.d.ts +4 -0
  38. package/types/libs/svg.d.ts +26 -0
  39. package/types/libs/types.d.ts +177 -0
  40. package/types/main.d.ts +22 -0
  41. package/types/manager/highLightMeshManager.d.ts +31 -0
  42. package/types/manager/lightManager.d.ts +35 -0
  43. package/types/manager/rayCasterManager.d.ts +18 -0
  44. package/types/tools/Events.d.ts +15 -0
  45. package/types/tools/math.d.ts +13 -0
  46. package/types/vendor/DXFPaser/BatchingKey.d.ts +25 -0
  47. package/types/vendor/DXFPaser/DxfFetcher.d.ts +6 -0
  48. package/types/vendor/DXFPaser/DxfScene.d.ts +95 -0
  49. package/types/vendor/DXFPaser/DxfWorker.d.ts +44 -0
  50. package/types/vendor/DXFPaser/DynamicBuffer.d.ts +30 -0
  51. package/types/vendor/DXFPaser/Entity.d.ts +18 -0
  52. package/types/vendor/DXFPaser/MTextFormatParser.d.ts +15 -0
  53. package/types/vendor/DXFPaser/MaterialKey.d.ts +8 -0
  54. package/types/vendor/DXFPaser/RBTree.d.ts +5 -0
  55. package/types/vendor/DXFPaser/TextRenderer.d.ts +43 -0
  56. package/types/vendor/DXFPaser/index.d.ts +26 -0
  57. package/types/vendor/controls/BaseArrow.d.ts +20 -0
  58. package/types/vendor/controls/FirstPersonControls.d.ts +32 -0
  59. package/types/vendor/controls/FlyControls.d.ts +18 -0
  60. package/types/vendor/controls/OrbitControls.d.ts +75 -0
  61. package/types/vendor/controls/TransformControls.d.ts +41 -0
  62. package/types/vendor/controls/directionControls.d.ts +26 -0
  63. package/types/vendor/loaders/GLTFLoader.d.ts +71 -0
  64. package/types/workbench/DxfViewer.d.ts +16 -0
  65. package/types/workbench/clickInfo.d.ts +24 -0
  66. package/types/workbench/clipping.d.ts +62 -0
  67. package/types/workbench/dxfMeasure.d.ts +92 -0
  68. package/types/workbench/dxfTools.d.ts +78 -0
  69. package/types/workbench/functionalComponent.d.ts +127 -0
  70. package/types/workbench/modelTree.d.ts +89 -0
  71. package/.editorconfig +0 -15
  72. package/.env +0 -13
  73. package/.env.development +0 -20
  74. package/.env.production +0 -25
  75. package/.env.test +0 -25
  76. package/.eslintignore +0 -15
  77. package/.eslintrc-auto-import.json +0 -65
  78. package/.eslintrc.cjs +0 -66
  79. package/.husky/commit-msg +0 -4
  80. package/.husky/pre-commit +0 -5
  81. package/.prettierignore +0 -9
  82. package/.prettierrc.cjs +0 -41
  83. package/.stylelintignore +0 -4
  84. package/.stylelintrc.cjs +0 -40
  85. package/.vscode/extensions.json +0 -14
  86. package/.vscode/settings.json +0 -92
  87. package/CHANGELOG.md +0 -246
  88. package/LICENSE +0 -21
  89. package/README.md +0 -205
  90. package/auto-imports.d.ts +0 -132
  91. package/build/getEnv.ts +0 -46
  92. package/build/plugins.ts +0 -138
  93. package/build/proxy.ts +0 -28
  94. package/commitlint.config.cjs +0 -84
  95. package/components.d.ts +0 -28
  96. package/index.html +0 -105
  97. package/lint-staged.config.cjs +0 -8
  98. package/postcss.config.cjs +0 -5
  99. package/public/logo.png +0 -0
  100. package/src/App.vue +0 -16
  101. package/src/api/config/servicePort.ts +0 -3
  102. package/src/api/enums/httpEnum.ts +0 -35
  103. package/src/api/helper/axiosCancel.ts +0 -50
  104. package/src/api/helper/axiosFileCancel.ts +0 -62
  105. package/src/api/helper/checkStatus.ts +0 -97
  106. package/src/api/index.ts +0 -142
  107. package/src/api/interface/index.ts +0 -27
  108. package/src/assets/global-icons/icon-demo.svg +0 -1
  109. package/src/assets/iconfont/iconfont.scss +0 -44
  110. package/src/assets/iconfont/iconfont.ttf +0 -0
  111. package/src/assets/images/empty-img.png +0 -0
  112. package/src/assets/option-icons/add.svg +0 -1
  113. package/src/assets/option-icons/check.svg +0 -1
  114. package/src/assets/option-icons/config.svg +0 -1
  115. package/src/assets/option-icons/del.svg +0 -1
  116. package/src/assets/option-icons/detail.svg +0 -1
  117. package/src/assets/option-icons/edit.svg +0 -2
  118. package/src/assets/option-icons/export.svg +0 -1
  119. package/src/assets/option-icons/folder.svg +0 -1
  120. package/src/assets/option-icons/full-screen.svg +0 -1
  121. package/src/assets/option-icons/more.svg +0 -1
  122. package/src/assets/option-icons/return.svg +0 -1
  123. package/src/assets/option-icons/search.svg +0 -1
  124. package/src/components/CSvgIcon/index.scss +0 -23
  125. package/src/components/CSvgIcon/index.vue +0 -74
  126. package/src/components/CTree/index.scss +0 -48
  127. package/src/components/CTree/index.vue +0 -176
  128. package/src/components/CTree/interface/index.ts +0 -6
  129. package/src/components/Dialog/index.scss +0 -74
  130. package/src/components/Dialog/index.vue +0 -87
  131. package/src/components/Empty/index.scss +0 -16
  132. package/src/components/Empty/index.vue +0 -43
  133. package/src/components/Grid/components/GridItem.vue +0 -68
  134. package/src/components/Grid/index.vue +0 -167
  135. package/src/components/Grid/interface/index.ts +0 -6
  136. package/src/components/Loading/index.scss +0 -67
  137. package/src/components/Loading/index.vue +0 -13
  138. package/src/components/Overflow/index.vue +0 -76
  139. package/src/components/ProTable/components/ColSetting.vue +0 -45
  140. package/src/components/ProTable/components/Pagination.vue +0 -29
  141. package/src/components/ProTable/components/SearchForm/components/SearchFormItem.vue +0 -93
  142. package/src/components/ProTable/components/SearchForm/index.scss +0 -12
  143. package/src/components/ProTable/components/SearchForm/index.vue +0 -91
  144. package/src/components/ProTable/components/TableColumn.vue +0 -56
  145. package/src/components/ProTable/index.scss +0 -14
  146. package/src/components/ProTable/index.vue +0 -274
  147. package/src/components/ProTable/interface/index.ts +0 -86
  148. package/src/components/ScrollBox/index.vue +0 -44
  149. package/src/components/SvgIcon/index.vue +0 -20
  150. package/src/components/Tabs/index.vue +0 -142
  151. package/src/config/index.ts +0 -12
  152. package/src/config/nprogress.ts +0 -12
  153. package/src/config/piniaPersist.ts +0 -19
  154. package/src/config/serviceLoading.ts +0 -45
  155. package/src/enums/httpEnum.ts +0 -24
  156. package/src/hooks/interface/index.ts +0 -32
  157. package/src/hooks/useOnline.ts +0 -27
  158. package/src/hooks/useTable.ts +0 -167
  159. package/src/main.ts +0 -35
  160. package/src/plugins/button/button.vue +0 -56
  161. package/src/plugins/index.js +0 -26
  162. package/src/plugins/index.vue +0 -24
  163. package/src/plugins/msg/msg.vue +0 -56
  164. package/src/stores/commonStore.ts +0 -9
  165. package/src/stores/index.ts +0 -8
  166. package/src/stores/interface/index.ts +0 -1
  167. package/src/styles/common.scss +0 -87
  168. package/src/styles/element.scss +0 -233
  169. package/src/styles/reset.scss +0 -20
  170. package/src/styles/var.scss +0 -2
  171. package/src/typings/global.d.ts +0 -37
  172. package/src/typings/window.d.ts +0 -8
  173. package/src/utils/color.ts +0 -59
  174. package/src/utils/commonUtils.ts +0 -175
  175. package/src/utils/errorHandler.ts +0 -28
  176. package/src/utils/is.ts +0 -147
  177. package/src/utils/layoutUtils.ts +0 -83
  178. package/src/utils/localUtils.ts +0 -42
  179. package/src/utils/serviceDict.ts +0 -9
  180. package/src/vite-env.d.ts +0 -6
  181. package/tsconfig.json +0 -50
  182. package/vite.config.ts +0 -76
@@ -0,0 +1,127 @@
1
+ import { default as Viewer } from '..';
2
+ import { ComponentConfig } from '../libs/types';
3
+ /**
4
+ * @description 模型预览工具面板容器(命令式 DOM),根据 ComponentConfig 配置
5
+ * 动态挂载 resetView / roaming / screenshot / cutting / measure / constructInfo / fullScreen
6
+ * / baseInfo / baseSetting 等子工具栏;子工具栏之间通过 _mouseupEvent 实现互斥切换
7
+ */
8
+ export declare class FunctionalComponent {
9
+ viewer: Viewer;
10
+ content: HTMLDivElement;
11
+ classWrapper: {
12
+ [k: string]: any;
13
+ };
14
+ constructor(viewer: Viewer, options: ComponentConfig);
15
+ private _init;
16
+ private _mouseupEvent;
17
+ }
18
+ /** @description 「重置视角」按钮,点击后相机回到初始化位置与朝向 */
19
+ export declare class resetView {
20
+ dom: HTMLDivElement;
21
+ constructor(viewer: Viewer, img?: string, text?: string);
22
+ }
23
+ /**
24
+ * @description 漫游控制器:根据 mode 切换 FlyControls(飞行)或 FirstPersonControls(第一人称),
25
+ * moveMax / rotateMax 控制移动和旋转速度上限
26
+ */
27
+ export declare class roaming {
28
+ private viewer;
29
+ private typeBox;
30
+ private flyBox;
31
+ private personBox;
32
+ private flyControlBox;
33
+ private personControlBox;
34
+ private flyParams;
35
+ private personParams;
36
+ private floorData?;
37
+ private moveMax;
38
+ private rotateMax;
39
+ currentType: string;
40
+ dom: HTMLDivElement;
41
+ constructor(viewer: Viewer, img?: string, text?: string, moveMax?: number, rotateMax?: number);
42
+ set state(param: "fly" | "person" | "");
43
+ private selectFloor;
44
+ /**
45
+ * 显示所有的楼层
46
+ * @param key 楼层数据id
47
+ */
48
+ showAllModel(key: string): void;
49
+ private _initUI;
50
+ private _initFlyUI;
51
+ private _initPersonUI;
52
+ private _initFylControlUI;
53
+ private _initPersonControlUI;
54
+ private _changeParam;
55
+ private _getFloorData;
56
+ destory(): void;
57
+ }
58
+ /** @description 截图按钮:把 renderer.domElement 导出为 PNG dataURL,download=true 时直接触发浏览器下载 */
59
+ export declare class screenShot {
60
+ dom: HTMLDivElement;
61
+ constructor(viewer: Viewer, img?: string, text?: string, download?: boolean, eventName?: string);
62
+ }
63
+ /** @description 剖切按钮(与 Clipping 类配合使用),负责切换 / 展示 / 关闭全局或局部剖切面板 */
64
+ export declare class cutting {
65
+ private viewer;
66
+ private displayBox?;
67
+ private globalBox;
68
+ private localBox;
69
+ private localContent;
70
+ private clipping;
71
+ dom: HTMLDivElement;
72
+ constructor(viewer: Viewer, img?: string, text?: string);
73
+ private initBoxUI;
74
+ private initContentUI;
75
+ private changeMin;
76
+ private changeMax;
77
+ private addMoveEvent;
78
+ destory(): void;
79
+ }
80
+ /** @description 全屏切换按钮,点击时在 window 与 documentElement 之间切换 fullscreen 状态 */
81
+ export declare class fullScreen {
82
+ dom: HTMLDivElement;
83
+ fullFlag: boolean;
84
+ constructor(img?: string, text?: string);
85
+ }
86
+ /** @description 构件信息面板:点击构件高亮 + 展示 mesh 的自定义属性,数据通过 information 类的 callback 回流 */
87
+ export declare class constructInfo {
88
+ dom: HTMLDivElement;
89
+ boxFlag: boolean;
90
+ private viewer;
91
+ private clickInfo;
92
+ private infoBox;
93
+ private callback;
94
+ private color;
95
+ private opacity;
96
+ constructor(viewer: Viewer, callback: (guid: string, fileId: number) => Promise<any[]>, img?: string, text?: string, color?: number, opacity?: number);
97
+ private createBox;
98
+ private resultCallBack;
99
+ private flagBox;
100
+ private drawEvent;
101
+ destory(): void;
102
+ }
103
+ /**
104
+ * @description 模型预览测量面板(命令式 DOM),内嵌一个独立的测量逻辑实例,
105
+ * 支持距离 / 角度 / 面积,完成后高亮并在面板底部展示结果
106
+ */
107
+ export declare class measureFun {
108
+ dom: HTMLDivElement;
109
+ private viewer;
110
+ private measureFlag;
111
+ private measureDio;
112
+ private unitDio;
113
+ private distanceMea;
114
+ private measureTextNum;
115
+ private measureTextX;
116
+ private measureTextY;
117
+ private measureUnit;
118
+ constructor(viewer: Viewer, img?: string, text?: string);
119
+ private createMeaDio;
120
+ private funButton;
121
+ private showMeaDio;
122
+ private clickSetting;
123
+ private unitAccuracy;
124
+ private selecChoose;
125
+ private meaCallBack;
126
+ destory(): void;
127
+ }
@@ -0,0 +1,89 @@
1
+ import { Object3D, Vector3 } from 'three';
2
+ import { default as Viewer } from '..';
3
+ import { TreeConfig } from '../libs/types';
4
+ /**
5
+ * @description 模型目录树(命令式 DOM):把加载后的 model Group 按
6
+ * 楼层 layer → category → model → component 四层递归展开,生成可勾选、
7
+ * 可点击高亮的树结构,挂载到指定 wrapper 元素
8
+ */
9
+ export default class ModelTree {
10
+ private viewer;
11
+ private wrapper;
12
+ private model;
13
+ private floor;
14
+ private artifact;
15
+ private config;
16
+ mountTree: {
17
+ [k: string]: any;
18
+ };
19
+ selectName: string;
20
+ constructor(viewer: Viewer, params: {
21
+ wrapper: HTMLDivElement;
22
+ config?: TreeConfig;
23
+ eventName?: string;
24
+ triangleClickCallBack?: Function;
25
+ inputPointerupCallBack?: Function;
26
+ });
27
+ /**
28
+ * 添加模型树的头部dom
29
+ */
30
+ private appendHeader;
31
+ /**
32
+ * 创建模型树的内容部分
33
+ * @returns {model: HTMLDivElement, floor: HTMLDivElement, artifact: HTMLDivElement}
34
+ */
35
+ private appendContent;
36
+ private findIndex;
37
+ /**
38
+ * 创建节点数据
39
+ * @param object 树结构的数据
40
+ * @param data 对应的模型数据
41
+ * @param isModel 是否是对应的整体模型 默认不是
42
+ * @param isChecked 当前创建的节点是否选中 默认选中
43
+ * @returns HTMLElement 最外层的大盒子
44
+ */
45
+ private createNode;
46
+ /**
47
+ * 寻找当前父节点的所有子节点 并且更改复选框的选中状态
48
+ * @param wrapper 父节点
49
+ * @param visible 是否选中
50
+ */
51
+ private findAllChildNode;
52
+ /**
53
+ * 手动添加树结构
54
+ * @param category 分类数据
55
+ * @param floor 楼层数据
56
+ * @param models 模型数据
57
+ * @returns 楼层的id 数据
58
+ */
59
+ addTree(category: {
60
+ [k: string]: any;
61
+ }, floor: {
62
+ [k: string]: any;
63
+ }, models: {
64
+ [k: string]: any;
65
+ }): {
66
+ [k: string]: any;
67
+ };
68
+ /**
69
+ * 选择楼层 需要给楼层的id
70
+ * @param key 楼层数据id
71
+ * @param up 上方向
72
+ */
73
+ selectFloor(key: string, up: Vector3): void;
74
+ /**
75
+ * 显示所有的楼层
76
+ * @param key 楼层数据id
77
+ */
78
+ showAllModel(key: string): void;
79
+ /**
80
+ * 显示或隐藏部分模型
81
+ * @param data 结构树数据
82
+ * @param model 当前操作的模型
83
+ * @param visible 显示还是隐藏
84
+ */
85
+ showOrHideMeshs(data: {
86
+ [k: string]: any;
87
+ }, model: Object3D, visible: boolean): void;
88
+ private appendStretch;
89
+ }
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- # @see: http://editorconfig.org
2
-
3
- root = true
4
-
5
- [*] # 表示所有文件适用
6
- charset = utf-8 # 设置文件字符集为 utf-8
7
- end_of_line = lf # 控制换行类型(lf | cr | crlf)
8
- insert_final_newline = true # 始终在文件末尾插入一个新行
9
- indent_style = space # 缩进风格(tab | space)
10
- indent_size = 2 # 缩进大小
11
- max_line_length = 130 # 最大行长度
12
-
13
- [*.md] # 表示仅对 md 文件适用以下规则
14
- max_line_length = off # 关闭最大行长度限制
15
- trim_trailing_whitespace = false # 关闭末尾空格修剪
package/.env DELETED
@@ -1,13 +0,0 @@
1
- # title
2
- VITE_GLOB_APP_TITLE = 模型引擎
3
- VITE_GLOB_DEMO_KEY = zyf_model_engine
4
-
5
- # 本地运行端口号
6
- VITE_PORT = 8822
7
-
8
- # 启动时自动打开浏览器
9
- VITE_OPEN = false
10
-
11
- # 打包后是否生成包分析文件
12
- VITE_REPORT = true
13
-
package/.env.development DELETED
@@ -1,20 +0,0 @@
1
- # 本地环境
2
- VITE_USER_NODE_ENV = development
3
-
4
- # 公共基础路径
5
- VITE_PUBLIC_PATH = /
6
-
7
- # 打包时是否删除 console
8
- VITE_DROP_CONSOLE = true
9
-
10
- # 是否开启 VitePWA
11
- VITE_PWA = false
12
-
13
- # 开发环境接口地址
14
- VITE_API_URL = /dev
15
-
16
- # 文件
17
- VITE_VIEWFILE_URL = ''
18
-
19
- # # 正式地址代理
20
- VITE_PROXY = [["/dev",""]]
package/.env.production DELETED
@@ -1,25 +0,0 @@
1
- # 线上环境
2
- VITE_USER_NODE_ENV = production
3
-
4
- # 公共基础路径
5
- VITE_PUBLIC_PATH = './'
6
-
7
- # 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔
8
- # Optional: gzip | brotli | none
9
- VITE_BUILD_COMPRESS = none
10
-
11
- # 打包压缩后是否删除源文件
12
- VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
13
-
14
- # 打包时是否删除 console
15
- VITE_DROP_CONSOLE = true
16
-
17
- # 是否开启 VitePWA
18
- VITE_PWA = true
19
- # 开发环境接口地址
20
- VITE_API_URL = ''
21
-
22
- VITE_VIEWFILE_URL = ''
23
-
24
-
25
-
package/.env.test DELETED
@@ -1,25 +0,0 @@
1
- # 线上环境
2
- VITE_USER_NODE_ENV = production
3
-
4
- # 公共基础路径
5
- VITE_PUBLIC_PATH = './'
6
-
7
- # 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔
8
- # Optional: gzip | brotli | none
9
- VITE_BUILD_COMPRESS = none
10
-
11
- # 打包压缩后是否删除源文件
12
- VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
13
-
14
- # 打包时是否删除 console
15
- VITE_DROP_CONSOLE = true
16
-
17
- # 是否开启 VitePWA
18
- VITE_PWA = true
19
- # 开发环境接口地址
20
- VITE_API_URL = ''
21
-
22
- VITE_VIEWFILE_URL = 'https://oss.xcj.zyfszkj.com:9998'
23
-
24
-
25
-
package/.eslintignore DELETED
@@ -1,15 +0,0 @@
1
- *.sh
2
- node_modules
3
- *.md
4
- *.woff
5
- *.ttf
6
- .vscode
7
- .idea
8
- dist
9
- /public
10
- /docs
11
- .husky
12
- .local
13
- /bin
14
- /src/mock/*
15
- stats.html
@@ -1,65 +0,0 @@
1
- {
2
- "globals": {
3
- "EffectScope": true,
4
- "ElMessage": true,
5
- "ElMessageBox": true,
6
- "ElNotification": true,
7
- "axiosController": true,
8
- "axiosFileController": true,
9
- "computed": true,
10
- "createApp": true,
11
- "customRef": true,
12
- "defineAsyncComponent": true,
13
- "defineComponent": true,
14
- "effectScope": true,
15
- "getCurrentInstance": true,
16
- "getCurrentScope": true,
17
- "h": true,
18
- "http": true,
19
- "inject": true,
20
- "is": true,
21
- "isProxy": true,
22
- "isReactive": true,
23
- "isReadonly": true,
24
- "isRef": true,
25
- "markRaw": true,
26
- "nextTick": true,
27
- "onActivated": true,
28
- "onBeforeMount": true,
29
- "onBeforeUnmount": true,
30
- "onBeforeUpdate": true,
31
- "onDeactivated": true,
32
- "onErrorCaptured": true,
33
- "onMounted": true,
34
- "onRenderTracked": true,
35
- "onRenderTriggered": true,
36
- "onScopeDispose": true,
37
- "onServerPrefetch": true,
38
- "onUnmounted": true,
39
- "onUpdated": true,
40
- "provide": true,
41
- "reactive": true,
42
- "readonly": true,
43
- "ref": true,
44
- "resolveComponent": true,
45
- "resolveDirective": true,
46
- "serviceDict": true,
47
- "shallowReactive": true,
48
- "shallowReadonly": true,
49
- "shallowRef": true,
50
- "toRaw": true,
51
- "toRef": true,
52
- "toRefs": true,
53
- "triggerRef": true,
54
- "unref": true,
55
- "useAttrs": true,
56
- "useCssModule": true,
57
- "useCssVars": true,
58
- "useSlots": true,
59
- "validate": true,
60
- "watch": true,
61
- "watchEffect": true,
62
- "watchPostEffect": true,
63
- "watchSyncEffect": true
64
- }
65
- }
package/.eslintrc.cjs DELETED
@@ -1,66 +0,0 @@
1
- // @see: http://eslint.cn
2
-
3
- module.exports = {
4
- root: true,
5
- env: {
6
- browser: true,
7
- node: true,
8
- es6: true
9
- },
10
- // 指定如何解析语法
11
- parser: "vue-eslint-parser",
12
- // 优先级低于 parse 的语法解析配置
13
- parserOptions: {
14
- parser: "@typescript-eslint/parser",
15
- ecmaVersion: 2020,
16
- sourceType: "module",
17
- jsxPragma: "React",
18
- ecmaFeatures: {
19
- jsx: true
20
- }
21
- },
22
- // 继承某些已有的规则
23
- extends: [
24
- "plugin:vue/vue3-recommended",
25
- "plugin:@typescript-eslint/recommended",
26
- "plugin:prettier/recommended",
27
- "./.eslintrc-auto-import.json"
28
- ],
29
- /**
30
- * "off" 或 0 ==> 关闭规则
31
- * "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行)
32
- * "error" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错)
33
- */
34
- rules: {
35
- // eslint (http://eslint.cn/docs/rules)
36
- "no-var": "error", // 要求使用 let 或 const 而不是 var
37
- "no-multiple-empty-lines": ["error", { max: 1 }], // 不允许多个空行
38
- "prefer-const": "off", // 使用 let 关键字声明但在初始分配后从未重新分配的变量,要求使用 const
39
- "no-use-before-define": "off", // 禁止在 函数/类/变量 定义之前使用它们
40
-
41
- // typeScript (https://typescript-eslint.io/rules)
42
- "@typescript-eslint/no-unused-vars": "off", // 禁止定义未使用的变量
43
- "@typescript-eslint/prefer-ts-expect-error": "error", // 禁止使用 @ts-ignore
44
- "@typescript-eslint/ban-ts-comment": "error", // 禁止 @ts-<directive> 使用注释或要求在指令后进行描述
45
- "@typescript-eslint/no-inferrable-types": "off", // 可以轻松推断的显式类型可能会增加不必要的冗长
46
- "@typescript-eslint/no-namespace": "off", // 禁止使用自定义 TypeScript 模块和命名空间
47
- "@typescript-eslint/no-explicit-any": "off", // 禁止使用 any 类型
48
- "@typescript-eslint/ban-types": "off", // 禁止使用特定类型
49
- "@typescript-eslint/no-var-requires": "off", // 允许使用 require() 函数导入模块
50
- "@typescript-eslint/no-empty-function": "off", // 禁止空函数
51
- "@typescript-eslint/no-non-null-assertion": "off", // 不允许使用后缀运算符的非空断言(!)
52
-
53
- // vue (https://eslint.vuejs.org/rules)
54
- "vue/script-setup-uses-vars": "error", // 防止<script setup>使用的变量<template>被标记为未使用,此规则仅在启用该no-unused-vars规则时有效
55
- "vue/v-slot-style": "error", // 强制执行 v-slot 指令样式
56
- "vue/no-mutating-props": "error", // 不允许改变组件 prop
57
- "vue/custom-event-name-casing": "error", // 为自定义事件名称强制使用特定大小写
58
- "vue/html-closing-bracket-newline": "error", // 在标签的右括号之前要求或禁止换行
59
- "vue/attribute-hyphenation": "error", // 对模板中的自定义组件强制执行属性命名样式:my-prop="prop"
60
- "vue/attributes-order": "off", // vue api使用顺序,强制执行属性顺序
61
- "vue/no-v-html": "off", // 禁止使用 v-html
62
- "vue/require-default-prop": "off", // 此规则要求为每个 prop 为必填时,必须提供默认值
63
- "vue/multi-word-component-names": "off", // 要求组件名称始终为 “-” 链接的单词
64
- "vue/no-setup-props-destructure": "off" // 禁止解构 props 传递给 setup
65
- }
66
- };
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- # . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- # npx --no-install commitlint --edit $1
package/.husky/pre-commit DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env sh
2
- # . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- # npm run lint:lint-staged
5
- # npm run lint:lint-staged
package/.prettierignore DELETED
@@ -1,9 +0,0 @@
1
- /dist/*
2
- .local
3
- /node_modules/**
4
-
5
- **/*.svg
6
- **/*.sh
7
-
8
- /public/*
9
- stats.html
package/.prettierrc.cjs DELETED
@@ -1,41 +0,0 @@
1
- // @see: https://www.prettier.cn
2
-
3
- module.exports = {
4
- // 指定最大换行长度
5
- printWidth: 130,
6
- // 缩进制表符宽度 | 空格数
7
- tabWidth: 2,
8
- // 使用制表符而不是空格缩进行 (true:制表符,false:空格)
9
- useTabs: false,
10
- // 结尾不用分号 (true:有,false:没有)
11
- semi: true,
12
- // 使用单引号 (true:单引号,false:双引号)
13
- singleQuote: false,
14
- // 在对象字面量中决定是否将属性名用引号括起来 可选值 "<as-needed|consistent|preserve>"
15
- quoteProps: "as-needed",
16
- // 在JSX中使用单引号而不是双引号 (true:单引号,false:双引号)
17
- jsxSingleQuote: false,
18
- // 多行时尽可能打印尾随逗号 可选值"<none|es5|all>"
19
- trailingComma: "none",
20
- // 在对象,数组括号与文字之间加空格 "{ foo: bar }" (true:有,false:没有)
21
- bracketSpacing: true,
22
- // 将 > 多行元素放在最后一行的末尾,而不是单独放在下一行 (true:放末尾,false:单独一行)
23
- bracketSameLine: false,
24
- // (x) => {} 箭头函数参数只有一个时是否要有小括号 (avoid:省略括号,always:不省略括号)
25
- arrowParens: "avoid",
26
- // 指定要使用的解析器,不需要写文件开头的 @prettier
27
- requirePragma: false,
28
- // 可以在文件顶部插入一个特殊标记,指定该文件已使用 Prettier 格式化
29
- insertPragma: false,
30
- // 用于控制文本是否应该被换行以及如何进行换行
31
- proseWrap: "preserve",
32
- // 在html中空格是否是敏感的 "css" - 遵守 CSS 显示属性的默认值, "strict" - 空格被认为是敏感的 ,"ignore" - 空格被认为是不敏感的
33
- htmlWhitespaceSensitivity: "css",
34
- // 控制在 Vue 单文件组件中 <script> 和 <style> 标签内的代码缩进方式
35
- vueIndentScriptAndStyle: false,
36
- // 换行符使用 lf 结尾是 可选值 "<auto|lf|crlf|cr>"
37
- endOfLine: "auto",
38
- // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 (rangeStart:开始,rangeEnd:结束)
39
- rangeStart: 0,
40
- rangeEnd: Infinity
41
- };
package/.stylelintignore DELETED
@@ -1,4 +0,0 @@
1
- /dist/*
2
- /public/*
3
- public/*
4
- stats.html
package/.stylelintrc.cjs DELETED
@@ -1,40 +0,0 @@
1
- // @see: https://stylelint.io
2
-
3
- module.exports = {
4
- root: true,
5
- // 继承某些已有的规则
6
- extends: [
7
- "stylelint-config-standard", // 配置 stylelint 拓展插件
8
- "stylelint-config-html/vue", // 配置 vue 中 template 样式格式化
9
- "stylelint-config-standard-scss", // 配置 stylelint scss 插件
10
- "stylelint-config-recommended-vue/scss", // 配置 vue 中 scss 样式格式化
11
- "stylelint-config-recess-order" // 配置 stylelint css 属性书写顺序插件,
12
- ],
13
- overrides: [
14
- // 扫描 .vue/html 文件中的 <style> 标签内的样式
15
- {
16
- files: ["**/*.{vue,html}"],
17
- customSyntax: "postcss-html"
18
- }
19
- ],
20
- rules: {
21
- "function-url-quotes": "always", // URL 的引号 "always(必须加上引号)"|"never(没有引号)"
22
- "color-hex-length": "long", // 指定 16 进制颜色的简写或扩写 "short(16进制简写)"|"long(16进制扩写)"
23
- "rule-empty-line-before": "never", // 要求或禁止在规则之前的空行 "always(规则之前必须始终有一个空行)"|"never(规则前绝不能有空行)"|"always-multi-line(多行规则之前必须始终有一个空行)"|"never-multi-line(多行规则之前绝不能有空行)"
24
- "font-family-no-missing-generic-family-keyword": null, // 禁止在字体族名称列表中缺少通用字体族关键字
25
- "scss/at-import-partial-extension": null, // 解决不能使用 @import 引入 scss 文件
26
- "property-no-unknown": null, // 禁止未知的属性
27
- "no-empty-source": null, // 禁止空源码
28
- "selector-class-pattern": null, // 强制选择器类名的格式
29
- "value-no-vendor-prefix": null, // 关闭 vendor-prefix (为了解决多行省略 -webkit-box)
30
- "no-descending-specificity": null, // 不允许较低特异性的选择器出现在覆盖较高特异性的选择器
31
- "value-keyword-case": null, // 解决在 scss 中使用 v-bind 大写单词报错
32
- "selector-pseudo-class-no-unknown": [
33
- true,
34
- {
35
- ignorePseudoClasses: ["global", "v-deep", "deep"]
36
- }
37
- ]
38
- },
39
- ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts"]
40
- };
@@ -1,14 +0,0 @@
1
- {
2
- "recommendations": [
3
- "vue.volar",
4
- "vue.vscode-typescript-vue-plugin",
5
- "hollowtree.vue-snippets",
6
- "dbaeumer.vscode-eslint",
7
- "stylelint.vscode-stylelint",
8
- "esbenp.prettier-vscode",
9
- "editorconfig.editorconfig",
10
- "streetsidesoftware.code-spell-checker",
11
- "syler.sass-indented",
12
- "mikestead.dotenv"
13
- ]
14
- }