create-jnrs-vue 1.2.28 → 1.2.29

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jnrs-vue",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "description": "JNRS 信息化管理系统",
5
5
  "author": "talia_tan",
6
6
  "private": true,
@@ -19,7 +19,6 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@element-plus/icons-vue": "^2.3.2",
22
- "@jnrs/lingshu-smart": "2.2.8",
23
22
  "@jnrs/shared": "1.1.23",
24
23
  "@jnrs/vue-core": "1.2.15",
25
24
  "@vueuse/core": "^14.1.0",
@@ -85,15 +85,35 @@
85
85
  "component": "/visual/index"
86
86
  },
87
87
  {
88
- "path": "/lingshuSmart/editorPage",
89
- "name": "LingshuSmartEditorPage",
90
88
  "meta": {
91
- "title": "Lingshu Smart",
89
+ "title": "灵枢智造系统",
92
90
  "icon": "Promotion",
93
- "noAuth": true,
94
- "global": true
91
+ "todoCount": 2
95
92
  },
96
- "component": "/lingshuSmart/editorPage"
93
+ "children": [
94
+ {
95
+ "path": "/lingshuSmart/editorPage",
96
+ "name": "lingshuSmartEditorPage",
97
+ "meta": {
98
+ "title": "编辑器",
99
+ "icon": "Operation",
100
+ "noAuth": true,
101
+ "global": true
102
+ },
103
+ "component": "/lingshuSmart/editorPage"
104
+ },
105
+ {
106
+ "path": "/lingshuSmart/previewPage",
107
+ "name": "lingshuSmartPreviewPage",
108
+ "meta": {
109
+ "title": "看板",
110
+ "icon": "Platform",
111
+ "noAuth": true,
112
+ "global": true
113
+ },
114
+ "component": "/lingshuSmart/previewPage"
115
+ }
116
+ ]
97
117
  },
