v1.2.1版本,优化调整了很多,整改验收阶段新加字段
This commit is contained in:
@@ -25,55 +25,49 @@ const _sfc_main = {
|
||||
description: "",
|
||||
address: "",
|
||||
areaName: "",
|
||||
// 隐患区域名称
|
||||
createdAt: "",
|
||||
areaColor: "",
|
||||
tagName: "",
|
||||
legalBasis: "",
|
||||
regulationName: "",
|
||||
attachments: []
|
||||
});
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const getFullPath = (filePath) => {
|
||||
return request_request.toImageUrl(filePath);
|
||||
};
|
||||
const legalBasisText = common_vendor.computed(() => detailData.legalBasis || detailData.regulationName || "");
|
||||
const getFullPath = (filePath) => request_request.toImageUrl(filePath);
|
||||
const previewHazardImage = (index) => {
|
||||
if (!detailData.attachments || detailData.attachments.length === 0)
|
||||
return;
|
||||
const urls = detailData.attachments.map((item) => getFullPath(item.filePath));
|
||||
common_vendor.index.previewImage({
|
||||
current: index,
|
||||
urls
|
||||
urls: detailData.attachments.map((item) => getFullPath(item.filePath))
|
||||
});
|
||||
};
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId, assignId });
|
||||
const params = { hazardId };
|
||||
if (assignId)
|
||||
params.assignId = assignId;
|
||||
const res = await request_api.getHiddenDangerDetail(params);
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/view.vue:120", "隐患详情数据:", res.data);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/view.vue:121", "隐患附件:", res.data.attachments);
|
||||
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;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/view.vue:128", "整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:135", "获取隐患详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:138", "获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId && options.assignId) {
|
||||
if (options.hazardId) {
|
||||
fetchDetail(options.hazardId, options.assignId);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: detailData.attachments && detailData.attachments.length > 0
|
||||
a: common_vendor.t(detailData.source || "暂无"),
|
||||
b: detailData.attachments && detailData.attachments.length > 0
|
||||
}, detailData.attachments && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
c: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: getFullPath(img.filePath),
|
||||
@@ -81,28 +75,41 @@ const _sfc_main = {
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.o(($event) => detailData.title = $event),
|
||||
d: common_vendor.p({
|
||||
disabled: "true",
|
||||
d: common_vendor.o(($event) => detailData.title = $event),
|
||||
e: common_vendor.p({
|
||||
disabled: true,
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
placeholder: "暂无",
|
||||
modelValue: detailData.title
|
||||
}),
|
||||
e: common_vendor.n(detailData.level === 1 ? "bg-blue light" : "bg-gray"),
|
||||
f: common_vendor.n(detailData.level === 2 ? "bg-blue light" : "bg-gray"),
|
||||
g: common_vendor.n(detailData.level === 3 ? "bg-blue light" : "bg-gray"),
|
||||
h: detailData.address,
|
||||
i: common_vendor.o(($event) => detailData.address = $event.detail.value),
|
||||
j: common_vendor.t(detailData.areaName || "暂无"),
|
||||
k: common_vendor.o(($event) => detailData.description = $event),
|
||||
l: common_vendor.p({
|
||||
h: common_vendor.o(($event) => detailData.address = $event),
|
||||
i: common_vendor.p({
|
||||
disabled: true,
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
placeholder: "暂无地址",
|
||||
modelValue: detailData.address
|
||||
}),
|
||||
j: common_vendor.t(legalBasisText.value || "暂无"),
|
||||
k: !legalBasisText.value ? 1 : "",
|
||||
l: detailData.areaColor
|
||||
}, detailData.areaColor ? {
|
||||
m: detailData.areaColor
|
||||
} : {}, {
|
||||
n: common_vendor.t(detailData.areaName || "暂无"),
|
||||
o: !detailData.areaName ? 1 : "",
|
||||
p: common_vendor.o(($event) => detailData.description = $event),
|
||||
q: common_vendor.p({
|
||||
placeholder: "暂无描述",
|
||||
disabled: true,
|
||||
autoHeight: true,
|
||||
modelValue: detailData.description
|
||||
}),
|
||||
m: common_vendor.t(detailData.source || "暂无"),
|
||||
n: common_vendor.t(detailData.createdAt || "暂无"),
|
||||
o: common_vendor.gei(_ctx, "")
|
||||
r: common_vendor.t(detailData.tagName || "暂无"),
|
||||
s: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user