xyc
2025-02-21 664db98c9e8595ce4dd636a27f480e3a08b81ff5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
  <zt-dialog ref="dialog" title="算法库进程详情" append-to-body column="3" @close="close" :editAble="false">
    <zt-table-wraper :dataForm="queryForm" ref="tableObj" v-slot="{ table }"
                     :page-size="20" :paging="true"
                     @dataLoaded="dataLoaded"
                     query-url="/taskReliability/SimulatAssess/process">
          <el-form :inline="true" :model="queryForm" @keyup.enter.native="table.query()">
            <el-form-item prop="isAlive" label-width="150px" style="margin-left: 20px">
              <el-checkbox v-model="queryForm.isAlive">只看存活</el-checkbox>
            </el-form-item>
          </el-form>
          <el-table ref="table" v-adaptive="{bottomOffset:30}" height="100px"
                    style="font-size: 18px"
                    v-loading="table.dataLoading"
                    :data="table.dataList"
                    border
                    highlight-current-row
                    @selection-change="table.selectionChangeHandle">
            <el-table-column align="center" label="序号" prop="index" width="60">
              <template slot-scope="scope">
                <span v-html="indexFormat(scope.$index)"></span>
              </template>
            </el-table-column>
            <el-table-column prop="pid" label="进程ID" align="center" width="100"/>
            <el-table-column prop="processIsAlive" label="存活状态" align="center" width="100">
              <template v-slot="{ row }">
                <span v-if="row.processIsAlive" style="">存活</span>
                <span v-else>终止</span>
              </template>
            </el-table-column>
            <el-table-column prop="commandLine" label="启动命令行" align="center"/>
            <el-table-column prop="progress" label="仿真进度" align="center" width="100"/>
            <el-table-column prop="processStartTime" label="生成时间" align="center" width="200"/>
            <el-table-column prop="processEndTime" label="终止时间" align="center" width="200"/>
            <el-table-column width="150" class="han" align="center" :table="table" label="操作">
              <template v-slot="{ row }">
                <zt-table-button v-if="row.processIsAlive" style="font-size: 18px" type="warning" @click="killProcess(row.id)">强制终止</zt-table-button>
              </template>
            </el-table-column>
          </el-table>
    </zt-table-wraper>
  </zt-dialog>
</template>
 
<script>
 
  export default {
    data() {
      return {
        queryForm: {
          isAlive: false,
        },
      }
    },
    watch: {
      'queryForm.isAlive'() {
        this.$refs.tableObj.query()
      },
    },
    components: {
    },
    mounted() {
      this.$refs.tableObj.query()
    },
    methods: {
      init() {
      },
      indexFormat(index) {
        let page = this.$refs.tableObj.page
        let limit = this.$refs.tableObj.limit
        let indexs = limit * (page - 1) + index + 1
        return '<span>' + indexs + '</span>'
      },
      async killProcess(id) {
        if (id) {
          let param = {
            taskId: id
          }
          let res = await this.$http.get(`/taskReliability/SimulatAssess/killProcess`, {params: param})
          this.$refs.tableObj.query()
        }
      },
    },
  }
</script>
<style>
</style>