9 天以前 533353dbeb19b3fa45817e9f65874db4e2ce6f9e
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
  <HomePanel title="待办中心" :loading="loading">
    <template #extra>
      <span v-if="list.length" class="todo-badge app-num">{{ list.length }} 项待处理</span>
    </template>
    <ul v-if="list.length" class="todo">
      <li v-for="item in list" :key="item.id" class="todo__item">
        <div class="todo__row">
          <span class="todo__dot"></span>
          <span class="todo__reason">{{ item.approveReason || '待办事项' }}</span>
          <span class="todo__time">{{ item.approveTime }}</span>
        </div>
        <div class="todo__meta">
          <span>编号 {{ item.approveId }}</span>
          <span>部门 {{ item.approveDeptName }}</span>
        </div>
      </li>
    </ul>
    <el-empty v-else description="暂无待办事项" :image-size="56" />
  </HomePanel>
</template>
 
<script setup>
import HomePanel from './HomePanel.vue'
 
defineProps({
  list: { type: Array, default: () => [] },
  loading: { type: Boolean, default: false }
})
</script>
 
<style scoped>
.todo-badge {
  font-size: 12px;
  color: var(--app-warning);
  background: var(--app-warning-soft);
  border-radius: 10px;
  padding: 2px 10px;
}
 
.todo {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
 
.todo__item {
  padding: 10px 12px;
  border-radius: var(--app-radius-sm);
  transition: background var(--app-transition);
}
 
.todo__item:hover {
  background: var(--app-surface-hover);
}
 
.todo__item + .todo__item {
  margin-top: 4px;
}
 
.todo__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
 
.todo__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--app-primary);
}
 
.todo__reason {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--app-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.todo__time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--app-text-tertiary);
}
 
.todo__meta {
  display: flex;
  gap: 16px;
  margin: 6px 0 0 14px;
  font-size: 12px;
  color: var(--app-text-tertiary);
}
</style>