修改并优化了一些功能及bug

This commit is contained in:
王利强
2026-05-14 13:45:46 +08:00
parent 805747d1d9
commit 2322fcf39a
51 changed files with 802 additions and 346 deletions

View File

@@ -34,10 +34,10 @@ const _sfc_main = {
if (userInfoStr) {
const userInfo = JSON.parse(userInfoStr);
userRole.value = userInfo.role || "";
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:211", "当前用户角色:", userRole.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:224", "当前用户角色:", userRole.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:214", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:227", "获取用户信息失败:", error);
}
};
getUserRole();
@@ -55,7 +55,7 @@ const _sfc_main = {
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:239", "获取任务信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:252", "获取任务信息失败:", error);
}
};
common_vendor.onLoad((options) => {
@@ -91,7 +91,7 @@ const _sfc_main = {
areaList.value = res.data.records;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:283", "获取区域列表失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:296", "获取区域列表失败:", error);
}
};
fetchAreaList();
@@ -104,26 +104,26 @@ const _sfc_main = {
showAreaPicker.value = false;
};
const chooseLocation = () => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:299", "chooseLocation called");
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:312", "chooseLocation called");
showAddPopup.value = false;
setTimeout(() => {
common_vendor.index.getLocation({
type: "gcj02",
// 使用国测局坐标系(腾讯地图使用)
success: (locationRes) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:308", "获取当前位置成功:", locationRes);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:321", "获取当前位置成功:", locationRes);
common_vendor.index.chooseLocation({
latitude: locationRes.latitude,
longitude: locationRes.longitude,
success: (res) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:314", "选择位置成功:", res);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:327", "选择位置成功:", res);
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
lng.value = res.longitude;
lat.value = res.latitude;
showAddPopup.value = true;
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:323", "选择位置失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:336", "选择位置失败:", err);
showAddPopup.value = true;
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({
@@ -135,17 +135,17 @@ const _sfc_main = {
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:337", "获取当前位置失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:350", "获取当前位置失败:", err);
common_vendor.index.chooseLocation({
success: (res) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:341", "选择位置成功:", res);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:354", "选择位置成功:", res);
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
lng.value = res.longitude;
lat.value = res.latitude;
showAddPopup.value = true;
},
fail: (chooseErr) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:348", "选择位置失败:", chooseErr);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:361", "选择位置失败:", chooseErr);
showAddPopup.value = true;
if (chooseErr.errMsg && chooseErr.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({
@@ -187,7 +187,7 @@ const _sfc_main = {
});
const selectedTag = tagOptions.value[formData.tagIndex];
const tagId = selectedTag ? selectedTag.id : null;
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:395", "innnn", sourceOptions);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:408", "innnn", sourceOptions);
const params = {
title: formData.title,
//标题
@@ -214,7 +214,7 @@ const _sfc_main = {
attachments
//附件列表(图片/视频)
};
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:413", "提交的参数:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:426", "提交的参数:", params);
try {
const res = await request_api.addHiddenDanger(params);
if (res.code === 0) {
@@ -239,7 +239,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:441", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:454", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -259,7 +259,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:462", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:475", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -341,7 +341,7 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:558", "上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:571", "上传失败:", err);
reject(err);
}
});
@@ -359,14 +359,14 @@ const _sfc_main = {
const fullImageUrl = imageFiles[0].url;
aiAnalyzing.value = true;
try {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:580", "开始调用AI分析接口图片地址:", fullImageUrl);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:593", "开始调用AI分析接口图片地址:", fullImageUrl);
const analyzeRes = await request_api.analyzeHazardImage({
// imageUrl: 'https://yx.zhihuixiangxi.com:58880/1.png' ,
imageUrl: fullImageUrl
});
if (analyzeRes.code === 0 && analyzeRes.data) {
const aiData = analyzeRes.data;
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:588", "AI分析结果:", aiData);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:601", "AI分析结果:", aiData);
if (aiData.title)
formData.title = aiData.title;
if (aiData.description)
@@ -388,7 +388,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:611", "AI分析接口调用失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:624", "AI分析接口调用失败:", error);
common_vendor.index.showToast({ title: "AI分析失败请重试", icon: "none" });
} finally {
aiAnalyzing.value = false;
@@ -410,7 +410,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:634", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:647", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -452,16 +452,43 @@ const _sfc_main = {
]);
common_vendor.watch(() => formData.source, (newVal) => {
const selected = sourceOptions.value[newVal];
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:680", "隐患来源选择结果:", {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:693", "隐患来源选择结果:", {
索引: newVal,
选中项: selected,
id: selected == null ? void 0 : selected.id,
title: selected == null ? void 0 : selected.title
});
});
const statusTabs = common_vendor.ref([
{ label: "全部状态", value: "" },
{ label: "待验收", value: "待验收" },
{ label: "待整改", value: "待整改" },
{ label: "待交办", value: "待交办" },
{ label: "验收通过", value: "验收通过" }
]);
const activeTab = common_vendor.ref(0);
const filteredList = common_vendor.computed(() => {
const currentTab = statusTabs.value[activeTab.value];
if (!currentTab || !currentTab.value) {
return hiddenDangerList.value;
}
return hiddenDangerList.value.filter((item) => item.statusName === currentTab.value);
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(hiddenDangerList.value, (item, k0, i0) => {
a: common_vendor.f(statusTabs.value, (tab, index, i0) => {
return common_vendor.e({
a: common_vendor.t(tab.label),
b: activeTab.value === index
}, activeTab.value === index ? {} : {}, {
c: index,
d: activeTab.value === index ? 1 : "",
e: common_vendor.o(($event) => activeTab.value = index, index)
});
}),
b: filteredList.value.length === 0
}, filteredList.value.length === 0 ? {} : {}, {
c: common_vendor.f(filteredList.value, (item, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(item.title),
b: common_vendor.t(item.statusName),
@@ -495,78 +522,78 @@ const _sfc_main = {
t: item.hazardId
});
}),
b: common_vendor.o(($event) => showAddPopup.value = true),
c: common_vendor.o(($event) => showAddPopup.value = false),
d: common_vendor.o(afterRead),
e: common_vendor.o(deletePic),
f: common_vendor.p({
d: common_vendor.o(($event) => showAddPopup.value = true),
e: common_vendor.o(($event) => showAddPopup.value = false),
f: common_vendor.o(afterRead),
g: common_vendor.o(deletePic),
h: common_vendor.p({
fileList: fileList1.value,
name: "1",
multiple: true,
maxCount: 10
}),
g: !aiAnalyzing.value
i: !aiAnalyzing.value
}, !aiAnalyzing.value ? {} : {}, {
h: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
i: aiAnalyzing.value,
j: aiAnalyzing.value,
k: common_vendor.o(handleAiAnalyze),
l: common_vendor.o(($event) => formData.title = $event),
m: common_vendor.p({
j: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
k: aiAnalyzing.value,
l: aiAnalyzing.value,
m: common_vendor.o(handleAiAnalyze),
n: common_vendor.o(($event) => formData.title = $event),
o: common_vendor.p({
placeholder: "请输入内容",
border: "surround",
modelValue: formData.title
}),
n: common_vendor.sr(levelChooseRef, "b44c631d-3,b44c631d-0", {
p: common_vendor.sr(levelChooseRef, "b44c631d-3,b44c631d-0", {
"k": "levelChooseRef"
}),
o: common_vendor.o(($event) => formData.level = $event),
p: common_vendor.p({
q: common_vendor.o(($event) => formData.level = $event),
r: common_vendor.p({
options: levelOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: formData.level
}),
q: common_vendor.o(($event) => formData.source = $event),
r: common_vendor.p({
s: common_vendor.o(($event) => formData.source = $event),
t: common_vendor.p({
options: sourceOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: formData.source
}),
s: common_vendor.o(($event) => selectedAddress.value = $event),
t: common_vendor.p({
v: common_vendor.o(($event) => selectedAddress.value = $event),
w: common_vendor.p({
placeholder: "请输入地址",
border: "surround",
modelValue: selectedAddress.value
}),
v: common_vendor.o(chooseLocation),
w: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
x: !selectedAreaName.value ? 1 : "",
y: common_vendor.o(($event) => showAreaPicker.value = true),
z: common_vendor.o(($event) => formData.description = $event),
A: common_vendor.p({
x: common_vendor.o(chooseLocation),
y: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
z: !selectedAreaName.value ? 1 : "",
A: common_vendor.o(($event) => showAreaPicker.value = true),
B: common_vendor.o(($event) => formData.description = $event),
C: common_vendor.p({
placeholder: "请输入内容",
modelValue: formData.description
}),
B: common_vendor.o(($event) => formData.tagIndex = $event),
C: common_vendor.p({
D: common_vendor.o(($event) => formData.tagIndex = $event),
E: common_vendor.p({
options: tagOptions.value,
modelValue: formData.tagIndex
}),
D: common_vendor.o(($event) => showAddPopup.value = false),
E: common_vendor.o(handleAdd),
F: common_vendor.o(($event) => showAddPopup.value = false),
G: common_vendor.p({
G: common_vendor.o(handleAdd),
H: common_vendor.o(($event) => showAddPopup.value = false),
I: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20"
}),
H: common_vendor.o(($event) => showAreaPicker.value = false),
I: common_vendor.o(confirmAreaSelect),
J: common_vendor.f(areaList.value, (item, k0, i0) => {
J: common_vendor.o(($event) => showAreaPicker.value = false),
K: common_vendor.o(confirmAreaSelect),
L: common_vendor.f(areaList.value, (item, k0, i0) => {
return common_vendor.e({
a: item.color,
b: common_vendor.t(item.name),
@@ -577,15 +604,15 @@ const _sfc_main = {
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
});
}),
K: areaList.value.length === 0
M: areaList.value.length === 0
}, areaList.value.length === 0 ? {} : {}, {
L: common_vendor.o(($event) => showAreaPicker.value = false),
M: common_vendor.p({
N: common_vendor.o(($event) => showAreaPicker.value = false),
O: common_vendor.p({
show: showAreaPicker.value,
mode: "bottom",
round: "20"
}),
N: common_vendor.gei(_ctx, "")
P: common_vendor.gei(_ctx, "")
});
};
}