|
@@ -14,7 +14,7 @@
|
|
|
<!-- 展示部分 -->
|
|
|
<el-main class="main">
|
|
|
<div class="main-head">
|
|
|
- <div class="showType" v-show="!isShowCheck">
|
|
|
+ <div class="showType" v-show="!selectCard.length">
|
|
|
<el-radio-group v-model="isPub" size="small">
|
|
|
<el-radio-button label="已发布">已发布</el-radio-button>
|
|
|
<el-radio-button label="未发布">未发布</el-radio-button>
|
|
@@ -27,18 +27,19 @@
|
|
|
</Dropdown>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="showAction" v-show="isShowCheck">
|
|
|
- <el-checkbox v-model="checkAll">全选</el-checkbox>
|
|
|
+ <div class="showAction" v-show="selectCard.length">
|
|
|
+ <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
<span style="margin-left: 10px;">|</span>
|
|
|
<span class="sum">已选择<span style="color:#252b30;margin: 0 5px;">{{selectCard.length}}</span>项目</span>
|
|
|
<el-button size="mini">移动到</el-button>
|
|
|
<el-button size="mini">下载</el-button>
|
|
|
<el-button size="mini">删除</el-button>
|
|
|
+ <i class="el-icon-close" style="float:right;line-height: 100%"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="main-body">
|
|
|
<template v-for="t in cardList">
|
|
|
- <topoImageCard :data="t" :key="t.id"></topoImageCard>
|
|
|
+ <topoImageCard :data="t" :key="t.id" @changeCheck="changeCheck"></topoImageCard>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-main>
|
|
@@ -187,7 +188,7 @@ export default {
|
|
|
],
|
|
|
checkAll: false,
|
|
|
selectCard: [],
|
|
|
- isShowCheck: false,
|
|
|
+ isIndeterminate: true, // 全选按钮
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -213,6 +214,23 @@ export default {
|
|
|
resetForm(formName) {
|
|
|
this.$refs[formName].resetFields();
|
|
|
},
|
|
|
+ changeCheck(v){
|
|
|
+ const index = this.selectCard.indexOf(v);
|
|
|
+ console.log(index);
|
|
|
+ if (index > -1) {
|
|
|
+ this.selectCard.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ this.selectCard.push(v);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCheckAllChange(val) {
|
|
|
+ this.cardList = this.cardList.map(t => {
|
|
|
+ t.checked = val
|
|
|
+ return t;
|
|
|
+ })
|
|
|
+ this.selectCard = val ? this.cardList.map(t => {t.checked = true}) : [];
|
|
|
+ this.isIndeterminate = false;
|
|
|
+ },
|
|
|
},
|
|
|
components: { Select, Button, leftAsideTree, Dropdown, topoImageCard },
|
|
|
};
|