diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/src/utils/structure.js b/src/utils/structure.js index 4c65ee7..13bfb99 100644 --- a/src/utils/structure.js +++ b/src/utils/structure.js @@ -27,7 +27,7 @@ * @param isSelect 是否是下拉需要顶级的树 * @returns {*} */ -export function toTreeList(plainList, id = '0', isSelect = false) { +export function toTreeList(plainList, rootId = '0', isSelect = false) { const pid = findPid(plainList) if (pid.length > 1) { return plainList diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/src/utils/structure.js b/src/utils/structure.js index 4c65ee7..13bfb99 100644 --- a/src/utils/structure.js +++ b/src/utils/structure.js @@ -27,7 +27,7 @@ * @param isSelect 是否是下拉需要顶级的树 * @returns {*} */ -export function toTreeList(plainList, id = '0', isSelect = false) { +export function toTreeList(plainList, rootId = '0', isSelect = false) { const pid = findPid(plainList) if (pid.length > 1) { return plainList diff --git a/src/utils/validate.js b/src/utils/validate.js index dbecf7a..223c280 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -88,3 +88,11 @@ return false } } + +/** + * 常用正则表达式 + */ +export const regularReg = { + password: '', // 密码 + mobile: /^1[34578]\d{9}$/ // 手机号码 +} diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/src/utils/structure.js b/src/utils/structure.js index 4c65ee7..13bfb99 100644 --- a/src/utils/structure.js +++ b/src/utils/structure.js @@ -27,7 +27,7 @@ * @param isSelect 是否是下拉需要顶级的树 * @returns {*} */ -export function toTreeList(plainList, id = '0', isSelect = false) { +export function toTreeList(plainList, rootId = '0', isSelect = false) { const pid = findPid(plainList) if (pid.length > 1) { return plainList diff --git a/src/utils/validate.js b/src/utils/validate.js index dbecf7a..223c280 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -88,3 +88,11 @@ return false } } + +/** + * 常用正则表达式 + */ +export const regularReg = { + password: '', // 密码 + mobile: /^1[34578]\d{9}$/ // 手机号码 +} diff --git a/src/views/overview/components/alarmInfoWindow.vue b/src/views/overview/components/alarmInfoWindow.vue new file mode 100644 index 0000000..1eb1f61 --- /dev/null +++ b/src/views/overview/components/alarmInfoWindow.vue @@ -0,0 +1,39 @@ + + + + + + {{ alarmInfo.wellCode }} + + + + 告警原因:{{ alarm.alarmContent }} + 设备编号:{{ alarm.devcode }} + + + 井类型:{{ alarmInfo.wellTypeName }} + 权属单位:{{ alarmInfo.deptName }} + 详细地址:{{ alarmInfo.position }} + + + + + + + diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/src/utils/structure.js b/src/utils/structure.js index 4c65ee7..13bfb99 100644 --- a/src/utils/structure.js +++ b/src/utils/structure.js @@ -27,7 +27,7 @@ * @param isSelect 是否是下拉需要顶级的树 * @returns {*} */ -export function toTreeList(plainList, id = '0', isSelect = false) { +export function toTreeList(plainList, rootId = '0', isSelect = false) { const pid = findPid(plainList) if (pid.length > 1) { return plainList diff --git a/src/utils/validate.js b/src/utils/validate.js index dbecf7a..223c280 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -88,3 +88,11 @@ return false } } + +/** + * 常用正则表达式 + */ +export const regularReg = { + password: '', // 密码 + mobile: /^1[34578]\d{9}$/ // 手机号码 +} diff --git a/src/views/overview/components/alarmInfoWindow.vue b/src/views/overview/components/alarmInfoWindow.vue new file mode 100644 index 0000000..1eb1f61 --- /dev/null +++ b/src/views/overview/components/alarmInfoWindow.vue @@ -0,0 +1,39 @@ + + + + + + {{ alarmInfo.wellCode }} + + + + 告警原因:{{ alarm.alarmContent }} + 设备编号:{{ alarm.devcode }} + + + 井类型:{{ alarmInfo.wellTypeName }} + 权属单位:{{ alarmInfo.deptName }} + 详细地址:{{ alarmInfo.position }} + + + + + + + diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue new file mode 100644 index 0000000..d2bab9f --- /dev/null +++ b/src/views/overview/overviewAmap.vue @@ -0,0 +1,751 @@ + + + + + + + + + + + + + diff --git a/mock/biz/overview.js b/mock/biz/overview.js new file mode 100644 index 0000000..6a608e2 --- /dev/null +++ b/mock/biz/overview.js @@ -0,0 +1,496 @@ +module.exports = [ + // mock get all routes form server + { + url: 'overview/alarmNow', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'wellId': 1, + 'wellCode': 'E32TFXR', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'latGaode': 39.9, + 'lngGaode': 116.4, + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '处理中' + }, + { + 'wellId': 2, + 'wellCode': 'E32TFW3R3', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'wellId': 3, + 'wellCode': 'E32TFW3R1', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + }, + { + 'boxId': 4, + 'boxCode': 'E32TFW3Rx', + 'position': '长安街55号', + 'alarmId': 1, + 'alarmContent': '水位超限', + 'latGaode': '39.917797', + 'lngGaode': '116.411391', + 'alarmTime': '2019-03-20 10:55:00', + 'jobStatus': '待处理' + } + ] + } + } + }, + { + url: 'overview/wellInfo', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'wellCode': 'N51F131', + 'wellName': '宋郎路中压A闸1', + 'wellType': '3', + 'wellTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.906869', + 'lngGaode': '116.36899', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00', + 'watchData': [ + { + 'type': '2', + 'typeName': '液位', + 'value': '21', + 'logtime': '2018-12-27 00:00:00' + }, + { + 'type': '1', + 'typeName': '井盖', + 'value': '正常', + 'logtime': '2018-12-27 00:00:00' + } + ] + } + } + } + }, + { + url: 'overview/alarmsByWell', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': '成功', + 'data': { + 'id': 1, + 'wellCode': 'FE23Q32', + 'deptId': '24', + 'deptName': '第一分公司', + 'position': '长安街55号', + 'alarmList': [ + { + 'devcode': '412018202100', + 'alarmId': 1, + 'alarmContent': '井盖开启', + 'alarmTime': '2019-03-20 10:55:00' + }, + { + 'devcode': '312018202100', + 'alarmId': 2, + 'alarmContent': '液位超限', + 'alarmTime': '2019-03-20 10:55:00' + } + ] + } + } + } + }, + { + url: 'well/info', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxType': '3', + 'boxTypeName': '雨水井', + 'deptid': '3', + 'deptName': '第一分公司', + 'deep': 0.5, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '110000', + 'bfzt': '1', + 'bfztName': '布防', + 'qu': '110000', + 'area': '110000', + 'responseDept': '', + 'responseDeptName': '', + 'tel': '', + 'valid': '1', + 'ts': '2018-12-27 00:00:00' + } + } + } + }, + { + url: 'dict/code/sluicewellType', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': { + 'list': [ + { + 'value': '1', + 'name': '雨水井' + }, + { + 'value': '2', + 'name': '污水井' + }, + { + 'value': '3', + 'name': '燃气井' + }, + { + 'value': '4', + 'name': '热力井' + }, + { + 'value': '5', + 'name': '电力井' + } + ] + } + } + } + }, + { + url: 'overview/wellList', + type: 'get', + response: _ => { + return { + 'code': 200, + 'message': 'success', + 'data': [ + { + 'id': 1, + 'boxCode': 'N51F131', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '24', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'responseDept': '25', + 'latGaode': '39.901694', + 'lngGaode': '116.709315', + 'photos': 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100;', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '110000', + 'qu': '110000', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 2, + 'boxCode': 'N51F132', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '0', + 'bfztName': '撤防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 3, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 4, + 'boxCode': 'N51F133', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 5, + 'boxCode': 'N51F135', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 6, + 'boxCode': 'N51F136', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '116.709315', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 7, + 'boxCode': 'N51F137', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 8, + 'boxCode': 'N51F138', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '39.90169', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 9, + 'boxCode': 'N51F139', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + }, + { + 'id': 10, + 'boxCode': 'N51F1310', + 'boxName': '宋郎路中压A闸1', + 'boxTypeName': '雨水井', + 'boxType': '3', + 'deptid': '3', + 'deptName': '一分公司', + 'deep': 0.0, + 'position': '宋郎路', + 'coordinateX': '39.899999999', + 'coordinateY': '116.70000000', + 'latBaidu': '39.901694', + 'lngBaidu': '116.709315', + 'latGaode': '', + 'lngGaode': '', + 'photos': '', + 'notes': '', + 'bfzt': '1', + 'bfztName': '布防', + 'area': '', + 'staff': '', + 'tel': '', + 'valid': '1', + 'deviceCount': 3, + 'ts': '2018-12-27 00:00:00' + } + ] + } + } + } +] diff --git a/mock/index.js b/mock/index.js index c84a737..09c6739 100644 --- a/mock/index.js +++ b/mock/index.js @@ -11,6 +11,7 @@ const config = require('./system/config') const dashboard = require('./biz/dashboard') const search = require('./remote-search') +const overview = require('./biz/overview') const device = require('./deviceManage/device') const mocks = [ @@ -24,6 +25,7 @@ ...config, ...search, ...dashboard, + ...overview, ...device ] diff --git a/package.json b/package.json index 9ef7af1..04c3926 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.21.1", "clipboard": "^2.0.8", diff --git a/src/components/Amap/AMapContainer.vue b/src/components/Amap/AMapContainer.vue new file mode 100644 index 0000000..d4b46fe --- /dev/null +++ b/src/components/Amap/AMapContainer.vue @@ -0,0 +1,85 @@ + + + + + + + + diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/src/utils/structure.js b/src/utils/structure.js index 4c65ee7..13bfb99 100644 --- a/src/utils/structure.js +++ b/src/utils/structure.js @@ -27,7 +27,7 @@ * @param isSelect 是否是下拉需要顶级的树 * @returns {*} */ -export function toTreeList(plainList, id = '0', isSelect = false) { +export function toTreeList(plainList, rootId = '0', isSelect = false) { const pid = findPid(plainList) if (pid.length > 1) { return plainList diff --git a/src/utils/validate.js b/src/utils/validate.js index dbecf7a..223c280 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -88,3 +88,11 @@ return false } } + +/** + * 常用正则表达式 + */ +export const regularReg = { + password: '', // 密码 + mobile: /^1[34578]\d{9}$/ // 手机号码 +} diff --git a/src/views/overview/components/alarmInfoWindow.vue b/src/views/overview/components/alarmInfoWindow.vue new file mode 100644 index 0000000..1eb1f61 --- /dev/null +++ b/src/views/overview/components/alarmInfoWindow.vue @@ -0,0 +1,39 @@ + + + + + + {{ alarmInfo.wellCode }} + + + + 告警原因:{{ alarm.alarmContent }} + 设备编号:{{ alarm.devcode }} + + + 井类型:{{ alarmInfo.wellTypeName }} + 权属单位:{{ alarmInfo.deptName }} + 详细地址:{{ alarmInfo.position }} + + + + + + + diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue new file mode 100644 index 0000000..d2bab9f --- /dev/null +++ b/src/views/overview/overviewAmap.vue @@ -0,0 +1,751 @@ + + + + + + + + + + + + + diff --git a/src/views/system/user/editUser.vue b/src/views/system/user/editUser.vue index d22cd09..c9eb42f 100644 --- a/src/views/system/user/editUser.vue +++ b/src/views/system/user/editUser.vue @@ -1,10 +1,10 @@ - + - + @@ -52,17 +52,16 @@ - - + + - + - - + @@ -94,17 +93,16 @@ import { toTreeList } from '@/utils/structure' import SelectTree from '@/components/SelectTree/singleSelect' import DeptSelect from '@/components/DeptSelect' -// import { getDeptTreeList } from '@/api/system/dept' +import { regularReg } from '@/utils/validate' import { getRoleTreeList } from '@/api/system/role' import { addUser, updateUser } from '@/api/system/user' -import { RSAencrypt } from '../../../utils/security' +import { RSAencrypt } from '@/utils/security' export default { name: 'EditUser', components: { SelectTree, DeptSelect }, data() { const validatePass = (rule, value, callback) => { - console.log('验证密码') if (value === '') { callback(new Error('密码不能为空')) } else { @@ -115,7 +113,6 @@ } } const validatePass2 = (rule, value, callback) => { - console.log('验证重复密码') if (value === '') { callback(new Error('重复密码不能为空')) } else if (value !== this.userForm.password) { @@ -139,35 +136,14 @@ rePassword: '', // 重复密码 birthday: '' }, // 表单 - deptProps: { - parent: 'pid', - value: 'id', - label: 'name', - children: 'children' - }, - roleProps: { - parent: 'pid', - value: 'id', - label: 'name', - children: 'children' - }, - deptTreeList: null, // 组织树列表数据 + deptProps: { parent: 'pid', value: 'id', label: 'name', children: 'children' }, + roleProps: { parent: 'pid', value: 'id', label: 'name', children: 'children' }, roleTreeList: null, // 角色树列表数据 - sexList: [ - { - label: '男', - value: '0' - }, - { - label: '女', - value: '1' - } - ], + sexList: this.$store.getters.sexList, // 性别选项 textMap: { - update: '编辑', - create: '新增' + update: '编辑用户', + create: '新增用户' }, // 表头显示标题 - ifdisabled: true, // 是否可修改 rules: { account: [{ required: true, message: '账号不能为空', trigger: ['blur', 'change'] }], name: [{ required: true, message: '姓名不能为空', trigger: ['blur', 'change'] }], @@ -175,34 +151,14 @@ rePassword: [{ required: true, validator: validatePass2, trigger: ['blur', 'change'] }], deptId: [{ required: true, message: '组织机构必选', trigger: ['blur', 'change'] }], roleid: [{ required: true, message: '角色必选', trigger: ['blur', 'change'] }], - email: [{ - required: false, // 是否必填 - message: '请输入邮箱地址', // 错误提示信息 - trigger: 'blur'// 检验方式(blur为鼠标点击其他地方,) - }, - { - type: 'email', // 要检验的类型(number,email,date等) - message: '请输入正确的邮箱地址', - trigger: ['blur', 'change'] }], - phone: [{ - required: false, - pattern: /^1[34578]\d{9}$/, // 可以写正则表达式呦呦呦 - message: '请输入正确的手机号', - trigger: ['blur', 'change'] }] + email: [{ required: false, message: '请输入邮箱地址', trigger: 'blur' }, { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }], + phone: [{ required: false, pattern: regularReg.mobile, message: '请输入正确的手机号', trigger: ['blur', 'change'] }] }, // 前端校验规则 - roleName: '', - deptShow: true, + roleName: '', // 角色名,展示用 btnLoading: false // 保存按钮的加载中状态 } }, - computed: { - userTree: function() { - const tree = toTreeList(this.userTreeList) - console.log(tree) - return tree - } - }, - mounted: function() { + created() { this.fetchRoleTree() }, methods: { @@ -211,15 +167,12 @@ this.dialogStatus = dialogStatus this.dialogFormVisible = true this.btnLoading = false - this.fetchRoleTree() if (dialogStatus === 'create') { // 如果是新增,清除验证 - this.ifdisabled = false this.resetForm() this.$nextTick(() => { this.$refs['dataForm'].clearValidate() }) } else if (dialogStatus === 'update') { // 如果是修改,将row中数据填写到输入框中 - this.ifdisabled = true this.userForm = { id: row.id, // 编号 account: row.account, // 账号 @@ -239,11 +192,9 @@ // 加载角色树形下拉菜单 fetchRoleTree: function() { getRoleTreeList(this.listQuery).then(response => { - console.log('fetchRoleTree:') console.log(response.data) - if (response.data.list) { + if (response.data.list) { // 将列表转树结构 this.roleTreeList = toTreeList(response.data.list, '0', true) - console.log(this.roleTreeList) } }) }, @@ -327,10 +278,6 @@ diff --git a/src/components/SelectTree/singleSelect.vue b/src/components/SelectTree/singleSelect.vue index f36bdd5..d05eb37 100644 --- a/src/components/SelectTree/singleSelect.vue +++ b/src/components/SelectTree/singleSelect.vue @@ -17,6 +17,8 @@ :expand-on-click-node="false" :filter-node-method="filterNode" :default-expand-all="false" + :default-expanded-keys="defaultExpandedKeys" + node-key="id" highlight-current accordion @node-click="onClickNode" @@ -81,6 +83,10 @@ label: 'areaName', children: 'children' }) + }, + defaultExpandedKeys: { + type: Array, + default: () => [] } }, data() { diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 12bdcf2..98e4748 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -13,7 +13,7 @@ children: [ { path: '/overview', - component: () => import('@/views/overview/overview'), + component: () => import('@/views/overview/overviewAmap'), name: 'overview', meta: { title: '窨井状态总览', icon: 'icon-config', permission: ['/overview/wellList'] } } diff --git a/src/store/getters.js b/src/store/getters.js index cc83193..c6a860e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -35,8 +35,11 @@ fixedHeader: state => state.settings.fixedHeader, // 固定高度 sidebarLogo: state => state.settings.sidebarLogo, // logo bodyHeight: state => state.settings.bodyHeight, // 内容高度 + amapKey: state => state.settings.amapKey, // 高德地图key + amapSecurityCode: state => state.settings.amapSecurityCode, // 高德地图安全码 websocket: state => state.websocket.websocket, // websocket对象 wsStatus: state => state.websocket.wsStatus, // websocket连接状态 - needRefresh: state => state.websocket.needRefresh // 是否需要刷新 + needRefresh: state => state.websocket.needRefresh, // 是否需要刷新 + sexList: state => state.dict.sexList // 性别列表 } export default getters diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..8f5de49 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,17 @@ +const state = { + sexList: [{ label: '男', value: '0' }, { label: '女', value: '1' }] +} + +const mutations = { +} + +const actions = { +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 41bfbf5..856b38a 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -10,7 +10,9 @@ tagsView: tagsView, // 是否显示tagsView fixedHeader: fixedHeader, // 是否固定面包屑 sidebarLogo: sidebarLogo, // 是否显示logo - bodyHeight: 400 // 内容高度 + bodyHeight: 400, // 内容高度 + amapSecurityCode: '182a2c5889f7fe6d90546d9b8f4781ad', // 安全密钥 + amapKey: 'e1733551f35b56f6d8e9c0a9d4c2523b' // 高德地图key } const mutations = { diff --git a/src/utils/structure.js b/src/utils/structure.js index 4c65ee7..13bfb99 100644 --- a/src/utils/structure.js +++ b/src/utils/structure.js @@ -27,7 +27,7 @@ * @param isSelect 是否是下拉需要顶级的树 * @returns {*} */ -export function toTreeList(plainList, id = '0', isSelect = false) { +export function toTreeList(plainList, rootId = '0', isSelect = false) { const pid = findPid(plainList) if (pid.length > 1) { return plainList diff --git a/src/utils/validate.js b/src/utils/validate.js index dbecf7a..223c280 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -88,3 +88,11 @@ return false } } + +/** + * 常用正则表达式 + */ +export const regularReg = { + password: '', // 密码 + mobile: /^1[34578]\d{9}$/ // 手机号码 +} diff --git a/src/views/overview/components/alarmInfoWindow.vue b/src/views/overview/components/alarmInfoWindow.vue new file mode 100644 index 0000000..1eb1f61 --- /dev/null +++ b/src/views/overview/components/alarmInfoWindow.vue @@ -0,0 +1,39 @@ + + + + + + {{ alarmInfo.wellCode }} + + + + 告警原因:{{ alarm.alarmContent }} + 设备编号:{{ alarm.devcode }} + + + 井类型:{{ alarmInfo.wellTypeName }} + 权属单位:{{ alarmInfo.deptName }} + 详细地址:{{ alarmInfo.position }} + + + + + + + diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue new file mode 100644 index 0000000..d2bab9f --- /dev/null +++ b/src/views/overview/overviewAmap.vue @@ -0,0 +1,751 @@ + + + + + + + + + + + + + diff --git a/src/views/system/user/editUser.vue b/src/views/system/user/editUser.vue index d22cd09..c9eb42f 100644 --- a/src/views/system/user/editUser.vue +++ b/src/views/system/user/editUser.vue @@ -1,10 +1,10 @@ - + - + @@ -52,17 +52,16 @@ - - + + - + - - + @@ -94,17 +93,16 @@ import { toTreeList } from '@/utils/structure' import SelectTree from '@/components/SelectTree/singleSelect' import DeptSelect from '@/components/DeptSelect' -// import { getDeptTreeList } from '@/api/system/dept' +import { regularReg } from '@/utils/validate' import { getRoleTreeList } from '@/api/system/role' import { addUser, updateUser } from '@/api/system/user' -import { RSAencrypt } from '../../../utils/security' +import { RSAencrypt } from '@/utils/security' export default { name: 'EditUser', components: { SelectTree, DeptSelect }, data() { const validatePass = (rule, value, callback) => { - console.log('验证密码') if (value === '') { callback(new Error('密码不能为空')) } else { @@ -115,7 +113,6 @@ } } const validatePass2 = (rule, value, callback) => { - console.log('验证重复密码') if (value === '') { callback(new Error('重复密码不能为空')) } else if (value !== this.userForm.password) { @@ -139,35 +136,14 @@ rePassword: '', // 重复密码 birthday: '' }, // 表单 - deptProps: { - parent: 'pid', - value: 'id', - label: 'name', - children: 'children' - }, - roleProps: { - parent: 'pid', - value: 'id', - label: 'name', - children: 'children' - }, - deptTreeList: null, // 组织树列表数据 + deptProps: { parent: 'pid', value: 'id', label: 'name', children: 'children' }, + roleProps: { parent: 'pid', value: 'id', label: 'name', children: 'children' }, roleTreeList: null, // 角色树列表数据 - sexList: [ - { - label: '男', - value: '0' - }, - { - label: '女', - value: '1' - } - ], + sexList: this.$store.getters.sexList, // 性别选项 textMap: { - update: '编辑', - create: '新增' + update: '编辑用户', + create: '新增用户' }, // 表头显示标题 - ifdisabled: true, // 是否可修改 rules: { account: [{ required: true, message: '账号不能为空', trigger: ['blur', 'change'] }], name: [{ required: true, message: '姓名不能为空', trigger: ['blur', 'change'] }], @@ -175,34 +151,14 @@ rePassword: [{ required: true, validator: validatePass2, trigger: ['blur', 'change'] }], deptId: [{ required: true, message: '组织机构必选', trigger: ['blur', 'change'] }], roleid: [{ required: true, message: '角色必选', trigger: ['blur', 'change'] }], - email: [{ - required: false, // 是否必填 - message: '请输入邮箱地址', // 错误提示信息 - trigger: 'blur'// 检验方式(blur为鼠标点击其他地方,) - }, - { - type: 'email', // 要检验的类型(number,email,date等) - message: '请输入正确的邮箱地址', - trigger: ['blur', 'change'] }], - phone: [{ - required: false, - pattern: /^1[34578]\d{9}$/, // 可以写正则表达式呦呦呦 - message: '请输入正确的手机号', - trigger: ['blur', 'change'] }] + email: [{ required: false, message: '请输入邮箱地址', trigger: 'blur' }, { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }], + phone: [{ required: false, pattern: regularReg.mobile, message: '请输入正确的手机号', trigger: ['blur', 'change'] }] }, // 前端校验规则 - roleName: '', - deptShow: true, + roleName: '', // 角色名,展示用 btnLoading: false // 保存按钮的加载中状态 } }, - computed: { - userTree: function() { - const tree = toTreeList(this.userTreeList) - console.log(tree) - return tree - } - }, - mounted: function() { + created() { this.fetchRoleTree() }, methods: { @@ -211,15 +167,12 @@ this.dialogStatus = dialogStatus this.dialogFormVisible = true this.btnLoading = false - this.fetchRoleTree() if (dialogStatus === 'create') { // 如果是新增,清除验证 - this.ifdisabled = false this.resetForm() this.$nextTick(() => { this.$refs['dataForm'].clearValidate() }) } else if (dialogStatus === 'update') { // 如果是修改,将row中数据填写到输入框中 - this.ifdisabled = true this.userForm = { id: row.id, // 编号 account: row.account, // 账号 @@ -239,11 +192,9 @@ // 加载角色树形下拉菜单 fetchRoleTree: function() { getRoleTreeList(this.listQuery).then(response => { - console.log('fetchRoleTree:') console.log(response.data) - if (response.data.list) { + if (response.data.list) { // 将列表转树结构 this.roleTreeList = toTreeList(response.data.list, '0', true) - console.log(this.roleTreeList) } }) }, @@ -327,10 +278,6 @@