diff --git a/build.sh b/build.sh index 8849f58c..bf6d3418 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:1.0.0 . -docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:1.0.0 +docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1 . +docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1 diff --git a/public/images/device/cover.png b/public/images/device/cover.png new file mode 100644 index 00000000..2c54ad7a Binary files /dev/null and b/public/images/device/cover.png differ diff --git a/public/images/device/ignore.png b/public/images/device/ignore.png new file mode 100644 index 00000000..9dbe4865 Binary files /dev/null and b/public/images/device/ignore.png differ diff --git a/public/images/device/import1.png b/public/images/device/import1.png new file mode 100644 index 00000000..493dace5 Binary files /dev/null and b/public/images/device/import1.png differ diff --git a/public/images/device/import2.png b/public/images/device/import2.png new file mode 100644 index 00000000..8ff766bb Binary files /dev/null and b/public/images/device/import2.png differ diff --git a/public/images/device/intersection.png b/public/images/device/intersection.png new file mode 100644 index 00000000..472bb0d0 Binary files /dev/null and b/public/images/device/intersection.png differ diff --git a/public/images/device/matadataMap.png b/public/images/device/matadataMap.png new file mode 100644 index 00000000..e410ee4b Binary files /dev/null and b/public/images/device/matadataMap.png differ diff --git a/public/images/device/union.png b/public/images/device/union.png new file mode 100644 index 00000000..b48e8bd5 Binary files /dev/null and b/public/images/device/union.png differ diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 9f4cf6f9..838d9529 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -573,4 +573,17 @@ export const queryLogsType = () => server.get(`/dictionary/device-log-type/items export const getDeviceNumber = (data?:any) => server.post('/device-instance/_count', data) +/** + * 导入映射设备 + * @param productId + * @param data + */ +export const importDeviceByPlugin = (productId: string, data: any[]) => server.post(`/device/instance/plugin/${productId}/import`, data) + +export const metadateMapById = (productId: string, data: ant[]) => server.patch(`/device/metadata/mapping/product/${productId}`, data) + +export const getMetadateMapById = (productId: string) => server.get(`/device/metadata/mapping/product/${productId}`) + +export const getInkingDevices = (data: string[]) => server.post('/plugin/mapping/device/_all', data) + diff --git a/src/utils/request.ts b/src/utils/request.ts index a74fb062..9676b40d 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -63,11 +63,12 @@ export const put = function (url: string, data = {}) { * @param {Object} [data] * @returns {AxiosInstance} */ -export const patch = function (url: string, data = {}) { +export const patch = function (url: string, data = {}, ext: any = {}) { return request>({ method: 'PATCH', url, - data + data, + ...ext }) } /** diff --git a/src/views/device/Instance/Detail/Info/components/InklingModal/index.ts b/src/views/device/Instance/Detail/Info/components/InklingModal/index.ts new file mode 100644 index 00000000..a2701e55 --- /dev/null +++ b/src/views/device/Instance/Detail/Info/components/InklingModal/index.ts @@ -0,0 +1,3 @@ +import Inkling from './index.vue' + +export default Inkling \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue b/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue new file mode 100644 index 00000000..971f35e1 --- /dev/null +++ b/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue @@ -0,0 +1,72 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Info/index.vue b/src/views/device/Instance/Detail/Info/index.vue index b62a13bc..c9879798 100644 --- a/src/views/device/Instance/Detail/Info/index.vue +++ b/src/views/device/Instance/Detail/Info/index.vue @@ -14,12 +14,36 @@ {{ instanceStore.current?.id }} + + + 映射 +
+
+ {{ inklingDeviceId }} +
+ + + +
+
{{ instanceStore.current?.productName }} - - - {{ instanceStore.current?.deviceType?.text }} @@ -83,6 +107,14 @@ @close="visible = false" @save="saveBtn" /> + \ No newline at end of file diff --git a/src/views/device/Instance/Import/file.vue b/src/views/device/Instance/Import/file.vue new file mode 100644 index 00000000..feb42d93 --- /dev/null +++ b/src/views/device/Instance/Import/file.vue @@ -0,0 +1,173 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Import/modal.vue b/src/views/device/Instance/Import/modal.vue index 8f957635..f55c983d 100644 --- a/src/views/device/Instance/Import/modal.vue +++ b/src/views/device/Instance/Import/modal.vue @@ -1,17 +1,39 @@ diff --git a/src/views/device/Instance/Import/plugin.vue b/src/views/device/Instance/Import/plugin.vue new file mode 100644 index 00000000..6b40a00f --- /dev/null +++ b/src/views/device/Instance/Import/plugin.vue @@ -0,0 +1,40 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Import/product.vue b/src/views/device/Instance/Import/product.vue index f83030b5..34640f26 100644 --- a/src/views/device/Instance/Import/product.vue +++ b/src/views/device/Instance/Import/product.vue @@ -3,56 +3,72 @@ :columns="columns" type='simple' @search="handleSearch" - class="scene-search" + class="device-import-product" target="device-import-product" /> - - - + + + + + \ No newline at end of file diff --git a/src/views/device/Product/Detail/MetadataMap/index.ts b/src/views/device/Product/Detail/MetadataMap/index.ts new file mode 100644 index 00000000..19a39952 --- /dev/null +++ b/src/views/device/Product/Detail/MetadataMap/index.ts @@ -0,0 +1,3 @@ +import Index from './index.vue' + +export default Index \ No newline at end of file diff --git a/src/views/device/Product/Detail/MetadataMap/index.vue b/src/views/device/Product/Detail/MetadataMap/index.vue new file mode 100644 index 00000000..d1a60f75 --- /dev/null +++ b/src/views/device/Product/Detail/MetadataMap/index.vue @@ -0,0 +1,225 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/Product/Detail/index.vue b/src/views/device/Product/Detail/index.vue index f311ede6..b57d8898 100644 --- a/src/views/device/Product/Detail/index.vue +++ b/src/views/device/Product/Detail/index.vue @@ -112,6 +112,7 @@ import Info from './BasicInfo/indev.vue'; import Device from './DeviceAccess/index.vue'; import Metadata from '../../../device/components/Metadata/index.vue'; import DataAnalysis from './DataAnalysis/index.vue'; +import MetadataMap from './MetadataMap' // import Metadata from '../../../components/Metadata/index.vue'; import { _deploy, @@ -163,6 +164,7 @@ const tabs = { Metadata, Device, DataAnalysis, + MetadataMap }; watch( @@ -280,6 +282,9 @@ const getProtocol = async () => { ]; } } + if (productStore.current?.accessProvider === 'plugin_gateway') { + list.value.push({ key: 'MetadataMap', tab: '物模型映射'}) + } } }; /** diff --git a/src/views/device/components/InklingDevice/index.ts b/src/views/device/components/InklingDevice/index.ts new file mode 100644 index 00000000..7ecf6a37 --- /dev/null +++ b/src/views/device/components/InklingDevice/index.ts @@ -0,0 +1,2 @@ +import InklingDevice from './index.vue' +export default InklingDevice \ No newline at end of file diff --git a/src/views/device/components/InklingDevice/index.vue b/src/views/device/components/InklingDevice/index.vue new file mode 100644 index 00000000..0ba77908 --- /dev/null +++ b/src/views/device/components/InklingDevice/index.vue @@ -0,0 +1,305 @@ + + + + + \ No newline at end of file diff --git a/src/views/init-home/data/RoleData.ts b/src/views/init-home/data/RoleData.ts index 9729255d..098e5a41 100644 --- a/src/views/init-home/data/RoleData.ts +++ b/src/views/init-home/data/RoleData.ts @@ -469,7 +469,7 @@ export default { id: '1-4-9', parentId: '1-4', path: 'T4zX-A0TC-BFum', - sortIndex: 9999, + sortIndex: 9998, level: 1, name: '远程升级', code: 'device/Firmware', @@ -493,6 +493,34 @@ export default { accessDescription: '此菜单不支持数据权限控制', granted: true, }, + { + id: '1-4-10', + parentId: '1-4', + path: 'T4zX-A0TC-BFum', + sortIndex: 9999, + level: 1, + name: '插件管理', + code: 'link/plugin', + icon: 'BoxPlotOutlined', + url: '/iot/link/plugin', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + accessSupport: { text: '不支持', value: 'unsupported' }, + assetAccesses: [], + options: {}, + createTime: 1659344075524, + accessDescription: '此菜单不支持数据权限控制', + granted: true, + }, ], [ROLEKEYS.complex]: [ { diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index e6daa6a0..61adef4e 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -1436,6 +1436,63 @@ export default [ supportDataAccess: false, indirectMenus: ['8ddbb67de5f65514105d47b448bfd70e'] }, + { + code: 'link/plugin', + name: '插件管理', + owner: 'iot', + //parentId: '1-4', + id: 'a20354876e9519e48f5ed6710ba6efb3', + sortIndex: 10, + url: '/iot/link/plugin', + icon: 'BoxPlotOutlined', + showPage: ['plugin-driver'], + permissions: [], + buttons: [ + { + id: 'view', + name: '查看', + permissions: [ + { + permission: 'plugin-driver', + actions: ['save'], + }, + ], + }, + { + id: 'update', + name: '编辑', + permissions: [ + { + permission: 'plugin-driver', + actions: ['save'], + }, + ], + }, + { + id: 'delete', + name: '删除', + permissions: [ + { + permission: 'plugin-driver', + actions: ['delete'], + }, + ], + }, + { + id: 'add', + name: '新增', + permissions: [ + { + permission: 'plugin-driver', + actions: ['save'], + }, + ], + }, + + ], + accessSupport: { text: "不支持", value: "unsupported" }, + supportDataAccess: false, + }, ], }, { diff --git a/src/views/init-home/index.vue b/src/views/init-home/index.vue index 021029c0..90ce6a3c 100644 --- a/src/views/init-home/index.vue +++ b/src/views/init-home/index.vue @@ -135,11 +135,11 @@ const submitData = async () => { const judgeInitSet = async () => { const resp: any = await getInit(); if (resp.status === 200 && resp.result.length) { - window.location.href = '/'; + // window.location.href = '/'; } }; onBeforeMount(() => { - // judgeInitSet(); + judgeInitSet(); });