@jnrs/lingshu-smart 2.2.8 → 2.2.9

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 (176) hide show
  1. package/dist/App.vue.d.ts +1 -2
  2. package/dist/assets/data/editor_default_setting.d.ts +1 -8
  3. package/dist/assets/data/editor_preset_menu.d.ts +1 -8
  4. package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +15 -3
  5. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +411 -2
  6. package/dist/components/editor/ControlBar/ExportImportDialog.vue.d.ts +2 -3
  7. package/dist/components/editor/ControlBar/MainButton.vue.d.ts +2 -3
  8. package/dist/components/editor/ControlBar/StepButton.vue.d.ts +1 -2
  9. package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.d.ts +1 -2
  10. package/dist/components/editor/DrawingBoard.vue.d.ts +1 -2
  11. package/dist/components/editor/MenuCard/Equipments.vue.d.ts +1 -2
  12. package/dist/components/editor/MenuCard/Layers.vue.d.ts +1 -2
  13. package/dist/components/editor/MenuCard/index.vue.d.ts +1 -2
  14. package/dist/components/editor/OptionCard/Equipment/Base.vue.d.ts +1 -2
  15. package/dist/components/editor/OptionCard/Equipment/DataSets.vue.d.ts +1 -2
  16. package/dist/components/editor/OptionCard/Equipment/Interaction.vue.d.ts +1 -2
  17. package/dist/components/editor/OptionCard/Equipment/Position.vue.d.ts +1 -2
  18. package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.d.ts +1 -2
  19. package/dist/components/editor/OptionCard/Equipment/index.vue.d.ts +1 -2
  20. package/dist/components/editor/OptionCard/Equipment/models/MachineTool.vue.d.ts +1 -2
  21. package/dist/components/editor/OptionCard/Equipment/models/Rail.vue.d.ts +1 -2
  22. package/dist/components/editor/OptionCard/Equipment/models/SingleJointRobot.vue.d.ts +2 -0
  23. package/dist/components/editor/OptionCard/Scene/Background.vue.d.ts +1 -2
  24. package/dist/components/editor/OptionCard/Scene/index.vue.d.ts +1 -2
  25. package/dist/components/editor/OptionCard/index.vue.d.ts +1 -2
  26. package/dist/components/editor/index.vue.d.ts +13 -4
  27. package/dist/components/index.d.ts +2 -2
  28. package/dist/components/index.js +27281 -4
  29. package/dist/components/preview/index.vue.d.ts +5 -6
  30. package/dist/composables/useStepRecord.d.ts +4 -12
  31. package/dist/constants/options.d.ts +1 -8
  32. package/dist/controller/AppController.d.ts +3 -10
  33. package/dist/controller/EditorController.d.ts +2 -9
  34. package/dist/index.js +1 -1
  35. package/dist/json/cases.json +577 -20
  36. package/dist/locales/i18next.d.ts +1 -1
  37. package/dist/locales/index.d.ts +2 -2
  38. package/dist/locales/index.js +13 -3
  39. package/dist/main.d.ts +0 -3
  40. package/dist/playground/EditPageDemo.vue.d.ts +1 -2
  41. package/dist/playground/ViewPageDemo.vue.d.ts +27 -2
  42. package/dist/stores/useAppStore.d.ts +5 -12
  43. package/dist/stores/useDataStore.d.ts +11 -18
  44. package/dist/stores/useEditorStore.d.ts +20 -27
  45. package/dist/types/app.types.d.ts +1 -1
  46. package/dist/types/base.types.d.ts +1 -1
  47. package/dist/types/components/config.types.d.ts +1 -1
  48. package/dist/types/components/operating.types.d.ts +1 -1
  49. package/dist/types/enums.d.ts +1 -1
  50. package/dist/types/guards.d.ts +5 -12
  51. package/dist/types/index.d.ts +2 -2
  52. package/dist/types/models/config.types.d.ts +49 -47
  53. package/dist/types/models/operating.types.d.ts +53 -53
  54. package/dist/ui/abstract/ComponentAbs.d.ts +2 -9
  55. package/dist/ui/abstract/ModelAbs.d.ts +2 -10
  56. package/dist/ui/components/Entrance.d.ts +1 -8
  57. package/dist/ui/components/Light.d.ts +1 -8
  58. package/dist/ui/components/Progress.d.ts +1 -8
  59. package/dist/ui/components/Resource.d.ts +1 -8
  60. package/dist/ui/components/StationSlot.d.ts +1 -23
  61. package/dist/ui/components/StationSlotGroup.d.ts +1 -8
  62. package/dist/ui/factories/createGlass.d.ts +0 -6
  63. package/dist/ui/factories/createModel.d.ts +2 -9
  64. package/dist/ui/factories/createShadow.d.ts +1 -9
  65. package/dist/ui/factories/createText.d.ts +0 -7
  66. package/dist/ui/models/CleaningMachine.d.ts +1 -1
  67. package/dist/ui/models/DoubleJointRobot.d.ts +19 -20
  68. package/dist/ui/models/LoadingStation.d.ts +1 -1
  69. package/dist/ui/models/MachineTool.d.ts +1 -1
  70. package/dist/ui/models/MarkingMachine.d.ts +1 -1
  71. package/dist/ui/models/Rail.d.ts +1 -1
  72. package/dist/ui/models/ResourceStore.d.ts +1 -1
  73. package/dist/ui/models/SingleJointRobot.d.ts +3 -3
  74. package/dist/ui/shapes/NamePlate.d.ts +0 -7
  75. package/dist/ui/shapes/ScrewHole.d.ts +0 -7
  76. package/dist/ui/shapes/Texture.d.ts +1 -8
  77. package/dist/ui/utils/attr.d.ts +2 -9
  78. package/dist/utils/type-guards.d.ts +1 -1
  79. package/package.json +3 -3
  80. package/dist/App.vue.js +0 -30
  81. package/dist/assets/data/editor_default.d.ts +0 -16
  82. package/dist/assets/data/editor_default.js +0 -59
  83. package/dist/assets/data/editor_default_setting.js +0 -58
  84. package/dist/assets/data/editor_preset.d.ts +0 -9
  85. package/dist/assets/data/editor_preset.js +0 -51
  86. package/dist/assets/data/editor_preset_menu.js +0 -290
  87. package/dist/components/editor/ControlBar/CaseManger.vue.js +0 -465
  88. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.js +0 -108
  89. package/dist/components/editor/ControlBar/ExportImportDialog.vue.js +0 -280
  90. package/dist/components/editor/ControlBar/MainButton.vue.js +0 -183
  91. package/dist/components/editor/ControlBar/StepButton.vue.js +0 -147
  92. package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.js +0 -98
  93. package/dist/components/editor/DrawingBoard.vue.js +0 -31
  94. package/dist/components/editor/MenuCard/Equipments.vue.js +0 -129
  95. package/dist/components/editor/MenuCard/Layers.vue.js +0 -201
  96. package/dist/components/editor/MenuCard/index.vue.js +0 -84
  97. package/dist/components/editor/OptionCard/Equipment/Base.vue.js +0 -96
  98. package/dist/components/editor/OptionCard/Equipment/Binds.vue.d.ts +0 -3
  99. package/dist/components/editor/OptionCard/Equipment/Binds.vue.js +0 -443
  100. package/dist/components/editor/OptionCard/Equipment/Bot.vue.d.ts +0 -3
  101. package/dist/components/editor/OptionCard/Equipment/Bot.vue.js +0 -81
  102. package/dist/components/editor/OptionCard/Equipment/DataSets.vue.js +0 -304
  103. package/dist/components/editor/OptionCard/Equipment/DockStore.vue.d.ts +0 -3
  104. package/dist/components/editor/OptionCard/Equipment/DockStore.vue.js +0 -597
  105. package/dist/components/editor/OptionCard/Equipment/Interaction.vue.js +0 -287
  106. package/dist/components/editor/OptionCard/Equipment/Position.backup.vue.d.ts +0 -3
  107. package/dist/components/editor/OptionCard/Equipment/Position.backup.vue.js +0 -440
  108. package/dist/components/editor/OptionCard/Equipment/Position.vue.js +0 -436
  109. package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.js +0 -1131
  110. package/dist/components/editor/OptionCard/Equipment/Store.vue.d.ts +0 -3
  111. package/dist/components/editor/OptionCard/Equipment/Store.vue.js +0 -453
  112. package/dist/components/editor/OptionCard/Equipment/Trailer.vue.d.ts +0 -3
  113. package/dist/components/editor/OptionCard/Equipment/Trailer.vue.js +0 -1109
  114. package/dist/components/editor/OptionCard/Equipment/index.vue.js +0 -100
  115. package/dist/components/editor/OptionCard/Equipment/models/MachineTool.vue.js +0 -99
  116. package/dist/components/editor/OptionCard/Equipment/models/Rail.vue.js +0 -225
  117. package/dist/components/editor/OptionCard/Equipment/models/SingleGripperRobot.vue.d.ts +0 -3
  118. package/dist/components/editor/OptionCard/Equipment/models/SingleGripperRobot.vue.js +0 -99
  119. package/dist/components/editor/OptionCard/Scene/Background.vue.js +0 -543
  120. package/dist/components/editor/OptionCard/Scene/index.vue.js +0 -200
  121. package/dist/components/editor/OptionCard/index.vue.js +0 -73
  122. package/dist/components/editor/index.vue.js +0 -156
  123. package/dist/components/preview/index.vue.js +0 -104
  124. package/dist/composables/useStepRecord.js +0 -135
  125. package/dist/constants/options.js +0 -55
  126. package/dist/controller/AppController.js +0 -168
  127. package/dist/controller/EditorController.js +0 -173
  128. package/dist/locales/en.js +0 -5
  129. package/dist/locales/i18next.js +0 -6
  130. package/dist/locales/zhCn.js +0 -5
  131. package/dist/main.js +0 -13
  132. package/dist/playground/EditPageDemo.vue.js +0 -57
  133. package/dist/playground/ViewPageDemo.vue.js +0 -277
  134. package/dist/stores/index.js +0 -3
  135. package/dist/stores/useAppStore.js +0 -78
  136. package/dist/stores/useDataStore.js +0 -116
  137. package/dist/stores/useEditorStore.js +0 -263
  138. package/dist/types/app.types.js +0 -2
  139. package/dist/types/base.types.js +0 -1
  140. package/dist/types/components/config.types.js +0 -1
  141. package/dist/types/components/operating.types.js +0 -1
  142. package/dist/types/enums.js +0 -46
  143. package/dist/types/guards.js +0 -28
  144. package/dist/types/index.js +0 -8
  145. package/dist/types/models/config.types.js +0 -1
  146. package/dist/types/models/operating.types.js +0 -1
  147. package/dist/ui/abstract/ComponentAbs.js +0 -64
  148. package/dist/ui/abstract/ModelAbs.js +0 -119
  149. package/dist/ui/components/Entrance.js +0 -83
  150. package/dist/ui/components/Light.js +0 -167
  151. package/dist/ui/components/Progress.js +0 -84
  152. package/dist/ui/components/Resource.js +0 -70
  153. package/dist/ui/components/StationSlot.js +0 -207
  154. package/dist/ui/components/StationSlotGroup.js +0 -110
  155. package/dist/ui/factories/createGlass.js +0 -51
  156. package/dist/ui/factories/createModel.js +0 -35
  157. package/dist/ui/factories/createShadow.js +0 -52
  158. package/dist/ui/factories/createText.js +0 -46
  159. package/dist/ui/models/CleaningMachine.js +0 -141
  160. package/dist/ui/models/DoubleJointRobot.js +0 -545
  161. package/dist/ui/models/LoadingStation.js +0 -167
  162. package/dist/ui/models/MachineTool.js +0 -184
  163. package/dist/ui/models/MarkingMachine.js +0 -148
  164. package/dist/ui/models/Rail.js +0 -117
  165. package/dist/ui/models/ResourceStore.js +0 -101
  166. package/dist/ui/models/SingleBot.d.ts +0 -20
  167. package/dist/ui/models/SingleBot.js +0 -202
  168. package/dist/ui/models/SingleGripperRobot.d.ts +0 -19
  169. package/dist/ui/models/SingleGripperRobot.js +0 -272
  170. package/dist/ui/models/SingleJointRobot.js +0 -346
  171. package/dist/ui/shapes/NamePlate.js +0 -85
  172. package/dist/ui/shapes/ScrewHole.js +0 -57
  173. package/dist/ui/shapes/Texture.js +0 -51
  174. package/dist/ui/utils/attr.js +0 -50
  175. package/dist/utils/index.js +0 -92
  176. package/dist/utils/type-guards.js +0 -105
