yangys
2025-08-24 a36c39e79960664f8f14b92383861642405f7215
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
<template>
  <span @click="handleOpen()">
    <el-badge :value="logsLen" :max="99">
        <el-tooltip
        class="box-item"
        effect="dark"
        :content="`您有${logsLen}条任务需要处理`"
        placement="top-start"
      >
       <i class="iconfont iconicon_notice"></i>
      </el-tooltip>
      
    </el-badge>
    <el-dialog title="待办" v-model="box" width="60%" append-to-body>
      <el-button type="primary" @click="handle">处理</el-button>
      <el-table :data="dataList">
        <el-table-column prop="" label="标题">
            <template  #default="{ row }">
                <div>
                    {{ row.variables.title }}
                </div>
            </template>
        </el-table-column>
        <el-table-column prop="processCreateTime" label="创建时间" show-overflow-tooltip width="180">
            <!-- <template #default="scope">
                {{ scope.row.createTime | formatDate('yyyy-MM-dd hh:mm') }}
            </template> -->
        </el-table-column>
        <el-table-column prop="startUserName" show-overflow-tooltip label="创建人"> </el-table-column>
      </el-table>
    </el-dialog>
  </span>
</template>
 
<script>
import { mapGetters } from 'vuex';
import { getList } from '@/api/flow/todolist';
export default {
  name: 'top-todo',
  data() {
    return {
      box: false,
      logsLen: 0,
      dataList: [],
    };
  },
  created() {
    this.getCount()
    setInterval(() => {
      this.getCount();
    }, 2*60*1000);
  },
  mounted() {},
  computed: {
  },
  props: [],
  methods: {
    handleOpen() {
      this.box = true;
    },
    handle() {
        this.$router.push({ path: '/flow/todoindex' });
        this.box = false;
    },
    getCount() {
      getList(1,10).then((res) => {
        this.logsLen = res.data.data.total;
        this.dataList = res.data.data.records;
      });
    },
  },
};
</script>
 
<style lang="scss" scoped>
.code {
  font-size: 12px;
  display: block;
  font-family: monospace;
  white-space: pre;
  margin: 1em 0px;
}
</style>