daiqisheng 3 лет назад
Родитель
Сommit
ae107bfb40
1 измененных файлов с 11 добавлено и 3 удалено
  1. 11 3
      src/pages/main/performance/components/table.vue

+ 11 - 3
src/pages/main/performance/components/table.vue

@@ -2,11 +2,12 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-07 19:41:48
+ * @LastEditTime: 2022-01-10 09:38:20
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
 -->
 <template>
-  <el-table class="simple-table" :data="computed_list" v-loading="loading">
+  <el-table class="simple-table" :data="computed_list" v-loading="loading" @selection-change="handleSelectionChange">
+    <el-table-column type="selection" width="55" v-if="multiple" />
     <el-table-column
       v-for="(
         { props, label, type, width, align, children, dictionary }, index
@@ -27,6 +28,7 @@
             @change="handleModify"
           />
         </div>
+        <div v-if="type === 'number'">{{ scope.$index + 1 }}</div>
         <div v-else-if="type === 'textarea'">
           <pre class="simple-table-break">{{ scope.row[props] }}</pre>
         </div>
@@ -36,7 +38,6 @@
         <div v-else-if="type === 'time'">
           <div>{{ $formatDate(scope.row[props], "YYYY-MM-DD HH:00:00") }}</div>
         </div>
-        <div v-if="type === 'number'">{{ scope.$index + 1 }}</div>
         <div v-else-if="type === 'click'">
           <div
             class="simple-table-click cursor-pointer"
@@ -120,6 +121,10 @@ export default {
       type: Array,
       default: () => [],
     },
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
     loading: {
       type: Boolean,
       default: false,
@@ -155,6 +160,9 @@ export default {
     handleCancel() {
       console.log("我被关闭了");
     },
+    handleSelectionChange(val) {
+      this.$emit("selection", val);
+    },
     handleModify() {
       this.$emit("modify", this.computed_list);
     },