From 4ea627c0c0a75c80c0c294f7ab305ebac51a6a21 Mon Sep 17 00:00:00 2001
From: Ironsp <1522278303@qq.com>
Date: Wed, 16 Sep 2026 17:04:33 +0800
Subject: [PATCH] =?UTF-8?q?feat=20=E6=95=B0=E6=8D=AE=E5=BA=93=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/home/homeNav.vue | 6 +++---
src/components/home/list.vue | 4 ++--
src/components/project/item.vue | 4 ++--
src/pages/project/index.vue | 16 +++++++++++-----
src/service/project.ts | 4 ++--
src/service/seed.ts | 10 +++++-----
6 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/src/components/home/homeNav.vue b/src/components/home/homeNav.vue
index 59394e4..3a64a5d 100644
--- a/src/components/home/homeNav.vue
+++ b/src/components/home/homeNav.vue
@@ -25,7 +25,7 @@ function onIconClick(name: string) {
})
}
else {
- console.log(`点击了${name}图标`)
+ console.log(`点击了导航栏图标`)
}
}
@@ -36,10 +36,10 @@ function onIconClick(name: string) {
- {{ project?.project_name || '-----' }}
+ {{ project?.project_name || '--' }}
- {{ project?.stake_range || '-----' }}
+ {{ project?.stake_range || '--' }}
diff --git a/src/components/home/list.vue b/src/components/home/list.vue
index 832986c..b9ca5db 100644
--- a/src/components/home/list.vue
+++ b/src/components/home/list.vue
@@ -6,8 +6,8 @@ const props = defineProps<{
}>()
const statusMap: Record = {
- 0: '未完成',
- 1: '已完成',
+ 0: '已暂停',
+ 1: '已结束',
2: '作业中',
}
diff --git a/src/components/project/item.vue b/src/components/project/item.vue
index e45d85c..2d28acf 100644
--- a/src/components/project/item.vue
+++ b/src/components/project/item.vue
@@ -10,9 +10,9 @@ defineProps<{
function getStatusText(status: number) {
const map: Record = {
- 0: '未完成',
+ 0: '已暂停',
1: '已结束',
- 2: '进行中',
+ 2: '作业中',
}
return map[status] || '未知'
}
diff --git a/src/pages/project/index.vue b/src/pages/project/index.vue
index 1646448..2cc569c 100644
--- a/src/pages/project/index.vue
+++ b/src/pages/project/index.vue
@@ -13,17 +13,22 @@ definePage({
const db = useDbStore()
const search = ref('')
-const activeTab = ref(0) // 0全部 1作业中 2已结束
-const tabs = ['全部', '作业中', '已结束']
+const activeTab = ref(0) // 0全部 1作业中 2已暂停 3已结束
+const tabs = ['全部', '作业中', '已暂停', '已结束']
+/** tab 下标对应项目 status:作业中=2,已暂停=0,已结束=1 */
+const tabStatusMap: Record = {
+ 1: 2,
+ 2: 0,
+ 3: 1,
+}
const projects = computed(() => {
const keyword = search.value.trim().toLowerCase()
+ const statusFilter = tabStatusMap[activeTab.value]
return db.project
.filter((item) => {
- if (activeTab.value === 1 && item.status === 1)
- return false
- if (activeTab.value === 2 && item.status !== 1)
+ if (statusFilter !== undefined && item.status !== statusFilter)
return false
if (keyword) {
const name = (item.project_name || '').toLowerCase()
@@ -135,6 +140,7 @@ onMounted(async () => {
.tabs {
display: flex;
+ flex-wrap: wrap;
gap: 12px;
margin-top: 12px;
}
diff --git a/src/service/project.ts b/src/service/project.ts
index 39739ad..6e99878 100644
--- a/src/service/project.ts
+++ b/src/service/project.ts
@@ -33,7 +33,7 @@ export interface Project {
qualified_rate?: number // 压实合格率,默认 0
progress?: number // 完成进度,默认 0
uncompacted_area?: number // 未压实面积 = 总面积 - 压实面积,默认 0
- status: 0 | 1 | 2 // 项目状态,0:未完成,1:已完成,2:作业中, 默认0
+ status: 0 | 1 | 2 // 项目状态,0:已暂停,1:已结束,2:作业中,默认 0
created_at?: string // 创建时间,默认当前时间
updated_at?: string // 更新时间,默认当前时间
}
@@ -63,7 +63,7 @@ export async function selectById(id: number): Promise {
return DB.selectById(TABLE, id)
}
-/** 按状态查询(0=进行中, 1=结束) */
+/** 按状态查询(0=已暂停, 1=已完成, 2=作业中) */
export async function selectByStatus(status: 0 | 1): Promise {
return DB.selectByField(TABLE, 'status', status)
}
diff --git a/src/service/seed.ts b/src/service/seed.ts
index 386be68..4c480ce 100644
--- a/src/service/seed.ts
+++ b/src/service/seed.ts
@@ -3,7 +3,7 @@ import { insert as insertWorkRecord } from './workRecord'
/**
* 项目假数据 (6个)
- * status: 0=未完成, 1=已完成, 2=作业中
+ * status: 0=已暂停, 1=已完成, 2=作业中
*/
async function seedProject() {
const data = [
@@ -14,7 +14,7 @@ async function seedProject() {
total_area: 25000.0,
status: 2,
},
- // 未完成 (1个)
+ // 已暂停 (1个)
{
project_name: '雄安新区市政道路',
stake_range: 'A区 ~ C区',
@@ -55,7 +55,7 @@ async function seedProject() {
/**
* 当日工作记录假数据
- * 仅作业中(1)和未完成(2)的项目各有3条
+ * 仅作业中和已暂停项目的各有3条
*/
async function seedWorkRecord() {
const data = [
@@ -84,7 +84,7 @@ async function seedWorkRecord() {
compaction_area: 1520.0,
pass_count: 6,
},
- // 项目2 (未完成) - 3条工作记录
+ // 项目2 (已暂停) - 3条工作记录
{
project_id: 2,
start_time: '2026-09-15 08:00:00',
@@ -118,7 +118,7 @@ async function seedWorkRecord() {
/**
* RTK 轨迹假数据
- * 仅作业中和未完成项目的每个工作记录 120 条
+ * 仅作业中和已暂停项目的每个工作记录 120 条
*/
async function seedRtkTrack() {
const data: any[] = []