Commit df14012a by LJM

bug

parent 42ac445d
Showing with 20 additions and 8 deletions
......@@ -241,7 +241,7 @@
</el-table>
<div class="row verCenter bothSide">
<div style="margin-left: 13px;">
<el-checkbox v-model="checked" @change="selectAll"></el-checkbox>
<el-checkbox @change="selectAll" v-model="checkAll" :indeterminate="isIndeterminate"></el-checkbox>
<el-button type="primary" @click="getNewsStatus(0)" style="margin-left: 10px;">未读</el-button>
<el-button type="primary" @click="getNewsStatus(1)">已读</el-button>
</div>
......@@ -293,7 +293,6 @@ export default {
return {
supplier_id: Number(localStorage.getItem('supplier_id')) || 0,
seconds: 10,
checked: false,
activeName: "all",
userinfo: {},
collapse: false,
......@@ -301,6 +300,8 @@ export default {
tabSure: "",
tabs: "",
width: "",
isIndeterminate: false,//对el-checkbox控制不完整的全选状态
checkAll: false,//标记是否全选
dialogVisible: false,//改密码
dialogNewsVisible: false,//消息通知
dialogNoticeVisible: false,//系统公告
......@@ -522,11 +523,13 @@ export default {
/**
* 全选
*/
selectAll(val) {
const row = this.$refs.table.data
row.forEach(row => {
this.$refs.table.toggleAllSelection(row)
})
selectAll() {
if (this.$refs.table.selection.length < this.tableData.length) {
this.checkAll = true;
} else {
this.checkAll = false;
}
this.$refs.table.toggleAllSelection();
},
/**
* 获取tab的数量
......@@ -664,7 +667,7 @@ export default {
this.msg_category_id = 9;
}
this.page = 1;
this.msg_status='';
this.msg_status = '';
this.getNotReadCount();
this.getNews();
},
......@@ -674,6 +677,15 @@ export default {
*/
handleSelectionChange(val) {
this.multipleSelection = val;
if (val.length < this.tableData.length && val.length > 0) {
this.isIndeterminate = true;
} else if (val.length == this.tableData.length) {
this.isIndeterminate = false;
this.checkAll = true;
} else if (val.length == 0) {
this.isIndeterminate = false;
this.checkAll = false;
}
},
/**
* 分页条数切换
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment