feat 项目列表

This commit is contained in:
Ironsp
2026-09-02 16:57:53 +08:00
parent 1a6bd1174e
commit 56197b13e7
5 changed files with 232 additions and 4 deletions

1
src/components.d.ts vendored
View File

@@ -21,6 +21,7 @@ declare module 'vue' {
HomeWarning: typeof import('./components/home/warning.vue')['default']
HomeWarning_list: typeof import('./components/home/warning_list.vue')['default']
MessageList: typeof import('./components/message/list.vue')['default']
ProjectItem: typeof import('./components/project/item.vue')['default']
SettingsProjectForm: typeof import('./components/settings/projectForm.vue')['default']
SettingsProjectSettings: typeof import('./components/settings/projectSettings.vue')['default']
SettingsRadioConfig: typeof import('./components/settings/radioConfig.vue')['default']

View File

@@ -1,13 +1,18 @@
<script setup lang="ts">
function goToProjectList() {
uni.navigateTo({
url: '/pages/project/index',
})
}
</script>
<template>
<view class="card">
<view class="card-header">
<text class="card-title">
项目列表
</text>
<!-- <text class="card-link">
查看全部
</text> -->
<wd-button variant="text">
<wd-button variant="text" @tap="goToProjectList">
查看全部
</wd-button>
</view>

View File

@@ -0,0 +1,95 @@
<script setup lang="ts">
defineProps<{
projectName: string
status: string
tags: string[]
time: string
trigger: string
}>()
</script>
<template>
<view class="project-item">
<view class="item-header">
<text class="project-name">
{{ projectName }}
</text>
<text class="status">
{{ status }}
</text>
</view>
<view class="tags">
<view v-for="(tag, index) in tags" :key="index" class="tag">
<text class="tag-text">
{{ tag }}
</text>
</view>
</view>
<text class="time">
{{ time }}
</text>
<text class="trigger">
{{ trigger }}
</text>
</view>
</template>
<style scoped>
.project-item {
background-color: #ffffff;
border-radius: 12px;
padding: 16px;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.project-name {
font-size: 22px;
font-weight: bold;
color: #333;
}
.status {
font-size: 14px;
padding: 4px 12px;
border-radius: 12px;
background-color: #f6ffed;
color: #52c41a;
}
.tags {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.tag {
background-color: #fff1f0;
border-radius: 8px;
padding: 4px 12px;
}
.tag-text {
font-size: 14px;
color: #ff4d4f;
}
.time {
font-size: 18px;
color: #666;
display: block;
margin-bottom: 8px;
}
.trigger {
font-size: 18px;
color: #666;
}
</style>

126
src/pages/project/index.vue Normal file
View File

@@ -0,0 +1,126 @@
<script setup lang="ts">
definePage({
layout: false,
style: {
navigationStyle: 'custom',
},
})
const search = ref('')
const activeTab = ref(0)
const tabs = ['全部', '进行中', '已结束']
const projects = [
{
projectName: '徐工XS65H #01',
status: '进行中',
tags: ['定位异常', '警告'],
time: '14:10:04·已持续5分30秒',
trigger: '触发阈值:RTK信号弱,精度下降',
},
{
projectName: '徐工XS65H #01',
status: '进行中',
tags: ['定位异常', '警告'],
time: '14:10:04·已持续5分30秒',
trigger: '触发阈值:RTK信号弱,精度下降',
},
]
function handleCreate() {
console.log('点击了新建项目')
}
</script>
<template>
<view class="page">
<back-nav title="全部项目">
<wd-button size="small" round @tap="handleCreate">
新建项目
</wd-button>
</back-nav>
<view class="content">
<!-- 搜索和筛选 -->
<view class="search-filter">
<uni-easyinput v-model="search" placeholder="搜索项目名称/路线桩号" />
<view class="tabs">
<view
v-for="(tab, index) in tabs"
:key="index"
class="tab-item"
:class="{ active: activeTab === index }"
@tap="activeTab = index"
>
<text class="tab-text">
{{ tab }}
</text>
</view>
</view>
</view>
<!-- 项目列表 -->
<view class="project-list">
<project-item
v-for="(item, index) in projects"
:key="index"
:project-name="item.projectName"
:status="item.status"
:tags="item.tags"
:time="item.time"
:trigger="item.trigger"
/>
</view>
</view>
</view>
</template>
<style scoped>
.page {
min-height: 100vh;
background-color: #EAEFF9;
}
.content {
padding: 16px;
padding-top: 72px;
}
.search-filter {
background-color: #ffffff;
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
}
.tabs {
display: flex;
gap: 12px;
margin-top: 12px;
}
.tab-item {
background-color: #f5f5f5;
border-radius: 8px;
padding: 8px 16px;
}
.tab-item.active {
background-color: #ff4d4f;
}
.tab-text {
font-size: 18px;
color: #333;
}
.tab-item.active .tab-text {
color: #fff;
}
.project-list {
display: flex;
flex-direction: column;
gap: 12px;
}
</style>

1
src/uni-pages.d.ts vendored
View File

@@ -7,6 +7,7 @@ type _LocationUrl =
"/pages/Ahome/index" |
"/pages/bluetooth/index" |
"/pages/message/index" |
"/pages/project/index" |
"/pages/report/index" |
"/pages/settings/index" |
"/pages/warning/index" |