Browse Source

fixed: table search style
add: lodash.get

Sendya 6 years ago
parent
commit
ab816d107f

+ 1 - 0
package.json

@@ -14,6 +14,7 @@
     "dayjs": "^1.7.5",
     "enquire.js": "^2.1.6",
     "js-cookie": "^2.2.0",
+    "lodash.get": "^4.4.2",
     "md5": "^2.2.1",
     "nprogress": "^0.2.0",
     "viser-vue": "^2.3.0",

+ 38 - 12
src/components/layout/LayoutMain.vue

@@ -1,7 +1,7 @@
 <template>
   <a-layout class="layout">
 
-    <a-drawer 
+    <a-drawer 
       v-if="device === 'mobile'"
       wrapClassName="drawer-sider"
       placement="left"
@@ -238,24 +238,50 @@
     margin-bottom: 16px;
   }
 
-  .content {
+  .table-page-search-wrapper {
+
+    .ant-form-inline {
+
+      .ant-form-item {
+        display: flex;
+        margin-bottom: 24px;
+        margin-right: 0;
+
+        .ant-form-item-control-wrapper {
+          flex: 1 1;
+          display: inline-block;
+          vertical-align: middle;
+        }
 
-    .search {
-      margin-bottom: 54px;
+        >.ant-form-item-label {
+          line-height: 32px;
+          padding-right: 8px;
+          width: auto;
+        }
+        .ant-form-item-control {
+          height: 32px;
+          line-height: 32px;
+        }
+      }
     }
 
-    .fold {
-      width: calc(100% - 216px);
-      display: inline-block
+    .table-page-search-submitButtons {
+      display: block;
+      margin-bottom: 24px;
+      white-space: nowrap;
     }
 
-    .operator {
+  }
+
+  .content {
+
+
+
+    .table-operator {
       margin-bottom: 18px;
-    }
 
-    @media screen and (max-width: 900px) {
-      .fold {
-        width: 100%;
+      button {
+        margin-right: 8px;
       }
     }
   }

+ 67 - 47
src/components/table/index.js

@@ -1,4 +1,5 @@
 import T from "ant-design-vue/es/table/Table";
+import get from "lodash.get"
 export default {
   data() {
     return {
@@ -13,6 +14,10 @@ export default {
     };
   },
   props: Object.assign({}, T.props, {
+    rowKey: {
+      type: String,
+      default: 'id'
+    },
     data: {
       type: Function,
       required: true
@@ -33,9 +38,12 @@ export default {
       type: Boolean,
       default: false
     },
+    showPagination: {
+      default: 'auto'
+    }
   }),
   watch: {
-    'localPagination.current' (val) {
+    'localPagination.current'(val) {
       this.$router.push({
         name: this.$route.name,
         params: Object.assign({}, this.$route.params, {
@@ -44,41 +52,28 @@ export default {
       });
     },
     pageNum(val) {
-      this.localPagination = Object.assign({}, this.localPagination, {
+      Object.assign(this.localPagination, {
         current: val
       });
     },
     pageSize(val) {
-      this.localPagination = Object.assign({}, this.localPagination, {
+      Object.assign(this.localPagination, {
         pageSize: val
       });
     },
     showSizeChanger(val) {
-      this.localPagination = Object.assign({}, this.localPagination, {
+      Object.assign(this.localPagination, {
         showSizeChanger: val
       });
-    },
-    /*
-    'selectedRows': function (selectedRows) {
-      this.needTotalList = this.needTotalList.map(item => {
-        return {
-          ...item,
-          total: selectedRows.reduce( (sum, val) => {
-            return sum + val[item.dataIndex]
-          }, 0)
-        }
-      })
-    }*/
+    }
   },
   created() {
-    this.localPagination = Object.assign({}, this.localPagination, {
+    this.localPagination = ['auto', true].includes(this.showPagination) && Object.assign({}, this.localPagination, {
       current: this.pageNum,
       pageSize: this.pageSize,
       showSizeChanger: this.showSizeChanger
     });
-
     this.needTotalList = this.initTotalList(this.columns)
-
     this.loadData();
   },
   methods: {
@@ -87,13 +82,11 @@ export default {
     },
     loadData(pagination, filters, sorter) {
       this.localLoading = true
-      const result = this.data(
+      var result = this.data(
         Object.assign({
-            pageNo:
-              (pagination && pagination.current) ||
+            pageNo: (pagination && pagination.current) ||
               this.localPagination.current,
-            pageSize:
-              (pagination && pagination.pageSize) ||
+            pageSize: (pagination && pagination.pageSize) ||
               this.localPagination.pageSize
           },
           (sorter && sorter.field && {
@@ -116,23 +109,26 @@ export default {
             pageSize: (pagination && pagination.pageSize) ||
               this.localPagination.pageSize
           });
+
+          !r.totalCount && ['auto', false].includes(this.showPagination) && (this.localPagination = false)
+          console.log(this.localPagination);
           this.localDataSource = r.data; // 返回结果中的数组数据
           this.localLoading = false
-        }).catch(() => {
-          this.localLoading = false
         });
       }
     },
-    initTotalList (columns) {
+    initTotalList(columns) {
       const totalList = []
-      columns.forEach(column => {
+      columns && columns instanceof Array && columns.forEach(column => {
         if (column.needTotal) {
-          totalList.push({ ...column, total: 0 })
+          totalList.push({ ...column,
+            total: 0
+          })
         }
       })
       return totalList
     },
-    updateSelect (selectedRowKeys, selectedRows) {
+    updateSelect(selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
       let list = this.needTotalList
@@ -140,7 +136,8 @@ export default {
         return {
           ...item,
           total: selectedRows.reduce((sum, val) => {
-            return sum + val[item.dataIndex]
+            let total = sum + get(val, item.dataIndex)
+            return isNaN(total) ? 0 : total
           }, 0)
         }
       })
@@ -149,7 +146,7 @@ export default {
     updateEdit() {
       this.selectedRows = []
     },
-    onClearSelected () {
+    onClearSelected() {
       this.selectedRowKeys = []
       this.updateSelect([], [])
     },
@@ -158,37 +155,53 @@ export default {
       let d = []
       // 构建 已选择
       d.push(
-        h('span', { style: { marginRight: '12px' } }, ['已选择 ', h('a', { style: { fontWeight: 600 }}, this.selectedRows.length)])
+        h('span', {
+          style: {
+            marginRight: '12px'
+          }
+        }, ['已选择 ', h('a', {
+          style: {
+            fontWeight: 600
+          }
+        }, this.selectedRows.length)])
       );
 
       // 构建 列统计
       this.needTotalList.map(item => {
-        d.push( h('span',
-          { style: { marginRight: '12px' } },
+        d.push(h('span', {
+            style: {
+              marginRight: '12px'
+            }
+          },
           [
             `${ item.title }总计 `,
-            h('a', { style: { fontWeight: 600 }}, `${ item.customRender ? item.customRender(item.total) : item.total }`)
-          ] )
-        )
+            h('a', {
+              style: {
+                fontWeight: 600
+              }
+            }, `${ !item.customRender ? item.total : item.customRender(item.total) }`)
+          ]))
       });
 
       // 构建 清空选择
-      d.push( h('a', {
-        style: { marginLeft: '24px' },
+      d.push(h('a', {
+        style: {
+          marginLeft: '24px'
+        },
         on: {
           click: _vm.onClearSelected
         }
-      }, '清空') )
+      }, '清空'))
 
       return d
     },
     renderAlert(h) {
-
       return h('span', {
         slot: 'message'
       }, this.renderMsg(h))
     },
   },
+
   render(h) {
     const _vm = this
 
@@ -206,7 +219,13 @@ export default {
     // 显示信息提示
     if (this.showAlertInfo) {
 
-      props.rowSelection = { selectedRowKeys: this.selectedRowKeys, onChange: this.updateSelect };
+      props.rowSelection = {
+        selectedRowKeys: this.selectedRowKeys,
+        onChange: (selectedRowKeys, selectedRows) => {
+          _vm.updateSelect(selectedRowKeys, selectedRows)
+          _vm.$emit('onSelect', { selectedRowKeys: selectedRowKeys, selectedRows: selectedRows })
+        }
+      };
 
       return h('div', {}, [
         h("a-alert", {
@@ -217,7 +236,7 @@ export default {
             type: 'info',
             showIcon: true
           }
-        }, [ _vm.renderAlert(h) ]),
+        }, [_vm.renderAlert(h)]),
         h("a-table", {
           tag: "component",
           attrs: props,
@@ -225,8 +244,9 @@ export default {
             change: _vm.loadData
           },
           scopedSlots: this.$scopedSlots
-        })
+        }, this.$slots.default)
       ]);
+
     }
 
     return h("a-table", {
@@ -236,6 +256,6 @@ export default {
         change: _vm.loadData
       },
       scopedSlots: this.$scopedSlots
-    });
+    }, this.$slots.default);
   }
-};
+};

+ 25 - 39
src/views/list/PermissionList.vue

@@ -1,47 +1,33 @@
 <template>
   <a-card :bordered="false">
-    <div>
-      <a-form layout="horizontal">
-        <div :class="advanced ? null : 'fold'">
-          <a-row :gutter="48">
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="名称"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input placeholder="请输入"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="状态"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-select placeholder="请选择">
-                  <a-select-option value="1">正常</a-select-option>
-                  <a-select-option value="2">禁用</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-
-            <span style="margin-top: 3px;">
-              <a-button type="primary">查询</a-button>
-              <a-button style="margin-left: 8px">重置</a-button>
-            </span>
-          </a-row>
-
-        </div>
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="角色ID">
+              <a-input placeholder="请输入"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="状态">
+              <a-select placeholder="请选择" default-value="0">
+                <a-select-option value="0">全部</a-select-option>
+                <a-select-option value="1">关闭</a-select-option>
+                <a-select-option value="2">运行中</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary">查询</a-button>
+                <a-button style="margin-left: 8px">重置</a-button>
+              </span>
+          </a-col>
+        </a-row>
       </a-form>
     </div>
 
-    <s-table
-      size="default"
-      :columns="columns"
-      :data="loadData"
-    >
-
+    <s-table :columns="columns" :data="loadData">
       <span slot="actions" slot-scope="text, record">
         <a-tag v-for="(action, index) in record.actionList" :key="index">{{ action.describe }}</a-tag>
       </span>

+ 24 - 33
src/views/list/RoleList.vue

@@ -1,38 +1,29 @@
 <template>
   <a-card :bordered="false">
-    <div>
-      <a-form layout="horizontal">
-        <div :class="advanced ? null : 'fold'">
-          <a-row :gutter="48">
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="角色ID"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input placeholder="请输入"/>
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="状态"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-select placeholder="请选择">
-                  <a-select-option value="1">正常</a-select-option>
-                  <a-select-option value="2">禁用</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-
-            <span style="margin-top: 3px;">
-              <a-button type="primary">查询</a-button>
-              <a-button style="margin-left: 8px">重置</a-button>
-            </span>
-          </a-row>
-
-        </div>
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="角色ID">
+              <a-input placeholder="请输入"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="状态">
+              <a-select placeholder="请选择" default-value="0">
+                <a-select-option value="0">全部</a-select-option>
+                <a-select-option value="1">关闭</a-select-option>
+                <a-select-option value="2">运行中</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary">查询</a-button>
+                <a-button style="margin-left: 8px">重置</a-button>
+              </span>
+          </a-col>
+        </a-row>
       </a-form>
     </div>
 

+ 60 - 64
src/views/list/TableInnerEditList.vue

@@ -1,91 +1,87 @@
 <template>
   <a-card :bordered="false">
-    <div :class="advanced ? 'search' : null">
-      <a-form layout="horizontal">
-        <div :class="advanced ? null : 'fold'">
-          <a-row :gutter="48">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="规则编号">
+              <a-input placeholder=""/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="使用状态">
+              <a-select placeholder="请选择" default-value="0">
+                <a-select-option value="0">全部</a-select-option>
+                <a-select-option value="1">关闭</a-select-option>
+                <a-select-option value="2">运行中</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="规则编号"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input placeholder="请输入"/>
+              <a-form-item label="调用次数">
+                <a-input-number style="width: 100%"/>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="使用状态"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-select placeholder="请选择">
-                  <a-select-option value="1">关闭</a-select-option>
-                  <a-select-option value="2">运行中</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="调用次数"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input-number style="width: 100%" placeholder="请输入"/>
-              </a-form-item>
-            </a-col>
-          </a-row>
-
-          <a-row :gutter="48" v-if="advanced">
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="更新日期"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}">
+              <a-form-item label="更新日期">
                 <a-date-picker style="width: 100%" placeholder="请输入更新日期"/>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="使用状态"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}">
-                <a-select placeholder="请选择">
+              <a-form-item label="使用状态">
+                <a-select placeholder="请选择" default-value="0">
+                  <a-select-option value="0">全部</a-select-option>
                   <a-select-option value="1">关闭</a-select-option>
                   <a-select-option value="2">运行中</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="描述"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input placeholder="请输入"/>
+              <a-form-item label="使用状态">
+                <a-select placeholder="请选择" default-value="0">
+                  <a-select-option value="0">全部</a-select-option>
+                  <a-select-option value="1">关闭</a-select-option>
+                  <a-select-option value="2">运行中</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
-          </a-row>
-        </div>
-
-        <span style="float: right; margin-top: 3px;">
-          <a-button type="primary">查询</a-button>
-          <a-button style="margin-left: 8px">重置</a-button>
-          <a @click="toggleAdvanced" style="margin-left: 8px">
-            {{ advanced ? '收起' : '展开' }}
-            <a-icon :type="advanced ? 'up' : 'down'"/>
-          </a>
-        </span>
+          </template>
+          <a-col :md="!advanced && 8 || 24" :sm="24">
+              <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
+                <a-button type="primary">查询</a-button>
+                <a-button style="margin-left: 8px">重置</a-button>
+                <a @click="toggleAdvanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+          </a-col>
+        </a-row>
       </a-form>
     </div>
 
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="() => $router.push({name: 'anime-add'})">新建</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1"><a-icon type="delete" />删除</a-menu-item>
+          <!-- lock | unlock -->
+          <a-menu-item key="2"><a-icon type="lock" />锁定</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
     <s-table
       ref="table"
       size="default"
       :columns="columns"
       :data="loadData"
       :showAlertInfo="true"
-      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onChange }"
+      @onSelect="onChange"
     >
       <template v-for="(col, index) in columns" v-if="col.scopedSlots" :slot="col.dataIndex" slot-scope="text, record, index">
         <div :key="index">
@@ -227,9 +223,9 @@
         this.$refs.table.updateEdit()
       },
 
-      onChange (selectedRowKeys, selectedRows) {
-        this.selectedRowKeys = selectedRowKeys
-        this.selectedRows = selectedRows
+      onChange (row) {
+        this.selectedRowKeys = row.selectedRowKeys
+        this.selectedRows = row.selectedRows
       },
       toggleAdvanced () {
         this.advanced = !this.advanced

+ 63 - 65
src/views/list/TableList.vue

@@ -1,90 +1,86 @@
 <template>
   <a-card :bordered="false">
-    <div :class="advanced ? 'search' : null">
-      <a-form layout="horizontal">
-        <div :class="advanced ? null : 'fold'">
-          <a-row :gutter="48">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="规则编号">
+              <a-input placeholder=""/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="使用状态">
+              <a-select placeholder="请选择" default-value="0">
+                <a-select-option value="0">全部</a-select-option>
+                <a-select-option value="1">关闭</a-select-option>
+                <a-select-option value="2">运行中</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="规则编号"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input placeholder="请输入"/>
+              <a-form-item label="调用次数">
+                <a-input-number style="width: 100%"/>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="使用状态"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-select placeholder="请选择">
-                  <a-select-option value="1">关闭</a-select-option>
-                  <a-select-option value="2">运行中</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="调用次数"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input-number style="width: 100%" placeholder="请输入"/>
-              </a-form-item>
-            </a-col>
-          </a-row>
-
-          <a-row :gutter="48" v-if="advanced">
-            <a-col :md="8" :sm="24">
-              <a-form-item
-                label="更新日期"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}">
+              <a-form-item label="更新日期">
                 <a-date-picker style="width: 100%" placeholder="请输入更新日期"/>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="使用状态"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}">
-                <a-select placeholder="请选择">
+              <a-form-item label="使用状态">
+                <a-select placeholder="请选择" default-value="0">
+                  <a-select-option value="0">全部</a-select-option>
                   <a-select-option value="1">关闭</a-select-option>
                   <a-select-option value="2">运行中</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item
-                label="描述"
-                :labelCol="{span: 5}"
-                :wrapperCol="{span: 18, offset: 1}"
-              >
-                <a-input placeholder="请输入"/>
+              <a-form-item label="使用状态">
+                <a-select placeholder="请选择" default-value="0">
+                  <a-select-option value="0">全部</a-select-option>
+                  <a-select-option value="1">关闭</a-select-option>
+                  <a-select-option value="2">运行中</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
-          </a-row>
-        </div>
-
-        <span style="float: right; margin-top: 3px;">
-          <a-button type="primary">查询</a-button>
-          <a-button style="margin-left: 8px">重置</a-button>
-          <a @click="toggleAdvanced" style="margin-left: 8px">
-            {{ advanced ? '收起' : '展开' }}
-            <a-icon :type="advanced ? 'up' : 'down'"/>
-          </a>
-        </span>
+          </template>
+          <a-col :md="!advanced && 8 || 24" :sm="24">
+              <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
+                <a-button type="primary">查询</a-button>
+                <a-button style="margin-left: 8px">重置</a-button>
+                <a @click="toggleAdvanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </span>
+          </a-col>
+        </a-row>
       </a-form>
     </div>
 
+    <div class="table-operator">
+      <a-button type="primary" icon="plus">新建</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1"><a-icon type="delete" />删除</a-menu-item>
+          <!-- lock | unlock -->
+          <a-menu-item key="2"><a-icon type="lock" />锁定</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
     <s-table
       size="default"
       :columns="columns"
       :data="loadData"
       :showAlertInfo="true"
-      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onChange }"
+      @onSelect="onChange"
     >
       <span slot="action" slot-scope="text, record">
         <a @click="handleEdit(record)">编辑</a>
@@ -184,10 +180,12 @@
 <script>
   import STable from '@/components/table/'
   import ATextarea from "ant-design-vue/es/input/TextArea";
+  import AInput from "ant-design-vue/es/input/Input";
 
   export default {
     name: "TableList",
     components: {
+      AInput,
       ATextarea,
       STable
     },
@@ -206,7 +204,7 @@
         mdl: {},
 
         // 高级搜索 展开/关闭
-        advanced: false,
+        advanced: true,
         // 查询参数
         queryParam: {},
         // 表头
@@ -265,9 +263,9 @@
       handleOk () {
 
       },
-      onChange (selectedRowKeys, selectedRows) {
-        this.selectedRowKeys = selectedRowKeys
-        this.selectedRows = selectedRows
+      onChange (row) {
+        this.selectedRowKeys = row.selectedRowKeys
+        this.selectedRows = row.selectedRows
       },
       toggleAdvanced () {
         this.advanced = !this.advanced

+ 4 - 0
yarn.lock

@@ -4635,6 +4635,10 @@ lodash.defaultsdeep@^4.6.0:
   version "4.6.0"
   resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.0.tgz#bec1024f85b1bd96cbea405b23c14ad6443a6f81"
 
+lodash.get@^4.4.2:
+  version "4.4.2"
+  resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
+
 lodash.mapvalues@^4.6.0:
   version "4.6.0"
   resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c"