diff --git a/package.json b/package.json index 7dbf187..5929bd1 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,8 @@ "pako": "^2.1.0", "sortablejs": "^1.15.6", "splitpanes": "3.1.5", + "three": "^0.181.2", + "urdf-loader": "^0.12.6", "uuid": "^11.1.0", "vue-cropper": "1.1.1", "vue3-ace-editor": "^2.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb7d55f..c7d6aff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -86,6 +86,12 @@ importers: splitpanes: specifier: 3.1.5 version: 3.1.5 + three: + specifier: ^0.181.2 + version: 0.181.2 + urdf-loader: + specifier: ^0.12.6 + version: 0.12.7(three@0.181.2) uuid: specifier: ^11.1.0 version: 11.1.1 @@ -1756,6 +1762,9 @@ packages: resolution: {integrity: sha512-gAQ9qrUN/UCypHtGFbbe7Rc/f9bzO88IwrG8TDo/aMKAApKyD6E3W4Cm0EfhfBb6Z6SKt59tTCTfD+n1xmAvMg==} engines: {node: '>=16.0.0'} + three@0.181.2: + resolution: {integrity: sha512-k/CjiZ80bYss6Qs7/ex1TBlPD11whT9oKfT8oTGiHa34W4JRd1NiH/Tr1DbHWQ2/vMUypxksLnF2CfmlmM5XFQ==} + tiny-emitter@2.1.0: resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} @@ -1801,6 +1810,11 @@ packages: resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==} engines: {node: '>=14.0.0'} + urdf-loader@0.12.7: + resolution: {integrity: sha512-9RQDhWt4x9K6R3uHjv68NLwX+JDm3A2XjhksrMgq6xl9NJcwqV21+htHU0cbG619hnqH1d4mUMFuqHo22R8DMA==} + peerDependencies: + three: '>=0.152.0' + uuid@11.1.1: resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==} hasBin: true @@ -3488,6 +3502,8 @@ snapshots: sync-message-port@1.2.0: {} + three@0.181.2: {} + tiny-emitter@2.1.0: {} tinyglobby@0.2.17: @@ -3552,6 +3568,10 @@ snapshots: acorn: 8.18.0 webpack-virtual-modules: 0.6.2 + urdf-loader@0.12.7(three@0.181.2): + dependencies: + three: 0.181.2 + uuid@11.1.1: {} vanilla-jsoneditor@3.13.0: diff --git a/src/api/device/arm.js b/src/api/device/arm.js new file mode 100644 index 0000000..a7a167e --- /dev/null +++ b/src/api/device/arm.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' +// 移动机械臂 +export function moveJ(data) { + return request({ + url: '/api/humanoid/moveJ', + method: 'post', + data: data + }) +} + +// 获取机械臂状态 +export function status(data) { + return request({ + url: '/api/humanoid/status', + method: 'post', + data: data + }) +} + +export function clearFault(params) { + return request({ + url: '/api/arm/clearFault', + method: 'get', + params + }) +} diff --git a/src/api/device/camera.js b/src/api/device/camera.js new file mode 100644 index 0000000..c10a7be --- /dev/null +++ b/src/api/device/camera.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getRgbStreamUrl(robotId, deviceId) { + return request({ + url: '/api/edge/camera/rgb-stream-url', + method: 'get', + params: { robotId, deviceId } + }) +} diff --git a/src/api/device/dexHand.js b/src/api/device/dexHand.js new file mode 100644 index 0000000..0d8793d --- /dev/null +++ b/src/api/device/dexHand.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' + +// 获取灵巧手状态 +export function status(query) { + return request({ + url: '/api/dexHand/status', + method: 'get', + params: query + }) +} + +// 设置灵巧手弯曲角度 +export function setDexHandAngle(query) { + return request({ + url: '/api/dexHand/angle', + method: 'get', + params: query + }) +} diff --git a/src/api/device/microphone.js b/src/api/device/microphone.js new file mode 100644 index 0000000..d14002d --- /dev/null +++ b/src/api/device/microphone.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 开始录音 +export function startMicrophoneApi(data) { + return request({ + url: '/api/Microphone/start', + method: 'post', + data: data + }) +} + +// 暂停录音 +export function pauseMicrophoneApi(data) { + return request({ + url: '/api/Microphone/pause', + method: 'post', + data: data + }) +} + +// 恢复录音 +export function resumeMicrophoneApi(data) { + return request({ + url: '/api/Microphone/resume', + method: 'post', + data: data + }) +} + +// 停止录音 +export function stopMicrophoneApi(data) { + return request({ + url: '/api/Microphone/stop', + method: 'post', + data: data + }) +} + +// 播放音频 +export function playSpeaker(data) { + return request({ + url: '/api/Speaker/play', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/api/device/speaker.js b/src/api/device/speaker.js new file mode 100644 index 0000000..ec9e94e --- /dev/null +++ b/src/api/device/speaker.js @@ -0,0 +1,72 @@ +import request from '@/utils/request' + +// 暂停播放 +export function pause(data) { + return request({ + url: '/api/Speaker/pause', + method: 'post', + data: data + }) +} + +// 播放音频 +export function play(data) { + return request({ + url: '/api/Speaker/play', + method: 'post', + data: data + }) +} + +// 恢复播放 +export function resume(data) { + return request({ + url: '/api/Speaker/resume', + method: 'post', + data: data + }) +} + +// 获取扬声器状态 +export function status(query) { + return request({ + url: '/api/Speaker/status', + method: 'get', + params: query + }) +} + +// 停止播放 +export function stop(data) { + return request({ + url: '/api/Speaker/stop', + method: 'post', + data: data + }) +} + +// 获取音量 +export function getVolume(query) { + return request({ + url: '/api/Speaker/volume', + method: 'get', + params: query + }) +} + +// 设置音量 +export function setVolume(data) { + return request({ + url: '/api/Speaker/volume', + method: 'post', + data: data + }) +} + +// 设置音量 +export function getAll() { + return request({ + url: '/api/Speaker/getAll', + method: 'get', + }) +} \ No newline at end of file diff --git a/src/api/touch_interaction.js b/src/api/touch_interaction.js new file mode 100644 index 0000000..9182549 --- /dev/null +++ b/src/api/touch_interaction.js @@ -0,0 +1,14 @@ +import request from "@/utils/request.js"; + +export function coordinateMarking(data) { + return request({ + url: '/show/touch/coordinates', + method: 'post', + headers: { + isToken: false, + 'Content-Type': 'multipart/form-data', + 'Authorization':'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImIzY2QwYjFjLWNlNjgtNDEwNy1hYzA1LTdmYTBlNmQ4NzJmNiJ9.2N9E9IDrFeCe-yRIBly60N0kYYmCscdrhyd8KHmhw2dxLi7B_A1i8bcWRTtx9YryFB3AhkvZkGauMx0CdZ0TDg' + }, + data: data + }) +} diff --git a/src/api/tts.js b/src/api/tts.js new file mode 100644 index 0000000..0a77f2a --- /dev/null +++ b/src/api/tts.js @@ -0,0 +1,30 @@ +import request from '@/utils/request' + +const serviceHeaders = { + Authorization: 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImFiNmEyY2Y0LWM3MjQtNDgyMy1hM2NiLTk4N2NhZWNmMzZiNCJ9.oq-JVRbQuq_ujQ2V0h2jXC3woHPdMQKhnYJ8ixRm-C6Ez4GqJWyHYgmnkw5dbDyhWGdIUH02uv6XT8UiboHD4g', + isToken: false, +} + +export function createTimbre(data) { + return request({ url: '/show/tts/create', method: 'post', headers: { ...serviceHeaders, 'Content-Type': 'multipart/form-data' }, data }) +} + +export function getTts() { + return request({ url: '/show/tts/query', method: 'get', headers: serviceHeaders }) +} + +export function createCorpus(data) { + return request({ url: '/show/tts/corpus', method: 'post', headers: serviceHeaders, data }) +} + +export function getSynthesize(data, config = {}) { + return request({ url: '/show/tts/synthesize', method: 'post', headers: serviceHeaders, responseType: 'blob', data }, config) +} + +export function createAdvancedCorpus(data) { + return request({ url: '/show/tts/corpus/advanced', method: 'post', headers: serviceHeaders, data }) +} + +export function getAdvancedSynthesize(data, config = {}) { + return request({ url: '/show/tts/synthesize/advanced', method: 'post', headers: serviceHeaders, responseType: 'blob', data }, config) +} diff --git a/src/index.js b/src/index.js index 5e1d222..cabf466 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,7 @@ import request from '@/utils/request' const commonViewModules = import.meta.glob([ './views/resource/**/*.vue', + './views/device/**/*.vue', './views/flow/**/*.vue', './views/system/**/*.vue', './views/tool/**/*.vue', @@ -40,6 +41,7 @@ export { default as RegisterView } from '@/views/register.vue' export { default as RedirectView } from '@/views/redirect/index.vue' export { default as Error401View } from '@/views/error/401.vue' export { default as Error404View } from '@/views/error/404.vue' +export { createDeviceRoutes } from '@/router/deviceRoutes' export { default as RuntimeAssignmentsEditor } from '@/views/flow/components/RuntimeAssignmentsEditor.vue' export { default as RuntimeParamsEditor } from '@/views/flow/components/RuntimeParamsEditor.vue' diff --git a/src/router/deviceRoutes.js b/src/router/deviceRoutes.js new file mode 100644 index 0000000..378bda3 --- /dev/null +++ b/src/router/deviceRoutes.js @@ -0,0 +1,92 @@ +const deviceViews = { + mechanicalArm: () => import('@/views/device/register/components/MechanicalArm/index.vue'), + camera: () => import('@/views/device/register/components/Camera/index.vue'), + head: () => import('@/views/device/register/components/Head/index.vue'), + speaker: () => import('@/views/device/register/components/Speaker/index.vue'), + dexHand: () => import('@/views/device/register/components/DexHand/index.vue'), + microphone: () => import('@/views/device/register/components/Microphone/index.vue'), + speechSynthesis: () => import('@/views/device/register/components/SpeechSynthesis/index.vue'), + touchInteraction: () => import('@/views/device/register/components/TouchInteraction/index.vue'), + logicFlow: () => import('@/views/device/register/components/VueFlow/index.vue'), + motor: () => import('@/views/device/register/components/Motor/index.vue') +} + +export function createDeviceRoutes(Layout) { + if (!Layout) { + throw new Error('[cmvr-common] createDeviceRoutes requires the host Layout component') + } + + return [ + { + path: '/device', + component: Layout, + children: [ + { + path: 'mechanical_arm/:id', + component: deviceViews.mechanicalArm, + name: 'DeviceMechanicalArmTeach', + meta: { title: '机械臂详情' }, + hidden: true + }, + { + path: 'camera/:id', + component: deviceViews.camera, + name: 'DeviceCameraTeach', + meta: { title: '摄像头详情' }, + hidden: true + }, + { + path: 'head/:id', + component: deviceViews.head, + name: 'DeviceHeadTeach', + meta: { title: '人工头详情' }, + hidden: true + }, + { + path: 'speaker/:id', + component: deviceViews.speaker, + name: 'DeviceSpeakerTeach', + meta: { title: '扬声器详情' }, + hidden: true + }, + { + path: 'hand/:id', + component: deviceViews.dexHand, + name: 'DeviceDexHandTeach', + meta: { title: '灵巧手详情' }, + hidden: true + }, + { + path: 'microphone/:id', + component: deviceViews.microphone, + name: 'DeviceMicrophoneTeach', + meta: { title: '麦克风详情' }, + hidden: true + } + ] + }, + { + path: '/speech_synthesis', + component: deviceViews.speechSynthesis, + meta: { title: '语音合成', noLogin: true }, + hidden: true + }, + { + path: '/touch_interaction', + component: deviceViews.touchInteraction, + meta: { title: '触摸交互', noLogin: true }, + hidden: true + }, + { + path: '/logic_flow', + component: deviceViews.logicFlow, + meta: { title: '流程运行状态', noLogin: true }, + hidden: true + }, + { + path: '/Motor/:id', + component: deviceViews.motor, + hidden: true + } + ] +} diff --git a/src/views/device/register/components/Camera/index.vue b/src/views/device/register/components/Camera/index.vue new file mode 100644 index 0000000..27bc45a --- /dev/null +++ b/src/views/device/register/components/Camera/index.vue @@ -0,0 +1,553 @@ + + + + + diff --git a/src/views/device/register/components/ControlCard/index.vue b/src/views/device/register/components/ControlCard/index.vue new file mode 100644 index 0000000..1590fb4 --- /dev/null +++ b/src/views/device/register/components/ControlCard/index.vue @@ -0,0 +1,36 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/register/components/DexHand/LeftBottomHand.vue b/src/views/device/register/components/DexHand/LeftBottomHand.vue new file mode 100644 index 0000000..302711f --- /dev/null +++ b/src/views/device/register/components/DexHand/LeftBottomHand.vue @@ -0,0 +1,431 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/register/components/DexHand/LeftTopHand.vue b/src/views/device/register/components/DexHand/LeftTopHand.vue new file mode 100644 index 0000000..faeae7c --- /dev/null +++ b/src/views/device/register/components/DexHand/LeftTopHand.vue @@ -0,0 +1,270 @@ + + + + + diff --git a/src/views/device/register/components/DexHand/RightBottomCharts.vue b/src/views/device/register/components/DexHand/RightBottomCharts.vue new file mode 100644 index 0000000..bc42122 --- /dev/null +++ b/src/views/device/register/components/DexHand/RightBottomCharts.vue @@ -0,0 +1,229 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/register/components/DexHand/RightTopCharts.vue b/src/views/device/register/components/DexHand/RightTopCharts.vue new file mode 100644 index 0000000..09cae93 --- /dev/null +++ b/src/views/device/register/components/DexHand/RightTopCharts.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/register/components/DexHand/index.vue b/src/views/device/register/components/DexHand/index.vue new file mode 100644 index 0000000..1185166 --- /dev/null +++ b/src/views/device/register/components/DexHand/index.vue @@ -0,0 +1,168 @@ + + + + + + diff --git a/src/views/device/register/components/Head/index.vue b/src/views/device/register/components/Head/index.vue new file mode 100644 index 0000000..ae48490 --- /dev/null +++ b/src/views/device/register/components/Head/index.vue @@ -0,0 +1,316 @@ + + + + + diff --git a/src/views/device/register/components/MechanicalArm/components/JointControl.vue b/src/views/device/register/components/MechanicalArm/components/JointControl.vue new file mode 100644 index 0000000..f53b595 --- /dev/null +++ b/src/views/device/register/components/MechanicalArm/components/JointControl.vue @@ -0,0 +1,133 @@ + + + \ No newline at end of file diff --git a/src/views/device/register/components/MechanicalArm/components/UrdfViewer.vue b/src/views/device/register/components/MechanicalArm/components/UrdfViewer.vue new file mode 100644 index 0000000..bdcc52b --- /dev/null +++ b/src/views/device/register/components/MechanicalArm/components/UrdfViewer.vue @@ -0,0 +1,394 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/register/components/MechanicalArm/index.vue b/src/views/device/register/components/MechanicalArm/index.vue new file mode 100644 index 0000000..9560acb --- /dev/null +++ b/src/views/device/register/components/MechanicalArm/index.vue @@ -0,0 +1,384 @@ + + + + + diff --git a/src/views/device/register/components/Microphone/index.vue b/src/views/device/register/components/Microphone/index.vue new file mode 100644 index 0000000..86ce97f --- /dev/null +++ b/src/views/device/register/components/Microphone/index.vue @@ -0,0 +1,233 @@ + + + diff --git a/src/views/device/register/components/Motor/index.vue b/src/views/device/register/components/Motor/index.vue new file mode 100644 index 0000000..8ecf371 --- /dev/null +++ b/src/views/device/register/components/Motor/index.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/register/components/Speaker/index.vue b/src/views/device/register/components/Speaker/index.vue new file mode 100644 index 0000000..e44db5d --- /dev/null +++ b/src/views/device/register/components/Speaker/index.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/views/device/register/components/SpeechSynthesis/AudioPlayer.vue b/src/views/device/register/components/SpeechSynthesis/AudioPlayer.vue new file mode 100644 index 0000000..be36efc --- /dev/null +++ b/src/views/device/register/components/SpeechSynthesis/AudioPlayer.vue @@ -0,0 +1,108 @@ + + + + + + diff --git a/src/views/device/register/components/SpeechSynthesis/chat.vue b/src/views/device/register/components/SpeechSynthesis/chat.vue new file mode 100644 index 0000000..5a954a1 --- /dev/null +++ b/src/views/device/register/components/SpeechSynthesis/chat.vue @@ -0,0 +1,699 @@ + + + + diff --git a/src/views/device/register/components/SpeechSynthesis/img/ai.png b/src/views/device/register/components/SpeechSynthesis/img/ai.png new file mode 100644 index 0000000..79bbe45 Binary files /dev/null and b/src/views/device/register/components/SpeechSynthesis/img/ai.png differ diff --git a/src/views/device/register/components/SpeechSynthesis/img/user.png b/src/views/device/register/components/SpeechSynthesis/img/user.png new file mode 100644 index 0000000..481f7e7 Binary files /dev/null and b/src/views/device/register/components/SpeechSynthesis/img/user.png differ diff --git a/src/views/device/register/components/SpeechSynthesis/index.vue b/src/views/device/register/components/SpeechSynthesis/index.vue new file mode 100644 index 0000000..94b9003 --- /dev/null +++ b/src/views/device/register/components/SpeechSynthesis/index.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/views/device/register/components/SpeechSynthesis/soundRecording.vue b/src/views/device/register/components/SpeechSynthesis/soundRecording.vue new file mode 100644 index 0000000..5b2a05b --- /dev/null +++ b/src/views/device/register/components/SpeechSynthesis/soundRecording.vue @@ -0,0 +1,115 @@ + + + + + + diff --git a/src/views/device/register/components/TouchInteraction/ai.png b/src/views/device/register/components/TouchInteraction/ai.png new file mode 100644 index 0000000..79bbe45 Binary files /dev/null and b/src/views/device/register/components/TouchInteraction/ai.png differ diff --git a/src/views/device/register/components/TouchInteraction/index.vue b/src/views/device/register/components/TouchInteraction/index.vue new file mode 100644 index 0000000..08788ae --- /dev/null +++ b/src/views/device/register/components/TouchInteraction/index.vue @@ -0,0 +1,512 @@ + + + + + diff --git a/src/views/device/register/components/TouchInteraction/zsj.png b/src/views/device/register/components/TouchInteraction/zsj.png new file mode 100644 index 0000000..481f7e7 Binary files /dev/null and b/src/views/device/register/components/TouchInteraction/zsj.png differ diff --git a/src/views/device/register/components/VueFlow/IPlayer/config.ts b/src/views/device/register/components/VueFlow/IPlayer/config.ts new file mode 100644 index 0000000..3048428 --- /dev/null +++ b/src/views/device/register/components/VueFlow/IPlayer/config.ts @@ -0,0 +1,59 @@ +export const conf = { + /** + * 基础功能配置 + * */ + autoplay: false, // 是否自动播放,不自动播放,浏览器有限制规则 + autoplayMuted: false, // 是否自动播放(静音播放) + videoInit: true, // 是否默认初始化video,默认初始化,默认true + playsinline: true, // 是否启用内联播放模式,仅移动端生效 + defaultPlaybackRate: 1, // 默认播放速度(可选:0.5/0.75/1/1.5/2等) + volume: 0.72, // 播放音量(可选:0 ~ 1) + loop: false, // 是否循环播放,默认不循环播放 + startTime: 0, // 点播模式下,初始起播时间 + videoAttributes: {}, // video扩展属性,暂且不配置 + lang: 'zh-cn', // 播放器初始显示语言,设置为中文 + fluid: true, // 是否流式布局(宽高优先于流失布局,默认16:9)注掉上方宽高看效果 + fitVideoSize: 'fixed', // 保持容器宽/高,不做适配,按照容器来 + videoFillMode: 'auto', // 宽高不够自动底色填充(fill拉伸填充等...) + seekedStatus: 'play', // 跳转后继续播放 + // 播放器进度条故事点信息数组 + progressDot: [ + { + id: 0, // 唯一标识,用于删除的时候索引 + time: 30, // 展示的时间点,例子为在播放到10s钟的时候展示 + text: '进度条信息提示...', // hover的时候展示文案,可以为空 + duration: 1, // 展示时间跨度,单位为s + style: { // 指定样式 + backgroundColor: 'white' + } + }, + ], + thumbnail: null, // 进度条预览图配置,普通业务用不到 + marginControls: false, // 是否开启画面和控制栏分离模式,不开启空间多一些 + domEventType: 'default', // 响应的事件类型,不用指定,用默认的即可 + /** + * 交互功能配置(一般使用默认即可) + * */ + /** + * 插件配置,根据需求自选 + * */ + icons: {}, // 使用默认的icon图标 + i18n: [], // 使用默认的中文 + // 自定义一些颜色 + commonStyle: { + progressColor: 'green', // 整个进度条颜色 + playedColor: 'chocolate', // 已播放的进度条颜色 + volumeColor: 'pink', // 音量大小竖向滑块颜色 + }, + controls: true, // 是否使用底部控制栏,默认使用 + miniprogress: true, // 是否使用mini进度条(当底部控制栏隐藏时生效) + screenShot: false, // 关闭截图功能 + rotate: true, // 是否使用视频旋转插件,默认不使用 + download: true, // 是否使用下载按钮,一般不用,一般自定义控制 + pip: true, // 使用使用画中画模式,默认不用 + mini: true, // 是否使用小屏幕控件 + cssFullscreen: true, // 是否使用网页样式全屏按钮开关 + playbackRate: [0.5, 1, 1.5, 2, 3], //传入倍速可选数组 + // playbackRate: true, //false,禁用倍速播放(即控制栏不显示) + keyShortcut: false, // 是否开启快捷键模式 +} diff --git a/src/views/device/register/components/VueFlow/IPlayer/index.vue b/src/views/device/register/components/VueFlow/IPlayer/index.vue new file mode 100644 index 0000000..55be899 --- /dev/null +++ b/src/views/device/register/components/VueFlow/IPlayer/index.vue @@ -0,0 +1,62 @@ + + + + + + diff --git a/src/views/device/register/components/VueFlow/RuntimeGroup.vue b/src/views/device/register/components/VueFlow/RuntimeGroup.vue new file mode 100644 index 0000000..dca777e --- /dev/null +++ b/src/views/device/register/components/VueFlow/RuntimeGroup.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/views/device/register/components/VueFlow/RuntimeNode.vue b/src/views/device/register/components/VueFlow/RuntimeNode.vue new file mode 100644 index 0000000..6ab3e75 --- /dev/null +++ b/src/views/device/register/components/VueFlow/RuntimeNode.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/views/device/register/components/VueFlow/customFlow.vue b/src/views/device/register/components/VueFlow/customFlow.vue new file mode 100644 index 0000000..9ba9db2 --- /dev/null +++ b/src/views/device/register/components/VueFlow/customFlow.vue @@ -0,0 +1,238 @@ + + + + + + diff --git a/src/views/device/register/components/VueFlow/index.vue b/src/views/device/register/components/VueFlow/index.vue new file mode 100644 index 0000000..c6c1b91 --- /dev/null +++ b/src/views/device/register/components/VueFlow/index.vue @@ -0,0 +1,205 @@ + + + + + diff --git a/src/views/device/register/components/index.js b/src/views/device/register/components/index.js new file mode 100644 index 0000000..93584d6 --- /dev/null +++ b/src/views/device/register/components/index.js @@ -0,0 +1,59 @@ +import {controlPageList} from "@/enum/index.js"; +import {ElMessage} from "element-plus"; +import router from "@/router"; + +export const intoControlPage = (path, params) => { + if (!controlPageList.includes(path)) { + ElMessage.warning('该页面不在控制台页面中,无法打开'); + return + } + // const fullPath = `${window.location.origin}${path}/${params}`; + // // 使用 window.open 在新标签页中打开 + // window.open(fullPath, '_blank'); + const fullPath = `${path}/${params}`; // 构造路由路径 + router.push(fullPath); // 使用路由跳转 +} + +// 定义需要转换的属性列表 +const propertiesToConvert = [ + "workModule", + "posStep", + "postureStep", + "jointStep", + "joint1", + "joint2", + "joint3", + "joint4", + "joint5", + "joint6", + "x", + "y", + "z", + "rx", + "ry", + "rz" +]; +export const formatNumber = (data) => { + const res = JSON.parse(JSON.stringify(data)); +// 遍历属性列表并转换值 + propertiesToConvert.forEach(property => { + if (data[property] !== null) { + res[property] = Number(data[property]); + } + }); + return res +} + +//对象中存在数字类型属性时,转换为字符串类型 +export const convertNumbersToStrings = (obj) => { + for (const key in obj) { + if (obj.hasOwnProperty(key)) { + const value = obj[key]; + // 检查值是否不是 null 且是数字类型 + if (value !== null && typeof value === 'number') { + obj[key] = String(value); // 转换为字符串 + } + } + } + return obj; +} diff --git a/src/views/device/robotManger/ContextMenu.vue b/src/views/device/robotManger/ContextMenu.vue new file mode 100644 index 0000000..ab47455 --- /dev/null +++ b/src/views/device/robotManger/ContextMenu.vue @@ -0,0 +1,89 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/robotManger/TechButtonWithLine.vue b/src/views/device/robotManger/TechButtonWithLine.vue new file mode 100644 index 0000000..a2a3526 --- /dev/null +++ b/src/views/device/robotManger/TechButtonWithLine.vue @@ -0,0 +1,547 @@ + + + + + \ No newline at end of file