@jnrs/lingshu-smart 1.0.1 → 2.2.3

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 (54) hide show
  1. package/README.md +34 -8
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/assets/json/menu.json.d.ts +187 -0
  4. package/dist/components/editor/ControlBar/CaseMangerButton.vue.d.ts +31 -0
  5. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +412 -0
  6. package/dist/components/editor/ControlBar/ExportImportDialog.vue.d.ts +4 -0
  7. package/dist/components/editor/ControlBar/MainButton.vue.d.ts +17 -0
  8. package/dist/components/editor/ControlBar/StepButton.vue.d.ts +2 -0
  9. package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.d.ts +9 -0
  10. package/dist/components/editor/DrawingBoard.vue.d.ts +2 -0
  11. package/dist/components/editor/MenuCard/Equipments.vue.d.ts +2 -0
  12. package/dist/components/editor/MenuCard/Layers.vue.d.ts +2 -0
  13. package/dist/components/editor/MenuCard/index.vue.d.ts +2 -0
  14. package/dist/components/editor/OptionCard/Equipment/Base.vue.d.ts +2 -0
  15. package/dist/components/editor/OptionCard/Equipment/Position.vue.d.ts +2 -0
  16. package/dist/components/editor/OptionCard/Equipment/index.vue.d.ts +2 -0
  17. package/dist/components/editor/OptionCard/Scene/Background.vue.d.ts +2 -0
  18. package/dist/components/editor/OptionCard/Scene/index.vue.d.ts +2 -0
  19. package/dist/components/editor/OptionCard/index.vue.d.ts +2 -0
  20. package/dist/components/editor/index.vue.d.ts +37 -0
  21. package/dist/components/index.d.ts +2 -1
  22. package/dist/components/index.js +24472 -1
  23. package/dist/composables/useStepRecord.d.ts +11 -0
  24. package/dist/constants/options.d.ts +9 -0
  25. package/dist/core/EditorManager.d.ts +33 -0
  26. package/dist/core/ViewContainer.d.ts +19 -0
  27. package/dist/favicon.ico +0 -0
  28. package/dist/index.js +1 -4
  29. package/dist/json/case.json +70 -0
  30. package/dist/locales/en.d.ts +0 -9
  31. package/dist/locales/index.js +8 -26
  32. package/dist/locales/zhCn.d.ts +0 -9
  33. package/dist/main.d.ts +0 -0
  34. package/dist/playground/EditPage.vue.d.ts +2 -0
  35. package/dist/playground/ViewPage.vue.d.ts +2 -0
  36. package/dist/stores/index.d.ts +1 -0
  37. package/dist/stores/useEditorStore.d.ts +14324 -0
  38. package/dist/types/components.d.ts +8 -0
  39. package/dist/types/index.d.ts +84 -1
  40. package/dist/types/model.d.ts +9 -0
  41. package/dist/ui/components/Light.d.ts +23 -0
  42. package/dist/ui/components/Progress.d.ts +24 -0
  43. package/dist/ui/components/Resource.d.ts +26 -0
  44. package/dist/ui/components/StationSlot.d.ts +36 -0
  45. package/dist/ui/models/BaseModel.d.ts +32 -0
  46. package/dist/ui/models/MachineTool.d.ts +12 -0
  47. package/dist/ui/models/ModelsFactory.d.ts +5 -0
  48. package/dist/ui/shapes/Glass.d.ts +12 -0
  49. package/dist/ui/shapes/NamePlate.d.ts +15 -0
  50. package/dist/ui/shapes/ScrewHole.d.ts +11 -0
  51. package/dist/ui/shapes/Texture.d.ts +12 -0
  52. package/dist/utils/index.d.ts +39 -0
  53. package/dist/utils/type-guards.d.ts +18 -0
  54. package/package.json +15 -7
