yeg
2026-09-09 5cfde6485efdd490294906ff5624ccb1ab92b80b
限制首页待办按负责人展示
1个文件已修改
6 ■■■■■ 已修改文件
src/views/Dashboard.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Dashboard.vue
@@ -10,6 +10,7 @@
import { useTodos } from '@/stores/todos'
import { getTestList } from '@/api/tests'
import { getBatteryGroupList } from '@/api/batteryGroups'
import { getCurrentUser } from '@/utils/auth'
use([CanvasRenderer, BarChart, GridComponent, TooltipComponent])
@@ -18,6 +19,7 @@
const router = useRouter()
const { records } = useTests()
const { records: todoRecords } = useTodos()
const currentOwner = computed(() => getCurrentUser()?.displayName || getCurrentUser()?.username || 'Admin')
onMounted(async () => {
  try {
    const [tests, groups] = await Promise.all([
@@ -75,7 +77,7 @@
  { label: '暂停', value: records.value.filter(item => item.status === '暂停').length, color: '#b34f4f' },
])
const todoList = computed(() => todoRecords.value.filter(item => item.status === '待处理').slice(0, 6))
const todoList = computed(() => todoRecords.value.filter(item => item.owner === currentOwner.value && item.status === '待处理').slice(0, 6))
const periodData = computed(() => {
  const now = new Date()
@@ -203,7 +205,7 @@
        </section>
        <section class="panel todo-panel">
          <header class="panel-header"><div class="panel-title"><i></i><h3>待办 ({{ todoRecords.filter(item => item.status === '待处理').length }})</h3></div><button class="text-action" type="button" @click="router.push('/todo-list')">全部</button></header>
          <header class="panel-header"><div class="panel-title"><i></i><h3>待办 ({{ todoList.length }})</h3></div><button class="text-action" type="button" @click="router.push('/todo-list')">全部</button></header>
          <div class="todo-list"><div v-for="item in todoList" :key="item.id"><span><strong>{{ item.content }}</strong><small>{{ item.operatedAt }} · 待处理</small></span><b class="pending">待处理</b></div></div>
        </section>
      </aside>