diff --git a/src/views/system/notifyManage/index.vue b/src/views/system/notifyManage/index.vue
index 5a97db4..cdff735 100644
--- a/src/views/system/notifyManage/index.vue
+++ b/src/views/system/notifyManage/index.vue
@@ -54,7 +54,7 @@
-
+
用户
设备
@@ -102,6 +102,7 @@ export default {
pushObj: '用户',
sendObj: ['全选']
},
+ pushObj: '用户',
checked: '',
msgTypeOptions: [
{ value: '1', label: '系统通知' },
@@ -126,7 +127,7 @@ export default {
{ value: '3', label: '设备3' }
],
selectOptions: [],
- showTags: false,
+ showTags: true,
rules: {
msgType: [
{ required: true, message: '请选择类型', trigger: 'blur' }
@@ -142,7 +143,7 @@ export default {
},
computed: {
sendObjOptions() {
- if (this.sendForm.pushObj === '用户') {
+ if (this.pushObj === '用户') {
return this.personOptions
} else {
return this.devOptions
@@ -156,6 +157,14 @@ export default {
getData() {
this.tableData = data1.rows
},
+ // 默认全选
+ defaultSelAll() {
+ let arr = null
+ arr = this.sendObjOptions.map(item => { return item.value })
+ this.selectOptions = ['全选', ...arr]
+ console.log(this.selectOptions)
+ this.showTags = true
+ },
clickRowHandler(row) {
// this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row) // 单选选中
@@ -165,6 +174,7 @@ export default {
},
// 发布
handleSend() {
+ this.defaultSelAll()
this.sendVisible = true
},
handleEdit() {
@@ -203,15 +213,15 @@ export default {
this.checked = false
}
},
- selectAll(val) {
- this.sendForm.sendObj = []
- if (val) {
- this.sendForm.sendObj = this.sendObjOptions.map(item => item.value)
- } else {
- this.sendForm.sendObj = []
- }
- // console.log(this.sendForm.sendObj)
- },
+ // selectAll(val) {
+ // this.sendForm.sendObj = []
+ // if (val) {
+ // this.sendForm.sendObj = this.sendObjOptions.map(item => item.value)
+ // } else {
+ // this.sendForm.sendObj = []
+ // }
+ // // console.log(this.sendForm.sendObj)
+ // },
// el-select 选中值发生变化时触发,val为目前选中的值
changeSelect(val) {
// 最后选中得值
@@ -248,8 +258,10 @@ export default {
},
pushObjChange(val) {
if (val) {
- this.selectOptions = []
- this.showTags = false
+ // this.selectOptions = []
+ // this.showTags = false
+ this.defaultSelAll()
+ this.showTags = true
}
}
}