diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - success: true - } - } - }, - { - url: '/deviceType/list', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTableList, - message: '请求成功', - success: true - } - } - } -] diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceModels/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/index.js b/mock/index.js index 09c6739..3f21e52 100644 --- a/mock/index.js +++ b/mock/index.js @@ -12,7 +12,8 @@ const dashboard = require('./biz/dashboard') const search = require('./remote-search') const overview = require('./biz/overview') -const device = require('./deviceManage/device') +const deviceType = require('./deviceManage/deviceType') +const deviceModels = require('./deviceManage/deviceModels') const mocks = [ ...user, @@ -26,7 +27,8 @@ ...search, ...dashboard, ...overview, - ...device + ...deviceType, + ...deviceModels ] // for front mock diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/index.js b/mock/index.js index 09c6739..3f21e52 100644 --- a/mock/index.js +++ b/mock/index.js @@ -12,7 +12,8 @@ const dashboard = require('./biz/dashboard') const search = require('./remote-search') const overview = require('./biz/overview') -const device = require('./deviceManage/device') +const deviceType = require('./deviceManage/deviceType') +const deviceModels = require('./deviceManage/deviceModels') const mocks = [ ...user, @@ -26,7 +27,8 @@ ...search, ...dashboard, ...overview, - ...device + ...deviceType, + ...deviceModels ] // for front mock diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js new file mode 100644 index 0000000..8554973 --- /dev/null +++ b/src/api/device/deviceModel.js @@ -0,0 +1,53 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 设备型号名称 +export function getDevice(params) { + return request({ + url: 'device/type', + method: 'get', + params + }) +} + +// 设备查询 +export function getDeviceModelList(params) { + return request({ + url: 'deviceModels/list', + method: 'get', + params + }) +} + +// 添加设备 +export function addDeviceModel(params) { + return request({ + url: 'deviceModels/add', + method: 'post', + params + }) +} +// 修改设备 +export function updateDeviceModel(params) { + return request({ + url: 'deviceModels/update', + method: 'post', + params + }) +} +// 删除设备 +export function delDeviceModel(ids) { + return request({ + url: 'deviceModels/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/index.js b/mock/index.js index 09c6739..3f21e52 100644 --- a/mock/index.js +++ b/mock/index.js @@ -12,7 +12,8 @@ const dashboard = require('./biz/dashboard') const search = require('./remote-search') const overview = require('./biz/overview') -const device = require('./deviceManage/device') +const deviceType = require('./deviceManage/deviceType') +const deviceModels = require('./deviceManage/deviceModels') const mocks = [ ...user, @@ -26,7 +27,8 @@ ...search, ...dashboard, ...overview, - ...device + ...deviceType, + ...deviceModels ] // for front mock diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js new file mode 100644 index 0000000..8554973 --- /dev/null +++ b/src/api/device/deviceModel.js @@ -0,0 +1,53 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 设备型号名称 +export function getDevice(params) { + return request({ + url: 'device/type', + method: 'get', + params + }) +} + +// 设备查询 +export function getDeviceModelList(params) { + return request({ + url: 'deviceModels/list', + method: 'get', + params + }) +} + +// 添加设备 +export function addDeviceModel(params) { + return request({ + url: 'deviceModels/add', + method: 'post', + params + }) +} +// 修改设备 +export function updateDeviceModel(params) { + return request({ + url: 'deviceModels/update', + method: 'post', + params + }) +} +// 删除设备 +export function delDeviceModel(ids) { + return request({ + url: 'deviceModels/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 3c10883..5345faa 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -14,7 +14,7 @@ } // 设备查询 -export function getDeviceList(params) { +export function getDeviceTypeList(params) { return request({ url: 'deviceType/list', method: 'get', @@ -39,9 +39,9 @@ }) } // 删除设备 -export function delDevice(ids) { +export function delDeviceType(ids) { return request({ - url: 'device/delete', + url: 'deviceType/delete', method: 'post', params: { ids: ids diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/index.js b/mock/index.js index 09c6739..3f21e52 100644 --- a/mock/index.js +++ b/mock/index.js @@ -12,7 +12,8 @@ const dashboard = require('./biz/dashboard') const search = require('./remote-search') const overview = require('./biz/overview') -const device = require('./deviceManage/device') +const deviceType = require('./deviceManage/deviceType') +const deviceModels = require('./deviceManage/deviceModels') const mocks = [ ...user, @@ -26,7 +27,8 @@ ...search, ...dashboard, ...overview, - ...device + ...deviceType, + ...deviceModels ] // for front mock diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js new file mode 100644 index 0000000..8554973 --- /dev/null +++ b/src/api/device/deviceModel.js @@ -0,0 +1,53 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 设备型号名称 +export function getDevice(params) { + return request({ + url: 'device/type', + method: 'get', + params + }) +} + +// 设备查询 +export function getDeviceModelList(params) { + return request({ + url: 'deviceModels/list', + method: 'get', + params + }) +} + +// 添加设备 +export function addDeviceModel(params) { + return request({ + url: 'deviceModels/add', + method: 'post', + params + }) +} +// 修改设备 +export function updateDeviceModel(params) { + return request({ + url: 'deviceModels/update', + method: 'post', + params + }) +} +// 删除设备 +export function delDeviceModel(ids) { + return request({ + url: 'deviceModels/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 3c10883..5345faa 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -14,7 +14,7 @@ } // 设备查询 -export function getDeviceList(params) { +export function getDeviceTypeList(params) { return request({ url: 'deviceType/list', method: 'get', @@ -39,9 +39,9 @@ }) } // 删除设备 -export function delDevice(ids) { +export function delDeviceType(ids) { return request({ - url: 'device/delete', + url: 'deviceType/delete', method: 'post', params: { ids: ids diff --git a/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue b/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue new file mode 100644 index 0000000..f6e68a3 --- /dev/null +++ b/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/index.js b/mock/index.js index 09c6739..3f21e52 100644 --- a/mock/index.js +++ b/mock/index.js @@ -12,7 +12,8 @@ const dashboard = require('./biz/dashboard') const search = require('./remote-search') const overview = require('./biz/overview') -const device = require('./deviceManage/device') +const deviceType = require('./deviceManage/deviceType') +const deviceModels = require('./deviceManage/deviceModels') const mocks = [ ...user, @@ -26,7 +27,8 @@ ...search, ...dashboard, ...overview, - ...device + ...deviceType, + ...deviceModels ] // for front mock diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js new file mode 100644 index 0000000..8554973 --- /dev/null +++ b/src/api/device/deviceModel.js @@ -0,0 +1,53 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 设备型号名称 +export function getDevice(params) { + return request({ + url: 'device/type', + method: 'get', + params + }) +} + +// 设备查询 +export function getDeviceModelList(params) { + return request({ + url: 'deviceModels/list', + method: 'get', + params + }) +} + +// 添加设备 +export function addDeviceModel(params) { + return request({ + url: 'deviceModels/add', + method: 'post', + params + }) +} +// 修改设备 +export function updateDeviceModel(params) { + return request({ + url: 'deviceModels/update', + method: 'post', + params + }) +} +// 删除设备 +export function delDeviceModel(ids) { + return request({ + url: 'deviceModels/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 3c10883..5345faa 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -14,7 +14,7 @@ } // 设备查询 -export function getDeviceList(params) { +export function getDeviceTypeList(params) { return request({ url: 'deviceType/list', method: 'get', @@ -39,9 +39,9 @@ }) } // 删除设备 -export function delDevice(ids) { +export function delDeviceType(ids) { return request({ - url: 'device/delete', + url: 'deviceType/delete', method: 'post', params: { ids: ids diff --git a/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue b/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue new file mode 100644 index 0000000..f6e68a3 --- /dev/null +++ b/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue deleted file mode 100644 index b22e406..0000000 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - - diff --git a/mock/deviceManage/device.js b/mock/deviceManage/device.js deleted file mode 100644 index 1640c25..0000000 --- a/mock/deviceManage/device.js +++ /dev/null @@ -1,85 +0,0 @@ -const deviceTypeList = [ - { - 'name': '井盖状态检测仪', - 'value': '10' - }, - { - 'name': '液位检测仪', - 'value': '11' - }, - { - 'name': '有害气体检测仪', - 'value': '12' - }, - { - 'name': '燃气智能检测终端', - 'value': '13' - }, - { - 'name': '温湿度检测仪', - 'value': '14' - }, - { - 'name': '开挖检测仪', - 'value': '15' - }, - { - 'name': '井盖定位检测仪', - 'value': '16' - }, - { - 'name': '噪声记录仪', - 'value': '17' - }, - { - 'name': '燃气智能检测终端(一体化)', - 'value': '18' - }, - { - 'name': '管盯', - 'value': '19' - } -] -const deviceTableList = [ - { - 'id': '112343243242341', - 'typeName': '井盖状态检测仪', - 'typeDescription': '检测井盖状态', - 'valid': '开启', - 'watchType': '监控检测井盖状态' - }, - { - 'id': '112343243242986', - 'typeName': '有害气体检测仪', - 'typeDescription': '检测气体类型', - 'valid': '关闭', - 'watchType': '监控气体类型' - } -] -module.exports = [ - // mock get all routes form server - { - url: '/device/type', - type: 'get', - response: _ => { - return { - code: 200, - data: deviceTypeList, - message: '请求成功', - 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 new file mode 100644 index 0000000..12ecabb --- /dev/null +++ b/mock/deviceManage/deviceModels.js @@ -0,0 +1,92 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + '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 + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + 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 new file mode 100644 index 0000000..1640c25 --- /dev/null +++ b/mock/deviceManage/deviceType.js @@ -0,0 +1,85 @@ +const deviceTypeList = [ + { + 'name': '井盖状态检测仪', + 'value': '10' + }, + { + 'name': '液位检测仪', + 'value': '11' + }, + { + 'name': '有害气体检测仪', + 'value': '12' + }, + { + 'name': '燃气智能检测终端', + 'value': '13' + }, + { + 'name': '温湿度检测仪', + 'value': '14' + }, + { + 'name': '开挖检测仪', + 'value': '15' + }, + { + 'name': '井盖定位检测仪', + 'value': '16' + }, + { + 'name': '噪声记录仪', + 'value': '17' + }, + { + 'name': '燃气智能检测终端(一体化)', + 'value': '18' + }, + { + 'name': '管盯', + 'value': '19' + } +] +const deviceTableList = [ + { + 'id': '112343243242341', + 'typeName': '井盖状态检测仪', + 'typeDescription': '检测井盖状态', + 'valid': '开启', + 'watchType': '监控检测井盖状态' + }, + { + 'id': '112343243242986', + 'typeName': '有害气体检测仪', + 'typeDescription': '检测气体类型', + 'valid': '关闭', + 'watchType': '监控气体类型' + } +] +module.exports = [ + // mock get all routes form server + { + url: '/device/type', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTypeList, + message: '请求成功', + success: true + } + } + }, + { + url: '/deviceType/list', + type: 'get', + response: _ => { + return { + code: 200, + data: deviceTableList, + message: '请求成功', + success: true + } + } + } +] diff --git a/mock/index.js b/mock/index.js index 09c6739..3f21e52 100644 --- a/mock/index.js +++ b/mock/index.js @@ -12,7 +12,8 @@ const dashboard = require('./biz/dashboard') const search = require('./remote-search') const overview = require('./biz/overview') -const device = require('./deviceManage/device') +const deviceType = require('./deviceManage/deviceType') +const deviceModels = require('./deviceManage/deviceModels') const mocks = [ ...user, @@ -26,7 +27,8 @@ ...search, ...dashboard, ...overview, - ...device + ...deviceType, + ...deviceModels ] // for front mock diff --git a/src/api/device/deviceModel.js b/src/api/device/deviceModel.js new file mode 100644 index 0000000..8554973 --- /dev/null +++ b/src/api/device/deviceModel.js @@ -0,0 +1,53 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +// 设备型号名称 +export function getDevice(params) { + return request({ + url: 'device/type', + method: 'get', + params + }) +} + +// 设备查询 +export function getDeviceModelList(params) { + return request({ + url: 'deviceModels/list', + method: 'get', + params + }) +} + +// 添加设备 +export function addDeviceModel(params) { + return request({ + url: 'deviceModels/add', + method: 'post', + params + }) +} +// 修改设备 +export function updateDeviceModel(params) { + return request({ + url: 'deviceModels/update', + method: 'post', + params + }) +} +// 删除设备 +export function delDeviceModel(ids) { + return request({ + url: 'deviceModels/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} diff --git a/src/api/device/deviceType.js b/src/api/device/deviceType.js index 3c10883..5345faa 100644 --- a/src/api/device/deviceType.js +++ b/src/api/device/deviceType.js @@ -14,7 +14,7 @@ } // 设备查询 -export function getDeviceList(params) { +export function getDeviceTypeList(params) { return request({ url: 'deviceType/list', method: 'get', @@ -39,9 +39,9 @@ }) } // 删除设备 -export function delDevice(ids) { +export function delDeviceType(ids) { return request({ - url: 'device/delete', + url: 'deviceType/delete', method: 'post', params: { ids: ids diff --git a/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue b/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue new file mode 100644 index 0000000..f6e68a3 --- /dev/null +++ b/src/views/deviceManage/deviceModel/components/dialogDeviceModel.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue deleted file mode 100644 index b22e406..0000000 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - - diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index d1da401..7119c0d 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -4,13 +4,10 @@
- - - + + - + - 搜索 @@ -52,49 +39,26 @@
- - 导出记录 - - - - - 批量导入 - - - + + 删除 - + 新增 - - + + + + diff --git a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue b/src/views/deviceManage/deviceModel/components/editDeviceModel.vue deleted file mode 100644 index b22e406..0000000 --- a/src/views/deviceManage/deviceModel/components/editDeviceModel.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - - diff --git a/src/views/deviceManage/deviceModel/deviceModel.vue b/src/views/deviceManage/deviceModel/deviceModel.vue index d1da401..7119c0d 100644 --- a/src/views/deviceManage/deviceModel/deviceModel.vue +++ b/src/views/deviceManage/deviceModel/deviceModel.vue @@ -4,13 +4,10 @@
- - - + + - + - 搜索 @@ -52,49 +39,26 @@
- - 导出记录 - - - - - 批量导入 - - - + + 删除 - + 新增 - - + +