98
118
  {
99
119
  "meta": {
@@ -1,9 +1,43 @@
1
1
  <script setup lang="ts">
2
- import { LingshuSmartEditor } from '@jnrs/lingshu-smart/components'
2
+ // import { type ICase, LingshuSmartEditor } from '@jnrs/lingshu-smart/components'
3
+
4
+ // /**
5
+ // * 加载方案列表数据
6
+ // * @param requestId 请求数据ID,即输入框输入的值(按需)
7
+ // */
8
+ // const loadCases = async (requestId?: string): Promise<ICase[]> => {
9
+ // // 此处模拟异步请求,生产环境请按需替换为后端 API
10
+ // const res = await fetch(`/json/cases.json?requestId=${requestId}`)
11
+ // await new Promise((resolve) => setTimeout(resolve, 500))
12
+ // const data = await res.json()
13
+ // return data.data
14
+ // }
15
+
16
+ // // 保存方案列表按钮回调
17
+ // const saveCases = (data?: ICase[]) => {
18
+ // console.log('保存方案列表数据', data)
19
+ // }
20
+
21
+ // // 预览按钮回调
22
+ // const handlePreview = (currentCase?: ICase) => {
23
+ // console.log('跳转预览页面', currentCase)
24
+ // window.open(`/preview/${currentCase?.uuid}`)
25
+ // }
26
+
27
+ // // 退出按钮回调
28
+ // const handleExit = () => {
29
+ // console.log('退出')
30
+ // }
3
31
  </script>
4
32
 
5
33
  <template>
6
- <LingshuSmartEditor />
34
+ <div>LingshuSmartEditor 模板</div>
35
+ <!-- <LingshuSmartEditor
36
+ :actions="{
37
+ loadCases,
38
+ saveCases,
39
+ handlePreview,
40
+ handleExit
41
+ }"
42
+ ></LingshuSmartEditor> -->
7
43
  </template>
8
-
9
- <style lang="scss" scoped></style>
@@ -0,0 +1,226 @@
1
+ <script setup lang="ts">
2
+ // import { type ICase, type ILayer, type ILayerOperating, type InteractiveUi, EnumModel } from '@/types'
3
+ // import { ref, computed, onMounted } from 'vue'
4
+ // import { uuidv4 } from '@jnrs/shared/uuid'
5
+ // import LingshuSmartPreview from '@/components/preview/index.vue'
6
+
7
+ // // 预览组件实例
8
+ // const lingshuSmartPreviewRef = ref()
9
+
10
+ // // 当前方案 ID
11
+ // const currentCaseId = ref()
12
+
13
+ // // 当前方案数据
14
+ // const currentCase = computed(() => {
15
+ // return lingshuSmartPreviewRef.value?.currentCase
16
+ // })
17
+
18
+ // /**
19
+ // * 加载方案列表数据
20
+ // * @param requestId 请求数据ID,即输入框输入的值(按需)
21
+ // */
22
+ // const loadCases = async (requestId?: string): Promise<ICase[]> => {
23
+ // // 此处模拟异步请求,生产环境请按需替换为后端 API
24
+ // const res = await fetch(`/json/cases.json?requestId=${requestId}`)
25
+ // await new Promise((resolve) => setTimeout(resolve, 500))
26
+ // const data = await res.json()
27
+ // return data.data
28
+ // }
29
+
30
+ // // 点击事件
31
+ // const onTap = (layer: ILayer, data: InteractiveUi) => {
32
+ // console.log('点击 parent', layer, '点击 target', data)
33
+ // }
34
+
35
+ // // 右键点击事件
36
+ // const onMenuTap = (layer: ILayer, data: InteractiveUi) => {
37
+ // console.log('右键点击 parent', layer, '右键点击 target', data)
38
+ // }
39
+
40
+ // // 拖拽结束事件
41
+ // const onDragEnd = (layer: ILayer, data: InteractiveUi) => {
42
+ // console.log('拖拽结束 parent', layer, '拖拽结束 target', data)
43
+ // }
44
+
45
+ // // 设备运行
46
+ // const operating = (data: ILayerOperating) => {
47
+ // lingshuSmartPreviewRef.value?.operating(data)
48
+ // }
49
+
50
+ // // websocket 消息处理
51
+ // const onMessage = (rawMessage: any) => {
52
+ // console.log('接收ws数据:', rawMessage)
53
+
54
+ // // 校验必要字段
55
+ // if (!rawMessage?.type || !rawMessage?.payload) {
56
+ // console.warn('无效的 WebSocket 消息格式', rawMessage)
57
+ // return
58
+ // }
59
+
60
+ // const type = rawMessage.type
61
+ // const payload = rawMessage.payload
62
+
63
+ // if (type === 'update') {
64
+ // // 根据原始数据处理设备运行数据
65
+ // switch (payload.type) {
66
+ // case 'Pallet':
67
+ // if (payload.addType && payload.addId) {
68
+ // // 新增资源
69
+ // operating({
70
+ // className: payload.addType,
71
+ // id: payload.addId,
72
+ // rawData: payload,
73
+ // resource: {
74
+ // resourceType: payload.type,
75
+ // name: payload.name,
76
+ // color: payload.status === 3 ? 'green' : '#424242',
77
+ // index: payload.addSiteNumber,
78
+ // handleType: 'add',
79
+ // rawData: payload
80
+ // }
81
+ // })
82
+ // }
83
+ // if (payload.removeType && payload.removeId) {
84
+ // // 删除资源
85
+ // operating({
86
+ // className: payload.removeType,
87
+ // id: payload.removeId,
88
+ // rawData: payload,
89
+ // resource: {
90
+ // resourceType: payload.type,
91
+ // index: payload.removeSiteNumber,
92
+ // handleType: 'remove',
93
+ // rawData: payload
94
+ // }
95
+ // })
96
+ // }
97
+ // break
98
+
99
+ // case 'MachineTool':
100
+ // operating({
101
+ // className: EnumModel.MACHINE_TOOL,
102
+ // id: payload.id,
103
+ // rawData: payload,
104
+ // light: {
105
+ // color: payload.status === 2 ? 'green' : '#424242',
106
+ // blinking: payload.status !== 2,
107
+ // rotating: payload.status === 2
108
+ // },
109
+ // progress: {
110
+ // percent: payload.percent,
111
+ // textContent: payload.status === 2 ? '运行中' : '待机中'
112
+ // },
113
+ // entrance: {
114
+ // isIn: payload.isIn,
115
+ // isOut: payload.isOut
116
+ // },
117
+ // stationRotatable: payload.stationRotatable
118
+ // })
119
+ // break
120
+
121
+ // case 'ResourceStore':
122
+ // operating({
123
+ // className: EnumModel.RESOURCE_STORE,
124
+ // id: payload.id,
125
+ // rawData: payload,
126
+ // light: {
127
+ // color: payload.status === 2 ? 'green' : '#424242',
128
+ // blinking: payload.status === 2
129
+ // }
130
+ // })
131
+ // break
132
+
133
+ // case 'SingleJointRobot':
134
+ // operating({
135
+ // className: EnumModel.SINGLE_JOINT_ROBOT,
136
+ // id: payload.id,
137
+ // rawData: payload,
138
+ // light: {
139
+ // color: payload.status === 2 ? 'green' : '#424242',
140
+ // blinking: payload.status === 2
141
+ // },
142
+ // x: payload.x,
143
+ // j1: payload.j1
144
+ // })
145
+
146
+ // case 'DoubleJointRobot':
147
+ // operating({
148
+ // className: EnumModel.DOUBLE_JOINT_ROBOT,
149
+ // id: payload.id,
150
+ // rawData: payload,
151
+ // light: {
152
+ // color: payload.status === 2 ? 'green' : '#424242',
153
+ // blinking: payload.status === 2
154
+ // },
155
+ // x: payload.x,
156
+ // j1: payload.j1,
157
+ // j2: payload.j2
158
+ // })
159
+ // break
160
+ // }
161
+ // }
162
+ // }
163
+
164
+ // onMounted(() => {
165
+ // const VIEW_PATH = '/preview/'
166
+ // if (location.pathname.includes(VIEW_PATH)) {
167
+ // currentCaseId.value = location.pathname.split(VIEW_PATH)[1]
168
+ // }
169
+
170
+ // // MOCK 服务器发送的 websocket 数据,实际需和后端确认数据格式
171
+ // setTimeout(() => {
172
+ // onMessage({
173
+ // traceId: uuidv4(),
174
+ // type: 'update',
175
+ // payload: {
176
+ // id: '75fb136f-bb81-4348-b53f-b9ba56f1816b',
177
+ // type: 'MachineTool',
178
+ // status: 2,
179
+ // percent: 0.8,
180
+ // isIn: true,
181
+ // isOut: false,
182
+ // stationRotatable: true
183
+ // }
184
+ // })
185
+ // }, 1500)
186
+ // })
187
+ </script>
188
+
189
+ <template>
190
+ <div>LingshuSmartPreview 模板</div>
191
+ <!-- <div class="main">
192
+ <div class="head">{{ currentCase?.title }}</div>
193
+ <LingshuSmartPreview
194
+ ref="lingshuSmartPreviewRef"
195
+ :actions="{
196
+ loadCases,
197
+ onTap,
198
+ onMenuTap,
199
+ onDragEnd
200
+ }"
201
+ :caseUuid="currentCaseId"
202
+ ></LingshuSmartPreview>
203
+ </div> -->
204
+ </template>
205
+
206
+ <style lang="scss" scoped>
207
+ .main {
208
+ position: relative;
209
+ width: 100vw;
210
+ height: 100vh;
211
+
212
+ .head {
213
+ position: absolute;
214
+ top: 0;
215
+ left: 0;
216
+ right: 0;
217
+ z-index: 10;
218
+ height: 50px;
219
+ line-height: 50px;
220
+ text-align: center;
221
+ color: #f5f5f5;
222
+ font-size: 26px;
223
+ font-weight: bold;
224
+ }
225
+ }
226
+ </style>
@@ -36,7 +36,7 @@ const { isLoading, wsStateInfo } = useWebSocket({
36
36
  <div class="visual_head">
37
37
  <div class="visual_head_left">
38
38
  <div class="visual_title">
39
- <b>数字孪生看板</b>
39
+ <b>可视化看板</b>
40
40
  <span>{{ wsStateInfo }}</span>
41
41
  </div>
42
42
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jnrs-vue",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "description": "巨能前端工程化开发,Vue 项目模板脚手架",
5
5
  "keywords": [
6
6
  "vue",