feat: 远程调度-厂界在线页面前后端

This commit is contained in:
LokerL 2024-10-20 13:38:57 +08:00
parent 1c6e360d91
commit be99d7e3e0
15 changed files with 1012 additions and 369 deletions

View File

@ -8,6 +8,7 @@ import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.oil.domain.OilDevice;
import com.ruoyi.project.oil.domain.OilDeviceDetail;
import com.ruoyi.project.oil.domain.monitor.ThDevice;
import com.ruoyi.project.oil.service.IOilDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -37,6 +38,12 @@ public class OilDeviceController extends BaseController {
private IOilDeviceService oilDeviceService;
@GetMapping("/thList")
public TableDataInfo list(ThDevice thDevice) {
startPage();
List<ThDevice> list = oilDeviceService.selectDeviceList(thDevice);
return getDataTable(list);
}
/**

View File

@ -140,6 +140,43 @@ public class ThDevice extends BaseEntity {
this.gangqu = gangqu;
}
private String p;
private String pp;
private String ppp;
private String bjyz;
public String getP() {
return p;
}
public void setP(String p) {
this.p = p;
}
public String getPp() {
return pp;
}
public void setPp(String pp) {
this.pp = pp;
}
public String getPpp() {
return ppp;
}
public void setPpp(String ppp) {
this.ppp = ppp;
}
public String getBjyz() {
return bjyz;
}
public void setBjyz(String bjyz) {
this.bjyz = bjyz;
}
/**
* 单位
*/

View File

@ -21,6 +21,13 @@ public interface ThDeviceMapper {
*/
List<ThDevice> selectAllDeviceListByDeptId(Long deptId);
/**
* 查询设备列表
* @param thDevice 设备
* @return 设备列表
*/
List<ThDevice> selectDeviceList(ThDevice thDevice);
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.project.oil.service;
import com.ruoyi.project.oil.domain.OilDevice;
import com.ruoyi.project.oil.domain.OilDeviceDetail;
import com.ruoyi.project.oil.domain.monitor.ThDevice;
import java.util.List;
@ -12,6 +13,9 @@ import java.util.List;
* @date 2023-07-08
*/
public interface IOilDeviceService {
List<ThDevice> selectDeviceList(ThDevice thDevice);
/**
* 查询检测设备
*

View File

@ -4,7 +4,9 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.project.oil.domain.OilDevice;
import com.ruoyi.project.oil.domain.OilDeviceDetail;
import com.ruoyi.project.oil.domain.monitor.ThDevice;
import com.ruoyi.project.oil.mapper.OilDeviceMapper;
import com.ruoyi.project.oil.mapper.ThDeviceMapper;
import com.ruoyi.project.oil.service.IOilDeviceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -30,9 +32,21 @@ public class OilDeviceServiceImpl implements IOilDeviceService {
@Autowired
private OilDeviceMapper oilDeviceMapper;
@Autowired
private ThDeviceMapper thDeviceMapper;
@Autowired
private JdbcTemplate jdbcTemplate;
/**
* 查询检测设备列表
*
*/
@Override
public List<ThDevice> selectDeviceList(ThDevice thDevice) {
return thDeviceMapper.selectDeviceList(thDevice);
}
/**
* 查询检测设备
*

View File

@ -1,6 +1,8 @@
package com.ruoyi.project.system.controller;
import java.util.List;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -39,6 +41,7 @@ public class SysDeptController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list")
@DataScope(deptAlias="d", permission="4")
public AjaxResult list(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);

View File

@ -3,6 +3,11 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.oil.mapper.ThDeviceMapper">
<parameterMap id="BaseParameterMap" type="com.ruoyi.project.oil.domain.monitor.ThDevice">
<parameter property="sn" jdbcType="VARCHAR"/>
<parameter property="name" jdbcType="VARCHAR"/>
<parameter property="deptId" jdbcType="BIGINT"/>
</parameterMap>
<resultMap id="BaseResultMap" type="com.ruoyi.project.oil.domain.monitor.ThDevice">
<id property="id" column="id" jdbcType="BIGINT"/>
@ -20,7 +25,11 @@
<result property="longitude" column="longitude" jdbcType="VARCHAR"/>
<result property="latitude" column="latitude" jdbcType="VARCHAR"/>
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
<result property="bjyz" column="bjyz" jdbcType="VARCHAR"/>
<result property="gangqu" column="gangqu" jdbcType="VARCHAR"/>
<result property="p" column="p" jdbcType="VARCHAR"/>
<result property="pp" column="pp" jdbcType="VARCHAR"/>
<result property="ppp" column="ppp" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
@ -45,6 +54,45 @@
left join sys_dept pp on p.parent_id = pp.dept_id
</sql>
<select id="selectDeviceList" resultMap="BaseResultMap" parameterType="com.ruoyi.project.oil.domain.monitor.ThDevice">
select d.id,
d.sn,
d.name,
d.create_by,
d.create_time,
d.status,
d.note,
d.file_url,
d.update_by,
d.update_time,
d.address,
d.dept_id,
d.longitude,
d.latitude,
d.bjyz,
p.dept_name as "p",
pp.dept_name as "pp",
ppp.dept_name as "ppp"
from th_device d
LEFT JOIN sys_dept p ON d.dept_id = p.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
<where>
<if test="deptId != null and deptId != ''">
AND d.dept_id IN (SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id)
</if>
<if test="sn != null and sn != ''">
AND d.sn like concat(concat('%',#{sn}),'%')
</if>
<if test="name != null and name != ''">
AND d.name like concat(concat('%',#{name}),'%')
</if>
</where>
order by d.id desc
</select>
<select id="selectDeviceListByDeptId" parameterType="long" resultMap="BaseResultMap">
<include refid="Base_Column_List"/>
where d.dept_id = #{deptId}

View File

@ -20,7 +20,6 @@
d.sn,
d.report_time,
d.SBZT,
d.kcjd,
d.lc,
d.dw,
d.zt,

View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getThList(params) {
return request({
url: '/device/thList',
params: params,
method: 'get',
})
}

View File

@ -87,7 +87,7 @@ export default {
const rootDept = this.deptList[0];
this.firstChildList = rootDept.children;
this.deptId = this.multiple ? this.firstChildList.map(item => item.deptId) : rootDept.deptId;
this.$emit("deptChange", this.multiple ? [rootDept] : rootDept);
// this.$emit("deptChange", this.multiple ? [rootDept] : rootDept);
} else {
console.error(response);
this.$message.error(response.msg);

View File

@ -0,0 +1,167 @@
<template>
<el-dialog
title="下发通知"
:visible.sync="openConfig1"
:before-close="handleClose"
>
<div style="display: inline-flex; height: 30px; line-height: 30px">
<el-button class="agreeButton" style="width: 120px" @click="chooseUser1()"
>选择联系人</el-button
>
<div style="margin-right: 5px">
<span style="margin-left: 2px" v-for="item in userList">{{
item.nickName
}}</span>
</div>
</div>
<div style="margin: 10px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入消息内容..."
v-model="shareContent"
>
</el-input>
</div>
<user-select
v-if="isShowUser"
:isShowUser="isShowUser"
@closeUser="closeUser"
@chooseUser="chooseUser"
/>
<div style="margin-left: 5px; height: 50px">
<el-checkbox v-model="isSendPhone">同时发送短信</el-checkbox>
</div>
<div style="margin-left: 5px; height: 50px">
<el-button class="agreeButton" @click="sendMsg">发送</el-button>
</div>
</el-dialog>
</template>
<script>
import bus from "@/utils/bus.js";
import { sendMessage } from "@/api/home";
import { addAlarm } from "@/api/demostrate/monitor";
import UserSelect from "@/views/home/components/UserSelect.vue";
export default {
components: { UserSelect },
props: {
shareContent: {
type: String,
default: "",
},
isOpenMsg: {
type: Boolean,
default: false,
},
},
watch: {
isOpenMsg: {
handler(newVal, oldVal) {
this.openConfig1 = newVal;
},
deep: true,
immediate: true,
},
},
data() {
return {
isSendPhone: false,
isShowUser: false,
userList: [],
phoneList: [],
shareContent: "",
openConfig1: false,
};
},
methods: {
sendMsg() {
let readList = [];
this.phoneList = [];
this.userList.forEach((element) => {
readList.push(element.userName);
this.phoneList.push(element.phonenumber);
});
let params = {
phoneList: this.phoneList,
isSendPhone: this.isSendPhone,
readerList: readList,
sendText: this.shareContent,
sendType: "设备报警",
};
sendMessage(params).then((response) => {
if (response.code == 200) {
this.$message.success("消息发送成功!");
}
});
},
closeUser(val) {
this.isShowUser = val;
},
chooseUser1() {
this.isShowUser = true;
},
//
chooseUser(val) {
if (val && val.length < 1) {
this.$message.error("请至少选择一名处理人员!");
this.isShowUser = false;
} else {
this.userList = val;
this.isShowUser = false;
}
},
//
handleClose() {
this.openConfig1 = false;
this.$emit("closeMsg", false);
},
},
mounted() {},
};
</script>
<style lang="scss" scoped>
.title {
padding-left: 20px;
color: #212121;
font-size: 16px;
margin-bottom: 10px;
margin-top: 10px;
background: url("~@/assets/ucs/biaoti.png") no-repeat;
background-position-y: 7px;
}
.agreeButton {
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: 0.1s;
transition: 0.1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
}
.agreeButton:hover {
background: #65a5f9;
border-color: #65a5f9;
color: #fff;
}
</style>

View File

@ -1,181 +1,196 @@
<template>
<el-dialog title="下发通知" :visible.sync="openConfig1" :before-close="handleClose">
<div style="display: inline-flex; height: 30px;
line-height: 30px;">
<el-button class="agreeButton" style="width: 120px;" @click="chooseUser1()">选择联系人</el-button>
<div style="margin-right: 5px;"><span style="margin-left:2px;" v-for="item in userList">{{ item.nickName
}}</span></div>
</div>
<div style="margin:10px">
<el-input type="textarea" :rows="2" placeholder="请输入消息内容..." v-model="shareContent">
</el-input>
</div>
<el-dialog
title="下发通知"
:visible.sync="openConfig1"
:before-close="handleClose"
>
<div style="display: inline-flex; height: 30px; line-height: 30px">
<el-button class="agreeButton" style="width: 120px" @click="chooseUser1()"
>选择联系人</el-button
>
<div style="margin-right: 5px">
<span style="margin-left: 2px" v-for="item in userList">{{
item.nickName
}}</span>
</div>
</div>
<div style="margin: 10px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入消息内容..."
v-model="shareContent"
>
</el-input>
</div>
<user-select v-if="isShowUser" :isShowUser="isShowUser" @closeUser="closeUser" @chooseUser="chooseUser" />
<user-select
v-if="isShowUser"
:isShowUser="isShowUser"
@closeUser="closeUser"
@chooseUser="chooseUser"
/>
<div style="margin-left:5px;height: 50px;"> <el-checkbox v-model="isSendPhone">同时发送短信</el-checkbox></div>
<div style="margin-left: 5px; height: 50px">
<el-checkbox v-model="isSendPhone">同时发送短信</el-checkbox>
</div>
<div style="margin-left:5px;height: 50px;"> <el-button class="agreeButton" @click="sendMsg">发送</el-button></div>
</el-dialog>
<div style="margin-left: 5px; height: 50px">
<el-button class="agreeButton" @click="sendMsg">发送</el-button>
</div>
</el-dialog>
</template>
<script>
import bus from '@/utils/bus.js'
import bus from "@/utils/bus.js";
import { sendMessage } from "@/api/home";
import { addAlarm } from "@/api/demostrate/monitor";
import UserSelect from "@/views/home/components/UserSelect.vue";
export default {
components: { UserSelect },
props: {
deviceInfo: {
type: Object,
default: {}
},
isOpenMsg: {
type: Boolean,
default: false
},
components: { UserSelect },
props: {
deviceInfo: {
type: Object,
default: {},
},
watch: {
isOpenMsg: {
handler(newVal, oldVal) {
this.openConfig1 = newVal
},
deep: true,
immediate: true
},
deviceInfo: {
handler(newVal, oldVal) {
this.shareContent = newVal.name + newVal.sn + '存在报警,报警等级为' + newVal.zt + ',请开展设备维护工作!'
},
deep: true,
immediate: true
}
isOpenMsg: {
type: Boolean,
default: false,
},
data() {
return {
isSendPhone:false,
isShowUser: false,
userList: [],
phoneList:[],
shareContent: "",
openConfig1: false,
}
},
watch: {
isOpenMsg: {
handler(newVal, oldVal) {
this.openConfig1 = newVal;
},
deep: true,
immediate: true,
},
methods: {
sendMsg() {
let readList = []
this.phoneList=[]
this.userList.forEach(element => {
readList.push(element.userName)
this.phoneList.push(element.phonenumber)
});
let params = {
phoneList :this.phoneList,
isSendPhone:this.isSendPhone,
//readList: JSON.stringify(readList),
readerList: readList,
sendText: this.shareContent,
sendType: '设备报警'
}
sendMessage(params).then(response => {
if (response.code == 200) {
this.$message.success("消息发送成功!")
deviceInfo: {
handler(newVal, oldVal) {
this.shareContent =
newVal.name +
newVal.sn +
"存在报警,报警等级为" +
newVal.zt +
",请开展设备维护工作!";
},
deep: true,
immediate: true,
},
},
data() {
return {
isSendPhone: false,
isShowUser: false,
userList: [],
phoneList: [],
shareContent: "",
openConfig1: false,
};
},
methods: {
sendMsg() {
let readList = [];
this.phoneList = [];
this.userList.forEach((element) => {
readList.push(element.userName);
this.phoneList.push(element.phonenumber);
});
let data = {
reportId: this.deviceInfo.reportId,
isDeal: '0',
dealUser: this.userList[0].userName
let params = {
phoneList: this.phoneList,
isSendPhone: this.isSendPhone,
//readList: JSON.stringify(readList),
readerList: readList,
sendText: this.shareContent,
sendType: "设备报警",
};
sendMessage(params).then((response) => {
if (response.code == 200) {
this.$message.success("消息发送成功!");
}
let data = {
reportId: this.deviceInfo.reportId,
isDeal: "0",
dealUser: this.userList[0].userName,
};
addAlarm(data).then(res => {
if (res.code == 200) {
this.$message.success("分配修复任务成功!")
this.handleClose()
bus.$emit('msgReaded')
} else {
this.$message.success("分配修复任务失败!")
}
});
}
});
},
closeUser(val) {
this.isShowUser = val
},
chooseUser1() {
this.isShowUser = true
},
//
chooseUser(val) {
if (val && val.length <1) {
this.$message.error("请至少选择一名处理人员!")
this.isShowUser = false
addAlarm(data).then((res) => {
if (res.code == 200) {
this.$message.success("分配修复任务成功!");
this.handleClose();
bus.$emit("msgReaded");
} else {
this.userList = val
this.isShowUser = false
this.$message.success("分配修复任务失败!");
}
},
//
handleClose() {
this.openConfig1 = false
this.$emit('closeMsg', false)
});
}
});
},
closeUser(val) {
this.isShowUser = val;
},
chooseUser1() {
this.isShowUser = true;
},
//
chooseUser(val) {
if (val && val.length < 1) {
this.$message.error("请至少选择一名处理人员!");
this.isShowUser = false;
} else {
this.userList = val;
this.isShowUser = false;
}
},
mounted() {
}
}
//
handleClose() {
this.openConfig1 = false;
this.$emit("closeMsg", false);
},
},
mounted() {},
};
</script>
<style lang="scss" scoped>
.title {
padding-left: 20px;
color: #212121;
font-size: 16px;
margin-bottom: 10px;
margin-top: 10px;
background: url("~@/assets/ucs/biaoti.png") no-repeat;
background-position-y: 7px;
padding-left: 20px;
color: #212121;
font-size: 16px;
margin-bottom: 10px;
margin-top: 10px;
background: url("~@/assets/ucs/biaoti.png") no-repeat;
background-position-y: 7px;
}
.agreeButton {
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: .1s;
transition: .1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: 0.1s;
transition: 0.1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
}
.agreeButton:hover {
background: #65a5f9;
border-color: #65a5f9;
color: #FFF;
background: #65a5f9;
border-color: #65a5f9;
color: #fff;
}
</style>

View File

@ -1,185 +1,221 @@
<template>
<el-dialog title="选择联系人" :visible.sync="openConfig1" :before-close="handleClose">
<el-form :model="userParams" size="small" :inline="true" label-width="100px">
<el-form-item label="用户名称" prop="userName">
<el-input v-model="userParams.userName" placeholder="请输入用户名称" />
</el-form-item>
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="userParams.nickName" placeholder="请输入用户昵称" />
</el-form-item>
<el-form-item>
<el-button class="agreeButton" @click="quetyList()">搜索</el-button>
</el-form-item>
</el-form>
<el-dialog
title="选择联系人"
:visible.sync="openConfig1"
:before-close="handleClose"
append-to-body
>
<el-form
:model="userParams"
size="small"
:inline="true"
label-width="100px"
>
<el-form-item label="用户名称" prop="userName">
<el-input v-model="userParams.userName" placeholder="请输入用户名称" />
</el-form-item>
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="userParams.nickName" placeholder="请输入用户昵称" />
</el-form-item>
<el-form-item>
<el-button class="agreeButton" @click="quetyList()">搜索</el-button>
</el-form-item>
</el-form>
<el-table :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" align="center" prop="userName" />
<el-table-column label="用户昵称" align="center" prop="nickName" />
<el-table-column label="企业" align="center" prop="deptName" />
<el-table-column label="用户手机号" align="center" prop="phonenumber" />
</el-table>
<pagination style="margin-bottom: 10px;" v-show="total > 0" :total="total" :page.sync="userParams.pageNum"
:limit.sync="userParams.pageSize" @pagination="getList" />
<div style="height: 80px; margin: 10px; display: flex; justify-content: center; align-items: center;">
<el-button class="agreeButton" @click="confirm">确定</el-button>
</div>
</el-dialog>
<el-table
ref="userTable"
:data="userList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" align="center" prop="userName" />
<el-table-column label="用户昵称" align="center" prop="nickName" />
<el-table-column label="企业" align="center" prop="deptName" />
<el-table-column label="用户手机号" align="center" prop="phonenumber" />
</el-table>
<pagination
style="margin-bottom: 10px"
v-show="total > 0"
:total="total"
:page.sync="userParams.pageNum"
:limit.sync="userParams.pageSize"
@pagination="getList"
/>
<div
style="
height: 80px;
margin: 10px;
display: flex;
justify-content: center;
align-items: center;
"
>
<el-button class="agreeButton" @click="confirm">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { listUser } from "@/api/system/user";
export default {
components: {},
props: {
isShowUser: {
type: Boolean,
default: false
},
roleType: {
type: String,
default: ''
},
components: {},
props: {
isShowUser: {
type: Boolean,
default: false,
},
watch: {
isShowUser: {
handler(newVal, oldVal) {
this.openConfig1 = newVal
this.getList()
},
deep: true,
immediate: true
},
roleType: {
handler(newVal, oldVal) {
this.userParams.roleType = newVal
},
deep: true,
immediate: true
},
roleType: {
type: String,
default: "",
},
data() {
return {
openConfig1: false,
userParams: {
userName: '',
nickName: '',
roleType: '',
pageNum: 1,
pageSize: 10,
},
userList: [],
selectList: [],
total: 0,
selectedList: {
type: Array,
default: [],
},
},
watch: {
isShowUser: {
handler(newVal, oldVal) {
this.openConfig1 = newVal;
this.getList();
},
deep: true,
immediate: true,
},
roleType: {
handler(newVal, oldVal) {
this.userParams.roleType = newVal;
},
deep: true,
immediate: true,
},
},
data() {
return {
openConfig1: false,
userParams: {
userName: "",
nickName: "",
roleType: "",
pageNum: 1,
pageSize: 10,
},
userList: [],
selectList: [],
total: 0,
};
},
methods: {
confirm() {
if (this.selectList.length < 1) {
this.$message.error("请选择联系人!");
} else {
this.openConfig1 = false;
this.$emit("chooseUser", this.selectList);
}
},
handleSelectionChange(val) {
this.selectList = val;
},
quetyList() {
listUser(this.userParams).then((response) => {
this.userList = response.rows;
this.total = response.total;
this.handleSelectedList();
});
},
getList() {
listUser(this.addDateRange(this.userParams)).then((response) => {
this.userList = response.rows;
this.total = response.total;
this.handleSelectedList();
});
},
//
handleClose() {
this.openConfig1 = false;
this.$emit("closeUser", false);
},
handleSelectedList() {
this.$nextTick(() => {
if (this.selectedList) {
this.selectedList.forEach((row) => {
const item = this.userList.find((item) => item.userId === row.userId);
this.$refs.userTable.toggleRowSelection(item, true);
});
}
});
},
methods: {
confirm() {
if (this.selectList.length < 1) {
this.$message.error("请选择联系人!")
} else {
this.openConfig1 = false
this.$emit('chooseUser', this.selectList)
}
},
handleSelectionChange(val) {
this.selectList = val;
},
quetyList() {
listUser(this.userParams).then(response => {
this.userList = response.rows;
this.total = response.total;
}
);
},
getList() {
listUser(this.addDateRange(this.userParams)).then(response => {
this.userList = response.rows;
this.total = response.total;
}
);
},
//
handleClose() {
this.openConfig1 = false
this.$emit('closeUser', false)
}
},
mounted() {
}
}
},
mounted() {},
};
</script>
<style lang="scss" scoped>
.agreeButton {
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: .1s;
transition: .1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: 0.1s;
transition: 0.1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
}
.agreeButton:hover {
background: #65a5f9;
border-color: #65a5f9;
color: #FFF;
background: #65a5f9;
border-color: #65a5f9;
color: #fff;
}
.title {
padding-left: 20px;
color: #212121;
font-size: 16px;
margin-bottom: 10px;
margin-top: 10px;
background: url("~@/assets/ucs/biaoti.png") no-repeat;
background-position-y: 7px;
padding-left: 20px;
color: #212121;
font-size: 16px;
margin-bottom: 10px;
margin-top: 10px;
background: url("~@/assets/ucs/biaoti.png") no-repeat;
background-position-y: 7px;
}
.agreeButton {
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: .1s;
transition: .1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: 0.1s;
transition: 0.1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
}
.agreeButton:hover {
background: #65a5f9;
border-color: #65a5f9;
color: #FFF;
background: #65a5f9;
border-color: #65a5f9;
color: #fff;
}
</style>
</style>

View File

@ -1,67 +1,165 @@
<template>
<div class="dashboard">
<h1 class="title">厂界在线设备远程调度</h1>
<div class="content">
<DeviceList :devices="devices" @select-device="selectDevice" />
<RemoteControl v-if="selectedDevice" :device="selectedDevice" @update-threshold="updateThreshold" />
<div class="app-container">
<el-form :inline="true" :model="queryParams" ref="form">
<el-form-item label="选择部门" prop="factoryId">
<dept-tree @deptChange="handleDeptChange" style="width: 150px" />
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
</el-form-item>
<el-form-item label="名称" prop="equipmentName">
<el-input v-model="queryParams.name"></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<div class="rt-wrapper">
<el-table
ref="singleTable"
:data="tableData"
highlight-current-row
:max-height="tableHeight"
style="width: 100%"
>
<el-table-column property="ppp" label="港口" width="80" />
<el-table-column property="pp" label="港区" width="130" />
<el-table-column property="p" label="公司" show-overflow-tooltip />
<el-table-column property="name" label="名称" show-overflow-tooltip />
<el-table-column property="sn" label="编号" show-overflow-tooltip />
<el-table-column
property="address"
label="地址"
show-overflow-tooltip
/>
<el-table-column property="bjyz" label="报警阈值" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="handleEdit(scope.row)"
>通知修改阈值</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pagination-wrapper">
<el-pagination
background
layout="sizes, prev, pager, next, total"
:total="total"
:page-size="queryParams.pageSize"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
>
</el-pagination>
</div>
</div>
</template>
<script>
import DeviceList from '@/views/remoteControl/oilRecovery/DeviceList.vue';
import RemoteControl from '@/views/remoteControl/oilRecovery/RemoteControl.vue';
export default {
name: 'Dashboard',
components: {
DeviceList,
RemoteControl,
<msg-dialog :visible.sync="showMsgDialog" :shareContent="shareContent"/>
</div>
</template>
<script>
import DeptTree from "@/components/DeptTree/index.vue";
import { getThList } from "@/api/remoteControl";
import MsgDialog from './msg-dialog.vue';
export default {
name: "remoteControl-bound",
components: { DeptTree, MsgDialog },
dicts: [],
data() {
return {
tableData: [],
loading: false,
dept: null,
deviceInfo: null,
total: 0,
tableHeight: 0,
showMsgDialog: false,
shareContent: "",
//
queryParams: {
pageNum: 1,
pageSize: 10,
sn: null,
name: null,
deptId: null,
},
};
},
mounted() {
this.$nextTick(() => {
this.tableHeight = window.innerHeight - 250;
});
},
methods: {
handleDeptChange(dept) {
this.dept = dept;
this.queryParams.deptId = dept.deptId;
this.getTableData();
},
data() {
return {
devices: [
{ id: 1, name: 'YQHS0001',factoryName: '***有限公司', threshold: 50 },
{ id: 2, name: 'YQHS0002', factoryName: '***有限公司',threshold: 60 },
{ id: 3, name: 'YQHS0003',factoryName: '***有限公司', threshold: 70 },
{ id: 3, name: 'YQHS0004',factoryName: '***有限公司', threshold: 70 },
],
selectedDevice: true,
handleCurrentChange(val) {
this.queryParams.pageNum = val;
this.getTableData();
},
handleSizeChange(val) {
this.queryParams.pageSize = val;
this.getTableData();
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getTableData();
},
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
sn: null,
name: null,
deptId: this.dept ? this.dept.deptId : null,
};
this.getTableData();
},
methods: {
selectDevice(device) {
this.selectedDevice = device;
},
updateThreshold(newThreshold) {
this.selectedDevice.threshold = newThreshold;
},
handleEdit(row) {
this.deviceInfo = structuredClone(row);
this.showMsgDialog = true;
this.shareContent = `请将[${row.p}]的[${row.name}设备](当前报警阈值:${row.bjyz})的报警阈值调整为:[]`;
},
};
</script>
<style scoped>
.dashboard {
height: 864px;
background: url('~@/assets/ldar/bg3.png') no-repeat;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
background: linear-gradient(135deg, #071e3b, #2a73d1);
}
.title {
font-size: 2em;
margin-bottom: 20px;
color: #fff;
}
.content {
display: flex;
height:700px;
width: 100%;
justify-content: space-around;
}
</style>
getTableData() {
if (!this.queryParams.deptId) {
this.$message.error("请选择部门");
return;
}
this.loading = true;
getThList(this.queryParams)
.then((res) => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
})
.catch((error) => {
console.error(error);
this.$message.error(error.message);
this.loading = false;
});
},
},
};
</script>
<style lang="css" scoped>
.pagination-wrapper {
margin-top: 10px;
display: flex;
justify-content: flex-end;
}
</style>

View File

@ -0,0 +1,199 @@
<template>
<el-dialog
title="下发通知"
:visible.sync="dialogVisible"
>
<div style="display: inline-flex; height: 30px; line-height: 30px">
<el-button class="agreeButton" style="width: 120px" @click="chooseUser1()"
>选择联系人</el-button
>
<div style="margin-right: 5px">
<!-- <span style="margin-left: 2px" v-for="item in userList">{{
item.nickName
}}</span> -->
<el-tag
:key="user.userId"
v-for="user in userList"
closable
:disable-transitions="false"
@close="handleRemoveUser(user)">
{{ user.userName }}
</el-tag>
</div>
</div>
<div style="margin: 10px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入消息内容..."
v-model="shareContent"
>
</el-input>
</div>
<user-select
v-if="isShowUser"
:isShowUser="isShowUser"
:selectedList="userList"
@closeUser="closeUser"
@chooseUser="chooseUser"
/>
<div style="margin-left: 5px; height: 50px">
<el-checkbox v-model="isSendPhone">同时发送短信</el-checkbox>
</div>
<div style="margin-left: 5px; height: 50px">
<el-button class="agreeButton" @click="sendMsg">发送</el-button>
</div>
</el-dialog>
</template>
<script>
import bus from "@/utils/bus.js";
import { sendMessage } from "@/api/home";
import { addAlarm } from "@/api/demostrate/monitor";
import UserSelect from "@/views/home/components/UserSelect.vue";
export default {
components: { UserSelect },
props: {
infoMsg: {
type: String,
default: "",
},
shareContent: {
type: String,
default: "",
},
visible: {
type: Boolean,
default: false,
},
},
computed: {
dialogVisible: {
get() {
return this.visible;
},
set(val) {
// this.$emit("updateVisible", val);
this.$emit("update:visible", val);
}
}
},
data() {
return {
isSendPhone: false,
isShowUser: false,
userList: [],
phoneList: [],
};
},
methods: {
sendMsg() {
let readList = [];
this.phoneList = [];
this.userList.forEach((element) => {
readList.push(element.userName);
this.phoneList.push(element.phonenumber);
});
let params = {
phoneList: this.phoneList,
isSendPhone: this.isSendPhone,
//readList: JSON.stringify(readList),
readerList: readList,
sendText: this.shareContent,
sendType: "设备报警",
};
sendMessage(params).then((response) => {
if (response.code == 200) {
this.$message.success("消息发送成功!");
let data = {
reportId: this.deviceInfo.reportId,
isDeal: "0",
dealUser: this.userList[0].userName,
};
addAlarm(data).then((res) => {
if (res.code == 200) {
this.$message.success("分配修复任务成功!");
this.handleClose();
bus.$emit("msgReaded");
} else {
this.$message.success("分配修复任务失败!");
}
});
}
});
},
closeUser(val) {
this.isShowUser = val;
},
chooseUser1() {
this.isShowUser = true;
},
//
chooseUser(val) {
if (val && val.length < 1) {
this.$message.error("请至少选择一名处理人员!");
this.isShowUser = false;
} else {
this.userList = val;
this.isShowUser = false;
}
},
handleRemoveUser(user) {
this.userList = this.userList.filter((item) => item.userId !== user.userId);
},
},
mounted() {},
};
</script>
<style lang="scss" scoped>
::v-deep .el-dialog .el-dialog__body {
padding: 0px;
}
.el-tag {
margin-left: 10px;
}
.title {
padding-left: 20px;
color: #212121;
font-size: 16px;
margin-bottom: 10px;
margin-top: 10px;
background: url("~@/assets/ucs/biaoti.png") no-repeat;
background-position-y: 7px;
}
.agreeButton {
display: inline-block;
line-height: 8px;
width: 80px;
height: 32px;
white-space: nowrap;
cursor: pointer;
color: #ffffff;
-webkit-appearance: none;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
outline: 0;
margin-left: 10px;
-webkit-transition: 0.1s;
transition: 0.1s;
font-weight: 500;
//padding: 12px 20px;
font-size: 14px;
border-radius: 4px;
background-color: #068f5c;
}
.agreeButton:hover {
background: #65a5f9;
border-color: #65a5f9;
color: #fff;
}
</style>