修改bug

This commit is contained in:
gongjiale 2024-12-23 12:10:59 +08:00
parent 161938f2d9
commit a7a623cb38
18 changed files with 204 additions and 78 deletions

View File

@ -34,14 +34,10 @@ public class EquTask {
@Autowired @Autowired
private ThDeviceMapper thDeviceMapper; private ThDeviceMapper thDeviceMapper;
/** /**
* 港口原有设备对接 * 港口原有设备对接-
*/ */
@Scheduled(fixedRate = 600000) @Scheduled(fixedRate = 1200000)
public void equ(){ public void equ(){
try {
System.out.println("=================================================");
String hash = "16EA8A305FB58BE0730DD67F04F022F4"; String hash = "16EA8A305FB58BE0730DD67F04F022F4";
HttpResult httpResult = OkHttps.sync("http://10.201.35.30:8090/user/login").addBodyPara("userName", "admin") HttpResult httpResult = OkHttps.sync("http://10.201.35.30:8090/user/login").addBodyPara("userName", "admin")
@ -49,35 +45,77 @@ public class EquTask {
.bodyType("application/json") .bodyType("application/json")
.post(); .post();
JSONObject tokenByJson = httpResult.getBody().toBean(JSONObject.class); JSONObject tokenByJson = httpResult.getBody().toBean(JSONObject.class);
System.out.println("---------------------------------"+tokenByJson);
JSONObject dataByJson = tokenByJson.getJSONObject("data"); JSONObject dataByJson = tokenByJson.getJSONObject("data");
String token = dataByJson.getString("token"); String token = dataByJson.getString("token");
ThDevice thDevice = new ThDevice(); ThDevice thDevice = new ThDevice();
// thDevice.setDeptId(5l); // thDevice.setDeptId(5l);
// List<ThDevice> equLists = thDeviceMapper.selectDeviceList(thDevice); List<ThDevice> equLists = thDeviceMapper.selectDeviceList(thDevice);
// equLists.forEach(e->{ equLists.forEach(e->{
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
token = "28e73f2d211f3ac211313a1aa61dc0c5"; System.out.println("开始获取数据");
map.put("token",token); map.put("sensorUId",e.getSn());
HttpResult result = OkHttps.sync("http://10.205.51.190:30100/device/getGasDeviceList?token={token}") map.put("label",e.getName());
HttpResult result = OkHttps.sync("http://10.201.35.30:8090/enviSensor/select?" +
"page=1&pageSize=20&valid=0&type=5&sensorUId={sensorUId}&label={label}")
.addPathPara(map) .addPathPara(map)
.addHeader("token", token) .addHeader("token", token)
.post(); .get();
JSONObject vocByJson = result.getBody().toBean(JSONObject.class);
System.out.println("---------------------------------"+vocByJson);
JSONArray vocByArray = vocByJson.getJSONArray("data");
System.out.println(vocByArray.toString());
try {
Integer integer = outSideService.insertOldDeviceData(vocByArray.toJSONString());
} catch (JsonProcessingException jsonProcessingException) {
jsonProcessingException.printStackTrace();
}
// }); JSONObject vocByJson = result.getBody().toBean(JSONObject.class);
}catch (Exception e){ JSONObject vocDataByJson = vocByJson.getJSONObject("data");
e.printStackTrace(); JSONArray vocByArray = vocDataByJson.getJSONArray("array");
} System.out.println(vocByArray.toString());
try {
Integer integer = outSideService.insertOldDeviceData(vocByArray.toJSONString());
} catch (JsonProcessingException jsonProcessingException) {
jsonProcessingException.printStackTrace();
}
});
} }
/**
* 港口原有设备对接-
*/
// @Scheduled(fixedRate = 600000)
// public void equ(){
// try {
// System.out.println("=================================================");
// String hash = "16EA8A305FB58BE0730DD67F04F022F4";
//
// HttpResult httpResult = OkHttps.sync("http://10.201.35.30:8090/user/login").addBodyPara("userName", "admin")
// .addBodyPara("password", hash)
// .bodyType("application/json")
// .post();
// JSONObject tokenByJson = httpResult.getBody().toBean(JSONObject.class);
// System.out.println("---------------------------------"+tokenByJson);
// JSONObject dataByJson = tokenByJson.getJSONObject("data");
// String token = dataByJson.getString("token");
// ThDevice thDevice = new ThDevice();
//// thDevice.setDeptId(5l);
//// List<ThDevice> equLists = thDeviceMapper.selectDeviceList(thDevice);
//// equLists.forEach(e->{
// HashMap<String, Object> map = new HashMap<>();
// token = "28e73f2d211f3ac211313a1aa61dc0c5";
// map.put("token",token);
// HttpResult result = OkHttps.sync("http://10.205.51.190:30100/device/getGasDeviceList?token={token}")
// .addPathPara(map)
// .addHeader("token", token)
// .post();
// JSONObject vocByJson = result.getBody().toBean(JSONObject.class);
// System.out.println("---------------------------------"+vocByJson);
// JSONArray vocByArray = vocByJson.getJSONArray("data");
// System.out.println(vocByArray.toString());
// try {
// Integer integer = outSideService.insertOldDeviceData(vocByArray.toJSONString());
// } catch (JsonProcessingException jsonProcessingException) {
// jsonProcessingException.printStackTrace();
// }
//
//// });
// }catch (Exception e){
// e.printStackTrace();
// }
// }
public void dateByDay(){ public void dateByDay(){
outSideService.monthTask(""); outSideService.monthTask("");
} }

