Browse Source

紧急发布Bug修复

dev
xuhuajiao 3 years ago
parent
commit
db425253cc
  1. 4
      src/views/publishContent/publishList/index.vue
  2. 48
      src/views/publishContent/urgentMessage/index.vue

4
src/views/publishContent/publishList/index.vue

@ -150,7 +150,7 @@ export default {
FetchUpdateReleaseState(params).then(res => {
if (res.code == 200) {
this.$message.success(res.msg)
this.getPublishList()
this.getPublishList(this.page)
} else {
this.$message.error(res.msg)
}
@ -170,7 +170,7 @@ export default {
FetchDeleteRelease(params).then(res => {
if (res.code == 200) {
this.$message.success(res.msg)
this.getPublishList()
this.getPublishList(this.page)
} else {
this.$message.error(res.msg)
}

48
src/views/publishContent/urgentMessage/index.vue

@ -106,10 +106,10 @@
<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 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="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="4">
@ -279,8 +279,10 @@ export default {
reqQueryMessage(params).then((res) => {
if (res.code == 200) {
this.form.notice_device = res.data.notice.noticeDevice
this.deviceTags = res.data.noticeDeviceDetailsVO
this.form.context_color = res.data.notice.contextColor
this.form.context = res.data.notice.context
this.form.context_speed = res.data.notice.contextSpeed
this.form.context_position = res.data.notice.contextPosition
this.form.context_size = res.data.notice.contextSize
this.form.notice_id = row.notice_id
@ -293,7 +295,7 @@ export default {
this.form.context_position_name = '底部'
}
//
if (this.form.context_speed_name == 0) {
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'
@ -323,6 +325,18 @@ export default {
//
submit() {
this.$refs.form.validate((valid) => {
console.log(this.deviceTags)
console.log(this.form.notice_devices)
if (this.form.notice_device == 2) {
if (this.deviceTags.length != 0) {
this.deviceTags.forEach(item => {
this.form.notice_devices.push({ deviceId: item.device_id })
})
} else {
this.$message.error('请添加设备!')
return
}
}
//
if (valid) {
const params = {
@ -336,6 +350,7 @@ export default {
notice_id: this.form.notice_id,
orga_id: '133221333123111'
}
console.log(params)
reqEditMessage(params).then((res) => {
if (res.code == 200) {
this.$message({
@ -345,6 +360,7 @@ export default {
: '添加紧急通知成功'
})
this.messageVisible = false
this.$refs.form.resetFields()
this.getUrgentMessage(this.queryInfo.page)
}
})
@ -393,26 +409,27 @@ export default {
//
tagHandle(tag) {
//
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.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.form.notice_devices.push({ deviceId: tag.device_id })
this.deviceTags.push(tag)
} else {
const current =
this.deviceTags &&
this.deviceTags.some((item) => item.device_name == tag.device_name)
this.deviceTags.some((item) => item.device_id == tag.device_id)
if (!current) {
this.deviceTags.push(tag)
// this.form.notice_devices.push({ deviceId: tag.device_id })
} else {
this.$message('请勿添加重复的设备!')
}
@ -427,6 +444,7 @@ export default {
//
clearDevice() {
this.deviceTags = []
this.form.notice_devices = []
},
//
closeDialog() {

Loading…
Cancel
Save