@@ -0,0 +1,11 @@
1
+ import { StepType } from '../types';
2
+ export declare function useStepRecord(): {
3
+ MAX_OPERATION_RECORD_LENGTH: number;
4
+ operationRecord: import('vue').Ref<string[], string[]>;
5
+ currentOperationRecordIndex: import('vue').Ref<number, number>;
6
+ operationRecordStatus: import('vue').ComputedRef<{
7
+ canUndo: boolean;
8
+ canRedo: boolean;
9
+ }>;
10
+ handleOperationRecordChange: (type: StepType) => void;
11
+ };
@@ -0,0 +1,9 @@
1
+ import { ICase, ILayer } from '../types';
2
+ /**
3
+ * 新方案默认值
4
+ */
5
+ export declare const CASE_INIT: ICase;
6
+ /**
7
+ * 新图层默认值
8
+ */
9
+ export declare const LAYER_INIT: ILayer;
@@ -0,0 +1,33 @@
1
+ import { IBaseModel } from '../types';
2
+ import { ViewContainer } from './ViewContainer';
3
+ interface EditorOptions {
4
+ container: ViewContainer;
5
+ zoomMin?: number;
6
+ zoomMax?: number;
7
+ onSelected?: (data: any[]) => void;
8
+ onRotate?: (rotation: number) => void;
9
+ onScale?: (width: number, height: number) => void;
10
+ onMove?: (percentX: number, percentY: number) => void;
11
+ }
12
+ /**
13
+ * EditorManager 类负责管理图形编辑功能,包括设备的选择、旋转和缩放等操作。它通过监听编辑器的事件来更新当前选中的设备,并提供方法来设置缩放范围、标尺和点阵等功能。
14
+ * @param {string} options.container - ViewContainer 对象
15
+ * @param {number} options.zoomMin - 最小缩放比例,默认为 0.1
16
+ * @param {number} options.zoomMax - 最大缩放比例,默认为 10
17
+ * @param {Function} options.onSelected - 设备选中事件的回调函数
18
+ * @param {Function} options.onRotate - 设备旋转事件的回调函数,参数为旋转角度
19
+ * @param {Function} options.onScale - 设备缩放事件的回调函数,参数为缩放比例
20
+ */
21
+ export declare class EditorManager {
22
+ private container;
23
+ private editor;
24
+ private onSelected?;
25
+ private onRotate?;
26
+ private onScale?;
27
+ private onMove?;
28
+ constructor(options: EditorOptions);
29
+ selectEquipment(condition?: string): void;
30
+ rerenderModel(modelConfig: IBaseModel): void;
31
+ private addEvent;
32
+ }
33
+ export {};
@@ -0,0 +1,19 @@
1
+ import { IScene, IBaseModel, IContainer } from '../types';
2
+ import { App } from 'leafer';
3
+ export declare class ViewContainer {
4
+ app: App;
5
+ private treeBoxUI;
6
+ private models;
7
+ constructor(options?: IContainer);
8
+ start(): void;
9
+ destroy(): void;
10
+ setZoom(zoomType?: 'fit' | number, duration?: number): void;
11
+ setTree(data?: IScene): void;
12
+ findAll(condition: string): import('leafer').IUI[];
13
+ findOne(condition: string): import('leafer').IUI | undefined;
14
+ removeOne(condition: string): void;
15
+ clearAll(): void;
16
+ addModel(modelConfig: IBaseModel): void;
17
+ removeModelById(id: string): void;
18
+ rerenderModel(modelConfig: IBaseModel): void;
19
+ }
Binary file
package/dist/index.js CHANGED
@@ -1,4 +1 @@
1
- console.log(
2
- "%c✨ 欢迎使用 @jnrs/lingshu-smart",
3
- 'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
4
- );
1
+
@@ -0,0 +1,70 @@
1
+ {
2
+ "code": 0,
3
+ "msg": "操作成功",
4
+ "data": [
5
+ {
6
+ "id": "c6ec0fcb-4863-4c1a-a6ab-04eb26a909b2",
7
+ "isActive": true,
8
+ "title": "测试方案20260202",
9
+ "layers": [
10
+ {
11
+ "selected": false,
12
+ "visible": true,
13
+ "editable": true,
14
+ "clickable": true,
15
+ "draggable": true,
16
+ "zIndex": 1,
17
+ "rotation": 0,
18
+ "scale": 2,
19
+ "className": "MachineTool",
20
+ "equipmentName": "机床",
21
+ "nameplate": "机床1",
22
+ "tags": ["MachineTool"],
23
+ "width": 220,
24
+ "height": 240,
25
+ "siteCount": 2,
26
+ "id": "ff67fd1e-0f4f-4cd2-8c00-5feb901b9fdd",
27
+ "x": 0.5,
28
+ "y": 0.5
29
+ },
30
+ {
31
+ "selected": false,
32
+ "visible": true,
33
+ "editable": true,
34
+ "clickable": true,
35
+ "draggable": true,
36
+ "zIndex": 2,
37
+ "rotation": 0,
38
+ "scale": 1,
39
+ "className": "MachineTool",
40
+ "equipmentName": "机床",
41
+ "nameplate": "机床2",
42
+ "tags": ["MachineTool"],
43
+ "width": 220,
44
+ "height": 240,
45
+ "siteCount": 2,
46
+ "id": "76754134-af16-468e-90bc-12ebe0169d45",
47
+ "x": 1,
48
+ "y": 1
49
+ }
50
+ ],
51
+ "scene": {
52
+ "width": 1920,
53
+ "height": 1080,
54
+ "zoomType": "fit",
55
+ "fill": {
56
+ "type": "radial",
57
+ "color": "#000",
58
+ "opacity": 1,
59
+ "stops": [
60
+ { "offset": 0, "color": "rgb(131, 186, 205)" },
61
+ { "offset": 1, "color": "rgb(0, 152, 102)" }
62
+ ],
63
+ "from": "center",
64
+ "to": "right"
65
+ },
66
+ "texture": ""
67
+ }
68
+ }
69
+ ]
70
+ }
@@ -2,14 +2,5 @@ declare const _default: {
2
2
  main: {
3
3
  title: string;
4
4
  };
5
- login: {
6
- title: string;
7
- formTitle: string;
8
- formAccount: string;
9
- formPassword: string;
10
- formBtn: string;
11
- greeting: string;
12
- };
13
- layout: {};
14
5
  };