@@ -1,35 +0,0 @@
1
- /**
2
- * @Author : TanRui
3
- * @WeChat : Tan578853789
4
- * @File : createModel.ts
5
- * @Date : 2026/02/13
6
- * @Desc. : 设备模型工厂函数
7
- */
8
- import { EnumModel } from '@/types';
9
- import { MachineTool } from '../models/MachineTool';
10
- import { LoadingStation } from '../models/LoadingStation';
11
- import { MarkingMachine } from '../models/MarkingMachine';
12
- import { CleaningMachine } from '../models/CleaningMachine';
13
- import { SingleJointRobot } from '../models/SingleJointRobot';
14
- import { Rail } from '../models/Rail';
15
- import { ResourceStore } from '../models/ResourceStore';
16
- export function createModel(config) {
17
- switch (config.className) {
18
- case EnumModel.MACHINE_TOOL:
19
- return new MachineTool(config);
20
- case EnumModel.LOADING_STATION:
21
- return new LoadingStation(config);
22
- case EnumModel.MARKING_MACHINE:
23
- return new MarkingMachine(config);
24
- case EnumModel.CLEANING_MACHINE:
25
- return new CleaningMachine(config);
26
- case EnumModel.SINGLE_JOINT_ROBOT:
27
- return new SingleJointRobot(config);
28
- case EnumModel.RAIL:
29
- return new Rail(config);
30
- case EnumModel.RESOURCE_STORE:
31
- return new ResourceStore(config);
32
- default:
33
- throw new Error('Unsupported model className');
34
- }
35
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * @Author : TanRui
3
- * @WeChat : Tan578853789
4
- * @File : createShadow.ts
5
- * @Date : 2026/04/02
6
- * @Desc. : 创建阴影效果的 Canvas 实例(leaferJs 的原生阴影性能差,官方推荐使用 canvas 实现阴影效果)
7
- * @Intro. : 该工厂函数用于创建一个带有阴影效果的 Canvas 实例,适用于设备模型的阴影渲染。通过配置阴影的大小、模糊程度和颜色,实现逼真的阴影效果,增强设备模型的视觉层次感和立体感。
8
- */
9
- import { Canvas, Pen } from 'leafer';
10
- export function createShadow(options) {
11
- const shadowSize = {
12
- width: options.width * 0.1, // 阴影宽度为元素宽度的 10%
13
- height: options.height * 0.1 // 阴影高度为元素高度的 10%
14
- };
15
- const { width = 0, height = 0, cornerRadius = 0, shadow = [
16
- {
17
- x: 0,
18
- y: 0,
19
- blur: shadowSize.width,
20
- color: 'rgba(0,0,0,0.3)'
21
- }
22
- ], innerShadow = [
23
- {
24
- x: shadowSize.width,
25
- y: shadowSize.height,
26
- blur: shadowSize.width,
27
- color: 'rgba(0,0,0,0.5)'
28
- },
29
- {
30
- x: -shadowSize.width,
31
- y: -shadowSize.height,
32
- blur: shadowSize.width,
33
- color: 'rgba(255,255,255,0.5)'
34
- }
35
- ] } = options;
36
- const ui = new Canvas({
37
- className: 'ShadowCanvas',
38
- pixelRatio: devicePixelRatio,
39
- width,
40
- height,
41
- hittable: false
42
- });
43
- const pen = new Pen();
44
- pen.setStyle({
45
- fill: 'rgba(255,255,255,0)',
46
- shadow: shadow ?? undefined,
47
- innerShadow: innerShadow ?? undefined
48
- });
49
- pen.roundRect(0, 0, width, height, cornerRadius);
50
- ui.draw(pen);
51
- return ui;
52
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * @Author : TanRui
3
- * @WeChat : Tan578853789
4
- * @File : createText.ts
5
- * @Date : 2026/04/08
6
- * @Desc. : 创建文本组件(Text)的工厂函数
7
- */
8
- import { Text } from 'leafer';
9
- /**
10
- * 创建自适应文本(支持动态字号、换行、省略号)
11
- */
12
- export function createText(options) {
13
- const { name, width, height, className = 'CreateText', fill = 'rgba(0,0,0,0.2)', fontSize, fontWeight = 'black', hittable = false } = options;
14
- if (!name) {
15
- return new Text({ text: '', width, height, visible: 0 });
16
- }
17
- // 动态计算字体大小(基于字符数)
18
- const charCount = name.length;
19
- const maxFontSize = Math.min(height * 0.8, width * 0.5);
20
- const minFontSize = 12;
21
- // 估算所需字号
22
- const estimatedFontSize = width / (charCount * 0.6);
23
- let autoFontSize = Math.min(maxFontSize, estimatedFontSize);
24
- // 如果估算字号小于最小值,则固定为最小值,并启用换行+省略
25
- if (autoFontSize < minFontSize) {
26
- autoFontSize = minFontSize;
27
- }
28
- return new Text({
29
- hittable,
30
- className,
31
- text: name,
32
- textAlign: 'center',
33
- verticalAlign: 'middle',
34
- fontSize: fontSize || autoFontSize,
35
- fontWeight,
36
- fill,
37
- width,
38
- height,
39
- lineHeight: {
40
- type: 'percent',
41
- value: 1
42
- },
43
- textOverflow: '...', // 启用省略号
44
- textWrap: 'break' // 强制断词
45
- });
46
- }
@@ -1,141 +0,0 @@
1
- import { Box } from 'leafer';
2
- import { ModelAbs } from '../abstract/ModelAbs';
3
- import { Entrance } from '../components/Entrance';
4
- import { EllipseLight } from '../components/Light';
5
- import { Progress } from '../components/Progress';
6
- import { StationSlotGroup } from '../components/StationSlotGroup';
7
- import { createGlass } from '../factories/createGlass';
8
- import { NamePlate } from '../shapes/NamePlate';
9
- import { setCursor } from '../utils/attr';
10
- /**
11
- * 清洗机
12
- */
13
- export class CleaningMachine extends ModelAbs {
14
- light = null;
15
- progress = null;
16
- entrance = null;
17
- stationSlotGroup = null;
18
- createUi() {
19
- const { uuid, className, nameplate, stationSlotGroup, width, height, x, y, zIndex, rotation, scale, visible, editable, draggable } = this.config;
20
- const stationContainer = new Box({
21
- className: 'stationContainer',
22
- x: this.width_05,
23
- y: this.height_05,
24
- width: this.width_05,
25
- height: 66,
26
- around: 'center',
27
- children: [
28
- createGlass({
29
- around: 'top-left',
30
- width: this.width_05,
31
- height: 66,
32
- cornerRadius: 33
33
- })
34
- ]
35
- });
36
- this.entrance = new Entrance({
37
- x: this.width_05,
38
- y: -2,
39
- width,
40
- height: this.width_02,
41
- isIn: false,
42
- isOut: false
43
- }).init();
44
- this.light = new EllipseLight({
45
- x: this.width_05,
46
- y: 30,
47
- width: this.width_02,
48
- height: this.width_02,
49
- showShadow: true,
50
- strokeWidth: 6,
51
- strokeColor: '#D7DCEC'
52
- }).init();
53
- this.progress = new Progress({
54
- x: this.width_05,
55
- y: height - 50,
56
- width: this.width_08,
57
- height: 20,
58
- progress: 0
59
- }).init();
60
- const main = new Box({
61
- data: this.config,
62
- id: uuid,
63
- className,
64
- x,
65
- y,
66
- width,
67
- height,
68
- zIndex,
69
- rotation,
70
- scale,
71
- visible,
72
- editable,
73
- draggable,
74
- origin: 'center',
75
- around: 'center',
76
- cornerRadius: 4,
77
- fill: {
78
- type: 'linear',
79
- from: 'left',
80
- to: 'right',
81
- stops: [
82
- { offset: 0, color: '#999' },
83
- { offset: 1, color: '#555' }
84
- ]
85
- },
86
- shadow: {
87
- spread: 1,
88
- blur: 4,
89
- color: 'rgba(0,0,0,0.5)'
90
- },
91
- children: [
92
- new Box({
93
- hittable: false,
94
- width,
95
- height,
96
- fill: {
97
- type: 'linear',
98
- stops: ['#ABB9DA', '#f2f2f2']
99
- },
100
- cornerRadius: 4,
101
- zIndex: -1
102
- }),
103
- stationContainer,
104
- this.entrance.ui,
105
- this.light.ui,
106
- this.progress.ui
107
- ]
108
- });
109
- if (stationSlotGroup) {
110
- this.stationSlotGroup = new StationSlotGroup({
111
- ...stationSlotGroup,
112
- x: this.width_05,
113
- y: this.height_05,
114
- width: this.width_05,
115
- height: 66,
116
- hittable: this.config.hittable
117
- }, this.config.rotation).init();
118
- main.add(this.stationSlotGroup.ui);
119
- }
120
- if (nameplate) {
121
- main.add(NamePlate({
122
- title: nameplate,
123
- x: this.width_05,
124
- y: height - 14,
125
- stroke: 'rgba(0,0,0,0.05)'
126
- }));
127
- }
128
- setCursor(main, this.config);
129
- return main;
130
- }
131
- operating(data) {
132
- if (data.light && this.light)
133
- this.light.operating(data.light);
134
- if (data.progress && this.progress)
135
- this.progress.operating(data.progress);
136
- if (data.entrance && this.entrance)
137
- this.entrance.operating(data.entrance);
138
- if (data.resource && this.stationSlotGroup)
139
- this.stationSlotGroup.operating(data.resource);
140
- }
141
- }