|
|
@@ -0,0 +1,161 @@
|
|
|
+<template>
|
|
|
+ <view class="app-container">
|
|
|
+ <TopBar title="">
|
|
|
+ <template #left>
|
|
|
+ <view class="flex items-center">
|
|
|
+ <view class="w-12 h-12 bg-primary-light rounded-2xl flex items-center justify-center mr-3">
|
|
|
+ <text class="uni-icons uniui-person-filled text-primary text-xl"></text>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <text class="text-gray-500 text-xs block">调度中心</text>
|
|
|
+ <text class="text-gray-800 text-lg font-bold">控制台</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <template #right>
|
|
|
+ <button class="w-10 h-10 bg-surface rounded-full flex items-center justify-center relative" @click="goToNotification">
|
|
|
+ <text class="uni-icons uniui-notification-filled text-gray-500 text-lg"></text>
|
|
|
+ </button>
|
|
|
+ </template>
|
|
|
+ </TopBar>
|
|
|
+
|
|
|
+ <!-- 主内容区域 -->
|
|
|
+ <view class="px-4 py-4 gap-y-4 pb-24">
|
|
|
+ <!-- 统计卡片 -->
|
|
|
+ <uni-card title="今日任务统计" :is-shadow="false" :is-full="false">
|
|
|
+ <view class="grid grid-cols-3 gap-3">
|
|
|
+ <view class="bg-surface rounded-xl p-4 text-center" @click="goToTaskList">
|
|
|
+ <text class="stat-number text-primary block">{{ taskStore.total }}</text>
|
|
|
+ <text class="text-desc mt-1 block">今日任务</text>
|
|
|
+ </view>
|
|
|
+ <view class="bg-surface rounded-xl p-4 text-center" @click="goToTaskList">
|
|
|
+ <text class="stat-number text-warning block">{{ taskStore.pendingCount }}</text>
|
|
|
+ <text class="text-desc mt-1 block">待排班</text>
|
|
|
+ </view>
|
|
|
+ <view class="bg-surface rounded-xl p-4 text-center" @click="goToEmergencyTeam">
|
|
|
+ <text class="stat-number text-danger block">{{ emergencyCount }}</text>
|
|
|
+ <text class="text-desc mt-1 block">应急中</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-card>
|
|
|
+
|
|
|
+ <!-- 快捷功能 -->
|
|
|
+ <uni-card title="快捷操作" :is-shadow="false">
|
|
|
+ <view class="grid grid-cols-4 gap-4">
|
|
|
+ <view class="flex flex-col items-center" @click="goToSchedule">
|
|
|
+ <view class="w-14 h-14 bg-primary-light rounded-2xl flex items-center justify-center mb-2 transition-transform">
|
|
|
+ <text class="uni-icons uniui-calendar-filled text-primary text-2xl"></text>
|
|
|
+ </view>
|
|
|
+ <text class="text-xs text-gray-500 font-medium">排班管理</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex flex-col items-center" @click="goToTaskList">
|
|
|
+ <view class="w-14 h-14 bg-warning-light rounded-2xl flex items-center justify-center mb-2 transition-transform">
|
|
|
+ <text class="uni-icons uniui-flag-filled text-warning text-2xl"></text>
|
|
|
+ </view>
|
|
|
+ <text class="text-xs text-gray-500 font-medium">任务列表</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex flex-col items-center" @click="goToVehicleList">
|
|
|
+ <view class="w-14 h-14 bg-success-light rounded-2xl flex items-center justify-center mb-2 transition-transform">
|
|
|
+ <text class="uni-icons uniui-cart-filled text-success text-2xl"></text>
|
|
|
+ </view>
|
|
|
+ <text class="text-xs text-gray-500 font-medium">车辆管理</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex flex-col items-center" @click="goToVisualization">
|
|
|
+ <view class="w-14 h-14 bg-danger-light rounded-2xl flex items-center justify-center mb-2 transition-transform">
|
|
|
+ <text class="uni-icons uniui-map-filled text-danger text-2xl"></text>
|
|
|
+ </view>
|
|
|
+ <text class="text-xs text-gray-500 font-medium">可视化</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-card>
|
|
|
+
|
|
|
+ <!-- 待审核任务 -->
|
|
|
+ <uni-card
|
|
|
+ title="待审核任务"
|
|
|
+ extra="查看全部"
|
|
|
+ :is-shadow="false"
|
|
|
+ @click-extra="goToTaskList"
|
|
|
+ >
|
|
|
+ <view v-if="pendingTasks.length === 0" class="py-6 text-center">
|
|
|
+ <text class="text-desc">暂无待审核任务</text>
|
|
|
+ </view>
|
|
|
+ <view v-else class="gap-y-3">
|
|
|
+ <view
|
|
|
+ v-for="task in pendingTasks"
|
|
|
+ :key="task.id"
|
|
|
+ class="card p-3 border-l-4 border-warning cursor-pointer"
|
|
|
+ @click="goToTaskDetail(task.id)"
|
|
|
+ >
|
|
|
+ <view class="flex justify-between items-start mb-2">
|
|
|
+ <text class="text-sm font-semibold text-gray-800">{{ task.projectName }}</text>
|
|
|
+ <StatusTag :status="task.status" />
|
|
|
+ </view>
|
|
|
+ <view class="flex items-center text-xs text-gray-500 mb-1">
|
|
|
+ <text class="uni-icons uniui-location-filled text-gray-400 mr-1"></text>
|
|
|
+ <text class="truncate">{{ task.address || '暂无地址' }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex items-center text-xs text-gray-500">
|
|
|
+ <text class="uni-icons uniui-clock-filled text-gray-400 mr-1"></text>
|
|
|
+ <text>申请时间:{{ task.applyTime || task.createTime }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-card>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, computed, onMounted } from 'vue'
|
|
|
+import { useTaskStore } from '@/stores/task'
|
|
|
+import TopBar from '@/components/common/TopBar.vue'
|
|
|
+import StatusTag from '@/components/common/StatusTag.vue'
|
|
|
+import UniCard from '@/components/uni-card/uni-card.vue'
|
|
|
+import UniList from '@/components/uni-list/uni-list.vue'
|
|
|
+import UniListItem from '@/components/uni-list/uni-list-item.vue'
|
|
|
+
|
|
|
+const taskStore = useTaskStore()
|
|
|
+
|
|
|
+const emergencyCount = computed(() => taskStore.tasks.filter(t => t.type === 'emergency').length)
|
|
|
+const pendingTasks = computed(() => taskStore.tasks.filter(t => t.status === 'pending').slice(0, 3))
|
|
|
+
|
|
|
+function goToTaskList() {
|
|
|
+ uni.switchTab({ url: '/pages/task/task' })
|
|
|
+}
|
|
|
+
|
|
|
+function goToTaskDetail(taskId: string) {
|
|
|
+ taskStore.setCurrentTask(taskId)
|
|
|
+ uni.navigateTo({ url: '/subPackages/pages-dispatch/taskDetail' })
|
|
|
+}
|
|
|
+
|
|
|
+function goToSchedule() {
|
|
|
+ uni.switchTab({ url: '/pages/schedule/schedule' })
|
|
|
+}
|
|
|
+
|
|
|
+function goToVehicleList() {
|
|
|
+ uni.navigateTo({ url: '/subPackages/pages-dispatch/vehicleList' })
|
|
|
+}
|
|
|
+
|
|
|
+function goToVisualization() {
|
|
|
+ uni.navigateTo({ url: '/subPackages/pages-dispatch/visualization' })
|
|
|
+}
|
|
|
+
|
|
|
+function goToEmergencyTeam() {
|
|
|
+ uni.navigateTo({ url: '/subPackages/pages-dispatch/emergencyTeam' })
|
|
|
+}
|
|
|
+
|
|
|
+function goToNotification() {
|
|
|
+ uni.navigateTo({ url: '/subPackages/pages-dispatch/notification' })
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ taskStore.fetchTasks()
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.stat-number {
|
|
|
+ font-size: 24px;
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
+</style>
|