Sfoglia il codice sorgente

优化表格展示

zhengnaiwen_citu 1 giorno fa
parent
commit
a13ec2b01a

+ 0 - 1
src/views/modelSystem/modelTrain/modelTrainFiles.vue

@@ -10,7 +10,6 @@
       :disable-sort="true"
       :is-tools="false"
       :show-select="false"
-      :showPage="false"
     >
       <template #navBtn>
         <v-btn class="buttons" rounded color="primary" @click="showUpload = true">文件上传</v-btn>

+ 25 - 8
src/views/modelSystem/modelTrain/modelTrainTable.vue

@@ -1,10 +1,20 @@
 <template>
   <m-dialog title="表名清单" :visible.sync="show" :footer="false">
-    <div class="mb-3">
-      <v-btn class="mr-3" color="primary" rounded @click="handleAdd">修改表名</v-btn>
-      <UploadBtn color="primary" accept=".txt" @change="handleChangeFile">导入表名</UploadBtn>
-    </div>
-    <div
+    <MTable
+      elevation="0"
+      :items="items"
+      :headers="headers"
+      :loading="loading"
+      :total="items.length"
+      :show-select="false"
+      :is-tools="false"
+    >
+      <template #navBtn>
+        <v-btn class="mr-3" color="primary" rounded @click="handleAdd">在线提交表名</v-btn>
+        <UploadBtn color="primary" accept=".txt" @change="handleChangeFile">上传表清单文件</UploadBtn>
+      </template>
+    </MTable>
+    <!-- <div
       style="min-height: 300px;"
       v-loading="loading"
     >
@@ -20,12 +30,13 @@
           </v-list-item-content>
         </v-list-item>
       </v-list>
-    </div>
+    </div> -->
     <ModelTrainTableSubmit ref="modelTrainTableSubmitRefs" @success="getData"></ModelTrainTableSubmit>
   </m-dialog>
 </template>
 
 <script>
+import MTable from '@/components/List/table'
 import UploadBtn from '@/components/UploadBtn'
 import MDialog from '@/components/Dialog'
 import ModelTrainTableSubmit from './modelTrainTableSubmit'
@@ -33,9 +44,11 @@ import {
   getDataBaseList,
   uploadDataTasksList
 } from '@/api/dataChart'
+// import loading from '@/directives/loading'
 export default {
   name: 'modelTrainTable',
   components: {
+    MTable,
     MDialog,
     UploadBtn,
     ModelTrainTableSubmit
@@ -45,7 +58,9 @@ export default {
       show: false,
       loading: false,
       items: [],
-
+      headers: [
+        { text: '表名', value: 'table_name' }
+      ],
       id: null
     }
   },
@@ -61,7 +76,9 @@ export default {
         const { data } = await getDataBaseList({
           task_id: this.id
         })
-        this.items = data.tables
+        this.items = data.tables.map(e => ({
+          table_name: e
+        }))
       } catch (error) {
         this.$snackbar.error(error)
       } finally {