15
6
  export default _default;
@@ -1,31 +1,13 @@
1
- const e = {
1
+ const t = {
2
2
  main: {
3
- title: "信息化管理系统模板"
4
- },
5
- login: {
6
- title: "信息化管理系统模板",
7
- formTitle: "登录",
8
- formAccount: "请输入账号",
9
- formPassword: "请输入密码",
10
- formBtn: "登 录",
11
- greeting: "欢迎使用"
12
- },
13
- layout: {}
14
- }, t = {
3
+ title: "灵枢智造"
4
+ }
5
+ }, n = {
15
6
  main: {
16
- title: "Management System"
17
- },
18
- login: {
19
- title: "Management System",
20
- formTitle: "Login",
21
- formAccount: "Please enter your account",
22
- formPassword: "Please enter your password",
23
- formBtn: "Log In",
24
- greeting: "Welcome"
25
- },
26
- layout: {}
7
+ title: "LingShu Smart"
8
+ }
27
9
  };
28
10
  export {
29
- t as en,
30
- e as zhCn
11
+ n as en,
12
+ t as zhCn
31
13
  };
@@ -2,14 +2,5 @@ declare const _default: {
2
2
  main: {
3
3
  title: string;
4
4
  };
5
- login: {
6
- title: string;
7
- formTitle: string;
8
- formAccount: string;
9
- formPassword: string;
10
- formBtn: string;
11
- greeting: string;
12
- };
13
- layout: {};
14
5
  };
15
6
  export default _default;
package/dist/main.d.ts ADDED
File without changes
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export * from './useEditorStore';