From 1cbd436f7377f3bb2c3598b50fc8f21ca4af012b Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Wed, 8 Jan 2025 11:13:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E5=A2=9E=E7=89=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=A8=A1=E5=9D=97=E5=8F=8A=E4=BC=98=E5=8C=96=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=A0=91):=20=E6=96=B0=E5=A2=9E=E7=89=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=A8=A1=E5=9D=97=E5=8F=8A=E4=BC=98=E5=8C=96=E5=85=B6?= =?UTF-8?q?=E5=AE=83=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/vite.config.dev.ts | 2 +- src/api/dept.ts | 11 + src/api/message-mgmt.ts | 2 - src/api/tsl.ts | 75 ++ src/assets/objectNetwork.png | Bin 0 -> 10118 bytes src/mock/deptTree.ts | 34 + src/router/routes/modules/iot.ts | 23 + .../workplace/components/announcement.vue | 94 +++ .../workplace/components/quick-operation.vue | 35 + .../workplace/components/recently-visited.vue | 44 ++ .../iot/device/components/device-detail.vue | 146 ++-- .../iot/device/components/device-edit.vue | 95 ++- src/views/iot/device/index.vue | 23 +- .../iot/product/components/product-detail.vue | 101 +-- .../iot/product/components/product-edit.vue | 445 ++++++++++++ .../iot/product/components/product-tsl.vue | 648 ++++++++++++++++++ src/views/iot/product/index.vue | 19 + .../message/components/message-edit.vue | 84 ++- 18 files changed, 1699 insertions(+), 182 deletions(-) create mode 100644 src/api/tsl.ts create mode 100644 src/assets/objectNetwork.png create mode 100644 src/mock/deptTree.ts create mode 100644 src/views/dashboard/workplace/components/announcement.vue create mode 100644 src/views/dashboard/workplace/components/quick-operation.vue create mode 100644 src/views/dashboard/workplace/components/recently-visited.vue create mode 100644 src/views/iot/product/components/product-edit.vue create mode 100644 src/views/iot/product/components/product-tsl.vue diff --git a/config/vite.config.dev.ts b/config/vite.config.dev.ts index e2d05a1..7ed0243 100644 --- a/config/vite.config.dev.ts +++ b/config/vite.config.dev.ts @@ -14,7 +14,7 @@ export default mergeConfig( proxy: { '/api': { // target: 'http://8.134.75.234:8081', - target: 'http://127.0.0.1:8081', + target: 'http://192.168.3.238:8081', changeOrigin: true, }, }, diff --git a/src/api/dept.ts b/src/api/dept.ts index 877c0ae..d6939eb 100644 --- a/src/api/dept.ts +++ b/src/api/dept.ts @@ -11,6 +11,17 @@ export interface DeptRecord extends DeptCreateRecord { id: string; } +// 获取部门树 +export function getAllDeptTree(id: number | string) { + return axios({ + method: 'get', + url: '/api/rest/dept/tree', + params: { + id, + } + }); +} + // 添加区域 export function create(data: DeptCreateRecord) { return axios.post(`/api/rest/dept`, data); diff --git a/src/api/message-mgmt.ts b/src/api/message-mgmt.ts index b9e65f0..34e575d 100644 --- a/src/api/message-mgmt.ts +++ b/src/api/message-mgmt.ts @@ -24,8 +24,6 @@ export interface MessageCreateRecord { attachmentIds?: string[]; } - - // 查看详情 export function queryMessage(userId: number, messageId: number) { return axios.get(`/api/rest/message/${userId}/${messageId}`); diff --git a/src/api/tsl.ts b/src/api/tsl.ts new file mode 100644 index 0000000..f15f26f --- /dev/null +++ b/src/api/tsl.ts @@ -0,0 +1,75 @@ +import axios from 'axios'; + +export interface Record { + current: number; + size: number; +} + +export interface ServeRecord extends Record { + name?: string; + identifier?: string; + productId: number; +} + +export interface PropertyRecord extends Record { + name?: string; + identifier?: string; + productId: number; + dataType?: string; + ioType?: string; +} + +export interface eventRecord extends Record { + name?: string; + level?: string; + identifier?: string; + productId?: number; +} + +export function queryServeList(data: ServeRecord) { + return axios({ + url: '/api/rest/tsl/serve', + method: 'get', + params: data, + }); +} + +export function queryPropertyList(data: PropertyRecord) { + return axios({ + url: '/api/rest/tsl/property', + method: 'get', + params: data, + }); +} + +export function queryEventList(data: eventRecord) { + return axios({ + url: '/api/rest/tsl/event', + method: 'get', + params: data, + }); +} + +export function createServe(data: any) { + return axios.post(`/api/rest/tsl/serve`, data); +} + +export function createProperty(data: any) { + return axios.post(`/api/rest/tsl/property`, data); +} + +export function createEvent(data: any) { + return axios.post(`/api/rest/tsl/event`, data); +} + +export function deleteServe(data: any) { + return axios.delete(`/api/rest/tsl/serve/${data}`, ); +} + +export function deleteProperty(data: any) { + return axios.delete(`/api/rest/tsl/property/${data}`); +} + +export function deleteEvent(data: any) { + return axios.delete(`/api/rest/tsl/event/${data}`); +} \ No newline at end of file diff --git a/src/assets/objectNetwork.png b/src/assets/objectNetwork.png new file mode 100644 index 0000000000000000000000000000000000000000..bef6f50d1fd256d5c830c07c481ef19d167cbd4e GIT binary patch literal 10118 zcmcI~^;cU>xOEaNg#tl}Q-T$DEgIadNO9NV?hrhXektTcW<%cQna`h=$H3? zYu*3g{%~f_nKia%o;maE{p@IURXJ=-GE4vffUO`e{SKKA|M!5=k!iJVO#w0ky1$c? z1k_AY8~^}NfP%DymXGm?5tfhEkMGY5%JS+x#F!~}L55UX@&Flp$Jjtys+*#8eS7C0 zH!RvLXxzTgCb9sS=_H+2b)rt?Ph;nfWdnPI?+ZE(9WUfV`kSt`Uy(|y7f9l#=y~51 zyvlu;BrQP`-!e=i53g@9tes0$c6 zE+f4BPmu`n^8tPV=fN$<>(5@-`a*LK2gxV%HdK`HAZrL-<}z#3y;cV>r9|rd@Yn;Q zL2QCFKgIN;U_xbPrz>(MksWM}JO9blpTK}3-XcOE{Zi$nnZMo_(=A`aK?tKn-{h{; zV89>+fPrDa8Dly|tihbw@lx_riroaVlb??}DmALl+~!$Wy-Rk4?W`g1WW0SX;3-0R z7=*CM%Ov8i+D#_#Fy3}b(0O=p=*~J|kegGLw>$_R*kFn;x*73S(b^9=)4L^MolBpV zNx&Y6Bw4Eiqnko&#t}vNV1ot7%CkctzMh)r)v@t;X`o68*kAke)D-yg{FE_F5!--^ zil=;GK5o}A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kOd!_v(I3>-R@0 zZdQOPokufA3qZ|#aX;qJoS+!6r5%gKFQ0;Se~Ha(jA8+NGuM|eU$g5Bw+yc#jAGxe zb<0mK0UIS8YQQ20VeL*;(hyCqliBrbta!B&+58G6BPr-V!bjErb$NYQe?P+u3g z-S{sv?k*Da{a_4bV6GEW7!YOn6>V%7|D|DQKJJGIh`t#uP7kHb-W*8Wb<~9#7#%2Xww9MIR$;cEr7hyVX8=^YnK3G7eEIo}bu86ur)rbQ zjT+a`obiSTUYYuj!`zC({_aEpbvjhxDx8v!+4%;kOc_~=nxqFW&-Y7|a9Kxc6hOC$ zZp;3-)kvq0|Hor4`Ak)R%YO{pku*+pYBK`Sa^)}YWsuPibs}Xd$A8Cj@hk5EkUbjs zIrLW^hXiZK7l%!GZ2(hV { + Mock.mock(new RegExp('/api/deptTree'), () => { + return successResponseWrap(deptTree); + }) + } +}) +// 假设你需要将这个数据作为一个 API 的响应 diff --git a/src/router/routes/modules/iot.ts b/src/router/routes/modules/iot.ts index bc65654..2cd262f 100644 --- a/src/router/routes/modules/iot.ts +++ b/src/router/routes/modules/iot.ts @@ -46,6 +46,29 @@ const IOT: AppRouteRecordRaw = { permissions: ['*'], }, }, + { + path: 'device/:id', + name: 'deviceDetail', + component: () => import('@/views/iot/device/components/device-detail.vue'), + meta: { + title: '设备详情', + requiresAuth: true, + showInMenu: false, + permissions: ['*'], + }, + }, + { + path: 'product/tsl/:id', + name: 'productTsl', + component: () => import('@/views/iot/product/components/product-tsl.vue'), + meta: { + title: '物模型', + requiresAuth: true, + showInMenu: false, + permissions: ['*'], + }, + } + ], }; diff --git a/src/views/dashboard/workplace/components/announcement.vue b/src/views/dashboard/workplace/components/announcement.vue new file mode 100644 index 0000000..d8ab12a --- /dev/null +++ b/src/views/dashboard/workplace/components/announcement.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/views/dashboard/workplace/components/quick-operation.vue b/src/views/dashboard/workplace/components/quick-operation.vue new file mode 100644 index 0000000..fad1a21 --- /dev/null +++ b/src/views/dashboard/workplace/components/quick-operation.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/views/dashboard/workplace/components/recently-visited.vue b/src/views/dashboard/workplace/components/recently-visited.vue new file mode 100644 index 0000000..805c4f7 --- /dev/null +++ b/src/views/dashboard/workplace/components/recently-visited.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/views/iot/device/components/device-detail.vue b/src/views/iot/device/components/device-detail.vue index 4d47e58..2dc6de9 100644 --- a/src/views/iot/device/components/device-detail.vue +++ b/src/views/iot/device/components/device-detail.vue @@ -1,70 +1,102 @@ diff --git a/src/views/iot/device/components/device-edit.vue b/src/views/iot/device/components/device-edit.vue index 540db64..7254c53 100644 --- a/src/views/iot/device/components/device-edit.vue +++ b/src/views/iot/device/components/device-edit.vue @@ -82,13 +82,25 @@ - + + + + +
+
+ + + + + + + +
+ + + +
@@ -108,6 +120,7 @@ import { useMessageStore } from '@/store'; import '@wangeditor/editor/dist/css/style.css' import { createDevice, updateDevice } from '@/api/device'; + import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface'; const props = defineProps({ prem: { @@ -115,6 +128,58 @@ }, isCreate: Boolean, }); + const paramsData = ref([ + { + name: '', + identifier: '', + dataType: '', + type: '', + }, + ]); + const dataTypeOptions = computed(() => [ + { + label: '整型', + value: 'INT', + }, + { + label: '单精度浮点型', + value: 'FLOAT', + }, + { + label: '双精度浮点型', + value: 'DOUBLE', + }, + { + label: '布尔型', + value: 'BOOLEAN', + }, + { + label: '字符串', + value: 'STRING', + }, + { + label: '日期型', + value: 'DATE', + }, + { + label: '透传', + value: 'RAW', + }, + ]); + const typeOptions = computed(() => [ + { + label: '物模型输入', + value: 'INPUT', + }, + { + label: '物模型输出', + value: 'OUTPUT', + }, + { + label: '读写属性', + value: 'RW', + }, + ]); const emit = defineEmits(['refresh']); const modalTitle = computed(() => { return props.isCreate ? '创建设备' : '编辑设备'; @@ -142,7 +207,22 @@ options.value = [] } }; - + // 点击添加参数 + const handleAddParams = () => { + // paramsVisible.value = true; + paramsData.value.push({ + name: '', + identifier: '', + dataType: '', + type: '', + }); + }; + // 删除参数 + const handleDeleteParams = (record: any) => { + if (record !== -1) { + paramsData.value.splice(record, 1); + } + }; // 组件被点击 const handleClick = () => { setVisible(true); @@ -153,6 +233,7 @@ const valid = await CreateRef.value?.validate(); if (!valid) { // 新增 + formData.value.extendParams = paramsData.value; if (props.isCreate) { // formData.value.username = formData.value.email; const res = await createDevice(formData.value); diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue index 29470e9..462d1ed 100644 --- a/src/views/iot/device/index.vue +++ b/src/views/iot/device/index.vue @@ -162,17 +162,16 @@ {{ record.online == true? '是' : '否' }} @@ -27,7 +34,7 @@ const route = useRoute(); const id = Number(route.params.id); - const columns=[ + const columns = [ { title: '参数名称', dataIndex: 'name', @@ -49,72 +56,34 @@ slotName: 'type', }, ]; - const renderData = ref( - { - name: '产品名称', - productType: '设备', - model: '123456', - link: 'TCP', - remark: '123456', - createTime: '2023-08-08 10:10:10', - params:[ - { - name:'设备名称', - identifier:'1.0.0', - dataType:'1.0.0', - type:'123456', - }, - { - name:'设备名称', - identifier:'1.0.0', - dataType:'1.0.0', - type:'123456', - }, - { - name:'设备名称', - identifier:'1.0.0', - dataType:'1.0.0', - type:'123456', - }, - ] - }, - ); - // const fetchData = async (Id: number) => { - // const res = await queryProductDetail(Id); - // renderData.value = res.data; - // }; - // onMounted(() => { - // fetchData(id); - // }); + const activeKey = ref('1'); + const renderData = ref([]); + const fetchData = async (Id: number) => { + const res = await queryProductDetail(Id); + renderData.value = res.data; + }; + const handleMenuClick = (e: any) => { + activeKey.value = e; + }; + onMounted(() => { + fetchData(id); + }); - - - diff --git a/src/views/iot/product/components/product-edit.vue b/src/views/iot/product/components/product-edit.vue new file mode 100644 index 0000000..fd2404a --- /dev/null +++ b/src/views/iot/product/components/product-edit.vue @@ -0,0 +1,445 @@ + + + + + diff --git a/src/views/iot/product/components/product-tsl.vue b/src/views/iot/product/components/product-tsl.vue new file mode 100644 index 0000000..7ea5aba --- /dev/null +++ b/src/views/iot/product/components/product-tsl.vue @@ -0,0 +1,648 @@ + + + + + diff --git a/src/views/iot/product/index.vue b/src/views/iot/product/index.vue index 431fbcb..b0b0774 100644 --- a/src/views/iot/product/index.vue +++ b/src/views/iot/product/index.vue @@ -172,6 +172,16 @@ 详情 + + + 物模型 + { const res = await deleteProduct(id); diff --git a/src/views/system/message/components/message-edit.vue b/src/views/system/message/components/message-edit.vue index bfcb000..b33ef4a 100644 --- a/src/views/system/message/components/message-edit.vue +++ b/src/views/system/message/components/message-edit.vue @@ -134,11 +134,12 @@ + > + 全选 @@ -146,11 +147,11 @@ :data="selectedDepartmentMembers" :columns="columns" style="height: 520px"> -