1.18整合
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
@@ -26,11 +27,34 @@ const _sfc_main = {
|
||||
createdAt: "",
|
||||
attachments: []
|
||||
});
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const getFullPath = (filePath) => {
|
||||
if (!filePath)
|
||||
return "";
|
||||
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
|
||||
return filePath;
|
||||
}
|
||||
return request_request.baseUrl + filePath;
|
||||
};
|
||||
const previewRectifyImage = (index) => {
|
||||
const urls = rectifyAttachments.value.map((item) => getFullPath(item.filePath));
|
||||
common_vendor.index.previewImage({
|
||||
current: index,
|
||||
urls
|
||||
});
|
||||
};
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId, assignId });
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||
const assign = res.data.assigns[0];
|
||||
if (assign.rectify && assign.rectify.attachments) {
|
||||
rectifyAttachments.value = assign.rectify.attachments;
|
||||
console.log("整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
@@ -46,12 +70,13 @@ const _sfc_main = {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0
|
||||
}, (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
a: rectifyAttachments.value.length > 0
|
||||
}, rectifyAttachments.value.length > 0 ? {
|
||||
b: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: img.filePath
|
||||
b: getFullPath(img.filePath),
|
||||
c: common_vendor.o(($event) => previewRectifyImage(idx), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
|
||||
Reference in New Issue
Block a user