|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-18 16:30:17
|
|
|
- * @LastEditTime: 2021-09-28 14:00:26
|
|
|
+ * @LastEditTime: 2021-09-29 10:47:37
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: 表格的封装
|
|
|
* @FilePath: \hyyfClient\src\components\NewTable.vue
|
|
@@ -18,18 +18,35 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
- <table-content
|
|
|
- :listData="listData"
|
|
|
- :height="height"
|
|
|
- :shows="shows"
|
|
|
- :tableItems="tableItems"
|
|
|
- @selectionChange="handleSelectionChange">
|
|
|
- </table-content>
|
|
|
+ <el-table :data="listData" border :height="height" @selection-change="handleSelectionChange">
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="shows.showSelect"
|
|
|
+ type="selection"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="shows.showIndex"
|
|
|
+ type="index" label="序号"
|
|
|
+ align="center" width="70">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <template v-for="item in tableItems">
|
|
|
+ <el-table-column :key="item.prop" v-bind="item" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <slot :name="item.slotName" :row="scope.row">
|
|
|
+ {{ scope.row[item.prop] }}
|
|
|
+ </slot>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import TableContent from './TableContent.vue'
|
|
|
+// import TableContent from './TableContent.vue'
|
|
|
|
|
|
export default {
|
|
|
props: {
|
|
@@ -55,7 +72,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- TableContent
|
|
|
+ // TableContent
|
|
|
},
|
|
|
methods: {
|
|
|
handleSelectionChange(rows) {
|