From 37c26bd3e0113311b7648a2b92802693935200c8 Mon Sep 17 00:00:00 2001
From: liugongyu <290219706@qq.com>
Date: Wed, 10 Dec 2025 14:52:13 +0800
Subject: [PATCH] 巡查计划
---
api/patrol-manage/patrol-plan.js | 35 +++++++++++++++++++++++++++++++++++
components/empty-view/empty-view.vue | 21 +++++++++++++++++++++
main.js | 4 ++--
pages-sub/daily/patrol-manage/add-patrol-record/index.vue | 277 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pages-sub/daily/patrol-manage/patrol-plan/index.vue | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------------------------------------------
pages.json | 9 +++++----
pages/login/index.vue | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
pages/workbench/index.vue | 272 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------
8 files changed, 590 insertions(+), 454 deletions(-)
create mode 100644 api/patrol-manage/patrol-plan.js
create mode 100644 components/empty-view/empty-view.vue
diff --git a/api/patrol-manage/patrol-plan.js b/api/patrol-manage/patrol-plan.js
new file mode 100644
index 0000000..4b5475f
--- /dev/null
+++ b/api/patrol-manage/patrol-plan.js
@@ -0,0 +1,35 @@
+// api/user.js
+import { post, get } from '@/common/utils/request';
+
+/**
+ * 登录接口
+ * @param {Object} params {mobile, password, code}
+ * @returns {Promise}
+ */
+export const login = (params) => {
+ return post('/admin-api/system/auth/login', params);
+};
+
+/**
+ * 巡检计划汇总
+ * @returns {Promise}
+ */
+export const inspectionPlanPage = (params) => {
+ return get('/app-api/app/garden/inspection-plan/page',params);
+};
+
+/**
+ * 退出登录
+ * @returns {Promise}
+ */
+export const logout = () => {
+ return post('/admin-api/system/auth/logout');
+};
+
+/**
+ * 模块列表用这个
+ * @returns {Promise}
+ */
+export const moduleList = () => {
+ return get('/app-api/member/app-module/list');
+};
diff --git a/components/empty-view/empty-view.vue b/components/empty-view/empty-view.vue
new file mode 100644
index 0000000..653c368
--- /dev/null
+++ b/components/empty-view/empty-view.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main.js b/main.js
index 37b9f44..cd04af4 100644
--- a/main.js
+++ b/main.js
@@ -3,7 +3,7 @@ import App from './App'
import uviewPlus from '@/uni_modules/uview-plus'
// 导入 Pinia 实例(你的 stores/index.js 导出的 pinia)
import pinia from '@/pinia/index'
-
+import EmptyView from '@/components/empty-view/empty-view.vue';
// #ifdef VUE3
import { createSSRApp } from 'vue'
@@ -16,7 +16,7 @@ export function createApp() {
// 4. 注册 Pinia(核心:在 app 挂载前注册)
app.use(pinia)
-
+ app.component('EmptyView', EmptyView)
// 5. 返回 app + pinia(可选,便于调试)
return {
app,
diff --git a/pages-sub/daily/patrol-manage/add-patrol-record/index.vue b/pages-sub/daily/patrol-manage/add-patrol-record/index.vue
index 569c3d2..c09864b 100644
--- a/pages-sub/daily/patrol-manage/add-patrol-record/index.vue
+++ b/pages-sub/daily/patrol-manage/add-patrol-record/index.vue
@@ -1,40 +1,38 @@
-
-
-
+
+
-
-
+
-
- {{ formData.content.length }}/200
-
+ >
+
-
-
+
-
+ >
(最少1张,最多3张)
- {{ uploadTips }}
-
+
-
-
+
-
-
-
+ >
+
+
+ {{ item.label }}
+
+
+
+
-
-
+
提交
-
+
\ No newline at end of file
diff --git a/pages-sub/daily/patrol-manage/patrol-plan/index.vue b/pages-sub/daily/patrol-manage/patrol-plan/index.vue
index d52f070..b7913a0 100644
--- a/pages-sub/daily/patrol-manage/patrol-plan/index.vue
+++ b/pages-sub/daily/patrol-manage/patrol-plan/index.vue
@@ -2,200 +2,189 @@
-
-
-
+ style="margin: 20rpx 20rpx 0"
+ >
-
+
+
+
+
-
+
+
-
道路名称:
{{ item.roadName }}
-
所属街道:
- {{ item.street }}
+ {{ item.streetName }}
-
养护级别:
- {{ item.maintainLevel }}
+ {{ levelMap[item.levelId] || '未知级别' }}
计划明细
-
计划类型:
- {{ item.planType }}
+ {{ planTypeMap[item.planTypeId] || '未知类型' }}
-
计划时间:
- {{ item.planTime }}
+ {{ formatPlanTime(item.beginTime, item.endTime) }}
-
-
-
- 暂无相关计划数据
-
-
\ No newline at end of file
diff --git a/pages.json b/pages.json
index dd3f56e..9202040 100644
--- a/pages.json
+++ b/pages.json
@@ -15,7 +15,8 @@
{
"path": "pages/workbench/index",
"style": {
- "navigationBarTitleText": "工作台"
+ "navigationBarTitleText": "工作台",
+ "navigationStyle": "custom"
}
},
{
@@ -32,8 +33,7 @@
{
"path": "patrol-manage/patrol-plan/index",
"style": {
- "navigationBarTitleText": "巡查计划",
- "enablePullDownRefresh": false
+ "navigationBarTitleText": "巡查计划"
}
},
{
@@ -150,7 +150,8 @@
"custom": {
"^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
- "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
+ "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
+ "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
}
},
"globalStyle": {
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 2f6753e..4921466 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -1,7 +1,13 @@
-
+
+
+
+
+
+ 园林登录
+
-
+
@@ -32,9 +42,13 @@
type="password"
:disabled="isLoading"
@blur="checkPassword"
+ :custom-style="{
+ backgroundColor: 'rgba(255, 255, 255, 0.9)',
+ borderColor: '#e5e7eb'
+ }"
>
-
+
@@ -48,6 +62,14 @@
size="large"
:loading="isLoading"
@click="handleLogin"
+ :custom-style="{
+ backgroundColor: '#3b82f6',
+ borderColor: '#3b82f6',
+ borderRadius: '44rpx',
+ height: '88rpx',
+ lineHeight: '88rpx',
+ fontSize: '32rpx'
+ }"
>
登录
@@ -76,8 +98,14 @@ const error = reactive({
// 实例化 Pinia 用户仓库
const userStore = useUserStore();
-// 页面加载时校验登录态
+// 页面加载时初始化
onMounted(() => {
+ // 检查登录态
+ checkLoginStatus();
+});
+
+// 检查登录状态
+const checkLoginStatus = () => {
try {
// 已登录则直接跳首页
if (userStore.isLogin) {
@@ -93,7 +121,7 @@ onMounted(() => {
} catch (err) {
console.warn('检查登录状态失败:', err);
}
-});
+};
// 校验账号
const checkAccount = () => {
@@ -124,7 +152,7 @@ const validateForm = () => {
return !error.account && !error.password;
};
-// 登录处理(核心:补充跳转逻辑)
+// 登录处理
const handleLogin = async () => {
if (!validateForm()) return;
@@ -138,24 +166,22 @@ const handleLogin = async () => {
uni.showToast({ title: '登录成功', icon: 'success', duration: 1500 });
- // 登录成功后跳转首页(优先tabBar,兼容普通页面)
+ // 登录成功后跳转首页
setTimeout(() => {
- // 方式1:跳tabBar首页(推荐,需在pages.json配置tabBar)
uni.switchTab({
url: globalConfig.router.tabBarList[1].path,
fail: (err) => {
console.warn('tabBar跳转失败,切换为普通跳转:', err);
- // 方式2:跳普通首页(非tabBar页面)
uni.redirectTo({ url: '/pages/workbench/index' });
}
});
}, 1500);
-
} catch (err) {
console.error('登录失败详情:', err);
- const errorMsg = err.message === '网络异常,请稍后重试'
- ? '网络异常,请稍后重试'
- : err.message || '登录失败,请检查账号密码';
+ const errorMsg =
+ err.message === '网络异常,请稍后重试'
+ ? '网络异常,请稍后重试'
+ : err.message || '登录失败,请检查账号密码';
uni.showToast({
title: errorMsg,
icon: 'none',
@@ -168,39 +194,151 @@ const handleLogin = async () => {
\ No newline at end of file
diff --git a/pages/workbench/index.vue b/pages/workbench/index.vue
index 69c6a97..dbb96aa 100644
--- a/pages/workbench/index.vue
+++ b/pages/workbench/index.vue
@@ -1,150 +1,180 @@
+
-
- 日常管理
-
-
+
+
-
- 问题管理
-
-
+
+
+
+
+
+
+
-
-
\ No newline at end of file
+
\ No newline at end of file
--
libgit2 0.21.4