Commit d6406a70ad315944be31b54a67b0577c8b7c772c

Authored by 刘淇
1 parent 5b5a4862

快速工单 详情 照片处理

common/config/env.js
@@ -12,8 +12,8 @@ const env = { @@ -12,8 +12,8 @@ const env = {
12 }, 12 },
13 // 生产环境 13 // 生产环境
14 production: { 14 production: {
15 - baseUrl: 'https://api.jcss.com',  
16 - uploadUrl: 'https://upload.jcss.com/upload', 15 + baseUrl: 'https://giomp.jichengshanshui.com.cn:4080',
  16 + uploadUrl: 'https://giomp.jichengshanshui.com.cn:4080',
17 // baseApi:'admin-api', 17 // baseApi:'admin-api',
18 // appApi:'app-api' 18 // appApi:'app-api'
19 } 19 }
@@ -22,7 +22,7 @@ const env = { @@ -22,7 +22,7 @@ const env = {
22 // 获取当前环境 22 // 获取当前环境
23 const getEnv = () => { 23 const getEnv = () => {
24 24
25 - const currentEnv = 'development'; 25 + const currentEnv = 'production';
26 26
27 return currentEnv; 27 return currentEnv;
28 }; 28 };
pages-sub/daily/quick-order/order-detail.vue
@@ -72,37 +72,36 @@ @@ -72,37 +72,36 @@
72 </template> 72 </template>
73 </up-cell> 73 </up-cell>
74 74
75 - <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> 75 + <!-- 5. 问题照片 -->
76 <up-cell title="问题照片" > 76 <up-cell title="问题照片" >
77 <template #value> 77 <template #value>
78 - <view class="cell-content-wrap"> 78 + <view class="cell-content-wrap" >
79 79
80 - <!-- 修复1:正确判断problemImgsList,补充空数组默认值 -->  
81 <up-album 80 <up-album
82 - v-if="!!orderDetail.problemsImgs?.length"  
83 - :urls="orderDetail.problemsImgs || []" 81 + :urls="orderDetail.problemsImgs "
84 singleSize="70" 82 singleSize="70"
85 - :preview-full-image="true"  
86 multipleSize="70" 83 multipleSize="70"
  84 + :preview-full-image="true"
  85 +
87 ></up-album> 86 ></up-album>
88 - <text v-else class="empty-text">暂无问题照片</text> 87 +<!-- <text v-else class="empty-text">暂无问题照片</text>-->
89 </view> 88 </view>
90 </template> 89 </template>
91 </up-cell> 90 </up-cell>
92 91
93 - <!-- 6. 完成照片(优化:空值处理+容错) -->  
94 - <up-cell title="完成照片" align="top"> 92 + <!-- 6. 完成照片 -->
  93 + <up-cell title="完成照片">
95 <template #value> 94 <template #value>
96 <view class="cell-content-wrap"> 95 <view class="cell-content-wrap">
97 <up-album 96 <up-album
98 - v-if="!!orderDetail.endImgs?.length"  
99 - :urls="orderDetail.endImgs || []" 97 +
  98 + :urls="orderDetail.endImgs"
100 singleSize="70" 99 singleSize="70"
101 multipleSize="70" 100 multipleSize="70"
102 :preview-full-image="true" 101 :preview-full-image="true"
103 102
104 ></up-album> 103 ></up-album>
105 - <text v-else class="empty-text">暂无完成照片</text> 104 +<!-- <text v-else class="empty-text">暂无完成照片</text>-->
106 </view> 105 </view>
107 </template> 106 </template>
108 </up-cell> 107 </up-cell>
@@ -125,15 +124,23 @@ @@ -125,15 +124,23 @@
125 </template> 124 </template>
126 125
127 <script setup lang="ts"> 126 <script setup lang="ts">
128 -import { ref, reactive } from 'vue'; 127 +import { ref } from 'vue';
129 import { inspectionPlanDetail } from "@/api/quick-order/quick-order"; 128 import { inspectionPlanDetail } from "@/api/quick-order/quick-order";
130 -import { onLoad, onShow } from '@dcloudio/uni-app';  
131 -import EmptyView from "../../../components/empty-view/empty-view.vue"; 129 +import { onLoad } from '@dcloudio/uni-app';
132 130
133 -// 状态管理  
134 -const loading = ref(true);  
135 -const orderDetail = ref({}); 131 +// 修复1:给orderDetail指定类型,明确图片数组的类型(关键)
  132 +interface OrderDetail {
  133 + problemsImgs?: string[];
  134 + endImgs?: string[];
  135 + [key: string]: any; // 兼容其他属性
  136 +}
136 137
  138 +// 修复2:初始化时给图片数组赋空数组,避免模板解析时访问undefined
  139 +const orderDetail = ref<OrderDetail>({
  140 + problemsImgs: [],
  141 + endImgs: []
  142 +});
  143 +const loading = ref(true);
137 144
138 /** 145 /**
139 * 获取工单详情 146 * 获取工单详情
@@ -142,8 +149,8 @@ const getOrderDetail = async (id: string) =&gt; { @@ -142,8 +149,8 @@ const getOrderDetail = async (id: string) =&gt; {
142 try { 149 try {
143 loading.value = true; 150 loading.value = true;
144 const res = await inspectionPlanDetail({ id }); 151 const res = await inspectionPlanDetail({ id });
145 - console.log('接口返回:', res);  
146 - // 优化:确保图片数组为数组类型,避免非数组导致渲染错误 152 + console.log('接口返回problemsImgs:', res.problemsImgs); // 确认数据存在
  153 + // 修复3:解构赋值时,强制保证图片数组为数组类型
147 orderDetail.value = { 154 orderDetail.value = {
148 ...res, 155 ...res,
149 problemsImgs: Array.isArray(res.problemsImgs) ? res.problemsImgs : [], 156 problemsImgs: Array.isArray(res.problemsImgs) ? res.problemsImgs : [],
@@ -157,7 +164,6 @@ const getOrderDetail = async (id: string) =&gt; { @@ -157,7 +164,6 @@ const getOrderDetail = async (id: string) =&gt; {
157 } 164 }
158 }; 165 };
159 166
160 -// 页面加载  
161 onLoad((options) => { 167 onLoad((options) => {
162 const { id } = options; 168 const { id } = options;
163 if (id) { 169 if (id) {
@@ -170,10 +176,6 @@ onLoad((options) =&gt; { @@ -170,10 +176,6 @@ onLoad((options) =&gt; {
170 </script> 176 </script>
171 177
172 <style scoped lang="scss"> 178 <style scoped lang="scss">
173 -// 页面基础样式  
174 -.u-page {  
175 -  
176 -}  
177 179
178 // 内容容器 180 // 内容容器
179 .content-wrap { 181 .content-wrap {
@@ -182,7 +184,12 @@ onLoad((options) =&gt; { @@ -182,7 +184,12 @@ onLoad((options) =&gt; {
182 box-sizing: border-box; 184 box-sizing: border-box;
183 } 185 }
184 186
185 - 187 +.cell-content-wrap {
  188 + :deep(image) { // 小程序中图片标签是image,且需要穿透样式隔离
  189 + width: 70px !important;
  190 + height: 70px !important;
  191 + }
  192 +}
186 193
187 194
188 </style> 195 </style>
189 \ No newline at end of file 196 \ No newline at end of file
pages-sub/problem/ai-manage/index.vue
@@ -266,7 +266,7 @@ const USER_ROLES = userStore.userInfo?.roles || []; @@ -266,7 +266,7 @@ const USER_ROLES = userStore.userInfo?.roles || [];
266 // ========== 基础状态 (按模块分组,语义化更强) ========== 266 // ========== 基础状态 (按模块分组,语义化更强) ==========
267 // tab切换 267 // tab切换
268 const activeTab = ref(0); // 0-待办 1-我发起的 2-已办 268 const activeTab = ref(0); // 0-待办 1-我发起的 2-已办
269 -const tabList = ref([{name: '待办'}, {name: '我发起的任务'}, {name: '已办'}]); 269 +const tabList = ref([{name: '待办'}, {name: '我发起的'}, {name: '已办'}]);
270 // 排序与搜索 270 // 排序与搜索
271 const selectedSortValue = ref(1); 271 const selectedSortValue = ref(1);
272 const sortOptions = ref([ 272 const sortOptions = ref([
pages-sub/problem/regional-order-manage/index.vue
@@ -231,7 +231,7 @@ const USER_ROLES = userStore.userInfo?.roles || []; @@ -231,7 +231,7 @@ const USER_ROLES = userStore.userInfo?.roles || [];
231 // ========== 基础状态 (按模块分组,语义化更强) ========== 231 // ========== 基础状态 (按模块分组,语义化更强) ==========
232 // tab切换 232 // tab切换
233 const activeTab = ref(0); // 0-待办 1-已办 2-我发起的任务 233 const activeTab = ref(0); // 0-待办 1-已办 2-我发起的任务
234 -const tabList = [{name: '待办'}, {name: '已办'}, {name: '我发起的任务'}]; 234 +const tabList = [{name: '待办'}, {name: '已办'}, {name: '我发起的'}];
235 // 排序与搜索 235 // 排序与搜索
236 const selectedSortValue = ref(1); 236 const selectedSortValue = ref(1);
237 const sortOptions = ref([ 237 const sortOptions = ref([
pages-sub/problem/work-order-manage/index.vue
@@ -298,7 +298,7 @@ const activeTab = ref(0); //0-待办 1-已办 2-我发起的任务 @@ -298,7 +298,7 @@ const activeTab = ref(0); //0-待办 1-已办 2-我发起的任务
298 const tabList = ref([ 298 const tabList = ref([
299 {name: '待办'}, 299 {name: '待办'},
300 {name: '已办'}, 300 {name: '已办'},
301 - {name: '我发起的任务'} 301 + {name: '我发起的'}
302 ]); 302 ]);
303 // 排序下拉框 303 // 排序下拉框
304 const selectedSortValue = ref(1); 304 const selectedSortValue = ref(1);