diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index 6a0a8b9..d572c38 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -5,7 +5,7 @@ @@ -90,6 +90,20 @@ + +
+ +
@@ -107,9 +121,11 @@ modelName: '', communication: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 + total: 0, // 数据总数 commuList: [ { label: 'LORA', @@ -165,6 +181,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -176,10 +202,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceModelList(this.listQuery).then(response => { - this.list = response.data + console.log(response) + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index 6a0a8b9..d572c38 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -5,7 +5,7 @@ @@ -90,6 +90,20 @@ + +
+ +
@@ -107,9 +121,11 @@ modelName: '', communication: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 + total: 0, // 数据总数 commuList: [ { label: 'LORA', @@ -165,6 +181,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -176,10 +202,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceModelList(this.listQuery).then(response => { - this.list = response.data + console.log(response) + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index c05674f..94b8d64 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -13,20 +13,21 @@ > - - + + 设备编号 + + + + + - - + /> @@ -47,15 +48,32 @@ - + - - + + + + + + + + @@ -72,17 +90,6 @@ /> - - - - -
{ - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index 6a0a8b9..d572c38 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -5,7 +5,7 @@ @@ -90,6 +90,20 @@
+ +
+ +
@@ -107,9 +121,11 @@ modelName: '', communication: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 + total: 0, // 数据总数 commuList: [ { label: 'LORA', @@ -165,6 +181,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -176,10 +202,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceModelList(this.listQuery).then(response => { - this.list = response.data + console.log(response) + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index c05674f..94b8d64 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -13,20 +13,21 @@ > - - + + 设备编号 + + + + + - - + /> @@ -47,15 +48,32 @@ - + - - + + + + + + + + @@ -72,17 +90,6 @@ /> - - - - -
+ +
+ +
@@ -118,6 +132,7 @@ deviceType: '', isValid: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 @@ -158,6 +173,7 @@ align: 'center' } ], // 显示列 + total: 0, // 数据总数 multipleSelection: [], // 多选选中项 list: [], // 列表数据 deviceTypeList: [], // 设备类型列表 @@ -170,6 +186,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -181,10 +207,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceTypeList(this.listQuery).then(response => { - this.list = response.data + console.log(response, '======response') + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index 6a0a8b9..d572c38 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -5,7 +5,7 @@ @@ -90,6 +90,20 @@ + +
+ +
@@ -107,9 +121,11 @@ modelName: '', communication: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 + total: 0, // 数据总数 commuList: [ { label: 'LORA', @@ -165,6 +181,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -176,10 +202,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceModelList(this.listQuery).then(response => { - this.list = response.data + console.log(response) + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index c05674f..94b8d64 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -13,20 +13,21 @@ > - - + + 设备编号 + + + + + - - + /> @@ -47,15 +48,32 @@ - + - - + + + + + + + + @@ -72,17 +90,6 @@ /> - - - - -
+ +
+ +
@@ -118,6 +132,7 @@ deviceType: '', isValid: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 @@ -158,6 +173,7 @@ align: 'center' } ], // 显示列 + total: 0, // 数据总数 multipleSelection: [], // 多选选中项 list: [], // 列表数据 deviceTypeList: [], // 设备类型列表 @@ -170,6 +186,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -181,10 +207,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceTypeList(this.listQuery).then(response => { - this.list = response.data + console.log(response, '======response') + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index d92669b..aa8e734 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -208,7 +208,7 @@ // 获取工单详情 getJobInfo: function(jobId) { this.loading = true - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' getJobInfo(jobId).then(response => { this.loading = false if (response.code === 200) { diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index 6a0a8b9..d572c38 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -5,7 +5,7 @@ @@ -90,6 +90,20 @@ + +
+ +
@@ -107,9 +121,11 @@ modelName: '', communication: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 + total: 0, // 数据总数 commuList: [ { label: 'LORA', @@ -165,6 +181,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -176,10 +202,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceModelList(this.listQuery).then(response => { - this.list = response.data + console.log(response) + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index c05674f..94b8d64 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -13,20 +13,21 @@ > - - + + 设备编号 + + + + + - - + /> @@ -47,15 +48,32 @@ - + - - + + + + + + + + @@ -72,17 +90,6 @@ /> - - - - -
+ +
+ +
@@ -118,6 +132,7 @@ deviceType: '', isValid: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 @@ -158,6 +173,7 @@ align: 'center' } ], // 显示列 + total: 0, // 数据总数 multipleSelection: [], // 多选选中项 list: [], // 列表数据 deviceTypeList: [], // 设备类型列表 @@ -170,6 +186,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -181,10 +207,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceTypeList(this.listQuery).then(response => { - this.list = response.data + console.log(response, '======response') + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index d92669b..aa8e734 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -208,7 +208,7 @@ // 获取工单详情 getJobInfo: function(jobId) { this.loading = true - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' getJobInfo(jobId).then(response => { this.loading = false if (response.code === 200) { diff --git a/src/views/wellManage/addWell.vue b/src/views/wellManage/addWell.vue index 96dcb84..abc976e 100644 --- a/src/views/wellManage/addWell.vue +++ b/src/views/wellManage/addWell.vue @@ -255,7 +255,7 @@ qu: [{ required: true, message: '所在区/县必选', trigger: 'change' }], area: [{ required: true, message: '所在街道/镇必选', trigger: 'change' }] }, - uploadPath: process.env.BASE_API + '/imageUpload', // 图片上传路径 + uploadPath: this.baseConfig.baseUrl + '/imageUpload', // 图片上传路径 dialogImageUrl: '', dialogVisible: false, labelPosition: 'right', @@ -467,7 +467,7 @@ // 图片上传 uploadFile(file) { console.log('uploadFile:' + file.file.name) - // const base_url = process.env.BASE_API + '/static/' + // const base_url = this.baseConfig.baseUrl + '/static/' Uploadimg(file).then(res => { if (res.code === 200) { this.fileList.push({ name: file.file.name, url: res.data }) @@ -528,7 +528,7 @@ }, handleSuccess(response, file, fileList) { console.log('handleSuccess') - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' if (response.code === 200) { this.fileList.push({ name: file.file.name, url: base_url + response.data }) this.handleChange() diff --git a/mock/deviceManage/deviceModels.js b/mock/deviceManage/deviceModels.js index 12ecabb..84882eb 100644 --- a/mock/deviceManage/deviceModels.js +++ b/mock/deviceManage/deviceModels.js @@ -40,29 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '3G,4G' - }, - { - 'id': '112343243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '4G' - }, - { - 'id': '119983243249864', - 'modelName': '井盖状态检测仪', - 'deviceType': '设备类型主键', - 'deviceTypeName': '检测井盖状态', - 'communication': '联通移动NB' - } -] module.exports = [ // mock get all routes form server { @@ -76,17 +53,5 @@ success: true } } - }, - { - url: '/deviceModels/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/mock/deviceManage/deviceType.js b/mock/deviceManage/deviceType.js index 69e9100..84882eb 100644 --- a/mock/deviceManage/deviceType.js +++ b/mock/deviceManage/deviceType.js @@ -40,22 +40,6 @@ 'value': '19' } ] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '是', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '否', - 'watchType': '监控气体类型' - } -] module.exports = [ // mock get all routes form server { @@ -69,17 +53,5 @@ success: true } } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } } ] diff --git a/package.json b/package.json index 5f6a084..f534952 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", + "copy-webpack-plugin": "^6.0.3", "animate.css": "^4.1.1", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/public/config/project.config.json b/public/config/project.config.json index 1b2796d..f986319 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -2,7 +2,7 @@ "title": "管网运行监测系统", "subtitle": "", "theme":"blue", - "baseUrl": "https://38911d91v5.zicp.fun/", + "baseUrl": "http://111.198.10.15:11309/", "mainPage": "http://111.198.10.15:11404/dcms/#", "singleSys": true, "refreshType":"websocket", diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js index 8554973..2eb93c8 100644 --- a/src/api/device/deviceModel.js +++ b/src/api/device/deviceModel.js @@ -1,5 +1,5 @@ /** - * 设备管理接口 + * 设备型号管理接口 */ import request from '@/utils/request' import qs from 'qs' @@ -7,7 +7,7 @@ // 设备型号名称 export function getDevice(params) { return request({ - url: 'device/type', + url: 'device/model', method: 'get', params }) @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceModelList(params) { return request({ - url: 'deviceModels/list', + url: 'deviceModels/listPage', method: 'get', params }) diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 5345faa..7274ede 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -16,7 +16,7 @@ // 设备查询 export function getDeviceTypeList(params) { return request({ - url: 'deviceType/list', + url: 'deviceType/listPage', method: 'get', params }) @@ -44,7 +44,7 @@ url: 'deviceType/delete', method: 'post', params: { - ids: ids + deviceTypeId: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index 6a0a8b9..d572c38 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -5,7 +5,7 @@ @@ -90,6 +90,20 @@ + +
+ +
@@ -107,9 +121,11 @@ modelName: '', communication: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 + total: 0, // 数据总数 commuList: [ { label: 'LORA', @@ -165,6 +181,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -176,10 +202,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceModelList(this.listQuery).then(response => { - this.list = response.data + console.log(response) + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/deviceManage/deviceType/components/editDeviceType.vue b/src/views/deviceManage/deviceType/components/editDeviceType.vue index c05674f..94b8d64 100644 --- a/src/views/deviceManage/deviceType/components/editDeviceType.vue +++ b/src/views/deviceManage/deviceType/components/editDeviceType.vue @@ -13,20 +13,21 @@ > - - + + 设备编号 + + + + + - - + /> @@ -47,15 +48,32 @@ - + - - + + + + + + + + @@ -72,17 +90,6 @@ /> - - - - -
+ +
+ +
@@ -118,6 +132,7 @@ deviceType: '', isValid: '', offset: 1, + limit: 20, sort: 'id', order: 'asc' }, // 查询条件 @@ -158,6 +173,7 @@ align: 'center' } ], // 显示列 + total: 0, // 数据总数 multipleSelection: [], // 多选选中项 list: [], // 列表数据 deviceTypeList: [], // 设备类型列表 @@ -170,6 +186,16 @@ this.fetchData() }, methods: { + // 改变页容量 + handleSizeChange(val) { + this.listQuery.limit = val + this.fetchData() + }, + // 改变当前页 + handleCurrentChange(val) { + this.listQuery.offset = val + this.fetchData() + }, // 获取设备类型 fetchDeviceType() { getDevice(this.listQuery).then(response => { @@ -181,10 +207,15 @@ this.fetchData(false) }, // 数据列表 - fetchData() { + fetchData(isNowPage = true) { this.listLoading = true + if (!isNowPage) { // 是否显示当前页,否则跳转第一页 + this.listQuery.offset = 1 + } getDeviceTypeList(this.listQuery).then(response => { - this.list = response.data + console.log(response, '======response') + this.list = response.data.rows + this.total = parseInt(response.data.total) this.listLoading = false }) }, diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index d92669b..aa8e734 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -208,7 +208,7 @@ // 获取工单详情 getJobInfo: function(jobId) { this.loading = true - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' getJobInfo(jobId).then(response => { this.loading = false if (response.code === 200) { diff --git a/src/views/wellManage/addWell.vue b/src/views/wellManage/addWell.vue index 96dcb84..abc976e 100644 --- a/src/views/wellManage/addWell.vue +++ b/src/views/wellManage/addWell.vue @@ -255,7 +255,7 @@ qu: [{ required: true, message: '所在区/县必选', trigger: 'change' }], area: [{ required: true, message: '所在街道/镇必选', trigger: 'change' }] }, - uploadPath: process.env.BASE_API + '/imageUpload', // 图片上传路径 + uploadPath: this.baseConfig.baseUrl + '/imageUpload', // 图片上传路径 dialogImageUrl: '', dialogVisible: false, labelPosition: 'right', @@ -467,7 +467,7 @@ // 图片上传 uploadFile(file) { console.log('uploadFile:' + file.file.name) - // const base_url = process.env.BASE_API + '/static/' + // const base_url = this.baseConfig.baseUrl + '/static/' Uploadimg(file).then(res => { if (res.code === 200) { this.fileList.push({ name: file.file.name, url: res.data }) @@ -528,7 +528,7 @@ }, handleSuccess(response, file, fileList) { console.log('handleSuccess') - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' if (response.code === 200) { this.fileList.push({ name: file.file.name, url: base_url + response.data }) this.handleChange() diff --git a/src/views/wellManage/editWell.vue b/src/views/wellManage/editWell.vue index 3aed2b7..a5e4778 100644 --- a/src/views/wellManage/editWell.vue +++ b/src/views/wellManage/editWell.vue @@ -396,7 +396,7 @@ this.loading = false } // 处理图片 - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' const urls = row.photos.split(';') for (const url of urls) { if (url) { @@ -510,7 +510,7 @@ }, uploadFile(file) { console.log('uploadFile:' + file.file.name) - const base_url = process.env.BASE_API + '/static/' + const base_url = this.baseConfig.baseUrl + '/static/' Uploadimg(file).then(res => { if (res.code === 200) { this.imageList.push({ name: file.file.name, url: base_url + res.data })