-
-
+ ]">
+
-
-
+ ]">
+
-
-
-
+ ]">
+
+
-
-
-
+ ]">
+
+
-
-
-
+ ]">
+
+
-
-
+ ]">
+
所有设备
- 部分设备添加
+ 部分设备添加
所有设备都将被发送
-
+
- 以下设备都将被发送总计{{ deviceTags.length }}个设备
+ 以下设备都将被发送总计{{ deviceTags.length }}个设备
- 清空
+ 清空
-
+
{{ tag.device_name }}
@@ -242,23 +106,9 @@
-
-
-
+
+
{{ tag.device_name }}
@@ -278,11 +128,11 @@ import {
export default {
name: 'UrgentMessage',
filters: {
- parseTime(time, cFormat) {
+ parseTime (time, cFormat) {
return parseTime(time, cFormat)
}
},
- data() {
+ data () {
return {
isAddEdit: false,
form: {
@@ -334,13 +184,13 @@ export default {
urgentMessage: []
}
},
- mounted() {
+ mounted () {
this.getUrgentMessage()
this.getDevice()
},
methods: {
// 获取紧急通知的列表
- getUrgentMessage(pager = 1) {
+ getUrgentMessage (pager = 1) {
this.queryInfo.page = pager
const params = this.queryInfo
reqUrgentMessage(params).then((res) => {
@@ -352,7 +202,7 @@ export default {
})
},
// 获取设备列表的信息
- getDevice() {
+ getDevice () {
const params = this.queryInfo
ReqDeviceList(params).then((res) => {
if (res.code == 200) {
@@ -364,7 +214,7 @@ export default {
},
// 紧急通知的状态 is_state为1 发布中 2 停止
// row.is_state == 1 ? "停止" : "恢复"
- isStopHandle(index, row) {
+ isStopHandle (index, row) {
console.log(row)
// console.log(index)
if (row.is_state == 1) {
@@ -396,7 +246,7 @@ export default {
})
},
// 编辑
- editFormData(row) {
+ editFormData (row) {
this.messageVisible = true
// 根据id查询返回的紧急通知的数据
const params = {
@@ -440,14 +290,14 @@ export default {
})
},
// 新增
- addFormData() {
+ addFormData () {
this.messageVisible = true
this.$nextTick(() => {
this.form.notice_id = null
})
},
// 提交
- submit() {
+ submit () {
this.$refs.form.validate((valid) => {
// 修改
if (valid) {
@@ -478,13 +328,13 @@ export default {
})
},
// 所有设备和部分设备的切换数据处理
- clearCheckbox() {
+ clearCheckbox () {
if (this.form.notice_device == 1) {
this.form.notice_devices = []
}
},
// 多选框
- handleSelectionChange(val) {
+ handleSelectionChange (val) {
this.selectedList = val
// if (val.length > 0) {
// this.clearBtnDisabled = false;
@@ -493,30 +343,31 @@ export default {
// }
},
// 改变文字的颜色
- headleChangeColor() {
+ headleChangeColor () {
this.form.context_size
},
// 改变文字的大小
- selectSize(selVal) {
+ selectSize (selVal) {
this.form.context_size = selVal.key
this.form.context_size_name = selVal.name
},
// 改变文字的位置
- selectPosition(selVal) {
+ selectPosition (selVal) {
+ console.log(selVal)
this.form.context_position = selVal.key
this.form.context_position_name = selVal.name
},
// 速度
- selectSpeed(selVal) {
+ selectSpeed (selVal) {
this.form.context_speed = selVal.key
this.form.context_speed_name = selVal.name
},
// 添加设备的对话框
- addDeviceTag() {
+ addDeviceTag () {
this.selectDeviceVisible = true
},
// 添加设备
- tagHandle(tag) {
+ tagHandle (tag) {
// 收集参数 部分设备的列表
if (this.form.notice_devices.length == 0) {
this.form.notice_devices.push({ deviceId: tag.device_id })
@@ -534,8 +385,8 @@ export default {
this.deviceTags.push(tag)
} else {
const current =
- this.deviceTags &&
- this.deviceTags.some((item) => item.device_name == tag.device_name)
+ this.deviceTags &&
+ this.deviceTags.some((item) => item.device_name == tag.device_name)
if (!current) {
this.deviceTags.push(tag)
} else {
@@ -546,20 +397,20 @@ export default {
}
},
// 单独删除某一个设备
- handleClose(tag) {
+ handleClose (tag) {
this.deviceTags.splice(this.deviceTags.indexOf(tag), 1)
},
// 清空设备
- clearDevice() {
+ clearDevice () {
this.deviceTags = []
},
// 关闭重置表单
- closeDialog() {
+ closeDialog () {
this.messageVisible = false
this.$refs.form.resetFields()
},
// 每条显示数据改变时的事件
- handleSizeChange(size) {
+ handleSizeChange (size) {
// 整理参数
this.queryInfo.size = size
this.getUrgentMessage()
@@ -569,84 +420,84 @@ export default {