|
@ -46,7 +46,7 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 编辑紧急通知 --> |
|
|
<div class="publish_layer"> |
|
|
<div class="publish_layer"> |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="紧急发布" |
|
|
title="紧急发布" |
|
@ -60,7 +60,7 @@ |
|
|
label="文本颜色" |
|
|
label="文本颜色" |
|
|
prop="context_color" |
|
|
prop="context_color" |
|
|
:rules="[ |
|
|
: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" /> |
|
@ -68,7 +68,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="文本内容" |
|
|
label="文本内容" |
|
|
prop="content" |
|
|
|
|
|
|
|
|
prop="context" |
|
|
:rules="[ |
|
|
:rules="[ |
|
|
{ required: true, message: '请输入文本内容', trigger: 'blur' } |
|
|
{ required: true, message: '请输入文本内容', trigger: 'blur' } |
|
|
]" |
|
|
]" |
|
@ -77,12 +77,12 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="文本大小" |
|
|
label="文本大小" |
|
|
prop="txtSize" |
|
|
|
|
|
|
|
|
prop="context_size" |
|
|
:rules="[ |
|
|
:rules="[ |
|
|
{ required: true, message: '请选择文本大小', trigger: 'change' }, |
|
|
{ required: true, message: '请选择文本大小', trigger: 'change' }, |
|
|
]" |
|
|
]" |
|
|
> |
|
|
> |
|
|
<el-select v-model="form.txtSize" size="small" class="filter-item"> |
|
|
|
|
|
|
|
|
<el-select v-model="form.context_size" size="small" class="filter-item"> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in sizeData" |
|
|
v-for="item in sizeData" |
|
|
:key="item.key" |
|
|
:key="item.key" |
|
@ -93,50 +93,50 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="文本位置" |
|
|
label="文本位置" |
|
|
prop="context_position" |
|
|
|
|
|
|
|
|
prop="context_position_name" |
|
|
:rules="[ |
|
|
:rules="[ |
|
|
{ required: true, message: '请选择文本位置', trigger: 'change' }, |
|
|
{ required: true, message: '请选择文本位置', trigger: 'change' }, |
|
|
]" |
|
|
]" |
|
|
> |
|
|
> |
|
|
<el-select v-model="form.context_position" size="small" class="filter-item"> |
|
|
|
|
|
|
|
|
<el-select v-model="form.context_position_name" size="small" value-key="name" class="filter-item" @change="selectPosition"> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in positionData" |
|
|
v-for="item in positionData" |
|
|
:key="item.key" |
|
|
:key="item.key" |
|
|
:label="item.name" |
|
|
:label="item.name" |
|
|
:value="item.key" |
|
|
|
|
|
|
|
|
:value="item" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="滚动速度" |
|
|
label="滚动速度" |
|
|
prop="speed" |
|
|
|
|
|
|
|
|
prop="context_speed_name" |
|
|
:rules="[ |
|
|
:rules="[ |
|
|
{ required: true, message: '请选择滚动速度', trigger: 'change' }, |
|
|
{ required: true, message: '请选择滚动速度', trigger: 'change' }, |
|
|
]" |
|
|
]" |
|
|
> |
|
|
> |
|
|
<el-select v-model="form.speed" size="small" class="filter-item"> |
|
|
|
|
|
|
|
|
<el-select v-model="form.context_speed_name" size="small" class="filter-item" @change="selectSpeed"> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in speedData" |
|
|
v-for="item in speedData" |
|
|
:key="item.key" |
|
|
:key="item.key" |
|
|
:label="item.name" |
|
|
:label="item.name" |
|
|
:value="item.key" |
|
|
|
|
|
|
|
|
:value="item" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="选择设备" |
|
|
label="选择设备" |
|
|
prop="deviceSelect" |
|
|
|
|
|
|
|
|
prop="notice_device" |
|
|
:rules="[ |
|
|
:rules="[ |
|
|
{ required: true, message: '请选择设备', trigger: 'change' }, |
|
|
{ required: true, message: '请选择设备', trigger: 'change' }, |
|
|
]" |
|
|
]" |
|
|
> |
|
|
> |
|
|
<el-radio-group v-model="form.deviceSelect"> |
|
|
|
|
|
<el-radio label="all" value="all">所有设备</el-radio> |
|
|
|
|
|
<el-radio label="other" value="other">部分设备<i v-if="form.deviceSelect === 'other'" 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-radio-group> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<div v-if="form.deviceSelect === 'all'" class="select_all_tip">所有设备都将被发送</div> |
|
|
|
|
|
<div v-if="deviceTags.length>0 && form.deviceSelect === 'other'" 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-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-col :span="4"> |
|
@ -145,21 +145,21 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-tag |
|
|
<el-tag |
|
|
v-for="tag in deviceTags" |
|
|
v-for="tag in deviceTags" |
|
|
:key="tag" |
|
|
|
|
|
|
|
|
:key="tag.device_id" |
|
|
closable |
|
|
closable |
|
|
:disable-transitions="true" |
|
|
:disable-transitions="true" |
|
|
:hit="false" |
|
|
:hit="false" |
|
|
context_color="#cbe3ff" |
|
|
context_color="#cbe3ff" |
|
|
@close="handleClose(tag)" |
|
|
@close="handleClose(tag)" |
|
|
> |
|
|
> |
|
|
{{ tag }} |
|
|
|
|
|
|
|
|
{{ tag.device_name}} |
|
|
</el-tag> |
|
|
</el-tag> |
|
|
</div> |
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<!-- :loading="crud.status.cu === 2" |
|
|
<!-- :loading="crud.status.cu === 2" |
|
|
@click="crud.submitCU"--> |
|
|
@click="crud.submitCU"--> |
|
|
<el-button type="primary" round>保存</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" round @click="submit">保存</el-button> |
|
|
<el-button round @click="messageVisible=false">关闭</el-button> |
|
|
<el-button round @click="messageVisible=false">关闭</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@ -173,15 +173,15 @@ |
|
|
width="400px" |
|
|
width="400px" |
|
|
> |
|
|
> |
|
|
<el-tag |
|
|
<el-tag |
|
|
v-for="tag in deviceAllTags" |
|
|
|
|
|
:key="tag" |
|
|
|
|
|
|
|
|
v-for="tag in deviceList" |
|
|
|
|
|
:key="tag.device_id" |
|
|
:disable-transitions="true" |
|
|
:disable-transitions="true" |
|
|
:hit="false" |
|
|
:hit="false" |
|
|
color="#cbe3ff" |
|
|
color="#cbe3ff" |
|
|
class="all_tags" |
|
|
class="all_tags" |
|
|
@click="tagHandle(tag)" |
|
|
@click="tagHandle(tag)" |
|
|
> |
|
|
> |
|
|
{{ tag }} |
|
|
|
|
|
|
|
|
{{ tag.device_name }} |
|
|
</el-tag> |
|
|
</el-tag> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
@ -190,7 +190,8 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { parseTime } from '@/utils/index.js' |
|
|
import { parseTime } from '@/utils/index.js' |
|
|
import {reqUrgentMessage} from '@/api/publish/urgentMessage' |
|
|
|
|
|
|
|
|
import { ReqDeviceList} from '@/api/device/deviceList.js' |
|
|
|
|
|
import {reqUrgentMessage,reqQueryMessage} from '@/api/publish/urgentMessage' |
|
|
export default { |
|
|
export default { |
|
|
name: 'UrgentMessage', |
|
|
name: 'UrgentMessage', |
|
|
filters: { |
|
|
filters: { |
|
@ -203,10 +204,16 @@ export default { |
|
|
form :{ |
|
|
form :{ |
|
|
context_color: '#ff0000',//文本的颜色 |
|
|
context_color: '#ff0000',//文本的颜色 |
|
|
context: '', //文本的内容 |
|
|
context: '', //文本的内容 |
|
|
txtSize: '', //文本的大小 |
|
|
|
|
|
context_position: '', //文本的位置 |
|
|
|
|
|
speed: '', //文本的速度 |
|
|
|
|
|
deviceSelect: '' //选择的设备 |
|
|
|
|
|
|
|
|
context_position: null, //文本的位置 |
|
|
|
|
|
context_position_name:null, |
|
|
|
|
|
context_speed_name:null, |
|
|
|
|
|
context_speed: null, //文本的速度 |
|
|
|
|
|
context_size:null,//文字的大小 |
|
|
|
|
|
// create_by:'', //发布人 |
|
|
|
|
|
notice_device:null, |
|
|
|
|
|
notice_devices:[], |
|
|
|
|
|
notice_id:'' ,//紧急通知的id |
|
|
|
|
|
orga_id:'133221333123111', |
|
|
}, |
|
|
}, |
|
|
queryInfo:{ |
|
|
queryInfo:{ |
|
|
notice_name:'', |
|
|
notice_name:'', |
|
@ -216,11 +223,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
messageVisible: false, |
|
|
messageVisible: false, |
|
|
selectDeviceVisible: false, |
|
|
selectDeviceVisible: false, |
|
|
sizeData: [{ key: '0', name: '16' }, { key: '1', name: '22' }, { key: '2', name: '24' }, { key: '3', name: '30' }], |
|
|
|
|
|
positionData: [{ key: '0', name: '顶部' }, { key: '1', name: '中间' }, { key: '2', 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: [], |
|
|
selectedList: [], |
|
|
deviceAllTags: ['GCXR1', 'GCXR2', 'GCXR3', 'GCXR4', 'GCXR5'], |
|
|
|
|
|
|
|
|
// 部分设备列表的数据 |
|
|
|
|
|
deviceList: [], |
|
|
|
|
|
// newArr:[], |
|
|
deviceTags: [], |
|
|
deviceTags: [], |
|
|
// 紧急通知列表 |
|
|
// 紧急通知列表 |
|
|
urgentMessage:[] |
|
|
urgentMessage:[] |
|
@ -228,6 +237,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
mounted(){ |
|
|
mounted(){ |
|
|
this.getUrgentMessage() |
|
|
this.getUrgentMessage() |
|
|
|
|
|
this.getDevice() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 获取紧急通知的列表 |
|
|
// 获取紧急通知的列表 |
|
@ -237,7 +247,19 @@ export default { |
|
|
|
|
|
|
|
|
if(res.code==200){ |
|
|
if(res.code==200){ |
|
|
this.urgentMessage=res.data.content |
|
|
this.urgentMessage=res.data.content |
|
|
console.log( this.urgentMessage) |
|
|
|
|
|
|
|
|
// 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('获取设备列表失败!') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -253,7 +275,51 @@ export default { |
|
|
editFormData(row) { |
|
|
editFormData(row) { |
|
|
console.log(row) |
|
|
console.log(row) |
|
|
this.messageVisible = true |
|
|
this.messageVisible = true |
|
|
this.form.context=row.context |
|
|
|
|
|
|
|
|
// 根据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 |
|
|
|
|
|
// 判断文字位置 |
|
|
|
|
|
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' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
submit(){ |
|
|
|
|
|
console.log("submit--") |
|
|
|
|
|
console.log(this.form.notice_device) |
|
|
|
|
|
console.log(this.form.notice_devices) |
|
|
|
|
|
console.log("----submit") |
|
|
|
|
|
}, |
|
|
|
|
|
// 所有设备和部分设备的切换数据处理 |
|
|
|
|
|
clearCheckbox(){ |
|
|
|
|
|
if(this.form.notice_device==1){ |
|
|
|
|
|
this.form.notice_devices=[] |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.form.AllDevice=this.deviceList |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleSelectionChange(val) { |
|
|
handleSelectionChange(val) { |
|
|
this.selectedList = val |
|
|
this.selectedList = val |
|
@ -264,23 +330,51 @@ export default { |
|
|
} |
|
|
} |
|
|
// console.log(val) |
|
|
// console.log(val) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 改变文字的颜色 |
|
|
headleChangeColor() { |
|
|
headleChangeColor() { |
|
|
// console.log(this.form.context_color) |
|
|
|
|
|
|
|
|
console.log(this.form.context_color) |
|
|
|
|
|
}, |
|
|
|
|
|
// 改变文字的位置 |
|
|
|
|
|
selectPosition(selVal){ |
|
|
|
|
|
// console.log(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 |
|
|
|
|
|
}, |
|
|
|
|
|
//添加设备的对话框 |
|
|
addDeviceTag() { |
|
|
addDeviceTag() { |
|
|
this.selectDeviceVisible = true |
|
|
this.selectDeviceVisible = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 添加设备 |
|
|
tagHandle(tag) { |
|
|
tagHandle(tag) { |
|
|
// console.log(tag) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.form.notice_devices.push({deviceId:tag.device_id}) |
|
|
|
|
|
|
|
|
|
|
|
const current = this.deviceTags.every((item) => {item == tag} ) |
|
|
|
|
|
// 查找是否存在相同的 |
|
|
|
|
|
console.log('current', current) |
|
|
|
|
|
if (!current) { |
|
|
|
|
|
// console.log('没有相同的') |
|
|
this.deviceTags.push(tag) |
|
|
this.deviceTags.push(tag) |
|
|
|
|
|
} |
|
|
|
|
|
// } else { |
|
|
|
|
|
// console.log('有相同的') |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
// 单独删除某一个设备 |
|
|
handleClose(tag) { |
|
|
handleClose(tag) { |
|
|
this.deviceTags.splice(this.deviceTags.indexOf(tag), 1) |
|
|
this.deviceTags.splice(this.deviceTags.indexOf(tag), 1) |
|
|
// console.log(this.deviceTags) |
|
|
// console.log(this.deviceTags) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 清空设备 |
|
|
clearDevice() { |
|
|
clearDevice() { |
|
|
this.deviceTags = [] |
|
|
this.deviceTags = [] |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|