zhengnaiwen_citu 4 päivää sitten
vanhempi
commit
a754e8c652
2 muutettua tiedostoa jossa 17 lisäystä ja 11 poistoa
  1. 3 3
      src/components/List/table.vue
  2. 14 8
      src/views/modelSystem/modelTrain/index.vue

+ 3 - 3
src/components/List/table.vue

@@ -422,10 +422,10 @@ export default {
     },
     handleSelected (data) {
       if (this.selectItem) return this.handleSelectedItem(data)
-      if (Array.isArray(data.items)) this.ids = data.value ? data.items.map(item => item?.id) : []
+      if (Array.isArray(data.items)) this.ids = data.value ? data.items.map(item => item?.[this.itemKey]) : []
       else {
-        if (data.value) this.ids.push(data.item.id)
-        else this.ids.splice(this.ids.findIndex(key => key.id === data.item.id))
+        if (data.value) this.ids.push(data.item[[this.itemKey]])
+        else this.ids.splice(this.ids.findIndex(key => key.id === data.item[this.itemKey]))
       }
       this.$emit('selected', this.ids)
     },

+ 14 - 8
src/views/modelSystem/modelTrain/index.vue

@@ -8,6 +8,7 @@
       :items="items"
       :total="total"
       :page-info="pageInfo"
+      item-key="task_id"
       @add="handleAdd"
       @delete="handleDelete"
       @pageHandleChange="pageHandleChange"
@@ -17,13 +18,18 @@
         <v-chip :color="item.status === 'failed' ? 'error' : 'success'" small>{{ item.status }}</v-chip>
       </template>
       <template #actions="{ item }">
-        <v-btn color="success" text @click="handleExecute(item.task_id)">执行</v-btn>
-        <!-- <v-btn color="success" text @click="handleExecuteStep(item.task_id)">分步执行</v-btn> -->
-        <v-btn color="primary" text @click="handleFindExecute(item.task_id)">执行进度</v-btn>
-        <v-btn color="primary" text @click="handleTable(item.task_id)">表名清单</v-btn>
-        <v-btn color="primary" text @click="handleFiles(item.task_id)">任务文件</v-btn>
-        <v-btn color="primary" text @click="handleLog(item.task_id)">运行日志</v-btn>
-        <v-btn color="error" text @click="handleDelete([item.task_id])">删除</v-btn>
+        <template v-if="item.directory_exists">
+          <v-btn color="success" text @click="handleExecute(item.task_id)">执行</v-btn>
+          <!-- <v-btn color="success" text @click="handleExecuteStep(item.task_id)">分步执行</v-btn> -->
+          <v-btn color="primary" text @click="handleFindExecute(item.task_id)">执行进度</v-btn>
+          <v-btn color="primary" text @click="handleTable(item.task_id)">表名清单</v-btn>
+          <v-btn color="primary" text @click="handleFiles(item.task_id)">任务文件</v-btn>
+          <v-btn color="primary" text @click="handleLog(item.task_id)">运行日志</v-btn>
+          <v-btn color="error" text @click="handleDelete([item.task_id])">删除</v-btn>
+        </template>
+        <template v-else>
+          <v-chip small>已删除</v-chip>
+        </template>
       </template>
     </m-table>
     <ModelTrainEdit ref="modelTrainEditRefs" @success="init"></ModelTrainEdit>
@@ -78,7 +84,7 @@ export default {
         { text: '任务名称', align: 'start', value: 'task_name' },
         { text: '数据库名称', align: 'start', value: 'db_name' },
         { text: '上下文', align: 'start', value: 'business_context' },
-        { text: '状态', align: 'center', value: 'status' },
+        { text: '运行状态', align: 'center', value: 'status' },
         { text: '创建者', align: 'center', value: 'created_by' },
         { text: '操作', align: 'start', value: 'actions' }
       ],