Commit ddd32afc by Sendya

chore: list demo update

parent 059d8b5f
......@@ -81,6 +81,7 @@
:columns="columns"
:data="loadData"
:alert="{ show: true, clear: true }"
:rowSelection="{ selectedRowKeys: this.selectedRowKeys, onChange: this.onSelectChange }"
>
<template v-for="(col, index) in columns" v-if="col.scopedSlots" :slot="col.dataIndex" slot-scope="text, record, index">
<div :key="index">
......@@ -194,7 +195,7 @@ export default {
// row = Object.assign({}, row)
},
// eslint-disable-next-line
del (row) {
del (row) {
this.$confirm({
title: '警告',
content: `真的要删除 ${row.no} 吗?`,
......@@ -220,9 +221,9 @@ export default {
row.editable = false
},
onChange (row) {
this.selectedRowKeys = row.selectedRowKeys
this.selectedRows = row.selectedRows
onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows
},
toggleAdvanced () {
this.advanced = !this.advanced
......
......@@ -63,7 +63,7 @@
<div class="table-operator">
<a-button type="primary" icon="plus" @click="$router.push({ name: 'QueryListEdit' })">新建</a-button>
<a-button type="dashed" @click="tableOption(false)" v-if="optionAlertShow">关闭 alert</a-button>
<a-button type="dashed" @click="tableOption">{{ optionAlertShow && '关闭' || '开启' }} alert</a-button>
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1"><a-icon type="delete" />删除</a-menu-item>
......@@ -188,16 +188,16 @@ export default {
onChange: this.onSelectChange
}
},
optionAlertShow: true
optionAlertShow: false
}
},
created () {
this.tableOption(true)
this.tableOption()
getRoleList({ t: new Date() })
},
methods: {
tableOption (bool) {
if (bool) {
tableOption () {
if (!this.optionAlertShow) {
this.options = {
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
rowSelection: {
......@@ -205,6 +205,7 @@ export default {
onChange: this.onSelectChange
}
}
this.optionAlertShow = true
} else {
this.options = {
alert: 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 to comment