Commit 732d8be7 by limin

新增选人数据后重置表格

1 parent efe1b463
<template> <template>
<div class="glsx-table"> <div class="glsx-table">
<el-table id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle"> <el-table id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column> <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column> <el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable"> <el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader">
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
...@@ -287,6 +287,9 @@ export default { ...@@ -287,6 +287,9 @@ export default {
this.data = this.findVal(res, this.tableParams.listName) this.data = this.findVal(res, this.tableParams.listName)
this.total = this.findVal(res, this.pageConf.totalCount) this.total = this.findVal(res, this.pageConf.totalCount)
this.loading = false this.loading = false
this.$nextTick(() => {
this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].doLayout()
})
this.$emit('setTableFinishFun', this.data) //表格请求到数据 this.$emit('setTableFinishFun', this.data) //表格请求到数据
}) })
.catch(() => { .catch(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!