From 3e82cc7d5e32d2d0925834615b90d52d819ff021 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Thu, 23 Feb 2023 11:05:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=A9=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/instance.ts | 58 +- src/components/Empty/assets/nodata.svg | 36 + src/components/Empty/index.vue | 44 + src/components/Table/index.tsx | 9 +- src/components/index.ts | 2 + .../Instance/Detail/EdgeMap/MSelect.vue | 117 + .../Instance/Detail/EdgeMap/PatchMapping.vue | 189 + .../device/Instance/Detail/EdgeMap/index.vue | 92 +- .../Detail/components/EditTable/index.vue | 6 +- yarn.lock | 10268 +++++++++------- 10 files changed, 6341 insertions(+), 4480 deletions(-) create mode 100644 src/components/Empty/assets/nodata.svg create mode 100644 src/components/Empty/index.vue create mode 100644 src/views/device/Instance/Detail/EdgeMap/MSelect.vue create mode 100644 src/views/device/Instance/Detail/EdgeMap/PatchMapping.vue diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 35907a23..ca3354de 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -402,4 +402,60 @@ export const treeMapping = (data?: any) => server.post(`/data-collect/channel/_a * @param data * @returns */ -export const saveMapping = (thingId: any, provider: string, data?: any) => server.patch(`/things/collector/device/${thingId}/${provider}`, data) \ No newline at end of file +export const saveMapping = (thingId: any, provider: string, data?: any) => server.patch(`/things/collector/device/${thingId}/${provider}`, data) + +/** + * 查询边缘网关通道 + * @param deviceId + * @param data + * @returns + */ +export const edgeChannel = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/data-collector-channel-list/invoke`, data) + +/** + * 查询边缘网关采集器 + * @param deviceId + * @param data + * @returns + */ +export const edgeCollector = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/data-collector-list/invoke`, data) + +/** + * 查询边缘网关点位 + * @param deviceId + * @param data + * @returns + */ +export const edgePoint = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/data-collector-point-list/invoke`, data) + +/** + * + * @param deviceId + * @param data + * @returns + */ +export const getEdgeMap = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/device-collector-list/invoke`, data) + +/** + * + * @param deviceId + * @param data + * @returns + */ +export const removeEdgeMap = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/device-collector-delete/invoke`, data) + +/** + * + * @param deviceId + * @param data + * @returns + */ +export const treeEdgeMap = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/data-collector-channel-tree/invoke`, data) + +/** + * + * @param deviceId + * @param data + * @returns + */ +export const saveEdgeMap = (deviceId: string, data?: any) => server.post(`/edge/operations/${deviceId}/device-collector-save/invoke`, data) \ No newline at end of file diff --git a/src/components/Empty/assets/nodata.svg b/src/components/Empty/assets/nodata.svg new file mode 100644 index 00000000..4fb16097 --- /dev/null +++ b/src/components/Empty/assets/nodata.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/Empty/index.vue b/src/components/Empty/index.vue new file mode 100644 index 00000000..19178587 --- /dev/null +++ b/src/components/Empty/index.vue @@ -0,0 +1,44 @@ + + + + + + + + + + + diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 3d3054c8..bdf9d073 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -1,11 +1,12 @@ import { UnorderedListOutlined, AppstoreOutlined } from '@ant-design/icons-vue' import styles from './index.module.less' -import { Pagination, Table, Empty, Spin, Alert } from 'ant-design-vue' +import { Pagination, Table, Spin, Alert } from 'ant-design-vue' import type { TableProps } from 'ant-design-vue/es/table' import type { TooltipProps } from 'ant-design-vue/es/tooltip' import type { PopconfirmProps } from 'ant-design-vue/es/popconfirm' import { CSSProperties, PropType } from 'vue'; import type { JColumnsProps } from './types' +import JEmpty from '@/components/Empty/index.vue' enum ModelEnum { TABLE = 'TABLE', @@ -146,7 +147,6 @@ const JTable = defineComponent({ } } as any, setup(props: JTableProps, { slots, emit, expose }) { - const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE const _model = ref(props.model ? props.model : ModelEnum.CARD); // 模式切换 const column = ref(props.gridColumn || 4); const _dataSource = ref[]>([]) @@ -323,7 +323,7 @@ const JTable = defineComponent({ ) } : - + } : @@ -343,7 +343,8 @@ const JTable = defineComponent({ } else { return record?.[column?.dataIndex] || '' } - } + }, + emptyText: () => }} /> diff --git a/src/components/index.ts b/src/components/index.ts index 2c47f28a..28d5bdb1 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -11,6 +11,7 @@ import FileFormat from './FileFormat/index.vue' import JUpload from './JUpload/index.vue' import { BasicLayoutPage, BlankLayoutPage, PageContainer } from './Layout' import Ellipsis from './Ellipsis/index.vue' +import JEmpty from './Empty/index.vue' export default { install(app: App) { @@ -28,5 +29,6 @@ export default { .component('BlankLayoutPage', BlankLayoutPage) .component('PageContainer', PageContainer) .component('Ellipsis', Ellipsis) + .component('JEmpty', JEmpty) } } diff --git a/src/views/device/Instance/Detail/EdgeMap/MSelect.vue b/src/views/device/Instance/Detail/EdgeMap/MSelect.vue new file mode 100644 index 00000000..1b66df49 --- /dev/null +++ b/src/views/device/Instance/Detail/EdgeMap/MSelect.vue @@ -0,0 +1,117 @@ + + + {{ item.name }} + + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/EdgeMap/PatchMapping.vue b/src/views/device/Instance/Detail/EdgeMap/PatchMapping.vue new file mode 100644 index 00000000..7a112a28 --- /dev/null +++ b/src/views/device/Instance/Detail/EdgeMap/PatchMapping.vue @@ -0,0 +1,189 @@ + + + + + 采集器的点位名称与属性名称一致时将自动映射绑定;有多个采集器点位名称与属性名称一致时以第1个采集器的点位数据进行绑定 + + + + + + + + 加入右侧 + + + + + + {{ item.title }} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/EdgeMap/index.vue b/src/views/device/Instance/Detail/EdgeMap/index.vue index bc1bd5fa..cb193cb8 100644 --- a/src/views/device/Instance/Detail/EdgeMap/index.vue +++ b/src/views/device/Instance/Detail/EdgeMap/index.vue @@ -1,5 +1,5 @@ - + @@ -53,6 +53,7 @@ v-model="record[column.dataIndex]" :id="record.channelId" type="COLLECTOR" + :edgeId="instanceStore.current.parentId" /> @@ -70,6 +71,7 @@ v-model="record[column.dataIndex]" :id="record.collectorId" type="POINT" + :edgeId="instanceStore.current.parentId" /> @@ -85,6 +87,7 @@ - + :edgeId="instanceStore.current.parentId" + /> + + +