|
|
@ -11,41 +11,74 @@ |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<!-- prop="name" --> |
|
|
|
<el-table-column label="序号" type="index" align="center" width="50" /> |
|
|
|
<el-table-column label="发布内容" align="center" prop="context" width="400" > |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<div>{{row.context}}</div> |
|
|
|
<el-table-column |
|
|
|
label="序号" |
|
|
|
type="index" |
|
|
|
align="center" |
|
|
|
width="50" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="发布内容" |
|
|
|
align="center" |
|
|
|
prop="context" |
|
|
|
width="400" |
|
|
|
> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<div>{{ row.context }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="通知时间" align="center" prop="create_time" > |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-table-column label="通知时间" align="center" prop="create_time"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<div>{{ row.create_time | parseTime }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="发布人" align="center" prop="creater_name" /> |
|
|
|
<el-table-column label="状态" align="center" prop="is_state"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<div :class="{ 'stop_txt': row.is_state}">{{ row.is_state==1 ? '发布中' : '停止' }}</div> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<div :class="{ stop_txt: row.is_state }"> |
|
|
|
{{ row.is_state == 1 ? "发布中" : "停止" }} |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="120px" align="center" fixed="right"> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
width="120px" |
|
|
|
align="center" |
|
|
|
fixed="right" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
class="edit_btn" |
|
|
|
@click="editFormData(scope.row)" |
|
|
|
>编辑</el-button> |
|
|
|
>编辑</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
:class="['start_btn', { 'stop_btn': scope.row.is_state==1 }]" |
|
|
|
:class="['start_btn', { stop_btn: scope.row.is_state == 1 }]" |
|
|
|
@click="isStopHandle(scope.$index, scope.row)" |
|
|
|
>{{ scope.row.is_state==1 ? '停止' : '恢复' }}</el-button> |
|
|
|
>{{ scope.row.is_state == 1 ? "停止" : "恢复" }}</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<!-- 分页器 --> |
|
|
|
<el-pagination |
|
|
|
style="margin-top: 20px; text-align: center" |
|
|
|
:current-page="queryInfo.page" |
|
|
|
:total="total" |
|
|
|
:page-size="queryInfo.size" |
|
|
|
:pager-count="5" |
|
|
|
:page-sizes="[3, 5, 10]" |
|
|
|
@current-change="getUrgentMessage" |
|
|
|
@size-change="handleSizeChange" |
|
|
|
layout="prev, pager, next, jumper,->,sizes,total" |
|
|
|
> |
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
<!-- 编辑紧急通知 --> |
|
|
|
<div class="publish_layer"> |
|
|
|
<el-dialog |
|
|
@ -60,34 +93,48 @@ |
|
|
|
label="文本颜色" |
|
|
|
prop="context_color" |
|
|
|
:rules="[ |
|
|
|
{ required: true, message: '请选择文本颜色', trigger: '' } |
|
|
|
{ required: true, message: '请选择文本颜色', trigger: '' }, |
|
|
|
]" |
|
|
|
> |
|
|
|
<colorPicker v-model="form.context_color" class="txt_color" @change="headleChangeColor" /> |
|
|
|
<colorPicker |
|
|
|
v-model="form.context_color" |
|
|
|
class="txt_color" |
|
|
|
@change="headleChangeColor" |
|
|
|
/> |
|
|
|
<el-input v-show="false" v-model="form.context_color" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="文本内容" |
|
|
|
prop="context" |
|
|
|
:rules="[ |
|
|
|
{ required: true, message: '请输入文本内容', trigger: 'blur' } |
|
|
|
{ required: true, message: '请输入文本内容', trigger: 'blur' }, |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-input v-model="form.context" type="textarea" rows="6" style="width: 674px;" /> |
|
|
|
<el-input |
|
|
|
v-model="form.context" |
|
|
|
type="textarea" |
|
|
|
rows="6" |
|
|
|
style="width: 674px" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="文本大小" |
|
|
|
prop="context_size" |
|
|
|
prop="context_size_name" |
|
|
|
:rules="[ |
|
|
|
{ required: true, message: '请选择文本大小', trigger: 'change' }, |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-select v-model="form.context_size" size="small" class="filter-item"> |
|
|
|
<el-select |
|
|
|
v-model="form.context_size_name" |
|
|
|
size="small" |
|
|
|
class="filter-item" |
|
|
|
@change="selectSize" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in sizeData" |
|
|
|
:key="item.key" |
|
|
|
:label="item.name" |
|
|
|
:value="item.key" |
|
|
|
:value="item" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -98,7 +145,13 @@ |
|
|
|
{ required: true, message: '请选择文本位置', trigger: 'change' }, |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-select v-model="form.context_position_name" size="small" value-key="name" class="filter-item" @change="selectPosition"> |
|
|
|
<el-select |
|
|
|
v-model="form.context_position_name" |
|
|
|
size="small" |
|
|
|
value-key="name" |
|
|
|
class="filter-item" |
|
|
|
@change="selectPosition" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in positionData" |
|
|
|
:key="item.key" |
|
|
@ -114,7 +167,12 @@ |
|
|
|
{ required: true, message: '请选择滚动速度', trigger: 'change' }, |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-select v-model="form.context_speed_name" size="small" class="filter-item" @change="selectSpeed"> |
|
|
|
<el-select |
|
|
|
v-model="form.context_speed_name" |
|
|
|
size="small" |
|
|
|
class="filter-item" |
|
|
|
@change="selectSpeed" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in speedData" |
|
|
|
:key="item.key" |
|
|
@ -130,17 +188,38 @@ |
|
|
|
{ required: true, message: '请选择设备', trigger: 'change' }, |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-radio-group v-model="form.notice_device" @change="clearCheckbox()"> |
|
|
|
<el-radio :label="1" value="all" >所有设备</el-radio> |
|
|
|
<el-radio :label="2" value= "other" >部分设备<i v-if="form.notice_device === 2" class="radio_tip" @click="addDeviceTag()">添加</i></el-radio> |
|
|
|
<el-radio-group |
|
|
|
v-model="form.notice_device" |
|
|
|
@change="clearCheckbox()" |
|
|
|
> |
|
|
|
<el-radio :label="1" value="all">所有设备</el-radio> |
|
|
|
<el-radio :label="2" value="other" |
|
|
|
>部分设备<i |
|
|
|
v-if="form.notice_device === 2" |
|
|
|
class="radio_tip" |
|
|
|
@click="addDeviceTag()" |
|
|
|
>添加</i |
|
|
|
></el-radio |
|
|
|
> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
<div v-if="form.notice_device === 1" class="select_all_tip">所有设备都将被发送</div> |
|
|
|
<div v-if="deviceTags.length>0 && form.notice_device === 2" class="select_other"> |
|
|
|
<div v-if="form.notice_device === 1" class="select_all_tip"> |
|
|
|
所有设备都将被发送 |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-if="deviceTags.length > 0 && form.notice_device === 2" |
|
|
|
class="select_other" |
|
|
|
> |
|
|
|
<el-row> |
|
|
|
<el-col :span="10" class="other_tip">以下设备都将被发送<span>总计{{ deviceTags.length }}个设备</span></el-col> |
|
|
|
<el-col :span="10" class="other_tip" |
|
|
|
>以下设备都将被发送<span |
|
|
|
>总计{{ deviceTags.length }}个设备</span |
|
|
|
></el-col |
|
|
|
> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-button round class="delt_btn" @click="clearDevice()">清空</el-button> |
|
|
|
<el-button round class="delt_btn" @click="clearDevice()" |
|
|
|
>清空</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-tag |
|
|
@ -152,7 +231,7 @@ |
|
|
|
context_color="#cbe3ff" |
|
|
|
@close="handleClose(tag)" |
|
|
|
> |
|
|
|
{{ tag.device_name}} |
|
|
|
{{ tag.device_name }} |
|
|
|
</el-tag> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
@ -160,11 +239,12 @@ |
|
|
|
<!-- :loading="crud.status.cu === 2" |
|
|
|
@click="crud.submitCU"--> |
|
|
|
<el-button type="primary" round @click="submit">保存</el-button> |
|
|
|
<el-button round @click="messageVisible=false">关闭</el-button> |
|
|
|
<el-button round @click="closeDialog">关闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
<!-- 添加发布的设备 --> |
|
|
|
<!-- 添加发布的设备 --> |
|
|
|
<div class="add_device_layer"> |
|
|
|
<el-dialog |
|
|
|
title="请选择设备" |
|
|
@ -189,220 +269,325 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { parseTime } from '@/utils/index.js' |
|
|
|
import { ReqDeviceList} from '@/api/device/deviceList.js' |
|
|
|
import {reqUrgentMessage,reqQueryMessage,reqEditMessage} from '@/api/publish/urgentMessage' |
|
|
|
export default { |
|
|
|
name: 'UrgentMessage', |
|
|
|
import { parseTime } from "@/utils/index.js"; |
|
|
|
import { ReqDeviceList } from "@/api/device/deviceList.js"; |
|
|
|
import { |
|
|
|
reqUrgentMessage, |
|
|
|
reqQueryMessage, |
|
|
|
reqEditMessage, |
|
|
|
reqChangeMessage |
|
|
|
} from "@/api/publish/urgentMessage"; |
|
|
|
export default { |
|
|
|
name: "UrgentMessage", |
|
|
|
filters: { |
|
|
|
parseTime(time, cFormat) { |
|
|
|
return parseTime(time, cFormat) |
|
|
|
} |
|
|
|
return parseTime(time, cFormat); |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
form :{ |
|
|
|
context_color: '#ff0000',//文本的颜色 |
|
|
|
context: '', //文本的内容 |
|
|
|
isAddEdit: false, |
|
|
|
form: { |
|
|
|
context_color: "#ff0000", //文本的颜色 |
|
|
|
context: "", //文本的内容 |
|
|
|
context_position: null, //文本的位置 |
|
|
|
context_position_name:null, |
|
|
|
context_speed_name:null, |
|
|
|
context_position_name: null, |
|
|
|
context_speed_name: null, |
|
|
|
context_speed: null, //文本的速度 |
|
|
|
context_size:null,//文字的大小 |
|
|
|
context_size_name: null, |
|
|
|
context_size: null, //文字的大小 |
|
|
|
// create_by:'', //发布人 |
|
|
|
notice_device:null, |
|
|
|
notice_devices:[], |
|
|
|
notice_id:'' ,//紧急通知的id |
|
|
|
orga_id:'133221333123111', |
|
|
|
notice_device: null, |
|
|
|
notice_devices: [], |
|
|
|
notice_id: "", //紧急通知的id |
|
|
|
orga_id: "133221333123111", |
|
|
|
}, |
|
|
|
queryInfo:{ |
|
|
|
notice_name:'', |
|
|
|
orga_id:'133221333123111', |
|
|
|
page:1, |
|
|
|
size:3 |
|
|
|
queryInfo: { |
|
|
|
notice_name: "", |
|
|
|
orga_id: "133221333123111", |
|
|
|
page: 1, |
|
|
|
size: 3, |
|
|
|
}, |
|
|
|
total: 0, |
|
|
|
messageVisible: false, |
|
|
|
selectDeviceVisible: false, |
|
|
|
sizeData: [{ key: '0', name: 16 }, { key: '1', name: 22 }, { key: '2', name: 24 }, { key: '3', name: 30 }], |
|
|
|
positionData: [{ key: 1, name: '顶部' }, { key: 2, name: '中间' }, { key: 3, name: '底部' }], |
|
|
|
speedData: [{ key: 0, name: '1s' }, { key: 1, name: '2s' }, { key: 2, name: '3s' }], |
|
|
|
sizeData: [ |
|
|
|
{ key: 0, name: 16 }, |
|
|
|
{ key: 1, name: 22 }, |
|
|
|
{ key: 2, name: 24 }, |
|
|
|
{ key: 3, name: 30 }, |
|
|
|
], |
|
|
|
positionData: [ |
|
|
|
{ key: 1, name: "顶部" }, |
|
|
|
{ key: 2, name: "中间" }, |
|
|
|
{ key: 3, name: "底部" }, |
|
|
|
], |
|
|
|
speedData: [ |
|
|
|
{ key: 0, name: "1s" }, |
|
|
|
{ key: 1, name: "2s" }, |
|
|
|
{ key: 2, name: "3s" }, |
|
|
|
], |
|
|
|
selectedList: [], |
|
|
|
// 部分设备列表的数据 |
|
|
|
deviceList: [], |
|
|
|
// newArr:[], |
|
|
|
deviceTags: [], |
|
|
|
// 紧急通知列表 |
|
|
|
urgentMessage:[] |
|
|
|
} |
|
|
|
urgentMessage: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted(){ |
|
|
|
this.getUrgentMessage() |
|
|
|
this.getDevice() |
|
|
|
mounted() { |
|
|
|
this.getUrgentMessage(); |
|
|
|
this.getDevice(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取紧急通知的列表 |
|
|
|
getUrgentMessage(){ |
|
|
|
const params=this.queryInfo |
|
|
|
reqUrgentMessage(params).then(res=>{ |
|
|
|
|
|
|
|
if(res.code==200){ |
|
|
|
this.urgentMessage=res.data.content |
|
|
|
// console.log( this.urgentMessage) |
|
|
|
getUrgentMessage(pager=1) { |
|
|
|
this.queryInfo.page=pager |
|
|
|
const params = this.queryInfo; |
|
|
|
reqUrgentMessage(params).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.urgentMessage = res.data.content; |
|
|
|
this.total = res.data.totalElements; |
|
|
|
// console.log(this.urgentMessage); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 获取设备列表的信息 |
|
|
|
getDevice(){ |
|
|
|
const params = this.queryInfo |
|
|
|
ReqDeviceList(params).then(res => { |
|
|
|
if(res.code==200) { |
|
|
|
this.deviceList=res.data.content |
|
|
|
}else{ |
|
|
|
return this.$message.error('获取设备列表失败!') |
|
|
|
getDevice() { |
|
|
|
const params = this.queryInfo; |
|
|
|
ReqDeviceList(params).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.deviceList = res.data.content; |
|
|
|
} else { |
|
|
|
return this.$message.error("获取设备列表失败!"); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 紧急通知的状态 is_state为1 发布中 2 停止 |
|
|
|
// row.is_state == 1 ? "停止" : "恢复" |
|
|
|
isStopHandle(index, row) { |
|
|
|
if(row.is_state ==1){ |
|
|
|
row.is_state=2 |
|
|
|
console.log(row) |
|
|
|
// console.log(index) |
|
|
|
if (row.is_state == 1) { |
|
|
|
row.is_state = 2; |
|
|
|
} else { |
|
|
|
row.is_state = 1; |
|
|
|
} |
|
|
|
const params={ |
|
|
|
id:row.notice_id, |
|
|
|
state:row.is_state |
|
|
|
} |
|
|
|
reqChangeMessage(params).then(res=>{ |
|
|
|
// console.log(res) |
|
|
|
if(res.code==200){ |
|
|
|
if(params.state==1){ |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message:'已发布成功!' |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
row.is_state=1 |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message:'已停止!' |
|
|
|
}); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return this.$message.error("失败了~~~~"); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 编辑 |
|
|
|
editFormData(row) { |
|
|
|
console.log(row) |
|
|
|
this.messageVisible = true |
|
|
|
this.messageVisible = true; |
|
|
|
// 根据id查询返回的紧急通知的数据 |
|
|
|
const params ={ |
|
|
|
notice_id:row.notice_id |
|
|
|
} |
|
|
|
reqQueryMessage(params).then(res=>{ |
|
|
|
console.log(res) |
|
|
|
if(res.code==200) { |
|
|
|
this.form.notice_device=res.data.notice.noticeDevice |
|
|
|
this.form.context_color=res.data.notice.contextColor |
|
|
|
this.form.context=res.data.notice.context |
|
|
|
this.form.context_position=res.data.notice.contextPosition |
|
|
|
this.form.context_size=res.data.notice.contextSize |
|
|
|
const params = { |
|
|
|
notice_id: row.notice_id, |
|
|
|
}; |
|
|
|
reqQueryMessage(params).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.form.notice_device = res.data.notice.noticeDevice; |
|
|
|
this.form.context_color = res.data.notice.contextColor; |
|
|
|
this.form.context = res.data.notice.context; |
|
|
|
this.form.context_position = res.data.notice.contextPosition; |
|
|
|
this.form.context_size = res.data.notice.contextSize; |
|
|
|
this.form.notice_id = row.notice_id; |
|
|
|
// 判断文字位置 |
|
|
|
if( this.form.context_position==1){ |
|
|
|
this.form.context_position_name='顶部' |
|
|
|
}else if( this.form.context_position==2){ |
|
|
|
this.form.context_position_name='中部' |
|
|
|
}else{ |
|
|
|
this.form.context_position_name='底部' |
|
|
|
if (this.form.context_position == 1) { |
|
|
|
this.form.context_position_name = "顶部"; |
|
|
|
} else if (this.form.context_position == 2) { |
|
|
|
this.form.context_position_name = "中部"; |
|
|
|
} else { |
|
|
|
this.form.context_position_name = "底部"; |
|
|
|
} |
|
|
|
// 判断速度 |
|
|
|
if(this.form.context_speed==0){ |
|
|
|
this.form.context_speed_name='1s' |
|
|
|
}else if(this.form.context_speed==1){ |
|
|
|
this.form.context_speed_name='2s' |
|
|
|
}else{ |
|
|
|
this.form.context_speed_name='3s' |
|
|
|
// if(context_speed_name == 0){ |
|
|
|
// this.form.context_speed_name='1s' |
|
|
|
// }else if(this.form.context_speed==1){ |
|
|
|
// this.form.context_speed_name='2s' |
|
|
|
// }else{ |
|
|
|
// this.form.context_speed_name='3s' |
|
|
|
// } |
|
|
|
//判断文字大小 |
|
|
|
if (this.form.context_size == 0) { |
|
|
|
this.form.context_size_name = "16"; |
|
|
|
} else if (this.form.context_size == 1) { |
|
|
|
this.form.context_size_name = "22"; |
|
|
|
} else if (this.form.context_size == 2) { |
|
|
|
this.form.context_size_name = "24"; |
|
|
|
} else { |
|
|
|
this.form.context_size_name = "30"; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
submit(){ |
|
|
|
const params={ |
|
|
|
context:this.form.context, |
|
|
|
context_color:this.form.context_color, |
|
|
|
// 新增 |
|
|
|
addFormData() { |
|
|
|
this.messageVisible = true; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.form.notice_id = null; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
submit() { |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
// 修改 |
|
|
|
if (valid) { |
|
|
|
const params = { |
|
|
|
context: this.form.context, |
|
|
|
context_color: this.form.context_color, |
|
|
|
context_position: this.form.context_position, |
|
|
|
context_size:this.form.context_size, |
|
|
|
context_speed:this.form.context_speed, |
|
|
|
notice_device:this.form.notice_device, |
|
|
|
notice_devices:this.form.notice_devices, |
|
|
|
notice_id:this.form.notice_id, |
|
|
|
orga_id:'133221333123111' |
|
|
|
} |
|
|
|
reqEditMessage(params).then(res=>{ |
|
|
|
console.log(params) |
|
|
|
console.log(res) |
|
|
|
}) |
|
|
|
context_size: this.form.context_size, |
|
|
|
context_speed: this.form.context_speed, |
|
|
|
notice_device: this.form.notice_device, |
|
|
|
notice_devices: this.form.notice_devices, |
|
|
|
notice_id: this.form.notice_id, |
|
|
|
orga_id: "133221333123111", |
|
|
|
}; |
|
|
|
reqEditMessage(params).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: this.form.notice_id |
|
|
|
? "修改紧急通知成功" |
|
|
|
: "添加紧急通知成功", |
|
|
|
}); |
|
|
|
this.messageVisible = false; |
|
|
|
this.getUrgentMessage(this.form.notice_id? this.queryInfo:1); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 所有设备和部分设备的切换数据处理 |
|
|
|
clearCheckbox(){ |
|
|
|
if(this.form.notice_device==1){ |
|
|
|
this.form.notice_devices=[] |
|
|
|
}else{ |
|
|
|
this.form.AllDevice=this.deviceList |
|
|
|
clearCheckbox() { |
|
|
|
if (this.form.notice_device == 1) { |
|
|
|
this.form.notice_devices = []; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 多选框 |
|
|
|
handleSelectionChange(val) { |
|
|
|
this.selectedList = val |
|
|
|
if (val.length > 0) { |
|
|
|
this.clearBtnDisabled = false |
|
|
|
} else { |
|
|
|
this.clearBtnDisabled = true |
|
|
|
} |
|
|
|
// console.log(val) |
|
|
|
this.selectedList = val; |
|
|
|
// if (val.length > 0) { |
|
|
|
// this.clearBtnDisabled = false; |
|
|
|
// } else { |
|
|
|
// this.clearBtnDisabled = true; |
|
|
|
// } |
|
|
|
}, |
|
|
|
// 改变文字的颜色 |
|
|
|
headleChangeColor() { |
|
|
|
console.log(this.form.context_color) |
|
|
|
this.form.context_size; |
|
|
|
}, |
|
|
|
// 改变文字的大小 |
|
|
|
selectSize(selVal) { |
|
|
|
this.form.context_size = selVal.key; |
|
|
|
this.form.context_size_name = selVal.name; |
|
|
|
}, |
|
|
|
// 改变文字的位置 |
|
|
|
selectPosition(selVal){ |
|
|
|
// console.log(selVal) |
|
|
|
this.form.context_position=selVal.key |
|
|
|
this.form.context_position_name=selVal.name |
|
|
|
selectPosition(selVal) { |
|
|
|
this.form.context_position = selVal.key; |
|
|
|
this.form.context_position_name = selVal.name; |
|
|
|
}, |
|
|
|
// 速度 |
|
|
|
selectSpeed(selVal){ |
|
|
|
this.form.context_speed=selVal.key |
|
|
|
this.form.context_speed_name=selVal.name |
|
|
|
selectSpeed(selVal) { |
|
|
|
this.form.context_speed = selVal.key; |
|
|
|
this.form.context_speed_name = selVal.name; |
|
|
|
}, |
|
|
|
//添加设备的对话框 |
|
|
|
addDeviceTag() { |
|
|
|
this.selectDeviceVisible = true |
|
|
|
this.selectDeviceVisible = true; |
|
|
|
}, |
|
|
|
// 添加设备 |
|
|
|
tagHandle(tag) { |
|
|
|
this.form.notice_devices.push({deviceId:tag.device_id}) |
|
|
|
if(this.deviceTags.length==0){ |
|
|
|
this.deviceTags.push(tag) |
|
|
|
}else{ |
|
|
|
const current = this.deviceTags &&this.deviceTags.some((item) => item.device_name == tag.device_name ) |
|
|
|
// 查找是否存在相同的 |
|
|
|
console.log('current', current) |
|
|
|
// 收集参数 部分设备的列表 |
|
|
|
if (this.form.notice_devices.length == 0) { |
|
|
|
this.form.notice_devices.push({ deviceId: tag.device_id }); |
|
|
|
} else { |
|
|
|
const result = this.form.notice_devices.some((item) => { |
|
|
|
return item.deviceId == tag.device_id; |
|
|
|
}); |
|
|
|
if (!result) { |
|
|
|
this.form.notice_devices.push({ deviceId: tag.device_id }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 添加设备不能重复 不重复才添加 |
|
|
|
if (this.deviceTags.length == 0) { |
|
|
|
this.deviceTags.push(tag); |
|
|
|
} else { |
|
|
|
const current = |
|
|
|
this.deviceTags && |
|
|
|
this.deviceTags.some((item) => item.device_name == tag.device_name); |
|
|
|
if (!current) { |
|
|
|
this.deviceTags.push(tag) |
|
|
|
this.deviceTags.push(tag); |
|
|
|
} else { |
|
|
|
this.$message("请勿添加重复的设备!"); |
|
|
|
} |
|
|
|
// !this.deviceTags.some(item => item.device_name === tag.device_name) |
|
|
|
// && this.deviceTags.push(tag) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 单独删除某一个设备 |
|
|
|
handleClose(tag) { |
|
|
|
this.deviceTags.splice(this.deviceTags.indexOf(tag), 1) |
|
|
|
// console.log(this.deviceTags) |
|
|
|
this.deviceTags.splice(this.deviceTags.indexOf(tag), 1); |
|
|
|
}, |
|
|
|
// 清空设备 |
|
|
|
clearDevice() { |
|
|
|
this.deviceTags = [] |
|
|
|
this.deviceTags = []; |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
// 关闭重置表单 |
|
|
|
closeDialog() { |
|
|
|
this.messageVisible = false; |
|
|
|
this.$refs.form.resetFields(); |
|
|
|
}, |
|
|
|
// 每条显示数据改变时的事件 |
|
|
|
handleSizeChange(size) { |
|
|
|
//整理参数 |
|
|
|
this.queryInfo.size = size |
|
|
|
this.getUrgentMessage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.list_warp { |
|
|
|
.list_warp { |
|
|
|
padding: 0 24px; |
|
|
|
.stop_txt { |
|
|
|
color: #3a8aeb; |
|
|
|
} |
|
|
|
} |
|
|
|
.txt_color{ |
|
|
|
} |
|
|
|
.txt_color { |
|
|
|
margin-top: 12px; |
|
|
|
} |
|
|
|
::v-deep .el-radio-group{ |
|
|
|
} |
|
|
|
::v-deep .el-radio-group { |
|
|
|
display: block; |
|
|
|
.el-radio{ |
|
|
|
.el-radio { |
|
|
|
position: relative; |
|
|
|
line-height: 40px; |
|
|
|
.radio_tip{ |
|
|
|
.radio_tip { |
|
|
|
position: absolute; |
|
|
|
right: -45px; |
|
|
|
top: 0; |
|
|
@ -417,8 +602,8 @@ export default { |
|
|
|
background-size: 42px 21px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.select_all_tip{ |
|
|
|
} |
|
|
|
.select_all_tip { |
|
|
|
width: 336px; |
|
|
|
height: 32px; |
|
|
|
line-height: 32px; |
|
|
@ -427,18 +612,18 @@ export default { |
|
|
|
font-size: 12px; |
|
|
|
color: #999; |
|
|
|
background: #fff; |
|
|
|
box-shadow: 0 0 5px rgba(0,0,0,.14); |
|
|
|
} |
|
|
|
.select_other{ |
|
|
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.14); |
|
|
|
} |
|
|
|
.select_other { |
|
|
|
width: 600px; |
|
|
|
margin: -20px 0 0 100px; |
|
|
|
padding: 18px 23px; |
|
|
|
background: #f8f8f8; |
|
|
|
border: 1px solid #dcdde3; |
|
|
|
border-radius: 4px; |
|
|
|
.other_tip{ |
|
|
|
.other_tip { |
|
|
|
line-height: 24px; |
|
|
|
span{ |
|
|
|
span { |
|
|
|
display: inline-block; |
|
|
|
margin-left: 20px; |
|
|
|
} |
|
|
@ -451,21 +636,21 @@ export default { |
|
|
|
color: #fff; |
|
|
|
background-color: #ee5747 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-tag--small{ |
|
|
|
} |
|
|
|
.el-tag--small { |
|
|
|
height: 28px; |
|
|
|
line-height: 26px; |
|
|
|
padding: 0 24px; |
|
|
|
margin: 18px 16px 0 0; |
|
|
|
font-size: 14px; |
|
|
|
// color: #3a8aeb; |
|
|
|
::v-deep .el-icon-close{ |
|
|
|
::v-deep .el-icon-close { |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
.add_device_layer{ |
|
|
|
::v-deep .el-dialog__body{ |
|
|
|
} |
|
|
|
.add_device_layer { |
|
|
|
::v-deep .el-dialog__body { |
|
|
|
padding: 0 20px 30px 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |