From e3ddbbd3c40af039cb9ee11e61e9746f56a9ec89 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Mon, 16 Jan 2023 15:19:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0AIcon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/device-type-3.png | Bin 1829 -> 0 bytes .../instance/device-card.png} | Bin src/api/device/instance.ts | 32 ++- src/api/northbound/alicloud.ts | 0 src/api/northbound/dueros.ts | 8 + src/components/AIcon/index.ts | 7 - src/components/AIcon/index.tsx | 32 +++ src/components/BadgeStatus/index.vue | 11 +- src/components/CardBox/index.vue | 1 - src/components/Table/index.tsx | 20 +- src/router/menu.ts | 14 + src/views/device/Instance/index.vue | 260 ++++++++++++++++++ src/views/northbound/AliCloud/index.vue | 7 + src/views/northbound/DuerOS/index.vue | 154 +++++++++++ yarn.lock | 27 ++ 15 files changed, 557 insertions(+), 16 deletions(-) delete mode 100644 public/images/device-type-3.png rename public/images/{device-type-3-big.png => device/instance/device-card.png} (100%) create mode 100644 src/api/northbound/alicloud.ts create mode 100644 src/api/northbound/dueros.ts delete mode 100644 src/components/AIcon/index.ts create mode 100644 src/components/AIcon/index.tsx create mode 100644 src/views/device/Instance/index.vue create mode 100644 src/views/northbound/AliCloud/index.vue create mode 100644 src/views/northbound/DuerOS/index.vue diff --git a/public/images/device-type-3.png b/public/images/device-type-3.png deleted file mode 100644 index 3561237e70b88989cb0079de46a2a1befb57fc15..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1829 zcmV+=2io|FP)>lXf00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP%hoiMphbX6EdD_V0Y_ zTl?(22~QEYd7o47<-v>AjpVsxB6Z#h50;O7|X0UIs?=A?#xSXPl+ z?EoDJ!~%rUxfd$L&ncxBs8C9okXNzSm@5(24Gjh+=+^mc`T8D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2uWle+OS4{oP{KFs+1PQhTI zQGZ3;DR$~JFj=4I!--2B=^Fg5*aDIyWyFB9jeuV1r@`Y1x*}#Avr9n>vgL!V6zln52vFZBj`|oS6XI~Z9o@@qmZdkvR2=mp+JHd@rUp1UL6^r@7-KSke+GOPJ@OT0WfoKpgArI+}IDGC6Ih$DN&gLebU|9j$6&u5+v9PBip3KV_Q?nml@wm^(hF$(-XB3djfzPV+@ zR-(Q0kxfI_He@>Kso)F~cd?=6g91Di$W9>V0%=8ZX!OTck03s`7#*MT@Rad?2##oO TVX3|?00000NkvXXu0mjfVDV!8 diff --git a/public/images/device-type-3-big.png b/public/images/device/instance/device-card.png similarity index 100% rename from public/images/device-type-3-big.png rename to public/images/device/instance/device-card.png diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 8c3c964f..8886dcbe 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -21,4 +21,34 @@ export const saveMetadata = (id: string, data: string) => server.put(`/device/in * @param id 设备ID * @returns 设备详情 */ -export const detail = (id: string) => server.get(`/device-instance/${id}/detail`) \ No newline at end of file +export const detail = (id: string) => server.get(`/device-instance/${id}/detail`) + +/** + * 查询数据 + * @param data 分页搜索数据 + * @returns + */ +export const query = (data?: Record) => server.post('/device-instance/_query', data) + +/** + * 删除设备 + * @param id 设备ID + * @returns + */ +export const _delete = (id: string) => server.remove(`/device-instance/${id}`) + +/** + * 启用设备 + * @param id 设备ID + * @param data + * @returns + */ +export const _deploy = (id: string) => server.post(`/device-instance/${id}/deploy`) + +/** + * 禁用设备 + * @param id 设备ID + * @param data + * @returns + */ + export const _undeploy = (id: string) => server.post(`/device-instance/${id}/undeploy`) \ No newline at end of file diff --git a/src/api/northbound/alicloud.ts b/src/api/northbound/alicloud.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/api/northbound/dueros.ts b/src/api/northbound/dueros.ts new file mode 100644 index 00000000..e3cb60cc --- /dev/null +++ b/src/api/northbound/dueros.ts @@ -0,0 +1,8 @@ +import server from '@/utils/request' + +/** + * 查询数据 + * @param data 分页搜索数据 + * @returns + */ +export const query = (data: Record) => server.post('/dueros/product/_query', data) \ No newline at end of file diff --git a/src/components/AIcon/index.ts b/src/components/AIcon/index.ts deleted file mode 100644 index 39b2aee7..00000000 --- a/src/components/AIcon/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createFromIconfontCN } from '@ant-design/icons-vue'; - -const AliIcon = createFromIconfontCN({ - scriptUrl: '/icons/iconfont.js', // 在 iconfont.cn 上生成 -}); - -export default AliIcon \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx new file mode 100644 index 00000000..eb1703a1 --- /dev/null +++ b/src/components/AIcon/index.tsx @@ -0,0 +1,32 @@ +import { createFromIconfontCN } from '@ant-design/icons-vue'; +import * as $Icon from '@ant-design/icons-vue'; +import { createVNode } from 'vue'; + +const AliIcon = createFromIconfontCN({ + scriptUrl: '/icons/iconfont.js', // 在 iconfont.cn 上生成 +}); + +const AntdIcon = (props: {type: string}) => { + const {type} = props; + let antIcon: {[key: string]: any} = $Icon + return createVNode(antIcon[type]) +} + +const iconKeys = [ + 'EyeOutlined', + 'EditOutlined', + 'PlusOutlined', + 'DeleteOutlined', + 'CheckCircleOutlined', + 'StopOutlined', + 'CheckOutlined', + 'CloseOutlined', + 'DownOutlined' +] + +const Icon = (props: {type: string}) => { + if(iconKeys.includes(props.type)) return + return +} + +export default Icon \ No newline at end of file diff --git a/src/components/BadgeStatus/index.vue b/src/components/BadgeStatus/index.vue index 47870618..067ee58b 100644 --- a/src/components/BadgeStatus/index.vue +++ b/src/components/BadgeStatus/index.vue @@ -6,8 +6,7 @@ \ No newline at end of file diff --git a/src/views/northbound/AliCloud/index.vue b/src/views/northbound/AliCloud/index.vue new file mode 100644 index 00000000..cd36fd59 --- /dev/null +++ b/src/views/northbound/AliCloud/index.vue @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/views/northbound/DuerOS/index.vue b/src/views/northbound/DuerOS/index.vue new file mode 100644 index 00000000..f8ab376f --- /dev/null +++ b/src/views/northbound/DuerOS/index.vue @@ -0,0 +1,154 @@ + + + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 53f50f7d..439b5bdc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -796,6 +796,11 @@ dependencies: "@types/webxr" "*" +"@types/web-bluetooth@^0.0.16": + version "0.0.16" + resolved "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz#1d12873a8e49567371f2a75fe3e7f7edca6662d8" + integrity sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ== + "@types/webxr@*": version "0.5.0" resolved "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.0.tgz" @@ -1003,6 +1008,28 @@ three "0.143.0" uppercamelcase "^1.1.0" +"@vueuse/core@^9.10.0": + version "9.10.0" + resolved "https://registry.npmmirror.com/@vueuse/core/-/core-9.10.0.tgz#2ef6e55ca773c5b2db1e3f13b8292af96dd32214" + integrity sha512-CxMewME07qeuzuT/AOIQGv0EhhDoojniqU6pC3F8m5VC76L47UT18DcX88kWlP3I7d3qMJ4u/PD8iSRsy3bmNA== + dependencies: + "@types/web-bluetooth" "^0.0.16" + "@vueuse/metadata" "9.10.0" + "@vueuse/shared" "9.10.0" + vue-demi "*" + +"@vueuse/metadata@9.10.0": + version "9.10.0" + resolved "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.10.0.tgz#1a5eb94ca755bd8e666505f47da7d88969cffdc7" + integrity sha512-G5VZhgTCapzU9rv0Iq2HBrVOSGzOKb+OE668NxhXNcTjUjwYxULkEhAw70FtRLMZc+hxcFAzDZlKYA0xcwNMuw== + +"@vueuse/shared@9.10.0": + version "9.10.0" + resolved "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.10.0.tgz#49874a0f9955d28689b3133de660367c63dbc030" + integrity sha512-vakHJ2ZRklAzqmcVBL38RS7BxdBA4+5poG9NsSyqJxrt9kz0zX3P5CXMy0Hm6LFbZXUgvKdqAS3pUH1zX/5qTQ== + dependencies: + vue-demi "*" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.npmmirror.com/JSONStream/-/JSONStream-1.3.5.tgz"