|
@ -4,93 +4,33 @@ |
|
|
<!--左侧插槽--> |
|
|
<!--左侧插槽--> |
|
|
<slot name="left" /> |
|
|
<slot name="left" /> |
|
|
<!-- type="primary" --> |
|
|
<!-- type="primary" --> |
|
|
<el-button |
|
|
|
|
|
v-if="crud.optShow.add" |
|
|
|
|
|
v-permission="permission.add" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
|
@click="crud.toAdd" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-button v-if="crud.optShow.add" v-permission="permission.add" size="mini" icon="el-icon-plus" @click="crud.toAdd"> |
|
|
新增 |
|
|
新增 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<!-- type="success" --> |
|
|
<!-- type="success" --> |
|
|
<el-button |
|
|
|
|
|
v-if="crud.optShow.edit" |
|
|
|
|
|
v-permission="permission.edit" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
|
:disabled="crud.selections.length !== 1" |
|
|
|
|
|
@click="crud.toEdit(crud.selections[0])" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-button v-if="crud.optShow.edit" v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="crud.selections.length !== 1" @click="crud.toEdit(crud.selections[0])"> |
|
|
修改 |
|
|
修改 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<!-- type="danger" --> |
|
|
<!-- 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="toDelete(crud.selections)"> |
|
|
删除 |
|
|
删除 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<!-- type="warning" --> |
|
|
<!-- type="warning" --> |
|
|
<el-button |
|
|
|
|
|
v-if="crud.optShow.download" |
|
|
|
|
|
:loading="crud.downloadLoading" |
|
|
|
|
|
:disabled="!crud.data.length" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
|
|
|
|
icon="el-icon-download" |
|
|
|
|
|
@click="crud.doExport" |
|
|
|
|
|
>导出</el-button> |
|
|
|
|
|
|
|
|
<el-button v-if="crud.optShow.download" :loading="crud.downloadLoading" :disabled="!crud.data.length" size="mini" icon="el-icon-download" @click="crud.doExport">导出</el-button> |
|
|
<!--右侧--> |
|
|
<!--右侧--> |
|
|
<slot name="right" /> |
|
|
<slot name="right" /> |
|
|
</span> |
|
|
</span> |
|
|
<el-button-group v-if="crud.optShow.group" class="crud-opts-right"> |
|
|
<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()" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-popover |
|
|
|
|
|
placement="bottom-end" |
|
|
|
|
|
width="150" |
|
|
|
|
|
trigger="click" |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
slot="reference" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
icon="el-icon-s-grid" |
|
|
|
|
|
> |
|
|
|
|
|
<i |
|
|
|
|
|
class="fa fa-caret-down" |
|
|
|
|
|
aria-hidden="true" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-button size="mini" plain type="info" icon="el-icon-search" @click="toggleSearch()" /> |
|
|
|
|
|
<el-button size="mini" icon="el-icon-refresh" @click="crud.refresh()" /> |
|
|
|
|
|
<el-popover placement="bottom-end" width="150" trigger="click"> |
|
|
|
|
|
<el-button slot="reference" size="mini" icon="el-icon-s-grid"> |
|
|
|
|
|
<i class="fa fa-caret-down" aria-hidden="true" /> |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-checkbox |
|
|
|
|
|
v-model="allColumnsSelected" |
|
|
|
|
|
:indeterminate="allColumnsSelectedIndeterminate" |
|
|
|
|
|
@change="handleCheckAllChange" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-checkbox v-model="allColumnsSelected" :indeterminate="allColumnsSelectedIndeterminate" @change="handleCheckAllChange"> |
|
|
全选 |
|
|
全选 |
|
|
</el-checkbox> |
|
|
</el-checkbox> |
|
|
<el-checkbox |
|
|
|
|
|
v-for="item in tableColumns" |
|
|
|
|
|
:key="item.property" |
|
|
|
|
|
v-model="item.visible" |
|
|
|
|
|
@change="handleCheckedTableColumnsChange(item)" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-checkbox v-for="item in tableColumns" :key="item.property" v-model="item.visible" @change="handleCheckedTableColumnsChange(item)"> |
|
|
{{ item.label }} |
|
|
{{ item.label }} |
|
|
</el-checkbox> |
|
|
</el-checkbox> |
|
|
</el-popover> |
|
|
</el-popover> |
|
@ -187,10 +127,9 @@ export default { |
|
|
this.tableColumns = columns |
|
|
this.tableColumns = columns |
|
|
}, |
|
|
}, |
|
|
toDelete(datas) { |
|
|
toDelete(datas) { |
|
|
this.$confirm(`确认删除选中的${datas.length}条数据?`, '提示', { |
|
|
|
|
|
|
|
|
this.$confirm(this.crud.confirmDeleteMsg ? this.crud.confirmDeleteMsg : `确认删除选中的${datas.length}条数据?`, '提示', { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
|
|
|
cancelButtonText: '取消' |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
this.crud.delAllLoading = true |
|
|
this.crud.delAllLoading = true |
|
|
this.crud.doDelete(datas) |
|
|
this.crud.doDelete(datas) |
|
@ -250,15 +189,15 @@ export default { |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
.crud-opts { |
|
|
|
|
|
display: -webkit-flex; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
} |
|
|
|
|
|
.crud-opts .crud-opts-right { |
|
|
|
|
|
margin-left: auto; |
|
|
|
|
|
} |
|
|
|
|
|
.crud-opts .crud-opts-right span { |
|
|
|
|
|
float: left; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.crud-opts { |
|
|
|
|
|
display: -webkit-flex; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
} |
|
|
|
|
|
.crud-opts .crud-opts-right { |
|
|
|
|
|
margin-left: auto; |
|
|
|
|
|
} |
|
|
|
|
|
.crud-opts .crud-opts-right span { |
|
|
|
|
|
float: left; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |