diff --git a/src/router/routes/modules/iot.ts b/src/router/routes/modules/iot.ts index ea3fe8f..acdebc2 100644 --- a/src/router/routes/modules/iot.ts +++ b/src/router/routes/modules/iot.ts @@ -36,6 +36,17 @@ const IOT: AppRouteRecordRaw = { permissions: ['iot:device'], }, }, + { + path: 'deviceCard', + name: 'DeviceCard', + component: () => import('@/views/iot/deviceCard/index.vue'), + meta: { + locale: '设备管理(卡片)', + title: '设备管理(卡片)', + requiresAuth: true, + permissions: ['iot:device'], + }, + }, { path: 'product/:id', name: 'productDetail', diff --git a/src/router/routes/modules/notification.ts b/src/router/routes/modules/notification.ts index 9accd2a..042ada1 100644 --- a/src/router/routes/modules/notification.ts +++ b/src/router/routes/modules/notification.ts @@ -43,7 +43,7 @@ const NOTIFICATION: AppRouteRecordRaw = { title: '公告详情', requiresAuth: true, showInMenu: false, - permissions: ['message:bulletin:query'], + permissions: ['message:bulletin'], }, }, ], diff --git a/src/router/routes/modules/user.ts b/src/router/routes/modules/user.ts index 192959f..9dd9894 100644 --- a/src/router/routes/modules/user.ts +++ b/src/router/routes/modules/user.ts @@ -44,17 +44,6 @@ const USER: AppRouteRecordRaw = { permissions: ['*'], }, }, - { - path: 'bulletinCard', - name: 'BulletinCard', - component: () => import('@/views/user/bulletin-card/index.vue'), - meta: { - locale: '公告通知(卡片)', - title: '公告通知(卡片)', - requiresAuth: true, - permissions: ['*'], - }, - }, { path: 'messages', name: 'Messages', diff --git a/src/views/user/bulletin-card/components/card-wrap.vue b/src/views/iot/deviceCard/components/card-wrap.vue similarity index 72% rename from src/views/user/bulletin-card/components/card-wrap.vue rename to src/views/iot/deviceCard/components/card-wrap.vue index 73eb930..ace3f90 100644 --- a/src/views/user/bulletin-card/components/card-wrap.vue +++ b/src/views/iot/deviceCard/components/card-wrap.vue @@ -20,11 +20,11 @@ {{ createBy }} - {{ dayjs(publishTime).format('YYYY-MM-DD HH:mm:ss') }} - - - {{ remark }} + {{ dayjs(createTime).format('YYYY-MM-DD HH:mm:ss') }} + + + @@ -32,9 +32,17 @@ - + 详情 + + + 删除 + @@ -46,6 +54,9 @@ import router from '@/router'; import dayjs from 'dayjs'; + import { deleteDevice } from '@/api/device'; + import { Message } from '@arco-design/web-vue'; + import DeviceEdit from '@/views/iot/deviceCard/components/device-edit.vue'; const props = defineProps({ loading: { @@ -72,14 +83,28 @@ type: String, default: '', }, - publishTime: { + createTime: { type: String, default: '', }, }); - // 详情 - const handleDetail = async (id: number) => { - await router.push({ name: 'Details', params: { id } }); + // 打开详情 + function openDetail(id:number): void{ + const url = router.resolve({ + name: 'deviceDetail', + params: {id} + }).href; + router.push(url); + } + // 删除 + const handleDelete = async (id: number) => { + const res = await deleteDevice(id); + if (res.status === 200) { + Message.success({ + content: '删除成功', + duration: 5 * 1000, + }); + } }; diff --git a/src/views/iot/deviceCard/components/device-detail.vue b/src/views/iot/deviceCard/components/device-detail.vue new file mode 100644 index 0000000..e7ac284 --- /dev/null +++ b/src/views/iot/deviceCard/components/device-detail.vue @@ -0,0 +1,102 @@ + + + + + + 设备详情 + {{renderData.name }} + {{renderData.hardwareVersion }} + {{renderData.firmwareVersion }} + {{renderData.productId }} + + {{dayjs(renderData.createTime).format('YYYY-MM-DD HH:mm:ss') }} + + + + + + + + + 基本信息 + + 执行服务内容 + + + + + + + + diff --git a/src/views/iot/deviceCard/components/device-edit.vue b/src/views/iot/deviceCard/components/device-edit.vue new file mode 100644 index 0000000..7099355 --- /dev/null +++ b/src/views/iot/deviceCard/components/device-edit.vue @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + 修改 + + + + {{ modalTitle }} + + + + + {{ + item.name + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + + + + + diff --git a/src/views/user/bulletin-card/index.vue b/src/views/iot/deviceCard/index.vue similarity index 53% rename from src/views/user/bulletin-card/index.vue rename to src/views/iot/deviceCard/index.vue index e933dbc..21feec8 100644 --- a/src/views/user/bulletin-card/index.vue +++ b/src/views/iot/deviceCard/index.vue @@ -1,6 +1,6 @@ - + @@ -12,39 +12,48 @@ > - + - - + - - - - - - - - - - + + + + + + + + - - - + + + @@ -77,10 +86,9 @@ @@ -94,29 +102,30 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/notification/noticeSet/components/notice-edit.vue b/src/views/notification/noticeSet/components/notice-edit.vue deleted file mode 100644 index 15297c6..0000000 --- a/src/views/notification/noticeSet/components/notice-edit.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - - 新建 - - - - 修改 - - - - {{ modalTitle }} - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/notification/noticeSet/index.vue b/src/views/notification/noticeSet/index.vue deleted file mode 100644 index 2125bab..0000000 --- a/src/views/notification/noticeSet/index.vue +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 查询 - - - - - - 重置 - - - - - - - - - - - - - - - - 导出 - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - - - - - - - - - - {{ item.title === '#' ? '序列号' : item.title }} - - - - - - - - - - - - {{ rowIndex + 1 + (pagination.current - 1) * pagination.size }} - - - - - - - - 详情 - - - - - - 删除 - - - - - - - - - - - diff --git a/src/views/user/bulletin-card/components/bulletin-detail.vue b/src/views/user/bulletin-card/components/bulletin-detail.vue deleted file mode 100644 index 1fbd75e..0000000 --- a/src/views/user/bulletin-card/components/bulletin-detail.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - {{ renderData.title }} - - 作者: {{ renderData.createBy }} - 时间: {{ dayjs(renderData.publishTime).format('YYYY-MM-DD') }} - - - - - - - - - - {{ item.fileName }} - - - - - - - - - - - - - - -