From 2fee7a95ccb88300477e8e62434d1d1bd25e8aa9 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 14 Mar 2023 13:43:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BE=B9=E7=BC=98=E7=BD=91=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/instance.ts | 7 + src/api/edge/device.ts | 9 + src/api/edge/resource.ts | 14 + src/views/device/Instance/Import/index.vue | 77 +++- src/views/device/Instance/index.vue | 1 - src/views/edge/Device/Save/index.vue | 260 ++++++++++++ src/views/edge/Device/index.vue | 438 ++++++++++++++++++++ src/views/edge/Resource/Issue/Result.vue | 132 ++++++ src/views/edge/Resource/Issue/index.vue | 181 ++++++++ src/views/edge/Resource/Save/index.vue | 45 ++ src/views/edge/Resource/index.vue | 383 +++++++++++++++++ src/views/media/Device/Save/SaveProduct.vue | 8 +- yarn.lock | 4 +- 13 files changed, 1532 insertions(+), 27 deletions(-) create mode 100644 src/api/edge/device.ts create mode 100644 src/api/edge/resource.ts create mode 100644 src/views/edge/Device/Save/index.vue create mode 100644 src/views/edge/Device/index.vue create mode 100644 src/views/edge/Resource/Issue/Result.vue create mode 100644 src/views/edge/Resource/Issue/index.vue create mode 100644 src/views/edge/Resource/Save/index.vue create mode 100644 src/views/edge/Resource/index.vue diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 25208fec..608bf9d5 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -33,6 +33,13 @@ export const detail = (id: string) => server.get(`/device-instan */ export const query = (data?: Record) => server.post('/device-instance/_query', data) +/** + * 不分页查询设备 + * @param data + * @returns + */ +export const queryNoPagingPost = (data?: Record) => server.post('/device-instance/_query/no-paging?paging=false', data) + /** * 删除设备 * @param id 设备ID diff --git a/src/api/edge/device.ts b/src/api/edge/device.ts new file mode 100644 index 00000000..ff2e4247 --- /dev/null +++ b/src/api/edge/device.ts @@ -0,0 +1,9 @@ +import server from '@/utils/request' + +export const restPassword = (id: string) => server.post(`/edge/operations/${id}/auth-user-password-reset/invoke`) + +export const _control = (deviceId: string) => server.get(`/edge/remote/${deviceId}/url`) + +export const _stopControl = (deviceId: string) => server.get(`/edge/remote/${deviceId}/stop`, {}) + + diff --git a/src/api/edge/resource.ts b/src/api/edge/resource.ts new file mode 100644 index 00000000..0c9a0a73 --- /dev/null +++ b/src/api/edge/resource.ts @@ -0,0 +1,14 @@ +import server from '@/utils/request' + +export const query = (data: Record) => server.post(`/entity/template/_query`, data) + +export const modify = (id: string, data: Record) => server.put(`/entity/template/${id}`, data) + +export const _delete = (id: string) => server.remove(`/entity/template/${id}`) + +export const _start = (data: Record) => server.post(`/entity/template/start/_batch`, data) + +export const _stop = (data: Record) => server.post(`/entity/template/stop/_batch`, data) + +export const queryDeviceList = (data: Record) => server.post(`/device-instance/detail/_query`, data) + diff --git a/src/views/device/Instance/Import/index.vue b/src/views/device/Instance/Import/index.vue index c939386e..ab649f09 100644 --- a/src/views/device/Instance/Import/index.vue +++ b/src/views/device/Instance/Import/index.vue @@ -1,12 +1,29 @@ \ No newline at end of file diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index 007c1813..54f908da 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -289,7 +289,6 @@ import { queryTree } from '@/api/device/category'; import { useMenuStore } from '@/store/menu'; import type { ActionsType } from './typings'; import dayjs from 'dayjs'; -import { throttle } from 'lodash-es'; const instanceRef = ref>({}); const params = ref>({}); diff --git a/src/views/edge/Device/Save/index.vue b/src/views/edge/Device/Save/index.vue new file mode 100644 index 00000000..0ce6c922 --- /dev/null +++ b/src/views/edge/Device/Save/index.vue @@ -0,0 +1,260 @@ + + + \ No newline at end of file diff --git a/src/views/edge/Device/index.vue b/src/views/edge/Device/index.vue new file mode 100644 index 00000000..86fcfcf0 --- /dev/null +++ b/src/views/edge/Device/index.vue @@ -0,0 +1,438 @@ + + + + + \ No newline at end of file diff --git a/src/views/edge/Resource/Issue/Result.vue b/src/views/edge/Resource/Issue/Result.vue new file mode 100644 index 00000000..52589e13 --- /dev/null +++ b/src/views/edge/Resource/Issue/Result.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/src/views/edge/Resource/Issue/index.vue b/src/views/edge/Resource/Issue/index.vue new file mode 100644 index 00000000..5bab28ac --- /dev/null +++ b/src/views/edge/Resource/Issue/index.vue @@ -0,0 +1,181 @@ + + + + + \ No newline at end of file diff --git a/src/views/edge/Resource/Save/index.vue b/src/views/edge/Resource/Save/index.vue new file mode 100644 index 00000000..9a695f10 --- /dev/null +++ b/src/views/edge/Resource/Save/index.vue @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/src/views/edge/Resource/index.vue b/src/views/edge/Resource/index.vue new file mode 100644 index 00000000..4e5128eb --- /dev/null +++ b/src/views/edge/Resource/index.vue @@ -0,0 +1,383 @@ + + + + + \ No newline at end of file diff --git a/src/views/media/Device/Save/SaveProduct.vue b/src/views/media/Device/Save/SaveProduct.vue index 298c1b49..2b169905 100644 --- a/src/views/media/Device/Save/SaveProduct.vue +++ b/src/views/media/Device/Save/SaveProduct.vue @@ -133,6 +133,7 @@ type Emits = { (e: 'update:visible', data: boolean): void; (e: 'update:productId', data: string): void; (e: 'close'): void; + (e: 'save', ): void; }; const emit = defineEmits(); @@ -140,6 +141,7 @@ const props = defineProps({ visible: { type: Boolean, default: false }, productId: { type: String, default: '' }, channel: { type: String, default: '' }, + deviceType: { type: String, default: 'device' } }); const _vis = computed({ @@ -171,12 +173,12 @@ const handleClick = async (e: any) => { formData.value.accessId = e.id; formData.value.accessName = e.name; formData.value.accessProvider = e.provider; - formData.value.messageProtocol = e.provider; + formData.value.messageProtocol = e.protocolDetail.id; formData.value.protocolName = e.protocolDetail.name; formData.value.transportProtocol = e.transport; const { result } = await DeviceApi.getConfiguration( - props.channel, + e.protocol, e.transport, ); console.log('result: ', result); @@ -206,7 +208,7 @@ const formData = ref({ access_pwd: '', stream_mode: 'UDP', }, - deviceType: 'device', + deviceType: props.deviceType, messageProtocol: '', name: '', protocolName: '', diff --git a/yarn.lock b/yarn.lock index c1d0ad47..3a663ae9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3695,8 +3695,8 @@ jetlinks-store@^0.0.3: jetlinks-ui-components@^1.0.5: version "1.0.5" - resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#30de07a15481f13ea86ebc817baaab3c99034403" - integrity sha512-ULgSPU0xY6xUky3beeHVvpHyAHmT6xHsO5eS5m7a3h7AmCoxA3oTWyF20vC+K1zTJBQ7LFCouySqRRz6GimAPg== + resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#360e87e3cba4d025ec4665943098a88b0d9ff59a" + integrity sha512-lYe7kx65XCvZzf7esQRTm/ljlQi5kMtv00yotnSmvMILR6tohx57fA5Ga895i63DrySSmJlqBUsniMtjQVzqqQ== dependencies: "@vueuse/core" "^9.12.0" ant-design-vue "^3.2.15"