diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/views/basic/device/list.vue b/src/views/basic/device/list.vue index cec6912..e384713 100644 --- a/src/views/basic/device/list.vue +++ b/src/views/basic/device/list.vue @@ -1,36 +1,20 @@ + + +./locate-info diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/views/basic/device/list.vue b/src/views/basic/device/list.vue index cec6912..e384713 100644 --- a/src/views/basic/device/list.vue +++ b/src/views/basic/device/list.vue @@ -1,36 +1,20 @@ + + +./locate-info diff --git a/src/views/basic/locate/list.vue b/src/views/basic/locate/list.vue new file mode 100644 index 0000000..59c5c6f --- /dev/null +++ b/src/views/basic/locate/list.vue @@ -0,0 +1,227 @@ + + + + diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/views/basic/device/list.vue b/src/views/basic/device/list.vue index cec6912..e384713 100644 --- a/src/views/basic/device/list.vue +++ b/src/views/basic/device/list.vue @@ -1,36 +1,20 @@ + + +./locate-info diff --git a/src/views/basic/locate/list.vue b/src/views/basic/locate/list.vue new file mode 100644 index 0000000..59c5c6f --- /dev/null +++ b/src/views/basic/locate/list.vue @@ -0,0 +1,227 @@ + + + + diff --git a/src/views/basic/locate/locate-info.ts b/src/views/basic/locate/locate-info.ts new file mode 100644 index 0000000..d493f7c --- /dev/null +++ b/src/views/basic/locate/locate-info.ts @@ -0,0 +1,45 @@ +// 列表查询参数接口 +export interface IListQuery { + deptid?: string + keywords: string // 点位编号 + offset?: number + limit?: number + sort?: string + order?: string +} + +export interface IDeviceInfo { + id: string + groupId: string + devcode: string + deviceName?: string + deviceType: string + deviceTypeName?: string + status?: string + statusName?: string + cell?: string + imei: string + iccid: string + model: string + modelName?: string + productId: string + productName?: string + encipherType: string + encipherTypeName?: string + createTime: string + createUserId: string + createUserName?: string + dataValue?: string +} + +export interface IConfigListQuery { + devcode: string // 设备编号 + configType: string // 配置类型 + status: string // 配置状态 + beginTime: string // 操作时间-开始 + endTime: string // 操作时间-结束 + offset?: number + limit?: number + sort?: string + order?: string +} diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/views/basic/device/list.vue b/src/views/basic/device/list.vue index cec6912..e384713 100644 --- a/src/views/basic/device/list.vue +++ b/src/views/basic/device/list.vue @@ -1,36 +1,20 @@ + + +./locate-info diff --git a/src/views/basic/locate/list.vue b/src/views/basic/locate/list.vue new file mode 100644 index 0000000..59c5c6f --- /dev/null +++ b/src/views/basic/locate/list.vue @@ -0,0 +1,227 @@ + + + + diff --git a/src/views/basic/locate/locate-info.ts b/src/views/basic/locate/locate-info.ts new file mode 100644 index 0000000..d493f7c --- /dev/null +++ b/src/views/basic/locate/locate-info.ts @@ -0,0 +1,45 @@ +// 列表查询参数接口 +export interface IListQuery { + deptid?: string + keywords: string // 点位编号 + offset?: number + limit?: number + sort?: string + order?: string +} + +export interface IDeviceInfo { + id: string + groupId: string + devcode: string + deviceName?: string + deviceType: string + deviceTypeName?: string + status?: string + statusName?: string + cell?: string + imei: string + iccid: string + model: string + modelName?: string + productId: string + productName?: string + encipherType: string + encipherTypeName?: string + createTime: string + createUserId: string + createUserName?: string + dataValue?: string +} + +export interface IConfigListQuery { + devcode: string // 设备编号 + configType: string // 配置类型 + status: string // 配置状态 + beginTime: string // 操作时间-开始 + endTime: string // 操作时间-结束 + offset?: number + limit?: number + sort?: string + order?: string +} diff --git a/src/views/data/query/data-query.ts b/src/views/data/query/data-query.ts index 4ec375f..885a786 100644 --- a/src/views/data/query/data-query.ts +++ b/src/views/data/query/data-query.ts @@ -1,9 +1,6 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string // 产品 - devcode: string - deviceType: string + keywords: string beginTime?: string // 电量 endTime?: string // offset?: number @@ -25,6 +22,9 @@ dataJson: string decryptBeforeData?: string decryptAfterData?: string + pci?: string + rsrp?: string + snr?: string logtime: string uptime: string } diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/views/basic/device/list.vue b/src/views/basic/device/list.vue index cec6912..e384713 100644 --- a/src/views/basic/device/list.vue +++ b/src/views/basic/device/list.vue @@ -1,36 +1,20 @@ + + +./locate-info diff --git a/src/views/basic/locate/list.vue b/src/views/basic/locate/list.vue new file mode 100644 index 0000000..59c5c6f --- /dev/null +++ b/src/views/basic/locate/list.vue @@ -0,0 +1,227 @@ + + + + diff --git a/src/views/basic/locate/locate-info.ts b/src/views/basic/locate/locate-info.ts new file mode 100644 index 0000000..d493f7c --- /dev/null +++ b/src/views/basic/locate/locate-info.ts @@ -0,0 +1,45 @@ +// 列表查询参数接口 +export interface IListQuery { + deptid?: string + keywords: string // 点位编号 + offset?: number + limit?: number + sort?: string + order?: string +} + +export interface IDeviceInfo { + id: string + groupId: string + devcode: string + deviceName?: string + deviceType: string + deviceTypeName?: string + status?: string + statusName?: string + cell?: string + imei: string + iccid: string + model: string + modelName?: string + productId: string + productName?: string + encipherType: string + encipherTypeName?: string + createTime: string + createUserId: string + createUserName?: string + dataValue?: string +} + +export interface IConfigListQuery { + devcode: string // 设备编号 + configType: string // 配置类型 + status: string // 配置状态 + beginTime: string // 操作时间-开始 + endTime: string // 操作时间-结束 + offset?: number + limit?: number + sort?: string + order?: string +} diff --git a/src/views/data/query/data-query.ts b/src/views/data/query/data-query.ts index 4ec375f..885a786 100644 --- a/src/views/data/query/data-query.ts +++ b/src/views/data/query/data-query.ts @@ -1,9 +1,6 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string // 产品 - devcode: string - deviceType: string + keywords: string beginTime?: string // 电量 endTime?: string // offset?: number @@ -25,6 +22,9 @@ dataJson: string decryptBeforeData?: string decryptAfterData?: string + pci?: string + rsrp?: string + snr?: string logtime: string uptime: string } diff --git a/src/views/data/query/dataDetailDialog.vue b/src/views/data/query/dataDetailDialog.vue index 6026e94..c09a2a9 100644 --- a/src/views/data/query/dataDetailDialog.vue +++ b/src/views/data/query/dataDetailDialog.vue @@ -1,44 +1,35 @@ diff --git a/src/api/basic/device.ts b/src/api/basic/device.ts index fe5bc37..4e251a5 100644 --- a/src/api/basic/device.ts +++ b/src/api/basic/device.ts @@ -1,10 +1,10 @@ import request from '../index' -const prefix = 'device' +const prefix = 'busDevice' // 查询设备列表 分页 -export function getDeviceListPage(data: object) { +export function getDeviceListPage(data: any) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list-page?limit=${data.limit}&offset=${data.offset}`, method: 'post', data, }) diff --git a/src/api/basic/locate.ts b/src/api/basic/locate.ts new file mode 100644 index 0000000..8b19246 --- /dev/null +++ b/src/api/basic/locate.ts @@ -0,0 +1,61 @@ +import request from '../index' +const prefix = 'busWellInfo' + +// 查询点位列表 分页 +export function getLocateList(data: any) { + return request({ + url: `${prefix}/list?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查询产品详情 +export function detailProduct(data: object) { + return request({ + url: `${prefix}/detail`, + method: 'post', + data, + }) +} +// 资源树列表 +export function getResourceTreeList() { + return request({ + url: `${prefix}/resource/tree`, + method: 'get', + }) +} + +// 资源类型列表 +export function getResourceTypeList() { + return request({ + url: `${prefix}/dict/code/resourceType`, + method: 'get', + }) +} + +// 添加产品 +export function addProduct(data: object) { + return request({ + url: `${prefix}/add`, + method: 'post', + data, + }) +} +// 修改产品 +export function updateProduct(data: object) { + return request({ + url: `${prefix}/update`, + method: 'post', + data, + }) +} +// 删除产品 +export function delProduct(id: string) { + return request({ + url: `${prefix}/delete`, + method: 'post', + data: { + ids: [id], + }, + }) +} diff --git a/src/api/data/query.ts b/src/api/data/query.ts index 9b5de39..eed4d35 100644 --- a/src/api/data/query.ts +++ b/src/api/data/query.ts @@ -1,10 +1,19 @@ import request from '../index' -const prefix = 'device/data' +const prefix = 'noise' // 查询数据 分页 export function getDeviceDataListPage(data: object) { return request({ - url: `${prefix}/list-page`, + url: `${prefix}/list`, + method: 'post', + data, + }) +} + +// 查询噪声原始采样点数据信息 +export function detailDataInfo(data: object) { + return request({ + url: `${prefix}/detail`, method: 'post', data, }) diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index 841e0cb..3b006e3 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -87,6 +87,10 @@ /** * X轴类型 */ + showXAxis: { + type: Boolean, + default: true, + }, xAxisType: { type: String, default: 'category', @@ -212,6 +216,7 @@ }, // 提示框 xAxis: [ { + show: props.showXAxis, type: props.xAxisType, boundaryGap: true, axisLine: { diff --git a/src/components/Echart/echart-interface.ts b/src/components/Echart/echart-interface.ts index fd7cb73..9bc85ef 100644 --- a/src/components/Echart/echart-interface.ts +++ b/src/components/Echart/echart-interface.ts @@ -77,6 +77,7 @@ // x轴 export interface xAxisOption { + show: Boolean type: string // 'category' | 'value' | 'time' | 'log' name?: string boundaryGap?: boolean | string[] diff --git a/src/router/modules/leak.ts b/src/router/modules/leak.ts index fca4db6..d650a21 100644 --- a/src/router/modules/leak.ts +++ b/src/router/modules/leak.ts @@ -17,24 +17,24 @@ { path: 'list', name: 'LocateList', - component: () => import('@/views/basic/group/list.vue'), + component: () => import('@/views/basic/locate/list.vue'), meta: { title: '点位列表', auth: '/basic/locate/list', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { path: 'detail/:id?', name: 'LocateInfoDetail', - component: () => import('@/views/basic/group/detail.vue'), + component: () => import('@/views/basic/locate/detail.vue'), meta: { title: '点位详情', sidebar: false, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/list', }, }, { @@ -46,7 +46,7 @@ auth: '/basic/locate/pair', sidebar: true, breadcrumb: true, - activeMenu: '/basic/locate', + activeMenu: '/basic/locate/pair', }, }, ], @@ -148,7 +148,6 @@ }, ], }, - { path: '/data/query', component: Layout, diff --git a/src/router/routes.ts b/src/router/routes.ts index 241c681..03393aa 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -2,7 +2,6 @@ import generatedRoutes from 'virtual:generated-pages' import systemRoute from './modules/system' import leakRoute from './modules/leak' -import dataRoute from './modules/data' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -117,16 +116,6 @@ }, { meta: { - title: '数据管理', - icon: '', - auth: '/data', - }, - children: [ - ...dataRoute, - ], - }, - { - meta: { title: '系统设置', icon: '', auth: '/system', diff --git a/src/views/basic/device/detail.vue b/src/views/basic/device/detail.vue index a95575c..c915041 100644 --- a/src/views/basic/device/detail.vue +++ b/src/views/basic/device/detail.vue @@ -4,7 +4,7 @@ import type { IDeviceInfo } from './device-info' import DeviceConfigList from './configList.vue' import DataQueryList from '@/views/data/query/list.vue' -import { addDevice, detailDevice, updateDevice } from '@/api/basic/device' +import { addDevice, updateDevice } from '@/api/basic/device' // 从路由中传过来的参数 const type = ref('') @@ -26,7 +26,6 @@ const deviceInfo = ref({ id: '', - groupId: '', devcode: '', deviceName: '', deviceType: '', @@ -38,8 +37,6 @@ iccid: '', model: '', modelName: '', - productId: '', - productName: '', encipherType: '', encipherTypeName: '', createTime: '', @@ -50,6 +47,7 @@ // 逻辑 const resetForm = () => { + sessionStorage.removeItem('deviceInfo') router.go(-1) } @@ -125,20 +123,13 @@ }) } -// 查询详情 -const detailById = (id: string) => { - detailDevice({ id }).then((res) => { - if (res.code === 200) { - deviceInfo.value = res.data - } - }) -} - const initDialog = (params: any) => { // 从路由中获取参数 type.value = params.type id.value = params.id !== undefined ? params.id : '' + deviceInfo.value = JSON.parse(sessionStorage.getItem('deviceInfo')!) + // 默认显示第一个tab内容 current.value = radioItems.value[0].value currentLabel.value = radioItems.value[0].name @@ -148,8 +139,6 @@ title.value = '设备详情' id.value = params.id - detailById(id.value) - break default: title.value = '' @@ -178,19 +167,12 @@ {{ deviceInfo.devcode }} - - {{ deviceInfo.imei }} - - - {{ deviceInfo.productName }} - - - - {{ deviceInfo.iccid }} + + {{ deviceInfo.modelName }} @@ -199,20 +181,12 @@ {{ deviceInfo.deviceTypeName }} - - - {{ deviceInfo.encipherTypeName }} - - - {{ deviceInfo.modelName }} - - - - {{ deviceInfo.createTime }} + + {{ deviceInfo.installDate }} diff --git a/src/views/basic/device/device-info.ts b/src/views/basic/device/device-info.ts index e0ff66e..0ba2135 100644 --- a/src/views/basic/device/device-info.ts +++ b/src/views/basic/device/device-info.ts @@ -1,13 +1,8 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string - devcode: string - imei: string - deviceType: string - status?: string - beginCell?: string // 电量 - endCell?: string // + keywords: string + beginTime: string + endTime: string offset?: number limit?: number sort?: string @@ -16,7 +11,6 @@ export interface IDeviceInfo { id: string - groupId: string devcode: string deviceName?: string deviceType: string @@ -28,10 +22,9 @@ iccid: string model: string modelName?: string - productId: string - productName?: string encipherType: string encipherTypeName?: string + installDate?: string createTime: string createUserId: string createUserName?: string diff --git a/src/views/basic/device/list.vue b/src/views/basic/device/list.vue index cec6912..e384713 100644 --- a/src/views/basic/device/list.vue +++ b/src/views/basic/device/list.vue @@ -1,36 +1,20 @@ + + +./locate-info diff --git a/src/views/basic/locate/list.vue b/src/views/basic/locate/list.vue new file mode 100644 index 0000000..59c5c6f --- /dev/null +++ b/src/views/basic/locate/list.vue @@ -0,0 +1,227 @@ + + + + diff --git a/src/views/basic/locate/locate-info.ts b/src/views/basic/locate/locate-info.ts new file mode 100644 index 0000000..d493f7c --- /dev/null +++ b/src/views/basic/locate/locate-info.ts @@ -0,0 +1,45 @@ +// 列表查询参数接口 +export interface IListQuery { + deptid?: string + keywords: string // 点位编号 + offset?: number + limit?: number + sort?: string + order?: string +} + +export interface IDeviceInfo { + id: string + groupId: string + devcode: string + deviceName?: string + deviceType: string + deviceTypeName?: string + status?: string + statusName?: string + cell?: string + imei: string + iccid: string + model: string + modelName?: string + productId: string + productName?: string + encipherType: string + encipherTypeName?: string + createTime: string + createUserId: string + createUserName?: string + dataValue?: string +} + +export interface IConfigListQuery { + devcode: string // 设备编号 + configType: string // 配置类型 + status: string // 配置状态 + beginTime: string // 操作时间-开始 + endTime: string // 操作时间-结束 + offset?: number + limit?: number + sort?: string + order?: string +} diff --git a/src/views/data/query/data-query.ts b/src/views/data/query/data-query.ts index 4ec375f..885a786 100644 --- a/src/views/data/query/data-query.ts +++ b/src/views/data/query/data-query.ts @@ -1,9 +1,6 @@ // 列表查询参数接口 export interface IListQuery { - groupId: string // 分组 - productId?: string // 产品 - devcode: string - deviceType: string + keywords: string beginTime?: string // 电量 endTime?: string // offset?: number @@ -25,6 +22,9 @@ dataJson: string decryptBeforeData?: string decryptAfterData?: string + pci?: string + rsrp?: string + snr?: string logtime: string uptime: string } diff --git a/src/views/data/query/dataDetailDialog.vue b/src/views/data/query/dataDetailDialog.vue index 6026e94..c09a2a9 100644 --- a/src/views/data/query/dataDetailDialog.vue +++ b/src/views/data/query/dataDetailDialog.vue @@ -1,44 +1,35 @@ diff --git a/src/views/data/query/list.vue b/src/views/data/query/list.vue index 9976ba3..52aa763 100644 --- a/src/views/data/query/list.vue +++ b/src/views/data/query/list.vue @@ -5,11 +5,9 @@ import type { IDataDetailInfo, IListQuery } from './data-query' import DataDetailDialog from './dataDetailDialog.vue' import type { IDictType } from '@/views/basic/common-interface' -import type { IGroupInfo } from '@/views/basic/group/group-info' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' -import { getGroupList } from '@/api/basic/group' import { exportDeviceData, getDeviceDataListPage } from '@/api/data/query' const props = defineProps({ @@ -25,41 +23,39 @@ const refDataDialog = ref() -// 分组列表 -const groupList = ref>([]) - // 查询条件 const searchQuery = ref({ - groupId: '', // 分组 - devcode: props.devcode === undefined ? '' : props.devcode, - deviceType: '', + keywords: props.devcode === undefined ? '' : props.devcode, beginTime: '', endTime: '', offset: 1, limit: 20, }) -const dateRangeLog = ref<[DateModelType, DateModelType]>(['', ''])// 筛选时间段数据 -const dateRangeUp = ref<[DateModelType, DateModelType]>(['', ''])// 筛选时间段数据 +const dateRange = ref<[DateModelType, DateModelType]>(['', ''])// 筛选时间段数据 const total = ref(0) // 数据条数 const loadingTable = ref(false) // 表格loading // 表头 const columns = ref([ - { text: '分组', value: 'groupName', align: 'center', width: '180' }, - { text: '设备编号', value: 'devcode', align: 'center', width: '140' }, - { text: '设备类型', value: 'deviceTypeName', align: 'center', width: '200' }, - { text: '电量(%)', value: 'cell', align: 'center', width: '80' }, - { text: '内容', value: 'dataJson', align: 'center' }, - { text: '采集时间', value: 'uptime', align: 'center', width: '180' }, - { text: '上报时间', value: 'logtime', align: 'center', width: '180' }, - { text: '设备状态', value: 'status', align: 'center', width: '90' }, + { text: '设备编号', value: 'devcode', align: 'center', width: '200' }, + { text: '采集时间', value: 'uptime', align: 'center', width: '200' }, + { text: '数值', value: 'ddata', align: 'center' }, + { text: '信号强度', value: 'signalStr', align: 'center' }, + { text: '设备状态', value: 'status', align: 'center', width: '150' }, ]) const dataList = ref>([]) // 表格数据 const statusDict = ref>([]) -const deviceTypeDict = ref>([]) // 逻辑 +const joinSignalStr = (data: IDataDetailInfo) => { + if (data.rsrp === undefined || data.rsrp === '') { + return '' + } + else { + return `pci:${data.pci};rsrp:${data.rsrp};snr:${data.snr}` + } +} // 跳转到新建的页面 const exportDeviceDataList = () => { @@ -107,6 +103,7 @@ dataList.value = response.data.rows.map((item: IDataDetailInfo) => { return { ...item, + signalStr: joinSignalStr(item), } }) total.value = parseInt(response.data.total) @@ -135,15 +132,13 @@ // 重置 const reset = () => { searchQuery.value = { - groupId: '', // 分组 - devcode: props.devcode, - deviceType: '', + keywords: props.devcode, beginTime: '', endTime: '', offset: 1, limit: 20, } - dateRangeUp.value = ['', ''] + dateRange.value = ['', ''] fetchData(true) } @@ -156,45 +151,20 @@ } }) } -const getDeviceTypeDict = async () => { - getDictByCode('deviceType').then((res: any) => { - if (res.code === 200) { - deviceTypeDict.value = res.data - sessionStorage.setItem('deviceType', JSON.stringify(deviceTypeDict.value)) - } - }) -} -const getAllGroupList = async () => { - await getGroupList({}).then((res: any) => { - if (res.code === 200) { - groupList.value = res.data.rows - } - }) -} + const getDict = async () => { await getStatusDict() - await getDeviceTypeDict() - await getAllGroupList() } const initQuerySearch = () => { - searchQuery.value.beginTime = dayjs(new Date().valueOf() - 3600 * 24 * 6 * 1000).format('YYYY-MM-DD') - searchQuery.value.endTime = dayjs(new Date().valueOf() + 3600 * 24 * 1000).format('YYYY-MM-DD') - dateRangeUp.value = [searchQuery.value.beginTime, searchQuery.value.endTime] + if (props.embedded === false) { + searchQuery.value.beginTime = dayjs(new Date().valueOf() - 3600 * 24 * 6 * 1000).format('YYYY-MM-DD') + searchQuery.value.endTime = dayjs(new Date().valueOf() + 3600 * 24 * 1000).format('YYYY-MM-DD') + dateRange.value = [searchQuery.value.beginTime, searchQuery.value.endTime] + } } -watch(dateRangeUp, (val) => { - if (val) { - searchQuery.value.beginTime = dayjs(val[0]).format('YYYY-MM-DD') === 'Invalid Date' ? '' : dayjs(val[0]).format('YYYY-MM-DD') - searchQuery.value.endTime = dayjs(val[1]).format('YYYY-MM-DD') === 'Invalid Date' ? '' : dayjs(val[1]).format('YYYY-MM-DD') - } - else { - searchQuery.value.beginTime = '' - searchQuery.value.endTime = '' - } -}) - -watch(dateRangeLog, (val) => { +watch(dateRange, (val) => { if (val) { searchQuery.value.beginTime = dayjs(val[0]).format('YYYY-MM-DD') === 'Invalid Date' ? '' : dayjs(val[0]).format('YYYY-MM-DD') searchQuery.value.endTime = dayjs(val[1]).format('YYYY-MM-DD') === 'Invalid Date' ? '' : dayjs(val[1]).format('YYYY-MM-DD') @@ -209,7 +179,7 @@ watch(props, (val) => { // 如果是嵌入的页面 当devcode改变时则将查询条件进行修改 if (val.embedded === true) { - searchQuery.value.devcode = props.devcode + searchQuery.value.keywords = props.devcode } }) @@ -225,28 +195,15 @@ - - - + - - - - - - - - - - - - + - +