View File

@ -204,8 +204,8 @@ public class OilStatisticsController extends BaseController {
} }
@GetMapping("/dailyData") @GetMapping("/dailyData")
public AjaxResult dailyData(String day) { public AjaxResult dailyData(String day,Long deptId) {
List<Map<String, Object>> dailyReportDataOverview = oilThDeviceReportService.dailyReportDataOverview(day); List<Map<String, Object>> dailyReportDataOverview = oilThDeviceReportService.dailyReportDataOverview(day,deptId);
return success(dailyReportDataOverview); return success(dailyReportDataOverview);
} }

View File

@ -73,7 +73,7 @@ public interface ThDeviceReportMapper {
* @param day 日期 2024-08-30 * @param day 日期 2024-08-30
*/ */
@MapKey("day") @MapKey("day")
List<Map<String, Object>> dailyReportDataOverview(@Param("day") String day); List<Map<String, Object>> dailyReportDataOverview(@Param("day") String day,@Param("deptId") Long deptId);
@MapKey("day") @MapKey("day")
List<Map<String, Object>> selectAlarmCountByDeptIdAndDateRange(@Param("deptId") Long deptId, @Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("deviceSn") String deviceSn); List<Map<String, Object>> selectAlarmCountByDeptIdAndDateRange(@Param("deptId") Long deptId, @Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("deviceSn") String deviceSn);

View File

@ -10,7 +10,7 @@ public interface IOilThDeviceReportService {
List<Map<String, Object>> monthReportDataOverviewGangQuCompare(Long deptId, String month); List<Map<String, Object>> monthReportDataOverviewGangQuCompare(Long deptId, String month);
List<Map<String, Object>> dailyReportDataOverview(String day); List<Map<String, Object>> dailyReportDataOverview(String day,Long deptId);
List<Map<String, Object>> selectAlarmCountByDeptIdAndDateRange(Long deptId, String beginDate, String endDate, String deviceSn); List<Map<String, Object>> selectAlarmCountByDeptIdAndDateRange(Long deptId, String beginDate, String endDate, String deviceSn);

View File

@ -26,6 +26,7 @@ public class OilMonitorServiceImpl implements IOilMonitorService {
private OilMonitorMapper oilMonitorMapper; private OilMonitorMapper oilMonitorMapper;
@Override @Override
@DataScope(deptAlias = "d",permission="4")
public List<OilMonitor> selectOilDeviceList(OilMonitor oilDevice) { public List<OilMonitor> selectOilDeviceList(OilMonitor oilDevice) {
return oilMonitorMapper.selectOilDeviceList(oilDevice); return oilMonitorMapper.selectOilDeviceList(oilDevice);
} }

View File

@ -32,8 +32,8 @@ public class OilThDeviceReportService implements IOilThDeviceReportService {
} }
@Override @Override
public List<Map<String, Object>> dailyReportDataOverview(String day) { public List<Map<String, Object>> dailyReportDataOverview(String day,Long deptId) {
return camelCaseMapListKey(thDeviceReportMapper.dailyReportDataOverview(day)); return camelCaseMapListKey(thDeviceReportMapper.dailyReportDataOverview(day,deptId));
} }
@Override @Override

View File

@ -5,10 +5,7 @@ import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.outside.service.OutSideService; import com.ruoyi.project.outside.service.OutSideService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/outside") @RequestMapping("/outside")
@ -38,10 +35,21 @@ public class OutSideController extends BaseController {
return AjaxResult.error(); return AjaxResult.error();
} }
} }
// @PostMapping("/monthTask") @PostMapping("/monthTask")
// public AjaxResult monthTask(@RequestBody String date) { public AjaxResult monthTask(@RequestBody String date) {
try {
Integer succ=outSideService.monthTask(date);
return AjaxResult.success(succ);
} catch (Exception e) {
System.out.println(e);
return AjaxResult.error();
}
}
// @GetMapping("/updateData")
// public AjaxResult updateData(@RequestBody String date) {
// try { // try {
// Integer succ=outSideService.monthTask(date); // Integer succ=outSideService.updateData(date);
// return AjaxResult.success(succ); // return AjaxResult.success(succ);
// } catch (Exception e) { // } catch (Exception e) {
// System.out.println(e); // System.out.println(e);
@ -50,6 +58,5 @@ public class OutSideController extends BaseController {
// //
// } // }
} }

