Commit df14012a by LJM

bug

parent 42ac445d
Showing with 20 additions and 8 deletions
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</el-table> </el-table>
<div class="row verCenter bothSide"> <div class="row verCenter bothSide">
<div style="margin-left: 13px;"> <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(0)" style="margin-left: 10px;">未读</el-button>
<el-button type="primary" @click="getNewsStatus(1)">已读</el-button> <el-button type="primary" @click="getNewsStatus(1)">已读</el-button>
</div> </div>
...@@ -293,7 +293,6 @@ export default { ...@@ -293,7 +293,6 @@ export default {
return { return {
supplier_id: Number(localStorage.getItem('supplier_id')) || 0, supplier_id: Number(localStorage.getItem('supplier_id')) || 0,
seconds: 10, seconds: 10,
checked: false,
activeName: "all", activeName: "all",
userinfo: {}, userinfo: {},
collapse: false, collapse: false,
...@@ -301,6 +300,8 @@ export default { ...@@ -301,6 +300,8 @@ export default {
tabSure: "", tabSure: "",
tabs: "", tabs: "",
width: "", width: "",
isIndeterminate: false,//对el-checkbox控制不完整的全选状态
checkAll: false,//标记是否全选
dialogVisible: false,//改密码 dialogVisible: false,//改密码
dialogNewsVisible: false,//消息通知 dialogNewsVisible: false,//消息通知
dialogNoticeVisible: false,//系统公告 dialogNoticeVisible: false,//系统公告
...@@ -522,11 +523,13 @@ export default { ...@@ -522,11 +523,13 @@ export default {
/** /**
* 全选 * 全选
*/ */
selectAll(val) { selectAll() {
const row = this.$refs.table.data if (this.$refs.table.selection.length < this.tableData.length) {
row.forEach(row => { this.checkAll = true;
this.$refs.table.toggleAllSelection(row) } else {
}) this.checkAll = false;
}
this.$refs.table.toggleAllSelection();
}, },
/** /**
* 获取tab的数量 * 获取tab的数量
...@@ -664,7 +667,7 @@ export default { ...@@ -664,7 +667,7 @@ export default {
this.msg_category_id = 9; this.msg_category_id = 9;
} }
this.page = 1; this.page = 1;
this.msg_status=''; this.msg_status = '';
this.getNotReadCount(); this.getNotReadCount();
this.getNews(); this.getNews();
}, },
...@@ -674,6 +677,15 @@ export default { ...@@ -674,6 +677,15 @@ export default {
*/ */
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = 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