Commit d6406a70ad315944be31b54a67b0577c8b7c772c
1 parent
5b5a4862
快速工单 详情 照片处理
Showing
5 changed files
with
39 additions
and
32 deletions
common/config/env.js
| ... | ... | @@ -12,8 +12,8 @@ const env = { |
| 12 | 12 | }, |
| 13 | 13 | // 生产环境 |
| 14 | 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 | 17 | // baseApi:'admin-api', |
| 18 | 18 | // appApi:'app-api' |
| 19 | 19 | } |
| ... | ... | @@ -22,7 +22,7 @@ const env = { |
| 22 | 22 | // 获取当前环境 |
| 23 | 23 | const getEnv = () => { |
| 24 | 24 | |
| 25 | - const currentEnv = 'development'; | |
| 25 | + const currentEnv = 'production'; | |
| 26 | 26 | |
| 27 | 27 | return currentEnv; |
| 28 | 28 | }; | ... | ... |
pages-sub/daily/quick-order/order-detail.vue
| ... | ... | @@ -72,37 +72,36 @@ |
| 72 | 72 | </template> |
| 73 | 73 | </up-cell> |
| 74 | 74 | |
| 75 | - <!-- 5. 问题照片(核心修复:判断条件+空值处理) --> | |
| 75 | + <!-- 5. 问题照片 --> | |
| 76 | 76 | <up-cell title="问题照片" > |
| 77 | 77 | <template #value> |
| 78 | - <view class="cell-content-wrap"> | |
| 78 | + <view class="cell-content-wrap" > | |
| 79 | 79 | |
| 80 | - <!-- 修复1:正确判断problemImgsList,补充空数组默认值 --> | |
| 81 | 80 | <up-album |
| 82 | - v-if="!!orderDetail.problemsImgs?.length" | |
| 83 | - :urls="orderDetail.problemsImgs || []" | |
| 81 | + :urls="orderDetail.problemsImgs " | |
| 84 | 82 | singleSize="70" |
| 85 | - :preview-full-image="true" | |
| 86 | 83 | multipleSize="70" |
| 84 | + :preview-full-image="true" | |
| 85 | + | |
| 87 | 86 | ></up-album> |
| 88 | - <text v-else class="empty-text">暂无问题照片</text> | |
| 87 | +<!-- <text v-else class="empty-text">暂无问题照片</text>--> | |
| 89 | 88 | </view> |
| 90 | 89 | </template> |
| 91 | 90 | </up-cell> |
| 92 | 91 | |
| 93 | - <!-- 6. 完成照片(优化:空值处理+容错) --> | |
| 94 | - <up-cell title="完成照片" align="top"> | |
| 92 | + <!-- 6. 完成照片 --> | |
| 93 | + <up-cell title="完成照片"> | |
| 95 | 94 | <template #value> |
| 96 | 95 | <view class="cell-content-wrap"> |
| 97 | 96 | <up-album |
| 98 | - v-if="!!orderDetail.endImgs?.length" | |
| 99 | - :urls="orderDetail.endImgs || []" | |
| 97 | + | |
| 98 | + :urls="orderDetail.endImgs" | |
| 100 | 99 | singleSize="70" |
| 101 | 100 | multipleSize="70" |
| 102 | 101 | :preview-full-image="true" |
| 103 | 102 | |
| 104 | 103 | ></up-album> |
| 105 | - <text v-else class="empty-text">暂无完成照片</text> | |
| 104 | +<!-- <text v-else class="empty-text">暂无完成照片</text>--> | |
| 106 | 105 | </view> |
| 107 | 106 | </template> |
| 108 | 107 | </up-cell> |
| ... | ... | @@ -125,15 +124,23 @@ |
| 125 | 124 | </template> |
| 126 | 125 | |
| 127 | 126 | <script setup lang="ts"> |
| 128 | -import { ref, reactive } from 'vue'; | |
| 127 | +import { ref } from 'vue'; | |
| 129 | 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) => { |
| 142 | 149 | try { |
| 143 | 150 | loading.value = true; |
| 144 | 151 | const res = await inspectionPlanDetail({ id }); |
| 145 | - console.log('接口返回:', res); | |
| 146 | - // 优化:确保图片数组为数组类型,避免非数组导致渲染错误 | |
| 152 | + console.log('接口返回problemsImgs:', res.problemsImgs); // 确认数据存在 | |
| 153 | + // 修复3:解构赋值时,强制保证图片数组为数组类型 | |
| 147 | 154 | orderDetail.value = { |
| 148 | 155 | ...res, |
| 149 | 156 | problemsImgs: Array.isArray(res.problemsImgs) ? res.problemsImgs : [], |
| ... | ... | @@ -157,7 +164,6 @@ const getOrderDetail = async (id: string) => { |
| 157 | 164 | } |
| 158 | 165 | }; |
| 159 | 166 | |
| 160 | -// 页面加载 | |
| 161 | 167 | onLoad((options) => { |
| 162 | 168 | const { id } = options; |
| 163 | 169 | if (id) { |
| ... | ... | @@ -170,10 +176,6 @@ onLoad((options) => { |
| 170 | 176 | </script> |
| 171 | 177 | |
| 172 | 178 | <style scoped lang="scss"> |
| 173 | -// 页面基础样式 | |
| 174 | -.u-page { | |
| 175 | - | |
| 176 | -} | |
| 177 | 179 | |
| 178 | 180 | // 内容容器 |
| 179 | 181 | .content-wrap { |
| ... | ... | @@ -182,7 +184,12 @@ onLoad((options) => { |
| 182 | 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 | 195 | </style> |
| 189 | 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 | 266 | // ========== 基础状态 (按模块分组,语义化更强) ========== |
| 267 | 267 | // tab切换 |
| 268 | 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 | 271 | const selectedSortValue = ref(1); |
| 272 | 272 | const sortOptions = ref([ | ... | ... |
pages-sub/problem/regional-order-manage/index.vue
| ... | ... | @@ -231,7 +231,7 @@ const USER_ROLES = userStore.userInfo?.roles || []; |
| 231 | 231 | // ========== 基础状态 (按模块分组,语义化更强) ========== |
| 232 | 232 | // tab切换 |
| 233 | 233 | const activeTab = ref(0); // 0-待办 1-已办 2-我发起的任务 |
| 234 | -const tabList = [{name: '待办'}, {name: '已办'}, {name: '我发起的任务'}]; | |
| 234 | +const tabList = [{name: '待办'}, {name: '已办'}, {name: '我发起的'}]; | |
| 235 | 235 | // 排序与搜索 |
| 236 | 236 | const selectedSortValue = ref(1); |
| 237 | 237 | const sortOptions = ref([ | ... | ... |
pages-sub/problem/work-order-manage/index.vue