zyf-model-engine 0.0.2 → 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.
- package/index.cjs +293 -0
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.mjs +21645 -0
- package/package.json +33 -12
- package/style.css +1 -1
- package/types/components/CSvgIcon/components/SvgPathIcon.vue.d.ts +9 -0
- package/types/components/CSvgIcon/defaultIcons.d.ts +23 -0
- package/types/components/CSvgIcon/index.vue.d.ts +30 -0
- package/types/components/Empty/index.vue.d.ts +16 -0
- package/types/components/Overflow/index.vue.d.ts +11 -0
- package/types/components/UtilsMenu/components/BaseInfo/index.vue.d.ts +122 -0
- package/types/components/UtilsMenu/components/Card/index.vue.d.ts +42 -0
- package/types/components/UtilsMenu/components/ComInfo/index.vue.d.ts +128 -0
- package/types/components/UtilsMenu/components/Config/index.vue.d.ts +8 -0
- package/types/components/UtilsMenu/components/Cutting/clipping.d.ts +56 -0
- package/types/components/UtilsMenu/components/Cutting/index.vue.d.ts +128 -0
- package/types/components/UtilsMenu/components/Measure/index.vue.d.ts +122 -0
- package/types/components/UtilsMenu/components/Measure/interface/index.d.ts +5 -0
- package/types/components/UtilsMenu/components/Measure/measure.d.ts +106 -0
- package/types/components/UtilsMenu/components/ModelTree/index.vue.d.ts +875 -0
- package/types/components/UtilsMenu/components/ModelTree/interface/index.d.ts +19 -0
- package/types/components/UtilsMenu/components/ModelTree/utils/index.d.ts +13 -0
- package/types/components/UtilsMenu/components/Roam/index.vue.d.ts +125 -0
- package/types/components/UtilsMenu/components/SubMenu/index.vue.d.ts +18 -0
- package/types/components/UtilsMenu/index.vue.d.ts +15 -0
- package/types/components/UtilsMenu/interface/index.d.ts +129 -0
- package/types/index-dxf.vue.d.ts +15 -0
- package/types/index.d.ts +209 -0
- package/types/index.vue.d.ts +18 -0
- package/types/libs/CFace.d.ts +16 -0
- package/types/libs/CLabel.d.ts +13 -0
- package/types/libs/CLine.d.ts +49 -0
- package/types/libs/CText.d.ts +17 -0
- package/types/libs/MathUtils.d.ts +26 -0
- package/types/libs/ViewCube.d.ts +21 -0
- package/types/libs/materials.d.ts +4 -0
- package/types/libs/svg.d.ts +26 -0
- package/types/libs/types.d.ts +177 -0
- package/types/main.d.ts +22 -0
- package/types/manager/highLightMeshManager.d.ts +31 -0
- package/types/manager/lightManager.d.ts +35 -0
- package/types/manager/rayCasterManager.d.ts +18 -0
- package/types/tools/Events.d.ts +15 -0
- package/types/tools/math.d.ts +13 -0
- package/types/vendor/DXFPaser/BatchingKey.d.ts +25 -0
- package/types/vendor/DXFPaser/DxfFetcher.d.ts +6 -0
- package/types/vendor/DXFPaser/DxfScene.d.ts +95 -0
- package/types/vendor/DXFPaser/DxfWorker.d.ts +44 -0
- package/types/vendor/DXFPaser/DynamicBuffer.d.ts +30 -0
- package/types/vendor/DXFPaser/Entity.d.ts +18 -0
- package/types/vendor/DXFPaser/MTextFormatParser.d.ts +15 -0
- package/types/vendor/DXFPaser/MaterialKey.d.ts +8 -0
- package/types/vendor/DXFPaser/RBTree.d.ts +5 -0
- package/types/vendor/DXFPaser/TextRenderer.d.ts +43 -0
- package/types/vendor/DXFPaser/index.d.ts +26 -0
- package/types/vendor/controls/BaseArrow.d.ts +20 -0
- package/types/vendor/controls/FirstPersonControls.d.ts +32 -0
- package/types/vendor/controls/FlyControls.d.ts +18 -0
- package/types/vendor/controls/OrbitControls.d.ts +75 -0
- package/types/vendor/controls/TransformControls.d.ts +41 -0
- package/types/vendor/controls/directionControls.d.ts +26 -0
- package/types/vendor/loaders/GLTFLoader.d.ts +71 -0
- package/types/workbench/DxfViewer.d.ts +16 -0
- package/types/workbench/clickInfo.d.ts +24 -0
- package/types/workbench/clipping.d.ts +62 -0
- package/types/workbench/dxfMeasure.d.ts +92 -0
- package/types/workbench/dxfTools.d.ts +78 -0
- package/types/workbench/functionalComponent.d.ts +127 -0
- package/types/workbench/modelTree.d.ts +89 -0
- package/build/getEnv.d.ts +0 -13
- package/build/plugins.d.ts +0 -7
- package/build/proxy.d.ts +0 -11
- package/index.html +0 -7
- package/logo.png +0 -0
- package/manifest.webmanifest +0 -1
- package/registerSW.js +0 -1
- package/src/api/config/servicePort.d.ts +0 -2
- package/src/api/enums/httpEnum.d.ts +0 -29
- package/src/api/helper/axiosCancel.d.ts +0 -21
- package/src/api/helper/axiosFileCancel.d.ts +0 -27
- package/src/api/helper/checkStatus.d.ts +0 -6
- package/src/api/index.d.ts +0 -26
- package/src/api/interface/index.d.ts +0 -18
- package/src/components/CTree/interface/index.d.ts +0 -6
- package/src/components/Grid/interface/index.d.ts +0 -5
- package/src/components/ProTable/interface/index.d.ts +0 -66
- package/src/config/index.d.ts +0 -5
- package/src/config/nprogress.d.ts +0 -3
- package/src/config/piniaPersist.d.ts +0 -10
- package/src/config/serviceLoading.d.ts +0 -5
- package/src/enums/httpEnum.d.ts +0 -19
- package/src/hooks/interface/index.d.ts +0 -30
- package/src/hooks/useOnline.d.ts +0 -6
- package/src/hooks/useTable.d.ts +0 -47
- package/src/main.d.ts +0 -1
- package/src/stores/commonStore.d.ts +0 -2
- package/src/stores/index.d.ts +0 -2
- package/src/stores/interface/index.d.ts +0 -1
- package/src/utils/color.d.ts +0 -28
- package/src/utils/commonUtils.d.ts +0 -63
- package/src/utils/errorHandler.d.ts +0 -5
- package/src/utils/is.d.ts +0 -82
- package/src/utils/layoutUtils.d.ts +0 -44
- package/src/utils/localUtils.d.ts +0 -24
- package/src/utils/serviceDict.d.ts +0 -7
- package/sw.js +0 -1
- package/vite.config.d.ts +0 -2
- package/workbox-3e911b1d.js +0 -1
- package/zyf-model-engine.mjs +0 -45118
- package/zyf-model-engine.umd.js +0 -81
|
@@ -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/build/getEnv.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare function isDevFn(mode: string): boolean;
|
|
2
|
-
export declare function isProdFn(mode: string): boolean;
|
|
3
|
-
export declare function isTestFn(mode: string): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* 是否生成包预览
|
|
6
|
-
*/
|
|
7
|
-
export declare function isReportMode(): boolean;
|
|
8
|
-
export declare function wrapperEnv(envConf: Recordable): ViteEnv;
|
|
9
|
-
/**
|
|
10
|
-
* 获取用户根目录
|
|
11
|
-
* @param dir file path
|
|
12
|
-
*/
|
|
13
|
-
export declare function getRootPath(...dir: string[]): string;
|
package/build/plugins.d.ts
DELETED
package/build/proxy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ProxyOptions } from 'vite';
|
|
2
|
-
|
|
3
|
-
declare type ProxyItem = [string, string];
|
|
4
|
-
declare type ProxyList = ProxyItem[];
|
|
5
|
-
declare type ProxyTargetList = Record<string, ProxyOptions>;
|
|
6
|
-
/**
|
|
7
|
-
* 创建代理,用于解析 .env.development 代理配置
|
|
8
|
-
* @param list
|
|
9
|
-
*/
|
|
10
|
-
export declare function createProxy(list?: ProxyList): ProxyTargetList;
|
|
11
|
-
export {};
|
package/index.html
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" type="image/svg+xml" href="./logo.png"><meta name="viewport" content="width=device-width,initial-scale=1"><title>模型引擎</title><script type="module" crossorigin src="./zyf-model-engine.umd.js"></script><link rel="stylesheet" href="./style.css"><link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head><body><div id="app"><style>#app,body,html{width:100%;height:100%;padding:0;margin:0}.loading-box{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.loading-box .loading-wrap{display:flex;align-items:center;justify-content:center;padding:98px}.dot{position:relative;box-sizing:border-box;display:inline-block;width:32px;height:32px;font-size:32px;transform:rotate(45deg);animation:ant-rotate 1.2s infinite linear}.dot i{position:absolute;display:block;width:14px;height:14px;background-color:#409eff;border-radius:100%;opacity:.3;transform:scale(.75);transform-origin:50% 50%;animation:ant-spin-move 1s infinite linear alternate}.dot i:first-child{top:0;left:0}.dot i:nth-child(2){top:0;right:0;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;animation-delay:1.2s}@keyframes ant-rotate{to{transform:rotate(405deg)}}@keyframes ant-spin-move{to{opacity:1}}</style><div class="loading-box"><div class="loading-wrap"><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script>const globalState = JSON.parse(window.localStorage.getItem("zyf_model_engine" + "global"));
|
|
2
|
-
if (globalState) {
|
|
3
|
-
const dot = document.querySelectorAll(".dot i");
|
|
4
|
-
const html = document.querySelector("html");
|
|
5
|
-
dot.forEach(item => (item.style.background = globalState.primary));
|
|
6
|
-
if (globalState.isDark) html.style.background = "#141414";
|
|
7
|
-
}</script></body></html>
|
package/logo.png
DELETED
|
Binary file
|
package/manifest.webmanifest
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"模型引擎","short_name":"模型引擎","start_url":"./","display":"standalone","background_color":"#ffffff","lang":"en","scope":"./","theme_color":"#ffffff","icons":[{"src":"/logo.png","sizes":"192x192","type":"image/png"},{"src":"/logo.png","sizes":"512x512","type":"image/png"},{"src":"/logo.png","sizes":"512x512","type":"image/png","purpose":"any maskable"}]}
|
package/registerSW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description:请求配置
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ResultEnum {
|
|
5
|
-
SUCCESS = 200,
|
|
6
|
-
ERROR = 500,
|
|
7
|
-
OVERDUE = 401,
|
|
8
|
-
TIMEOUT = 30000,
|
|
9
|
-
TYPE = "success"
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @description:请求方法
|
|
13
|
-
*/
|
|
14
|
-
export declare enum RequestEnum {
|
|
15
|
-
GET = "GET",
|
|
16
|
-
POST = "POST",
|
|
17
|
-
PATCH = "PATCH",
|
|
18
|
-
PUT = "PUT",
|
|
19
|
-
DELETE = "DELETE"
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @description:常用的 contentTyp 类型
|
|
23
|
-
*/
|
|
24
|
-
export declare enum ContentTypeEnum {
|
|
25
|
-
JSON = "application/json;charset=UTF-8",
|
|
26
|
-
TEXT = "text/plain;charset=UTF-8",
|
|
27
|
-
FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8",
|
|
28
|
-
FORM_DATA = "multipart/form-data;charset=UTF-8"
|
|
29
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CustomAxiosRequestConfig } from '../index';
|
|
2
|
-
|
|
3
|
-
export declare let pendingMap: Map<string, AbortController>;
|
|
4
|
-
export declare const getPendingUrl: (config: CustomAxiosRequestConfig) => string;
|
|
5
|
-
export declare class AxiosCanceler {
|
|
6
|
-
/**
|
|
7
|
-
* @description: 添加请求
|
|
8
|
-
* @param {Object} config
|
|
9
|
-
* @return void
|
|
10
|
-
*/
|
|
11
|
-
addPending(config: CustomAxiosRequestConfig): void;
|
|
12
|
-
/**
|
|
13
|
-
* @description: 移除请求
|
|
14
|
-
* @param {Object} config
|
|
15
|
-
*/
|
|
16
|
-
removePending(config: CustomAxiosRequestConfig): void;
|
|
17
|
-
/**
|
|
18
|
-
* @description: 清空所有pending
|
|
19
|
-
*/
|
|
20
|
-
removeAllPending(): void;
|
|
21
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CustomAxiosRequestConfig } from '../index';
|
|
2
|
-
|
|
3
|
-
export declare let pendingMap: Map<string, AbortController>;
|
|
4
|
-
export declare const getPendingUrl: (config: CustomAxiosRequestConfig) => string;
|
|
5
|
-
export declare class AxiosFileCancel {
|
|
6
|
-
size(): number;
|
|
7
|
-
/**
|
|
8
|
-
* @description: 添加请求
|
|
9
|
-
* @param {Object} config
|
|
10
|
-
* @return void
|
|
11
|
-
*/
|
|
12
|
-
addPending(config: CustomAxiosRequestConfig): void;
|
|
13
|
-
/**
|
|
14
|
-
* @description: 移除请求
|
|
15
|
-
* @param {Object} config
|
|
16
|
-
*/
|
|
17
|
-
removePending(config: CustomAxiosRequestConfig): void;
|
|
18
|
-
/**
|
|
19
|
-
* @description: 根据fileUid移除指定请求
|
|
20
|
-
* @param {number} fileUid
|
|
21
|
-
*/
|
|
22
|
-
removeSpecifyPending(fileUid: number): void;
|
|
23
|
-
/**
|
|
24
|
-
* @description: 清空所有pending
|
|
25
|
-
*/
|
|
26
|
-
removeAllPending(): void;
|
|
27
|
-
}
|
package/src/api/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
-
import { AxiosCanceler } from './helper/axiosCancel';
|
|
3
|
-
import { AxiosFileCancel } from './helper/axiosFileCancel';
|
|
4
|
-
import { ResultData } from './interface';
|
|
5
|
-
|
|
6
|
-
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
|
7
|
-
noLoading?: boolean;
|
|
8
|
-
repeatRequestCancel?: boolean;
|
|
9
|
-
fileUid?: number;
|
|
10
|
-
}
|
|
11
|
-
declare class RequestHttp {
|
|
12
|
-
service: AxiosInstance;
|
|
13
|
-
constructor(config: AxiosRequestConfig);
|
|
14
|
-
/**
|
|
15
|
-
* @description 常用请求方法封装
|
|
16
|
-
*/
|
|
17
|
-
get<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
|
|
18
|
-
post<T>(url: string, params?: object | string, _object?: {}): Promise<ResultData<T>>;
|
|
19
|
-
put<T>(url: string, params?: object, _object?: {}): Promise<ResultData<T>>;
|
|
20
|
-
delete<T>(url: string, params?: any, _object?: {}): Promise<ResultData<T>>;
|
|
21
|
-
download(url: string, params?: object, _object?: {}): Promise<BlobPart>;
|
|
22
|
-
}
|
|
23
|
-
export declare const http: RequestHttp;
|
|
24
|
-
export declare const axiosController: AxiosCanceler;
|
|
25
|
-
export declare const axiosFileController: AxiosFileCancel;
|
|
26
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare type fetchType = "get" | "post" | "put" | "delete" | "download";
|
|
2
|
-
export interface Result {
|
|
3
|
-
code: string;
|
|
4
|
-
msg: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ResultData<T = any> extends Result {
|
|
7
|
-
data: T;
|
|
8
|
-
}
|
|
9
|
-
export interface ResPage<T> {
|
|
10
|
-
list: T[];
|
|
11
|
-
page: number;
|
|
12
|
-
limit: number;
|
|
13
|
-
total: number;
|
|
14
|
-
}
|
|
15
|
-
export interface ReqPage {
|
|
16
|
-
page: number;
|
|
17
|
-
limit: number;
|
|
18
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { VNode, ComponentPublicInstance } from 'vue';
|
|
2
|
-
import { BreakPoint, Responsive } from '../../Grid/interface';
|
|
3
|
-
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults';
|
|
4
|
-
import { ProTableProps, default as ProTable } from '../index.vue';
|
|
5
|
-
|
|
6
|
-
export interface tableTreeProps {
|
|
7
|
-
hasChildren: string;
|
|
8
|
-
children: string;
|
|
9
|
-
}
|
|
10
|
-
export interface EnumProps {
|
|
11
|
-
label?: string;
|
|
12
|
-
value?: string | number | boolean | any[];
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
tagType?: string;
|
|
15
|
-
children?: EnumProps[];
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
export declare type TypeProps = "index" | "selection" | "expand";
|
|
19
|
-
export declare type SearchType = "input" | "input-number" | "select" | "select-v2" | "tree-select" | "cascader" | "date-picker" | "time-picker" | "time-select" | "switch" | "slider";
|
|
20
|
-
export declare type SearchRenderScope = {
|
|
21
|
-
searchParam: {
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
};
|
|
24
|
-
placeholder: string;
|
|
25
|
-
clearable: boolean;
|
|
26
|
-
options: EnumProps[];
|
|
27
|
-
data: EnumProps[];
|
|
28
|
-
};
|
|
29
|
-
export declare type SearchProps = {
|
|
30
|
-
el?: SearchType;
|
|
31
|
-
props?: any;
|
|
32
|
-
key?: string;
|
|
33
|
-
order?: number;
|
|
34
|
-
span?: number;
|
|
35
|
-
offset?: number;
|
|
36
|
-
defaultValue?: string | number | boolean | any[];
|
|
37
|
-
render?: (scope: SearchRenderScope) => VNode;
|
|
38
|
-
} & Partial<Record<BreakPoint, Responsive>>;
|
|
39
|
-
export declare type FieldNamesProps = {
|
|
40
|
-
label: string;
|
|
41
|
-
value: string;
|
|
42
|
-
children?: string;
|
|
43
|
-
};
|
|
44
|
-
export declare type RenderScope<T> = {
|
|
45
|
-
row: T;
|
|
46
|
-
$index: number;
|
|
47
|
-
column: TableColumnCtx<T>;
|
|
48
|
-
[key: string]: any;
|
|
49
|
-
};
|
|
50
|
-
export declare type HeaderRenderScope<T> = {
|
|
51
|
-
$index: number;
|
|
52
|
-
column: TableColumnCtx<T>;
|
|
53
|
-
[key: string]: any;
|
|
54
|
-
};
|
|
55
|
-
export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, "children" | "renderCell" | "renderHeader">> {
|
|
56
|
-
tag?: boolean;
|
|
57
|
-
isShow?: boolean;
|
|
58
|
-
search?: SearchProps | undefined;
|
|
59
|
-
enum?: EnumProps[] | ((params?: any) => Promise<any>);
|
|
60
|
-
isFilterEnum?: boolean;
|
|
61
|
-
fieldNames?: FieldNamesProps;
|
|
62
|
-
headerRender?: (scope: HeaderRenderScope<T>) => VNode;
|
|
63
|
-
render?: (scope: RenderScope<T>) => VNode | string;
|
|
64
|
-
_children?: ColumnProps<T>[];
|
|
65
|
-
}
|
|
66
|
-
export declare type ProTableInstance = Omit<InstanceType<typeof ProTable>, keyof ComponentPublicInstance | keyof ProTableProps>;
|
package/src/config/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PersistedStateOptions } from 'pinia-plugin-persistedstate';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description pinia 持久化参数配置
|
|
5
|
-
* @param {String} key 存储到持久化的 name
|
|
6
|
-
* @param {Array} paths 需要持久化的 state name
|
|
7
|
-
* @return persist
|
|
8
|
-
* */
|
|
9
|
-
declare const piniaPersistConfig: (key: string, paths?: string[]) => PersistedStateOptions;
|
|
10
|
-
export default piniaPersistConfig;
|
package/src/enums/httpEnum.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description:请求方法
|
|
3
|
-
*/
|
|
4
|
-
export declare enum RequestEnum {
|
|
5
|
-
GET = "GET",
|
|
6
|
-
POST = "POST",
|
|
7
|
-
PATCH = "PATCH",
|
|
8
|
-
PUT = "PUT",
|
|
9
|
-
DELETE = "DELETE"
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @description:常用的 contentTyp 类型
|
|
13
|
-
*/
|
|
14
|
-
export declare enum ContentTypeEnum {
|
|
15
|
-
JSON = "application/json;charset=UTF-8",
|
|
16
|
-
TEXT = "text/plain;charset=UTF-8",
|
|
17
|
-
FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8",
|
|
18
|
-
FORM_DATA = "multipart/form-data;charset=UTF-8"
|
|
19
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare namespace Table {
|
|
2
|
-
interface Pageable {
|
|
3
|
-
page: number;
|
|
4
|
-
limit: number;
|
|
5
|
-
total: number;
|
|
6
|
-
}
|
|
7
|
-
interface StateProps {
|
|
8
|
-
tableData: any[];
|
|
9
|
-
pageable: Pageable;
|
|
10
|
-
searchParam: {
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
13
|
-
searchInitParam: {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
};
|
|
16
|
-
totalParam: {
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
};
|
|
19
|
-
icon?: {
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export declare namespace HandleData {
|
|
25
|
-
type MessageType = "" | "success" | "warning" | "info" | "error";
|
|
26
|
-
}
|
|
27
|
-
export declare namespace Theme {
|
|
28
|
-
type ThemeType = "light" | "inverted" | "dark";
|
|
29
|
-
type GreyOrWeakType = "grey" | "weak";
|
|
30
|
-
}
|
package/src/hooks/useOnline.d.ts
DELETED
package/src/hooks/useTable.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { fetchType } from '../api/interface/index';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description table 页面操作方法封装
|
|
5
|
-
* @param {Function} api 获取表格数据 api 方法 (必传)
|
|
6
|
-
* @param {Object} initParam 获取数据初始化参数 (非必传,默认为{})
|
|
7
|
-
* @param {Boolean} isPageable 是否有分页 (非必传,默认为true)
|
|
8
|
-
* @param {Function} dataCallBack 对后台返回的数据进行处理的方法 (非必传)
|
|
9
|
-
* */
|
|
10
|
-
export declare const useTable: (initParam: object, isPageable: boolean, fetchType: fetchType, tableLimit?: number, api?: string | ((params: any) => Promise<any>), dataCallBack?: (data: any) => any, requestError?: (error: any) => void) => {
|
|
11
|
-
getTableList: () => Promise<void>;
|
|
12
|
-
search: () => void;
|
|
13
|
-
reset: () => void;
|
|
14
|
-
handleSizeChange: (val: number) => void;
|
|
15
|
-
handleCurrentChange: (val: number) => void;
|
|
16
|
-
updatedTotalParam: () => void;
|
|
17
|
-
tableData: import('vue').Ref<any[], any[]>;
|
|
18
|
-
pageable: import('vue').Ref<{
|
|
19
|
-
page: number;
|
|
20
|
-
limit: number;
|
|
21
|
-
total: number;
|
|
22
|
-
}, {
|
|
23
|
-
page: number;
|
|
24
|
-
limit: number;
|
|
25
|
-
total: number;
|
|
26
|
-
}>;
|
|
27
|
-
searchParam: import('vue').Ref<{
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}, {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
}>;
|
|
32
|
-
searchInitParam: import('vue').Ref<{
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}, {
|
|
35
|
-
[key: string]: any;
|
|
36
|
-
}>;
|
|
37
|
-
totalParam: import('vue').Ref<{
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}, {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}>;
|
|
42
|
-
icon?: import('vue').Ref<{
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
}, {
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
}>;
|
|
47
|
-
};
|
package/src/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/src/stores/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type AssemblySizeType = "large" | "default" | "small";
|