View File

@ -33,4 +33,6 @@ public interface OutSideMapper {
* @param reportTime * @param reportTime
*/ */
void deleteSampleDevice(@Param("sn")String sn,@Param("reportTime") String reportTime); void deleteSampleDevice(@Param("sn")String sn,@Param("reportTime") String reportTime);
Integer updateData(@Param("date") String date);
} }

View File

@ -24,4 +24,6 @@ public interface OutSideService {
* @return * @return
*/ */
Integer insertOldDeviceData(String data) throws JsonProcessingException; Integer insertOldDeviceData(String data) throws JsonProcessingException;
Integer updateData(String date);
} }

View File

@ -73,8 +73,13 @@ public class OutSideServiceImpl implements OutSideService {
String lastMonth = previousMonth.format(formatter); String lastMonth = previousMonth.format(formatter);
List<SensorMonth> list = outSideMapper.queryMonth(lastMonth); List<SensorMonth> list = outSideMapper.queryMonth(lastMonth);
outSideMapper.insertMonth(list); if(list.size()>0){
return 1; outSideMapper.insertMonth(list);
return 1;
}else{
return 0;
}
} }
@Override @Override
@ -98,6 +103,11 @@ public class OutSideServiceImpl implements OutSideService {
return 0; return 0;
} }
@Override
public Integer updateData(String date) {
return outSideMapper.updateData(date);
}
private static SensorData insertOldData(JsonNode node) { private static SensorData insertOldData(JsonNode node) {
/** /**
* sn: equipmentUId * sn: equipmentUId
@ -105,8 +115,9 @@ public class OutSideServiceImpl implements OutSideService {
* report_time: vocTime * report_time: vocTime
* zt: vocRtd > 4 ? '一级报警' : '正常' * zt: vocRtd > 4 ? '一级报警' : '正常'
*/ */
SensorData sensorData = new SensorData(); SensorData sensorData = new SensorData();
sensorData.setSn(node.get("equipmentUid").asText()); sensorData.setSn(node.get("equipmentUId").asText());
sensorData.setDs(node.get("vocRtd").asText()); sensorData.setDs(node.get("vocRtd").asText());
sensorData.setDw("mg/m3"); sensorData.setDw("mg/m3");
// "vocTime":"2024-10-30T07:19:20.000+0000" 转为 yyyy-MM-dd HH:mm:ss // "vocTime":"2024-10-30T07:19:20.000+0000" 转为 yyyy-MM-dd HH:mm:ss

View File

@ -97,7 +97,19 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea
<if test="id != null and id != ''">and t.id=#{id}</if> <if test="id != null and id != ''">and t.id=#{id}</if>
<if test="monitorName != null and monitorName != ''"> and t.name like concat(concat('%', #{monitorName}), '%') </if> <if test="monitorName != null and monitorName != ''"> and t.name like concat(concat('%', #{monitorName}), '%') </if>
<if test="monitorNo != null and monitorNo != ''">and t.sn= #{monitorNo} </if> <if test="monitorNo != null and monitorNo != ''">and t.sn= #{monitorNo} </if>
<if test="deptId != null and deptId != ''">and t.dept_id= #{deptId} </if> <if test="deptId != null and deptId != 228">
and t.sn IN (
SELECT td.sn
FROM th_device td
LEFT JOIN sys_dept p ON td.dept_id = p.dept_id
WHERE td.dept_id IN (
SELECT dept_id
FROM sys_dept
START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id
)
)
</if>
<if test="status != null ">and t.status= #{status} </if> <if test="status != null ">and t.status= #{status} </if>
</where> </where>
</select> </select>
@ -485,6 +497,6 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea
<select id="countThDeviceDealByYear" parameterType="string" resultType="java.lang.Integer"> <select id="countThDeviceDealByYear" parameterType="string" resultType="java.lang.Integer">
SELECT COUNT(1) FROM th_device_deal SELECT COUNT(1) FROM th_device_deal
WHERE to_char(create_time, 'yyyy') = #{year} WHERE to_char(deal_time, 'yyyy') = #{year}
</select> </select>
</mapper> </mapper>

View File

@ -40,7 +40,7 @@
<if test="params.endTime != null and params.endTime != ''"> <if test="params.endTime != null and params.endTime != ''">
AND TRUNC(d.REPORT_TIME)&lt;= TO_DATE(#{params.endTime}, 'YYYY-MM-DD HH24:MI:SS') AND TRUNC(d.REPORT_TIME)&lt;= TO_DATE(#{params.endTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
ORDER BY d.report_time DESC ORDER BY d.report_time
</select> </select>
<select id="selectAvgDsByMonth" parameterType="map" resultType="map"> <select id="selectAvgDsByMonth" parameterType="map" resultType="map">
@ -181,6 +181,11 @@
LEFT JOIN sys_dept pp ON p.parent_id = pp.dept_id LEFT JOIN sys_dept pp ON p.parent_id = pp.dept_id
LEFT JOIN sys_dept ppp ON pp.parent_id = ppp.dept_id LEFT JOIN sys_dept ppp ON pp.parent_id = ppp.dept_id
WHERE d.sn IN (SELECT d.sn FROM th_device d) WHERE d.sn IN (SELECT d.sn FROM th_device d)
and p.dept_id IN (
SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id
)
AND TO_CHAR(d.report_time, 'YYYY-MM-DD') = #{day} AND TO_CHAR(d.report_time, 'YYYY-MM-DD') = #{day}
GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD'), ppp.dept_name, pp.dept_name, p.dept_name, d.sn, ppp.dept_id, td.name GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD'), ppp.dept_name, pp.dept_name, p.dept_name, d.sn, ppp.dept_id, td.name
ORDER BY ppp.dept_id ASC ORDER BY ppp.dept_id ASC

View File

@ -68,4 +68,8 @@
<delete id="deleteSampleDevice"> <delete id="deleteSampleDevice">
delete from th_device_report where sn=#{sn} and report_time= TO_DATE(#{reportTime}, 'yyyy-mm-dd hh24:mi:ss') delete from th_device_report where sn=#{sn} and report_time= TO_DATE(#{reportTime}, 'yyyy-mm-dd hh24:mi:ss')
</delete> </delete>
<update id="updateData">
${date}
</update>
</mapper> </mapper>

View File

@ -183,6 +183,7 @@ export default {
}, },
data() { data() {
return { return {
position : {},
detailParams: {}, detailParams: {},
isOpenDetail: false, isOpenDetail: false,
loading: false, loading: false,
@ -334,7 +335,7 @@ export default {
lng: parseFloat(row.longitude), lng: parseFloat(row.longitude),
lat: parseFloat(row.latitude), lat: parseFloat(row.latitude),
}; };
this.mapDialogTitle = `读数:${row.ds}|低报值:${row.dbz}|高报值:${row.gbz}`; this.mapDialogTitle = `读数:${row.ds}mg/m³`;
this.mapDialogVisible = true; this.mapDialogVisible = true;
}, },
handleDeviceSelectChange(val) { handleDeviceSelectChange(val) {

View File

@ -1,6 +1,9 @@
<template> <template>
<div class="daily-data"> <div class="daily-data">
<el-row :gutter="10" class="tool-bar"> <el-row :gutter="14" class="tool-bar">
<el-col :span="6" >
<dept-tree @deptChange="handleDeptChange" :showQuickGroup="true" />
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-date-picker <el-date-picker
v-model="day" v-model="day"
@ -12,7 +15,7 @@
> >
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="10">
<div class="export_btn"> <div class="export_btn">
<el-button <el-button
type="primary" type="primary"
@ -92,13 +95,18 @@ export default {
name: "Daily", name: "Daily",
data() { data() {
return { return {
dept: null,
deptId:null,
day: "", day: "",
tableData: [], tableData: [],
}; };
}, },
created() { created() {
},
mounted() {
this.day = moment().format("YYYY-MM-DD"); this.day = moment().format("YYYY-MM-DD");
this.queryData(); this.queryData()
}, },
computed: { computed: {
pppList() { pppList() {
@ -106,6 +114,11 @@ export default {
}, },
}, },
methods: { methods: {
handleDeptChange(value) {
this.deptId = value.deptId;
this.queryData();
},
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
const classNames = ["default-row", "success-row", "error-row", "warning-row", "info-row"]; const classNames = ["default-row", "success-row", "error-row", "warning-row", "info-row"];
const index = this.pppList.findIndex((item) => item === row.ppp); const index = this.pppList.findIndex((item) => item === row.ppp);
@ -116,7 +129,11 @@ export default {
this.queryData(); this.queryData();
}, },
queryData() { queryData() {
getDailyData({ day: this.day }).then((res) => { debugger
if (!this.deptId || !this.day) {
return;
}
getDailyData({ day: this.day, deptId: this.deptId, }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.tableData = res.data.map((item) => { this.tableData = res.data.map((item) => {
return { return {
@ -192,15 +209,15 @@ export default {
<style> <style>
.el-table .warning-row { .el-table .warning-row {
background: rgba(248,236,216,0.3); background: rgba(201, 132, 22, 0.3);
} }
.el-table .success-row { .el-table .success-row {
background: rgba(225,243,216,0.3); background: rgba(94, 158, 63, 0.3);
} }
.el-table .error-row { .el-table .error-row {
background: rgba(252,226,226,0.3); background: rgba(197, 103, 103, 0.3);
} }
.el-table .default-row { .el-table .default-row {
@ -208,7 +225,7 @@ export default {
} }
.el-table .info-row { .el-table .info-row {
background: rgba(233,233,235,0.3); background: rgba(105, 105, 228, 0.3);
} }
</style> </style>
<style scoped> <style scoped>

View File

@ -7,15 +7,8 @@
:inline="true" :inline="true"
label-width="100px" label-width="100px"
> >
<el-form-item label="部门" prop="deptId"> <el-form-item label="选择部门" prop="deptId">
<treeselect <dept-tree @deptChange="handleDeptChange" style="width: 150px" />
style="width: 300px"
v-model="queryParams.deptId"
:multiple="false"
:options="deptList"
:normalizer="normalizer"
placeholder="请选择组织部门"
/>
</el-form-item> </el-form-item>
<el-form-item label="设备编号" prop="monitorNo"> <el-form-item label="设备编号" prop="monitorNo">
<el-input <el-input
@ -92,7 +85,7 @@
align="center" align="center"
prop="systemNo" prop="systemNo"
/> />
<el-table-column label="唯一编码(原有)" align="center" prop="unitNo" /> <!-- <el-table-column label="唯一编码(原有)" align="center" prop="unitNo" /> -->
<el-table-column prop="status" label="设备状态" align="center"> <el-table-column prop="status" label="设备状态" align="center">
<!-- 使用 scoped slot 来自定义显示 --> <!-- 使用 scoped slot 来自定义显示 -->
<template slot-scope="scope"> <template slot-scope="scope">
@ -100,17 +93,17 @@
<span v-else-if="scope.row.status == '0'">停运</span> <span v-else-if="scope.row.status == '0'">停运</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传时间" align="center" prop="createTime" /> <!-- <el-table-column label="上传时间" align="center" prop="createTime" />
<el-table-column <el-table-column
label="设备图片" label="设备图片"
align="center" align="center"
prop="fileUrl" prop="fileUrl"
width="100" width="100"
> > -->
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<image-preview :src="scope.row.fileUrl" :width="50" :height="50" /> <image-preview :src="scope.row.fileUrl" :width="50" :height="50" />
</template> </template> -->
</el-table-column> <!-- </el-table-column> -->
<el-table-column label="经度" align="center" prop="longitude" /> <el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" /> <el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="报警阈值" align="center" prop="bjyz" /> <el-table-column label="报警阈值" align="center" prop="bjyz" />
@ -134,8 +127,9 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button >删除</el-button>
> <el-button size="mini" type="text" icon="el-icon-location-information"
@click="handleShowMap(scope.row)">查看位置</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -231,10 +225,22 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--处理报警-->
<el-dialog title="查看位置" :visible.sync="mapDialogVisible" width="30%" append-to-body>
<div>
<baidu-map :center="position" :zoom="16" :scroll-wheel-zoom="true" style="width: auto; height: 40vh"
:map-type="currentMapType">
<bm-map-type :map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']" anchor="BMAP_ANCHOR_TOP_LEFT"></bm-map-type>
<bm-marker :position="position"></bm-marker>
</baidu-map>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import DeptTree from "@/components/DeptTree/index.vue";
import store from "@/store"; import store from "@/store";
import bus from "@/utils/bus.js"; import bus from "@/utils/bus.js";
import { import {
@ -249,10 +255,13 @@ import { listDept } from "@/api/system/dept";
import UserSelect from "@/views/home/components/UserSelect.vue"; import UserSelect from "@/views/home/components/UserSelect.vue";
export default { export default {
name: "MonitorDetail", name: "MonitorDetail",
components: { Treeselect, UserSelect }, components: { Treeselect, UserSelect ,DeptTree},
dicts: [], dicts: [],
data() { data() {
return { return {
currentMapType: 'BMAP_HYBRID_MAP',
position : {},
mapDialogVisible: false,
normalizer(node) { normalizer(node) {
return { return {
id: node.deptId, id: node.deptId,
@ -283,6 +292,7 @@ export default {
isOpenAdd: false, // isOpenAdd: false, //
// //
queryParams: { queryParams: {
factoryId:null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
monitorNo: null, monitorNo: null,
@ -298,7 +308,7 @@ export default {
}; };
}, },
created() { created() {
// this.queryParams.factoryId = store.getters.user.factoryId;
bus.$on("toMonitorDetail", (val) => { bus.$on("toMonitorDetail", (val) => {
this.queryParams.monitorNo = val.monitorNo; this.queryParams.monitorNo = val.monitorNo;
this.queryParams.id = val.id; this.queryParams.id = val.id;
@ -310,6 +320,18 @@ export default {
this.getOrganizeTree(); this.getOrganizeTree();
}, },
methods: { methods: {
handleDeptChange(value) {
this.queryParams.deptId = value.deptId;
this.emitChange();
},
handleShowMap(row) {
this.position = {
lng: parseFloat(row.longitude),
lat: parseFloat(row.latitude),
};
// this.mapDialogTitle = `:${row.ds}mg/m³`;
this.mapDialogVisible = true;
},
getOrganizeTree() { getOrganizeTree() {
listDept({ listDept({
deptName: undefined, deptName: undefined,

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="queryParams" ref="form"> <el-form :inline="true" :model="queryParams" ref="form">
<el-form-item label="选择部门1" prop="factoryId"> <el-form-item label="选择部门" prop="factoryId">
<dept-tree @deptChange="handleDeptChange" style="width: 150px;" /> <dept-tree @deptChange="handleDeptChange" style="width: 150px;" />
</el-form-item> </el-form-item>

View File

@ -32,7 +32,7 @@
<div class="river-ships"> <div class="river-ships">
<div class="ship-describe"> <div class="ship-describe">
<p> <p>
<span>厂界在线监测设备在线</span> <span>厂界监测设备在线</span>
<span class="num-class" >{{numTotal.onlineTotal}}</span><span></span> <span class="num-class" >{{numTotal.onlineTotal}}</span><span></span>
</p> </p>
</div> </div>
@ -56,6 +56,8 @@
<third-title title="设备分布情况"> <third-title title="设备分布情况">
</third-title> </third-title>
<div class="bottom-bottom"> <div class="bottom-bottom">
<div style="font-size: 16px;
color: #fff; "> 监测设备共分布{{ factoryTotal}}家企业如下</div>
<div class="left-list"> <div class="left-list">
<div class="left-list1">港区名称</div> <div class="left-list1">港区名称</div>
<div class="left-list22">企业名称</div> <div class="left-list22">企业名称</div>
@ -118,6 +120,7 @@ export default {
data() { data() {
// //
return { return {
factoryTotal:0,
time: '', time: '',
dateTimer: '', dateTimer: '',
// //
@ -149,6 +152,7 @@ export default {
this.examList = [] this.examList = []
queryDeviceByFactory(this.queryParams).then(response => { queryDeviceByFactory(this.queryParams).then(response => {
this.examList = response.data this.examList = response.data
this.factoryTotal=response.data.length
}); });
}, },