|
|
@ -12,7 +12,7 @@ |
|
|
|
修改 |
|
|
|
</el-button> |
|
|
|
<!-- type="danger" --> |
|
|
|
<el-button v-if="crud.optShow.del" slot="reference" v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"> |
|
|
|
<el-button v-if="crud.optShow.del" slot="reference" v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="delVisible=true"> |
|
|
|
删除 |
|
|
|
</el-button> |
|
|
|
<!-- type="warning" --> |
|
|
@ -20,6 +20,17 @@ |
|
|
|
<!--右侧--> |
|
|
|
<slot name="right" /> |
|
|
|
</div> |
|
|
|
<!-- 删除弹窗 --> |
|
|
|
<el-dialog :visible.sync="delVisible" title="确认删除"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<p class="delMsg">确定删除所选{{ crud.selections.length }}条数据吗?</p> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" :loading="crud.delAllLoading" @click="toDelete(crud.selections)">确定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-button-group v-if="crud.optShow.group" class="crud-opts-right"> |
|
|
|
<el-button size="mini" plain type="info" icon="el-icon-search" @click="toggleSearch()" /> |
|
|
|
<el-button size="mini" icon="el-icon-refresh" @click="crud.refresh()" /> |
|
|
@ -79,7 +90,9 @@ export default { |
|
|
|
allColumnsSelectedIndeterminate: false, |
|
|
|
tableUnwatcher: null, |
|
|
|
// 忽略下次表格列变动 |
|
|
|
ignoreNextTableColumnsChange: false |
|
|
|
ignoreNextTableColumnsChange: false, |
|
|
|
delVisible: false |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -128,14 +141,15 @@ export default { |
|
|
|
this.tableColumns = columns |
|
|
|
}, |
|
|
|
toDelete(datas) { |
|
|
|
this.$confirm(this.crud.confirmDeleteMsg ? this.crud.confirmDeleteMsg : `确认删除选中的${datas.length}条数据?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消' |
|
|
|
}).then(() => { |
|
|
|
// this.$confirm(this.crud.confirmDeleteMsg ? this.crud.confirmDeleteMsg : `确认删除选中的${datas.length}条数据?`, '提示', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// cancelButtonText: '取消' |
|
|
|
// }).then(() => { |
|
|
|
this.crud.delAllLoading = true |
|
|
|
this.delVisible = false |
|
|
|
this.crud.doDelete(datas) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
// }).catch(() => { |
|
|
|
// }) |
|
|
|
}, |
|
|
|
handleCheckAllChange(val) { |
|
|
|
if (val === false) { |
|
|
@ -207,4 +221,8 @@ export default { |
|
|
|
.crud-opts .crud-opts-right span { |
|
|
|
float: left; |
|
|
|
} |
|
|
|
.delMsg{ |
|
|
|
color: #fff; |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
</style> |