Commit 993d98fadb796f13eefdab2672e9ff6dd3d791b9

Authored by 刘淇
1 parent 37c26bd3

工作台

@@ -47,4 +47,18 @@ page { @@ -47,4 +47,18 @@ page {
47 background-color: #f8f8f8; 47 background-color: #f8f8f8;
48 height: 100%; 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 </style> 64 </style>
51 \ No newline at end of file 65 \ No newline at end of file
api/patrol-manage/patrol-plan.js
@@ -19,11 +19,11 @@ export const inspectionPlanPage = (params) =&gt; { @@ -19,11 +19,11 @@ export const inspectionPlanPage = (params) =&gt; {
19 }; 19 };
20 20
21 /** 21 /**
22 - * 退出登录 22 + * 巡检计划明细
23 * @returns {Promise} 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,3 +33,11 @@ export const logout = () =&gt; {
33 export const moduleList = () => { 33 export const moduleList = () => {
34 return get('/app-api/member/app-module/list'); 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,7 +74,7 @@
74 </up-form> 74 </up-form>
75 75
76 <!-- 底部提交按钮 --> 76 <!-- 底部提交按钮 -->
77 - <view class="submit-btn-wrap"> 77 + <view class="fixed-bottom-btn-wrap">
78 <up-button 78 <up-button
79 type="primary" 79 type="primary"
80 size="default" 80 size="default"
@@ -197,19 +197,4 @@ const submit = () =&gt; { @@ -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 </style> 200 </style>
216 \ No newline at end of file 201 \ No newline at end of file
pages-sub/daily/patrol-manage/patrol-plan/index.vue
@@ -23,7 +23,10 @@ @@ -23,7 +23,10 @@
23 placeholder="请输入道路名称" 23 placeholder="请输入道路名称"
24 bg-color="#f5f5f5" 24 bg-color="#f5f5f5"
25 shape="round" 25 shape="round"
  26 + :show-action="true" actionText="搜索" :animation="true"
26 @search="handleSearch" 27 @search="handleSearch"
  28 + @custom="handleSearch"
  29 + :clearabled="false"
27 maxlength="50" 30 maxlength="50"
28 style="margin: 20rpx 20rpx 0" 31 style="margin: 20rpx 20rpx 0"
29 ></up-search> 32 ></up-search>
@@ -65,7 +68,9 @@ @@ -65,7 +68,9 @@
65 </view> 68 </view>
66 <view class="row-item"> 69 <view class="row-item">
67 <text class="label">计划时间:</text> 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 </view> 74 </view>
70 </view> 75 </view>
71 </view> 76 </view>
@@ -76,6 +81,7 @@ @@ -76,6 +81,7 @@
76 </template> 81 </template>
77 82
78 <script setup> 83 <script setup>
  84 +import { timeFormat } from '@/uni_modules/uview-plus';
79 import { ref } from 'vue'; 85 import { ref } from 'vue';
80 import { onLoad, onShow } from '@dcloudio/uni-app'; 86 import { onLoad, onShow } from '@dcloudio/uni-app';
81 import { inspectionPlanPage } from "@/api/patrol-manage/patrol-plan"; 87 import { inspectionPlanPage } from "@/api/patrol-manage/patrol-plan";
@@ -107,18 +113,6 @@ const planTypeMap = { @@ -107,18 +113,6 @@ const planTypeMap = {
107 3003: '应急养护' 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 // Tab切换 116 // Tab切换
123 const handleTabChange = (val) => { 117 const handleTabChange = (val) => {
124 console.log(val) 118 console.log(val)
pages-sub/daily/patrol-manage/pending-plan-detail/index.vue
@@ -4,129 +4,110 @@ @@ -4,129 +4,110 @@
4 <view class="detail-card"> 4 <view class="detail-card">
5 <!-- 标题行 --> 5 <!-- 标题行 -->
6 <view class="detail-item"> 6 <view class="detail-item">
7 - <text class="label">标题:</text> 7 + <text class="label">计划名称:</text>
8 <text class="value up-line-1">{{ planInfo && planInfo.title ? planInfo.title : '-' }}</text> 8 <text class="value up-line-1">{{ planInfo && planInfo.title ? planInfo.title : '-' }}</text>
9 </view> 9 </view>
10 10
11 <!-- 计划编码行 --> 11 <!-- 计划编码行 -->
12 <view class="detail-item"> 12 <view class="detail-item">
13 <text class="label">计划编码:</text> 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 </view> 15 </view>
16 16
17 <!-- 养护周期行 --> 17 <!-- 养护周期行 -->
18 <view class="detail-item"> 18 <view class="detail-item">
19 <text class="label">养护周期:</text> 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 </view> 21 </view>
22 22
23 <!-- 计划完成次数行 --> 23 <!-- 计划完成次数行 -->
24 <view class="detail-item"> 24 <view class="detail-item">
25 <text class="label">计划完成次数:</text> 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 </view> 27 </view>
28 28
29 <!-- 已完成次数行 + 查看记录按钮 --> 29 <!-- 已完成次数行 + 查看记录按钮 -->
30 <view class="detail-item flex-between"> 30 <view class="detail-item flex-between">
31 <view class="left-wrap"> 31 <view class="left-wrap">
32 <text class="label">已完成次数:</text> 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 </view> 34 </view>
35 <!-- 查看记录按钮(限制宽度+紧凑样式) --> 35 <!-- 查看记录按钮(限制宽度+紧凑样式) -->
36 - <u-button 36 + <up-button
37 type="primary" 37 type="primary"
38 size="mini" 38 size="mini"
39 - :disabled="!(planInfo && planInfo.code)"  
40 @click="gotoFinishPlanDetail" 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 </view> 44 </view>
46 45
47 <!-- 计划有效期行 --> 46 <!-- 计划有效期行 -->
48 <view class="detail-item"> 47 <view class="detail-item">
49 <text class="label">计划有效期:</text> 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 </view> 51 </view>
52 </view> 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 type="primary" 57 type="primary"
58 size="default" 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 </view> 64 </view>
66 </view> 65 </view>
67 </template> 66 </template>
68 67
69 <script setup> 68 <script setup>
  69 +import { timeFormat } from '@/uni_modules/uview-plus';
70 import { ref } from 'vue'; 70 import { ref } from 'vue';
71 import { onLoad, onShow } from '@dcloudio/uni-app'; 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 onLoad((options) => { 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 onShow(() => { 84 onShow(() => {
92 - if (!planId.value) { 85 + if (!batchNo.value) {
93 uni.showToast({ 86 uni.showToast({
94 title: '计划ID不存在', 87 title: '计划ID不存在',
95 icon: 'none' 88 icon: 'none'
96 }); 89 });
97 return; 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 const gotoFinishPlanDetail = () => { 105 const gotoFinishPlanDetail = () => {
118 - // if (!planInfo.value || !planInfo.value.code) {  
119 - // uni.showToast({  
120 - // title: '计划数据未加载完成',  
121 - // icon: 'none'  
122 - // });  
123 - // return;  
124 - // } 106 +
125 uni.navigateTo({ 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 const addNewRecord = () => { 112 const addNewRecord = () => {
132 if (!planInfo.value || !planInfo.value.code) { 113 if (!planInfo.value || !planInfo.value.code) {
@@ -137,7 +118,7 @@ const addNewRecord = () =&gt; { @@ -137,7 +118,7 @@ const addNewRecord = () =&gt; {
137 return; 118 return;
138 } 119 }
139 uni.navigateTo({ 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 </script> 124 </script>
@@ -196,31 +177,4 @@ const addNewRecord = () =&gt; { @@ -196,31 +177,4 @@ const addNewRecord = () =&gt; {
196 word-break: break-all; 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 </style> 180 </style>
227 \ No newline at end of file 181 \ No newline at end of file
pages/workbench/index.vue
@@ -19,10 +19,10 @@ @@ -19,10 +19,10 @@
19 <view v-else class="menu-card-wrap"> 19 <view v-else class="menu-card-wrap">
20 20
21 <up-card 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 <template #body> 28 <template #body>
@@ -59,8 +59,10 @@ @@ -59,8 +59,10 @@
59 <script setup lang="ts"> 59 <script setup lang="ts">
60 // 原始代码完全保留 60 // 原始代码完全保留
61 import {ref, nextTick} from 'vue'; 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 interface MenuItem { 67 interface MenuItem {
66 id: number; 68 id: number;
@@ -94,7 +96,8 @@ const headClick = () =&gt; { @@ -94,7 +96,8 @@ const headClick = () =&gt; {
94 96
95 onShow(async () => { 97 onShow(async () => {
96 try { 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 const menuData = rawMenuData || []; 101 const menuData = rawMenuData || [];
99 moduleList.value = menuData; 102 moduleList.value = menuData;
100 await nextTick(); 103 await nextTick();
@@ -153,7 +156,6 @@ const handleMenuClick = (item: MenuItem) =&gt; { @@ -153,7 +156,6 @@ const handleMenuClick = (item: MenuItem) =&gt; {
153 .content-wrap { 156 .content-wrap {
154 position: relative; 157 position: relative;
155 z-index: 2; 158 z-index: 2;
156 - padding: 0 20rpx;  
157 padding-top: 160px; 159 padding-top: 160px;
158 } 160 }
159 161