Commit 993d98fadb796f13eefdab2672e9ff6dd3d791b9

Authored by 刘淇
1 parent 37c26bd3

工作台

... ... @@ -47,4 +47,18 @@ page {
47 47 background-color: #f8f8f8;
48 48 height: 100%;
49 49 }
  50 +
  51 +// 底部按钮样式
  52 +.fixed-bottom-btn-wrap {
  53 + position: fixed;
  54 + bottom: 0;
  55 + left: 0;
  56 + right: 0;
  57 + z-index: 999;
  58 + padding: 0;
  59 + /* #ifdef MP-WEIXIN */
  60 + //padding-bottom: constant(safe-area-inset-bottom);
  61 + //padding-bottom: env(safe-area-inset-bottom);
  62 + /* #endif */
  63 +}
50 64 </style>
51 65 \ No newline at end of file
... ...
api/patrol-manage/patrol-plan.js
... ... @@ -19,11 +19,11 @@ export const inspectionPlanPage = (params) =&gt; {
19 19 };
20 20  
21 21 /**
22   - * 退出登录
  22 + * 巡检计划明细
23 23 * @returns {Promise}
24 24 */
25   -export const logout = () => {
26   - return post('/admin-api/system/auth/logout');
  25 +export const inspectionPlanDetail = (data) => {
  26 + return post('/app-api/app/garden/inspection-plan-detail/get-details',data);
27 27 };
28 28  
29 29 /**
... ...
api/user.js
... ... @@ -33,3 +33,11 @@ export const logout = () =&gt; {
33 33 export const moduleList = () => {
34 34 return get('/app-api/member/app-module/list');
35 35 };
  36 +
  37 +/**
  38 + * 字典数据
  39 + * @returns {Promise}
  40 + */
  41 +export const getSimpleDictDataList = () => {
  42 + return get({ url: '/system/dict-data/simple-list' })
  43 +}
... ...
pages-sub/daily/patrol-manage/add-patrol-record/index.vue
... ... @@ -74,7 +74,7 @@
74 74 </up-form>
75 75  
76 76 <!-- 底部提交按钮 -->
77   - <view class="submit-btn-wrap">
  77 + <view class="fixed-bottom-btn-wrap">
78 78 <up-button
79 79 type="primary"
80 80 size="default"
... ... @@ -197,19 +197,4 @@ const submit = () =&gt; {
197 197  
198 198  
199 199  
200   -// 底部按钮样式
201   -.submit-btn-wrap {
202   - position: fixed;
203   - bottom: 0;
204   - left: 0;
205   - right: 0;
206   - z-index: 999;
207   - padding: 0;
208   - background-color: #f8f8f8;
209   - /* #ifdef MP-WEIXIN */
210   - //padding-bottom: constant(safe-area-inset-bottom);
211   - //padding-bottom: env(safe-area-inset-bottom);
212   - /* #endif */
213   -}
214   -
215 200 </style>
216 201 \ No newline at end of file
... ...
pages-sub/daily/patrol-manage/patrol-plan/index.vue
... ... @@ -23,7 +23,10 @@
23 23 placeholder="请输入道路名称"
24 24 bg-color="#f5f5f5"
25 25 shape="round"
  26 + :show-action="true" actionText="搜索" :animation="true"
26 27 @search="handleSearch"
  28 + @custom="handleSearch"
  29 + :clearabled="false"
27 30 maxlength="50"
28 31 style="margin: 20rpx 20rpx 0"
29 32 ></up-search>
... ... @@ -65,7 +68,9 @@
65 68 </view>
66 69 <view class="row-item">
67 70 <text class="label">计划时间:</text>
68   - <text class="value up-line-1">{{ formatPlanTime(item.beginTime, item.endTime) }}</text>
  71 +<!-- <text class="value up-line-1">{{ formatPlanTime(item.beginTime, item.endTime) }}</text>-->
  72 + <text class="value up-line-1">{{ timeFormat(item.beginTime,'yyyy-mm-dd')}} 至 {{ timeFormat(item.endTime,'yyyy-mm-dd')}} </text>
  73 +
69 74 </view>
70 75 </view>
71 76 </view>
... ... @@ -76,6 +81,7 @@
76 81 </template>
77 82  
78 83 <script setup>
  84 +import { timeFormat } from '@/uni_modules/uview-plus';
79 85 import { ref } from 'vue';
80 86 import { onLoad, onShow } from '@dcloudio/uni-app';
81 87 import { inspectionPlanPage } from "@/api/patrol-manage/patrol-plan";
... ... @@ -107,18 +113,6 @@ const planTypeMap = {
107 113 3003: '应急养护'
108 114 };
109 115  
110   -// 时间格式化
111   -const formatPlanTime = (beginTime, endTime) => {
112   - if (!beginTime || !endTime) return '暂无';
113   - const formatDate = (timestamp) => {
114   - const date = new Date(timestamp);
115   - const year = date.getFullYear();
116   - const month = (date.getMonth() + 1).toString().padStart(2, '0');
117   - const day = date.getDate().toString().padStart(2, '0');
118   - return `${year}-${month}-${day}`;
119   - };
120   - return `${formatDate(beginTime)} 至 ${formatDate(endTime)}`;
121   -};
122 116 // Tab切换
123 117 const handleTabChange = (val) => {
124 118 console.log(val)
... ...
pages-sub/daily/patrol-manage/pending-plan-detail/index.vue
... ... @@ -4,129 +4,110 @@
4 4 <view class="detail-card">
5 5 <!-- 标题行 -->
6 6 <view class="detail-item">
7   - <text class="label">标题:</text>
  7 + <text class="label">计划名称:</text>
8 8 <text class="value up-line-1">{{ planInfo && planInfo.title ? planInfo.title : '-' }}</text>
9 9 </view>
10 10  
11 11 <!-- 计划编码行 -->
12 12 <view class="detail-item">
13 13 <text class="label">计划编码:</text>
14   - <text class="value up-line-1">{{ planInfo && planInfo.code ? planInfo.code : '-' }}</text>
  14 + <text class="value up-line-1">{{ planInfo.planNo ? planInfo.planNo : '-' }}</text>
15 15 </view>
16 16  
17 17 <!-- 养护周期行 -->
18 18 <view class="detail-item">
19 19 <text class="label">养护周期:</text>
20   - <text class="value up-line-1">{{ planInfo && planInfo.cycle ? planInfo.cycle : '-' }}</text>
  20 + <text class="value up-line-1">{{ planInfo && planInfo.rate ? planInfo.rate : '-' }}</text>
21 21 </view>
22 22  
23 23 <!-- 计划完成次数行 -->
24 24 <view class="detail-item">
25 25 <text class="label">计划完成次数:</text>
26   - <text class="value up-line-1">{{ planInfo && planInfo.planCount ? planInfo.planCount : 0 }} 次</text>
  26 + <text class="value up-line-1">{{ planInfo && planInfo.planNum ? planInfo.planNum : 0 }} 次</text>
27 27 </view>
28 28  
29 29 <!-- 已完成次数行 + 查看记录按钮 -->
30 30 <view class="detail-item flex-between">
31 31 <view class="left-wrap">
32 32 <text class="label">已完成次数:</text>
33   - <text class="value up-line-1">{{ planInfo && planInfo.finishCount ? planInfo.finishCount : 0 }} 次</text>
  33 + <text class="value up-line-1">{{ planInfo && planInfo.planFinishNum ? planInfo.planFinishNum : 0 }} 次</text>
34 34 </view>
35 35 <!-- 查看记录按钮(限制宽度+紧凑样式) -->
36   - <u-button
  36 + <up-button
37 37 type="primary"
38 38 size="mini"
39   - :disabled="!(planInfo && planInfo.code)"
40 39 @click="gotoFinishPlanDetail"
41   - class="view-record-btn"
  40 + :style="{ width: '80px', height: '28px', fontSize: '14px', borderRadius: 4 }"
42 41 >
43 42 查看记录
44   - </u-button>
  43 + </up-button>
45 44 </view>
46 45  
47 46 <!-- 计划有效期行 -->
48 47 <view class="detail-item">
49 48 <text class="label">计划有效期:</text>
50   - <text class="value up-line-1">{{ planInfo && planInfo.validTime ? planInfo.validTime : '-' }}</text>
  49 +<!-- <text class="value up-line-1">{{ planInfo && planInfo.validTime ? planInfo.validTime : '-' }}</text>-->
  50 + <text class="value up-line-1">{{ timeFormat(planInfo.beginTime,'yyyy-mm-dd')}} 至 {{ timeFormat(planInfo.endTime,'yyyy-mm-dd')}} </text>
51 51 </view>
52 52 </view>
53 53  
54 54 <!-- 底部新增记录按钮 -->
55   - <view class="fixed-btn-wrap">
56   - <u-button
  55 + <view class="fixed-bottom-btn-wrap">
  56 + <up-button
57 57 type="primary"
58 58 size="default"
59   - @click="addNewRecord"
60   - :disabled="!(planInfo && planInfo.code)"
61   - :style="{ width: '100%', height: '88rpx', fontSize: '30rpx', borderRadius: 0 }"
  59 + @click="submit"
  60 + :style="{ width: '100%', height: '88rpx', fontSize: '32rpx', borderRadius: 0 }"
62 61 >
63 62 新增记录
64   - </u-button>
  63 + </up-button>
65 64 </view>
66 65 </view>
67 66 </template>
68 67  
69 68 <script setup>
  69 +import { timeFormat } from '@/uni_modules/uview-plus';
70 70 import { ref } from 'vue';
71 71 import { onLoad, onShow } from '@dcloudio/uni-app';
72   -
  72 +import { inspectionPlanDetail } from "@/api/patrol-manage/patrol-plan";
73 73 // 响应式数据定义
74   -const planInfo = ref({
75   - title: '123213',
76   - code: '',
77   - cycle: '',
78   - planCount: 0,
79   - finishCount: 0,
80   - validTime: ''
81   -});
82   -const planId = ref('')
83   -
  74 +const planInfo = ref({});
  75 +const batchNo = ref('')
  76 +const finishState = ref('')
84 77 // 页面加载接收参数
85 78 onLoad((options) => {
86   - console.log('计划ID:', options.id);
87   - planId.value = options.id;
  79 + console.log('计划ID:', options.batchNo);
  80 + batchNo.value = options.batchNo;
  81 + finishState.value = options.status
88 82 });
89   -
90 83 // 页面显示时请求数据
91 84 onShow(() => {
92   - if (!planId.value) {
  85 + if (!batchNo.value) {
93 86 uni.showToast({
94 87 title: '计划ID不存在',
95 88 icon: 'none'
96 89 });
97 90 return;
98 91 }
99   - getPlanDetail(planId.value);
  92 + getPlanDetail(batchNo.value);
100 93 });
101   -
102   -// 模拟接口请求
103   -const getPlanDetail = (id) => {
104   - setTimeout(() => {
105   - planInfo.value = {
106   - title: '朝阳区望京街道道路养护计划朝阳区望京街道道路养护计划朝阳区望京街道道路养护计划',
107   - code: 'YH-2025-0891YH-2025-0891YH-2025-0891YH-2025-0891',
108   - cycle: '每月1次',
109   - planCount: 12,
110   - finishCount: 3,
111   - validTime: '2025-01-01 至 2025-12-31'
112   - };
113   - }, 300);
  94 +const getPlanDetail = async () => {
  95 + const queryData = {
  96 + batchNo: batchNo.value,
  97 + finishState: finishState.value
  98 + }
  99 + console.log(queryData)
  100 + const planInfoRes = await inspectionPlanDetail(queryData)
  101 + planInfo.value = planInfoRes[0]
  102 + console.log(planInfoRes)
114 103 };
115   -
116 104 // 跳转到已完成计划明细
117 105 const gotoFinishPlanDetail = () => {
118   - // if (!planInfo.value || !planInfo.value.code) {
119   - // uni.showToast({
120   - // title: '计划数据未加载完成',
121   - // icon: 'none'
122   - // });
123   - // return;
124   - // }
  106 +
125 107 uni.navigateTo({
126   - url: `/pages-sub/daily/patrol-manage/finish-plan-detail/index?planId=${planInfo.value.code}`
  108 + url: `/pages-sub/daily/patrol-manage/finish-plan-detail/index?batchNo=${planInfo.value.code}`
127 109 });
128 110 };
129   -
130 111 // 新增记录
131 112 const addNewRecord = () => {
132 113 if (!planInfo.value || !planInfo.value.code) {
... ... @@ -137,7 +118,7 @@ const addNewRecord = () =&gt; {
137 118 return;
138 119 }
139 120 uni.navigateTo({
140   - url: `/pages-sub/daily/patrol-manage/add-patrol-record/index?planId=${planInfo.value.code}`
  121 + url: `/pages-sub/daily/patrol-manage/add-patrol-record/index?batchNo=${planInfo.value.code}`
141 122 });
142 123 };
143 124 </script>
... ... @@ -196,31 +177,4 @@ const addNewRecord = () =&gt; {
196 177 word-break: break-all;
197 178 }
198 179  
199   -// 查看记录按钮样式(核心优化)
200   -.view-record-btn {
201   - width: 160rpx !important; // 固定宽度,按需调整
202   - padding: 0 !important; // 移除内边距,减少宽度
203   - margin-right: 10rpx;
204   - font-size: 24rpx !important; // 缩小字体,更紧凑
205   - height: 50rpx !important; // 调整高度,比例协调
206   -}
207   -
208   -// 底部固定按钮容器
209   -.fixed-btn-wrap {
210   - position: fixed;
211   - bottom: 0;
212   - left: 0;
213   - right: 0;
214   - z-index: 999;
215   - padding: 0;
216   - background-color: #f8f8f8;
217   -}
218   -
219   -// 兼容小程序底部安全区
220   -/* #ifdef MP-WEIXIN */
221   -.fixed-btn-wrap {
222   - padding-bottom: constant(safe-area-inset-bottom);
223   - padding-bottom: env(safe-area-inset-bottom);
224   -}
225   -/* #endif */
226 180 </style>
227 181 \ No newline at end of file
... ...
pages/workbench/index.vue
... ... @@ -19,10 +19,10 @@
19 19 <view v-else class="menu-card-wrap">
20 20  
21 21 <up-card
22   - :title-size="18"
23   - v-for="(parentModule, index) in moduleList"
24   - :key="parentModule.id"
25   - :title="parentModule.name"
  22 + :title-size="18"
  23 + v-for="(parentModule, index) in moduleList"
  24 + :key="parentModule.id"
  25 + :title="parentModule.name"
26 26 >
27 27  
28 28 <template #body>
... ... @@ -59,8 +59,10 @@
59 59 <script setup lang="ts">
60 60 // 原始代码完全保留
61 61 import {ref, nextTick} from 'vue';
62   -import {onShow} from '@dcloudio/uni-app';
63   -import {useUserStore} from '@/pinia/user';
  62 +import { onShow } from '@dcloudio/uni-app';
  63 +import { useUserStore } from '@/pinia/user';
  64 +import globalConfig from '@/common/config/global';
  65 +import cache from '@/common/utils/cache';
64 66  
65 67 interface MenuItem {
66 68 id: number;
... ... @@ -94,7 +96,8 @@ const headClick = () =&gt; {
94 96  
95 97 onShow(async () => {
96 98 try {
97   - const rawMenuData = userStore.moduleListInfo as MenuItem[];
  99 + const rawMenuData = userStore.moduleListInfo || cache.get(globalConfig.cache.moduleListKey);
  100 + // const rawMenuData = userStore.moduleListInfo as MenuItem[];
98 101 const menuData = rawMenuData || [];
99 102 moduleList.value = menuData;
100 103 await nextTick();
... ... @@ -153,7 +156,6 @@ const handleMenuClick = (item: MenuItem) =&gt; {
153 156 .content-wrap {
154 157 position: relative;
155 158 z-index: 2;
156   - padding: 0 20rpx;
157 159 padding-top: 160px;
158 160 }
159 161  
... ...