隐患详情重新设计,检查计划重新设计成做题排查式

This commit is contained in:
王利强
2026-06-21 16:30:12 +08:00
parent 1fe87ec438
commit cc94d3e3e9
256 changed files with 12542 additions and 5956 deletions

View File

@@ -7,6 +7,8 @@ if (!Math) {
"./pages/map/map.js";
"./pages/plandetail/plandetail.js";
"./pages/Inspectionresult/Inspectionresult.js";
"./pages/Inspectionresult/list.js";
"./pages/Inspectionresult/detail.js";
"./pages/membermanagemen/membermanagemen.js";
"./pages/corporateInformation/corporateInformation.js";
"./pages/editcompanInformation/editcompanInformation.js";
@@ -17,6 +19,7 @@ if (!Math) {
"./pages/Idphotomanagement/Idphotomanagement.js";
"./pages/hiddendanger/Inspection.js";
"./pages/hiddendanger/view.js";
"./pages/hiddendanger/detail2.js";
"./pages/hiddendanger/rectification.js";
"./pages/hiddendanger/acceptance.js";
"./pages/hiddendanger/assignment.js";

View File

@@ -4,6 +4,8 @@
"pages/map/map",
"pages/plandetail/plandetail",
"pages/Inspectionresult/Inspectionresult",
"pages/Inspectionresult/list",
"pages/Inspectionresult/detail",
"pages/membermanagemen/membermanagemen",
"pages/corporateInformation/corporateInformation",
"pages/editcompanInformation/editcompanInformation",
@@ -14,6 +16,7 @@
"pages/Idphotomanagement/Idphotomanagement",
"pages/hiddendanger/Inspection",
"pages/hiddendanger/view",
"pages/hiddendanger/detail2",
"pages/hiddendanger/rectification",
"pages/hiddendanger/acceptance",
"pages/hiddendanger/assignment",

View File

@@ -1,5 +1,7 @@
"use strict";
const _imports_0$6 = "/static/home_icon/jianbianbeijing.png";
const _imports_0$7 = "/static/home_icon/jianbianbeijing.png";
const _imports_0$6 = "/static/yinhuan_detail/status.png";
const _imports_1$4 = "/static/yinhuan_detail/date.png";
const _imports_0$5 = "/static/yujin/yujin_sousuo.png";
const _imports_1$3 = "/static/yujin/yujin_tongji.png";
const _imports_0$4 = "/static/my/edit.png";
@@ -11,16 +13,18 @@ const _imports_0$2 = "/static/index/index_bg.png";
const _imports_0$1 = "/static/index/phone.png";
const _imports_1 = "/static/index/lock.png";
const _imports_0 = "/static/index/蒙版组 260.png";
exports._imports_0 = _imports_0$6;
exports._imports_0$1 = _imports_0$5;
exports._imports_0$2 = _imports_0$4;
exports._imports_0$3 = _imports_0$3;
exports._imports_0$4 = _imports_0$2;
exports._imports_0$5 = _imports_0$1;
exports._imports_0$6 = _imports_0;
exports._imports_1 = _imports_1$3;
exports._imports_1$1 = _imports_1$2;
exports._imports_1$2 = _imports_1$1;
exports._imports_1$3 = _imports_1;
exports._imports_0 = _imports_0$7;
exports._imports_0$1 = _imports_0$6;
exports._imports_0$2 = _imports_0$5;
exports._imports_0$3 = _imports_0$4;
exports._imports_0$4 = _imports_0$3;
exports._imports_0$5 = _imports_0$2;
exports._imports_0$6 = _imports_0$1;
exports._imports_0$7 = _imports_0;
exports._imports_1 = _imports_1$4;
exports._imports_1$1 = _imports_1$3;
exports._imports_1$2 = _imports_1$2;
exports._imports_1$3 = _imports_1$1;
exports._imports_1$4 = _imports_1;
exports._imports_2 = _imports_2;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/assets.js.map

View File

@@ -784,6 +784,10 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
}
resetScheduling();
}
function getDepFromReactive(object, key) {
var _a;
return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
}
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
const builtInSymbols = new Set(
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
@@ -1501,6 +1505,38 @@ const shallowUnwrapHandlers = {
function proxyRefs(objectWithRefs) {
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
}
function toRefs(object) {
if (!isProxy(object)) {
warn$2(`toRefs() expects a reactive object but received a plain one.`);
}
const ret = isArray$1(object) ? new Array(object.length) : {};
for (const key in object) {
ret[key] = propertyToRef(object, key);
}
return ret;
}
class ObjectRefImpl {
constructor(_object, _key, _defaultValue) {
this._object = _object;
this._key = _key;
this._defaultValue = _defaultValue;
this.__v_isRef = true;
}
get value() {
const val = this._object[this._key];
return val === void 0 ? this._defaultValue : val;
}
set value(newVal) {
this._object[this._key] = newVal;
}
get dep() {
return getDepFromReactive(toRaw(this._object), this._key);
}
}
function propertyToRef(source, key, defaultValue) {
const val = source[key];
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
}
const stack = [];
function pushWarningContext(vnode) {
stack.push(vnode);
@@ -7103,9 +7139,9 @@ function isConsoleWritable() {
return isWritable;
}
function initRuntimeSocketService() {
const hosts = "192.168.1.144,127.0.0.1,172.17.192.1";
const hosts = "192.168.1.144,127.0.0.1,172.22.80.1";
const port = "8090";
const id = "mp-weixin_Capuq2";
const id = "mp-weixin_VsFItf";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();
@@ -8059,11 +8095,26 @@ const onShow = /* @__PURE__ */ createLifeCycleHook(
1 | 2
/* HookFlags.PAGE */
);
const onHide = /* @__PURE__ */ createLifeCycleHook(
ON_HIDE,
1 | 2
/* HookFlags.PAGE */
);
const onLoad = /* @__PURE__ */ createLifeCycleHook(
ON_LOAD,
2
/* HookFlags.PAGE */
);
const onReady = /* @__PURE__ */ createLifeCycleHook(
ON_READY,
2
/* HookFlags.PAGE */
);
const onBackPress = /* @__PURE__ */ createLifeCycleHook(
ON_BACK_PRESS,
2
/* HookFlags.PAGE */
);
const onReachBottom = /* @__PURE__ */ createLifeCycleHook(
ON_REACH_BOTTOM,
2
@@ -8756,10 +8807,13 @@ exports.n = n;
exports.nextTick$1 = nextTick$1;
exports.o = o;
exports.objToStyle = objToStyle;
exports.onBackPress = onBackPress;
exports.onBeforeMount = onBeforeMount;
exports.onHide = onHide;
exports.onLoad = onLoad;
exports.onMounted = onMounted;
exports.onReachBottom = onReachBottom;
exports.onReady = onReady;
exports.onShow = onShow;
exports.onUnmounted = onUnmounted;
exports.p = p;
@@ -8771,6 +8825,7 @@ exports.s = s;
exports.signatureProps = signatureProps;
exports.sr = sr;
exports.t = t;
exports.toRefs = toRefs;
exports.unref = unref;
exports.useTranslate = useTranslate;
exports.uuid = uuid;

View File

@@ -0,0 +1,657 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_three_one_api_area = require("../../request/three_one_api/area.js");
const utils_upload = require("../../utils/upload.js");
const components_hazard_hazardForm = require("./hazardForm.js");
if (!Array) {
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_upload2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
}
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_upload + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
}
const LOCATION_PICKER_DRAFT_KEY = "hazard_form_location_picker_draft";
const _sfc_main = {
__name: "HazardFormPopup",
props: {
show: {
type: Boolean,
default: false
},
title: {
type: String,
default: "填写隐患信息"
},
mode: {
type: String,
default: "collect"
},
modelValue: {
type: Object,
default: null
},
extraParams: {
type: Object,
default: () => ({})
},
showDraftBanner: {
type: Boolean,
default: false
},
bodyHeight: {
type: String,
default: ""
},
canvasId: {
type: String,
default: "hazardFormWatermarkCanvas"
}
},
emits: ["update:show", "update:modelValue", "success", "confirm", "clear-draft"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emit = __emit;
const popupVisible = common_vendor.computed({
get: () => props.show,
set: (value) => emit("update:show", value)
});
const isApiSuccess = (res) => Number(res == null ? void 0 : res.code) === 0 || Number(res == null ? void 0 : res.code) === 200;
const bodyStyle = common_vendor.computed(() => props.bodyHeight ? { height: props.bodyHeight } : {});
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const submitting = common_vendor.ref(false);
const aiAnalyzing = common_vendor.ref(false);
const syncingFromParent = common_vendor.ref(false);
const formData = common_vendor.reactive({
title: "",
level: 0,
source: 0,
description: "",
tagIndex: 0,
tagId: null,
regulationId: null,
regulationName: ""
});
const address = common_vendor.ref("");
const lng = common_vendor.ref(0);
const lat = common_vendor.ref(0);
const areaId = common_vendor.ref("");
const areaName = common_vendor.ref("");
const fileList = common_vendor.ref([]);
const tagOptions = common_vendor.ref([]);
const showLawPopup = common_vendor.ref(false);
const lawKeyword = common_vendor.ref("");
const selectedLawId = common_vendor.ref(null);
const selectedLawName = common_vendor.ref("");
const lawList = common_vendor.ref([]);
const lawLoading = common_vendor.ref(false);
const lawPageNum = common_vendor.ref(1);
const lawPageSize = common_vendor.ref(10);
const hasMoreLaw = common_vendor.ref(true);
const showAreaPicker = common_vendor.ref(false);
const areaList = common_vendor.ref([]);
const tempAreaId = common_vendor.ref("");
const choosingLocation = common_vendor.ref(false);
const suppressModelEmit = common_vendor.ref(false);
const uploadInstance = common_vendor.getCurrentInstance();
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList, {
watermark: {
canvasId: props.canvasId,
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance: uploadInstance
}
});
function getPayload() {
syncTagIdFromIndex();
return {
formData: {
title: formData.title,
level: formData.level,
source: formData.source,
description: formData.description,
tagIndex: formData.tagIndex,
tagId: formData.tagId,
regulationId: formData.regulationId,
regulationName: formData.regulationName
},
address: address.value,
lng: lng.value,
lat: lat.value,
areaId: areaId.value,
areaName: areaName.value,
fileList: fileList.value,
tagOptions: tagOptions.value
};
}
function applyPayload(payload) {
if (!payload)
return;
syncingFromParent.value = true;
const data = payload.formData || {};
formData.title = data.title || "";
formData.level = data.level ?? 0;
formData.source = data.source ?? 0;
formData.description = data.description || "";
formData.tagIndex = data.tagIndex ?? 0;
formData.tagId = data.tagId ?? null;
formData.regulationId = data.regulationId ?? null;
formData.regulationName = data.regulationName || "";
address.value = payload.address || "";
lng.value = payload.lng || 0;
lat.value = payload.lat || 0;
areaId.value = payload.areaId || "";
areaName.value = payload.areaName || "";
fileList.value = payload.fileList ? [...payload.fileList] : [];
selectedLawId.value = data.regulationId ?? null;
selectedLawName.value = data.regulationName || "";
syncingFromParent.value = false;
}
function hasPayloadContent(payload) {
if (!payload)
return false;
const data = payload.formData || {};
const files = payload.fileList || [];
return !!(data.title || data.description || data.regulationName || payload.address || files.length > 0);
}
function getLocationPickerDraftKey() {
var _a;
return ((_a = props.extraParams) == null ? void 0 : _a.locationDraftKey) || LOCATION_PICKER_DRAFT_KEY;
}
function saveLocationPickerDraft() {
const snapshot = getPayload();
try {
common_vendor.index.setStorageSync(getLocationPickerDraftKey(), snapshot);
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:400", "保存选点草稿失败:", error);
}
return snapshot;
}
function loadLocationPickerDraft() {
try {
const draft = common_vendor.index.getStorageSync(getLocationPickerDraftKey());
return draft && typeof draft === "object" ? draft : null;
} catch (error) {
return null;
}
}
function clearLocationPickerDraft() {
try {
common_vendor.index.removeStorageSync(getLocationPickerDraftKey());
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:418", "清除选点草稿失败:", error);
}
}
function restoreAfterLocationPicker(patch = {}) {
const draft = loadLocationPickerDraft();
if (!draft)
return false;
applyPayload({
...draft,
...patch,
formData: {
...draft.formData || {},
...patch.formData || {}
},
fileList: patch.fileList ?? draft.fileList ?? []
});
clearLocationPickerDraft();
return true;
}
function reopenPopupAfterLocation() {
common_vendor.nextTick$1(() => {
choosingLocation.value = false;
popupVisible.value = true;
emitModelValue();
});
}
function resetForm() {
applyPayload(components_hazard_hazardForm.createEmptyHazardPayload());
selectedLawId.value = null;
selectedLawName.value = "";
tempAreaId.value = "";
clearLocationPickerDraft();
}
function syncTagIdFromIndex() {
const selectedTag = tagOptions.value[formData.tagIndex];
formData.tagId = (selectedTag == null ? void 0 : selectedTag.id) ?? formData.tagId ?? null;
}
function onChooseSelect(field, index) {
formData[field] = Number(index);
if (field === "tagIndex") {
syncTagIdFromIndex();
}
emitModelValue();
}
function emitModelValue() {
if (suppressModelEmit.value || syncingFromParent.value || props.modelValue === null)
return;
if (props.mode === "collect" || props.mode === "direct")
return;
emit("update:modelValue", getPayload());
}
function closePopup() {
popupVisible.value = false;
}
function handleClose() {
closePopup();
}
function validateForm() {
if (fileList.value.length === 0) {
common_vendor.index.showToast({ title: "请上传隐患图片", icon: "none" });
return false;
}
if (!formData.title) {
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
return false;
}
if (!address.value) {
common_vendor.index.showToast({ title: "请输入隐患位置", icon: "none" });
return false;
}
if (!formData.description) {
common_vendor.index.showToast({ title: "请输入隐患描述", icon: "none" });
return false;
}
return true;
}
async function handleConfirm() {
if (!validateForm())
return;
const payload = getPayload();
if (props.mode === "collect") {
if (props.modelValue !== null) {
emit("update:modelValue", payload);
}
emit("confirm", payload);
closePopup();
common_vendor.index.showToast({ title: "隐患信息已暂存", icon: "success" });
return;
}
submitting.value = true;
try {
const params = components_hazard_hazardForm.buildHiddenDangerParams(payload, props.extraParams);
const res = await request_api.addHiddenDanger(params);
if (isApiSuccess(res)) {
suppressModelEmit.value = true;
closePopup();
emit("success", { ...payload, hazardId: res.data });
await common_vendor.nextTick$1();
resetForm();
common_vendor.index.showToast({ title: res.msg || "新增成功", icon: "success" });
} else {
common_vendor.index.showToast({ title: res.msg || "新增失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:534", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
} finally {
suppressModelEmit.value = false;
submitting.value = false;
}
}
function openLawPopup() {
showLawPopup.value = true;
if (lawList.value.length === 0) {
fetchRegulationList();
}
}
async function fetchRegulationList(isLoadMore = false) {
var _a;
if (lawLoading.value)
return;
lawLoading.value = true;
try {
const params = {
pageNum: lawPageNum.value,
pageSize: lawPageSize.value,
status: 1
};
if ((_a = lawKeyword.value) == null ? void 0 : _a.trim()) {
params.keyword = lawKeyword.value.trim();
}
const res = await request_api.getRegulationList(params);
if (res.code === 0) {
const records = res.data.records || res.data || [];
lawList.value = isLoadMore ? [...lawList.value, ...records] : records;
const total = res.data.total || 0;
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:569", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
}
function searchRegulation() {
lawPageNum.value = 1;
lawList.value = [];
hasMoreLaw.value = true;
fetchRegulationList();
}
function loadMoreLaw() {
if (!hasMoreLaw.value || lawLoading.value)
return;
lawPageNum.value++;
fetchRegulationList(true);
}
function selectLaw(item) {
selectedLawId.value = item.id;
selectedLawName.value = item.depict || item.keyword || "";
}
function confirmLaw() {
if (selectedLawId.value) {
formData.regulationId = selectedLawId.value;
formData.regulationName = selectedLawName.value;
}
showLawPopup.value = false;
emitModelValue();
}
function openAreaPicker() {
tempAreaId.value = areaId.value;
showAreaPicker.value = true;
}
async function fetchAreaList() {
var _a;
try {
const res = await request_three_one_api_area.getAreaList();
if (res.code === 0 && ((_a = res.data) == null ? void 0 : _a.records)) {
areaList.value = res.data.records;
}
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:614", "获取区域列表失败:", error);
}
}
function confirmAreaSelect() {
if (tempAreaId.value) {
areaId.value = tempAreaId.value;
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
areaName.value = selected ? selected.name : "";
}
showAreaPicker.value = false;
emitModelValue();
}
function chooseLocation() {
choosingLocation.value = true;
saveLocationPickerDraft();
closePopup();
setTimeout(() => {
common_vendor.index.getLocation({
type: "gcj02",
success: (locationRes) => {
openChooseLocation(locationRes.latitude, locationRes.longitude);
},
fail: () => {
openChooseLocation();
}
});
}, 300);
}
function openChooseLocation(latitude, longitude) {
const options = {};
if (latitude != null && longitude != null) {
options.latitude = latitude;
options.longitude = longitude;
}
common_vendor.index.chooseLocation({
...options,
success: (res) => {
restoreAfterLocationPicker({
address: res.address + (res.name ? `(${res.name})` : ""),
lng: res.longitude,
lat: res.latitude
});
reopenPopupAfterLocation();
},
fail: (err) => {
restoreAfterLocationPicker();
reopenPopupAfterLocation();
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({ title: "选择位置失败", icon: "none" });
}
}
});
}
async function handleAiAnalyze() {
const imageFiles = fileList.value.filter((f) => {
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
});
if (imageFiles.length === 0) {
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
return;
}
aiAnalyzing.value = true;
try {
const analyzeRes = await request_api.analyzeHazardImage({ imageUrl: imageFiles[0].url });
if (analyzeRes.code === 0 && analyzeRes.data) {
const aiData = analyzeRes.data;
if (aiData.title)
formData.title = aiData.title;
if (aiData.description)
formData.description = aiData.description;
if (aiData.level) {
const levelIndex = components_hazard_hazardForm.AI_LEVEL_MAP[aiData.level];
if (levelIndex !== void 0) {
formData.level = levelIndex;
}
}
emitModelValue();
common_vendor.index.showToast({ title: "AI分析完成已自动填充", icon: "success", duration: 2e3 });
} else {
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:699", "AI分析接口调用失败:", error);
common_vendor.index.showToast({ title: "AI分析失败请重试", icon: "none" });
} finally {
aiAnalyzing.value = false;
}
}
async function fetchTagOptions() {
try {
const res = await request_api.getHiddenDangerLabelList();
if (res.code === 0) {
tagOptions.value = res.data.map((item) => ({
id: item.id,
title: item.name
}));
syncTagIdFromIndex();
}
} catch (error) {
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:717", "获取标签列表失败:", error);
}
}
common_vendor.watch(
() => props.modelValue,
(val) => {
if (props.mode === "direct")
return;
if (hasPayloadContent(val)) {
applyPayload(val);
}
},
{ deep: true, immediate: true }
);
common_vendor.watch(
() => props.show,
(val) => {
if (val && areaList.value.length === 0) {
fetchAreaList();
}
if (!val)
return;
if (choosingLocation.value) {
return;
}
const locationDraft = loadLocationPickerDraft();
if (locationDraft) {
applyPayload(locationDraft);
clearLocationPickerDraft();
return;
}
if (hasPayloadContent(props.modelValue)) {
applyPayload(props.modelValue);
}
}
);
fetchTagOptions();
fetchAreaList();
__expose({
getPayload,
applyPayload,
resetForm,
validateForm
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(__props.title),
b: common_vendor.o(handleClose),
c: __props.showDraftBanner
}, __props.showDraftBanner ? {
d: common_vendor.o(($event) => emit("clear-draft"))
} : {}, {
e: common_vendor.f(common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS), (item, index, i0) => {
return {
a: common_vendor.t(item.title),
b: item.id,
c: formData.source === index ? 1 : "",
d: common_vendor.o(($event) => onChooseSelect("source", index), item.id)
};
}),
f: common_vendor.o(common_vendor.unref(afterRead)),
g: common_vendor.o(common_vendor.unref(deletePic)),
h: common_vendor.p({
fileList: fileList.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
i: __props.canvasId,
j: canvasWidth.value,
k: canvasHeight.value,
l: canvasWidth.value + "px",
m: canvasHeight.value + "px",
n: !aiAnalyzing.value
}, !aiAnalyzing.value ? {} : {}, {
o: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
p: aiAnalyzing.value,
q: aiAnalyzing.value,
r: common_vendor.o(handleAiAnalyze),
s: common_vendor.o(($event) => formData.title = $event),
t: common_vendor.p({
placeholder: "请输入内容",
border: "surround",
modelValue: formData.title
}),
v: common_vendor.f(common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS), (item, index, i0) => {
return {
a: common_vendor.t(item.title),
b: item.id,
c: formData.level === index ? 1 : "",
d: common_vendor.o(($event) => onChooseSelect("level", index), item.id)
};
}),
w: common_vendor.o(($event) => address.value = $event),
x: common_vendor.p({
placeholder: "请输入地址",
border: "surround",
modelValue: address.value
}),
y: common_vendor.o(chooseLocation),
z: common_vendor.t(formData.regulationName || "请选择法律依据"),
A: !formData.regulationName ? 1 : "",
B: common_vendor.o(openLawPopup),
C: common_vendor.t(areaName.value || "请选择隐患区域"),
D: !areaName.value ? 1 : "",
E: common_vendor.o(openAreaPicker),
F: common_vendor.o(($event) => formData.description = $event),
G: common_vendor.p({
placeholder: "请输入内容",
modelValue: formData.description
}),
H: common_vendor.f(tagOptions.value, (item, index, i0) => {
return {
a: common_vendor.t(item.title),
b: item.id,
c: formData.tagIndex === index ? 1 : "",
d: common_vendor.o(($event) => onChooseSelect("tagIndex", index), item.id)
};
}),
I: common_vendor.s(bodyStyle.value),
J: common_vendor.o(handleClose),
K: submitting.value,
L: common_vendor.o(handleConfirm),
M: common_vendor.o(handleClose),
N: common_vendor.o(($event) => popupVisible.value = $event),
O: common_vendor.p({
mode: "center",
round: "20",
["safe-area-inset-bottom"]: false,
show: popupVisible.value
}),
P: common_vendor.o(($event) => showLawPopup.value = false),
Q: common_vendor.o(searchRegulation),
R: lawKeyword.value,
S: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
T: common_vendor.o(searchRegulation),
U: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
W: common_vendor.f(lawList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis),
c: selectedLawId.value === item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => selectLaw(item), item.id)
};
}),
X: lawLoading.value
}, lawLoading.value ? {} : {}), {
V: !lawLoading.value && lawList.value.length === 0,
Y: common_vendor.o(loadMoreLaw),
Z: common_vendor.o(($event) => showLawPopup.value = false),
aa: common_vendor.o(confirmLaw),
ab: common_vendor.o(($event) => showLawPopup.value = false),
ac: common_vendor.p({
show: showLawPopup.value,
mode: "center",
round: "20",
["safe-area-inset-bottom"]: false
}),
ad: common_vendor.o(($event) => showAreaPicker.value = false),
ae: common_vendor.o(confirmAreaSelect),
af: common_vendor.f(areaList.value, (item, k0, i0) => {
return common_vendor.e({
a: item.color,
b: common_vendor.t(item.name),
c: tempAreaId.value === item.id
}, tempAreaId.value === item.id ? {} : {}, {
d: item.id,
e: tempAreaId.value === item.id ? 1 : "",
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
});
}),
ag: areaList.value.length === 0
}, areaList.value.length === 0 ? {} : {}, {
ah: common_vendor.o(($event) => showAreaPicker.value = false),
ai: common_vendor.p({
show: showAreaPicker.value,
mode: "bottom",
round: "20"
})
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fd540320"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazard/HazardFormPopup.js.map

View File

@@ -0,0 +1,9 @@
{
"component": true,
"usingComponents": {
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,373 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.popup-content.data-v-fd540320 {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.popup-header.data-v-fd540320 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.popup-header .popup-title.data-v-fd540320 {
font-size: 32rpx;
color: #333;
}
.popup-header .popup-close.data-v-fd540320 {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.popup-body.data-v-fd540320 {
padding: 30rpx;
max-height: 900rpx;
overflow-y: auto;
}
.draft-banner.data-v-fd540320 {
font-size: 24rpx;
background-color: #fff7eb;
border: 1rpx solid #ffe4cc;
width: 100%;
box-sizing: border-box;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding: 16rpx 20rpx;
border-radius: 8rpx;
color: #fa8c16;
}
.draft-banner-left.data-v-fd540320 {
display: flex;
flex-direction: row;
align-items: center;
}
.draft-banner-icon.data-v-fd540320 {
margin-right: 10rpx;
}
.draft-banner-action.data-v-fd540320 {
cursor: pointer;
padding: 0 10rpx;
color: #2667e9;
font-weight: bold;
}
.hazard-choose-scroll.data-v-fd540320 {
width: 100%;
white-space: nowrap;
}
.hazard-choose-row.data-v-fd540320 {
display: inline-flex;
flex-direction: row;
align-items: center;
padding-right: 20rpx;
}
.hazard-choose-wrap.data-v-fd540320 {
display: flex;
flex-wrap: wrap;
}
.hazard-choose-tag.data-v-fd540320 {
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
background: #fff;
flex-shrink: 0;
margin-right: 12rpx;
}
.hazard-choose-tag--source.data-v-fd540320 {
width: 152rpx;
height: 64rpx;
}
.hazard-choose-tag--level.data-v-fd540320 {
width: 183rpx;
height: 72rpx;
}
.hazard-choose-tag--tag.data-v-fd540320 {
min-width: 120rpx;
height: 64rpx;
padding: 0 24rpx;
margin-bottom: 12rpx;
}
.hazard-choose-tag--active.data-v-fd540320 {
background: #2667e9;
border-color: #2667e9;
}
.hazard-choose-tag--active .hazard-choose-tag__text.data-v-fd540320 {
color: #fff;
}
.hazard-choose-tag__text.data-v-fd540320 {
font-size: 24rpx;
line-height: 1.2;
color: #606266;
text-align: center;
}
.ai-btn-wrapper.data-v-fd540320 {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-fd540320 {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668ea 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-fd540320::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-fd540320 {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-fd540320 {
opacity: 0.7;
}
.popup-footer.data-v-fd540320 {
display: flex;
border-top: 1rpx solid #eee;
}
.popup-footer button.data-v-fd540320 {
flex: 1;
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
font-size: 30rpx;
}
.popup-footer button.data-v-fd540320::after {
border: none;
}
.popup-footer .btn-cancel.data-v-fd540320 {
background: #fff;
color: #666;
}
.popup-footer .btn-confirm.data-v-fd540320 {
color: #fff;
}
.address-box.data-v-fd540320 {
display: flex;
align-items: center;
gap: 20rpx;
}
.address-box .address-input-wrapper.data-v-fd540320 {
flex: 1;
}
.address-box .btn-address.data-v-fd540320 {
flex-shrink: 0;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
font-size: 26rpx;
border-radius: 8rpx;
color: #fff;
}
.address-box .btn-address.data-v-fd540320::after {
border: none;
}
.select-trigger.data-v-fd540320 {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
}
.select-trigger .select-value.data-v-fd540320 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.select-trigger .select-value.placeholder.data-v-fd540320 {
color: #c0c4cc;
}
.picker-popup.data-v-fd540320 {
background: #fff;
}
.picker-popup .picker-header.data-v-fd540320 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.picker-popup .picker-header .picker-cancel.data-v-fd540320 {
font-size: 28rpx;
color: #999;
}
.picker-popup .picker-header .picker-title.data-v-fd540320 {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.picker-popup .picker-header .picker-confirm.data-v-fd540320 {
font-size: 28rpx;
color: #2667e9;
}
.picker-popup .picker-body.data-v-fd540320 {
max-height: 600rpx;
padding: 0 30rpx;
}
.picker-popup .picker-item.data-v-fd540320 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 0;
border-bottom: 1rpx solid #f5f5f5;
font-size: 30rpx;
color: #333;
}
.picker-popup .picker-item.data-v-fd540320:last-child {
border-bottom: none;
}
.picker-popup .picker-item.picker-item-active.data-v-fd540320 {
color: #2667e9;
}
.area-color-dot.data-v-fd540320 {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
margin-right: 16rpx;
}
.law-popup.data-v-fd540320 {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
max-height: 80vh;
}
.law-popup .popup-header.data-v-fd540320 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.law-popup .popup-header .popup-title.data-v-fd540320 {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.law-popup .popup-header .popup-close.data-v-fd540320 {
font-size: 40rpx;
color: #999;
}
.search-box.data-v-fd540320 {
display: flex;
align-items: center;
background: #f5f5f5;
border-radius: 40rpx;
padding: 16rpx 24rpx;
margin: 20rpx 30rpx;
}
.search-box .search-icon.data-v-fd540320 {
font-size: 28rpx;
color: #999;
margin-right: 12rpx;
}
.search-box .search-input.data-v-fd540320 {
flex: 1;
font-size: 28rpx;
background: transparent;
border: none;
}
.search-box .search-btn.data-v-fd540320 {
color: #2667e9;
font-size: 26rpx;
margin-left: 16rpx;
}
.loading-tip.data-v-fd540320,
.empty-tip.data-v-fd540320 {
text-align: center;
padding: 40rpx;
color: #999;
font-size: 26rpx;
}
.law-list.data-v-fd540320 {
max-height: 400rpx;
padding: 0 30rpx;
}
.law-item.data-v-fd540320 {
padding: 24rpx;
border: 2rpx solid #e5e5e5;
border-radius: 12rpx;
margin-bottom: 16rpx;
font-size: 28rpx;
color: #333;
}
.law-item .law-title.data-v-fd540320 {
line-height: 1.5;
margin-bottom: 8rpx;
font-weight: bold;
}
.law-item .law-basis.data-v-fd540320 {
font-size: 24rpx;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.law-item-active.data-v-fd540320 {
border-color: #2667e9;
background: #f0f6ff;
}
.law-popup-footer.data-v-fd540320 {
display: flex;
padding: 30rpx;
border-top: 1rpx solid #eee;
gap: 20rpx;
}
.law-popup-footer button.data-v-fd540320 {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
border-radius: 40rpx;
}
.law-popup-footer button.data-v-fd540320::after {
border: none;
}
.law-popup-footer .btn-cancel.data-v-fd540320 {
background: #f5f5f5;
color: #666;
}
.law-popup-footer .btn-confirm.data-v-fd540320 {
background: #2667e9;
color: #fff;
}

View File

@@ -0,0 +1,73 @@
"use strict";
const utils_upload = require("../../utils/upload.js");
const LEVEL_OPTIONS = [
{ id: 2, title: "一般隐患" },
{ id: 3, title: "重大隐患" }
];
const SOURCE_OPTIONS = [
{ id: 1, title: "部门检查" },
{ id: 2, title: "督导检查" },
{ id: 3, title: "企业自查" },
{ id: 4, title: "行业互查" }
];
const AI_LEVEL_MAP = {
轻微: 0,
轻微隐患: 0,
一般: 0,
一般隐患: 0,
重大: 1,
重大隐患: 1
};
function createEmptyHazardPayload() {
return {
formData: {
title: "",
level: 0,
source: 0,
description: "",
tagIndex: 0,
tagId: null,
regulationId: null,
regulationName: ""
},
address: "",
lng: 0,
lat: 0,
areaId: "",
areaName: "",
fileList: []
};
}
function buildHiddenDangerParams(payload, extra = {}) {
var _a, _b, _c;
const { formData, address, lng, lat, areaId, fileList } = payload;
const selectedTag = (_a = payload.tagOptions) == null ? void 0 : _a[formData.tagIndex];
const tagId = formData.tagId ?? (selectedTag ? selectedTag.id : null);
return {
title: formData.title,
level: ((_b = LEVEL_OPTIONS[formData.level]) == null ? void 0 : _b.id) || 2,
lng: lng || 0,
lat: lat || 0,
address: address || "",
areaId: areaId || null,
description: formData.description || "",
source: ((_c = SOURCE_OPTIONS[formData.source]) == null ? void 0 : _c.title) || "",
tagId,
attachments: (fileList || []).filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file)),
regulationId: formData.regulationId || null,
...extra
};
}
function hasValidHazardPayload(payload) {
if (!payload)
return false;
const { formData, fileList } = payload;
return !!((formData == null ? void 0 : formData.title) && (fileList == null ? void 0 : fileList.length) > 0);
}
exports.AI_LEVEL_MAP = AI_LEVEL_MAP;
exports.LEVEL_OPTIONS = LEVEL_OPTIONS;
exports.SOURCE_OPTIONS = SOURCE_OPTIONS;
exports.buildHiddenDangerParams = buildHiddenDangerParams;
exports.createEmptyHazardPayload = createEmptyHazardPayload;
exports.hasValidHazardPayload = hasValidHazardPayload;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazard/hazardForm.js.map

View File

@@ -0,0 +1,4 @@
"use strict";
require("../../common/vendor.js");
require("../../request/request.js");
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazard/index.js.map

View File

@@ -0,0 +1,242 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_request = require("../../request/request.js");
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
const components_hazardDetail_useHazardDetailScroll = require("./useHazardDetailScroll.js");
const _sfc_main = {
__name: "HazardDetailPanel",
props: {
detail: {
type: Object,
default: () => ({})
},
loading: {
type: Boolean,
default: false
}
},
setup(__props) {
const props = __props;
const { detail, loading } = common_vendor.toRefs(props);
const {
historyList,
activeIndex,
contentScrollIntoView,
stepScrollIntoView,
scrollWithAnimation,
onContentScroll,
onScrollToLower,
scrollToNode,
scheduleMeasureLayout
} = components_hazardDetail_useHazardDetailScroll.useHazardDetailScroll(detail, loading);
const statusClass = common_vendor.computed(() => {
var _a, _b;
return components_hazardDetail_hazardDetail.getStatusClass((_a = props.detail) == null ? void 0 : _a.status, (_b = props.detail) == null ? void 0 : _b.statusName);
});
const LEVEL_CLASS_MAP = {
2: "level-normal",
3: "level-major"
};
const LEVEL_NAME_CLASS_MAP = {
一般: "level-normal",
一般隐患: "level-normal",
重大: "level-major",
重大隐患: "level-major"
};
const getLevelTagClass = (content) => {
const level = content == null ? void 0 : content.level;
const levelName = content == null ? void 0 : content.levelName;
if (level != null && LEVEL_CLASS_MAP[level]) {
return LEVEL_CLASS_MAP[level];
}
if (levelName && LEVEL_NAME_CLASS_MAP[levelName]) {
return LEVEL_NAME_CLASS_MAP[levelName];
}
return "";
};
const resolveFileUrl = (path) => request_request.toImageUrl(path);
const formatCost = (cost) => {
if (cost == null || cost === "")
return "-";
const num = Number(cost);
return Number.isNaN(num) ? "-" : `${num}`;
};
const previewSingle = (path) => {
const url = resolveFileUrl(path);
if (!url)
return;
common_vendor.index.previewImage({ current: url, urls: [url] });
};
const previewImages = (attachments, index) => {
const urls = (attachments || []).filter((f) => f.fileType === "image" || !f.fileType).map((f) => resolveFileUrl(f.filePath)).filter(Boolean);
if (!urls.length)
return;
common_vendor.index.previewImage({ current: urls[index] || urls[0], urls });
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(common_vendor.unref(detail).title || "-"),
b: common_vendor.t(common_vendor.unref(detail).statusName || "-"),
c: common_vendor.n(statusClass.value),
d: common_vendor.t(common_vendor.unref(detail).createdAt || "-"),
e: common_vendor.unref(loading)
}, common_vendor.unref(loading) ? {} : common_vendor.unref(historyList).length === 0 ? {} : {
g: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.nodeName),
b: common_vendor.unref(activeIndex) === index ? 1 : "",
c: index < common_vendor.unref(historyList).length - 1
}, index < common_vendor.unref(historyList).length - 1 ? {} : {}, {
d: "step-" + index,
e: "hazard-step-" + index,
f: common_vendor.unref(activeIndex) === index ? 1 : "",
g: common_vendor.o(($event) => common_vendor.unref(scrollToNode)(index), "step-" + index)
});
}),
h: common_vendor.unref(stepScrollIntoView),
i: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.titlePrefix),
b: common_vendor.t(item.operator),
c: common_vendor.t(item.time),
d: item.type === "submit"
}, item.type === "submit" ? common_vendor.e({
e: common_vendor.t(item.content.title),
f: common_vendor.t(item.content.source),
g: item.content.areaColor
}, item.content.areaColor ? {
h: item.content.areaColor
} : {}, {
i: common_vendor.t(item.content.areaName),
j: common_vendor.t(item.content.address),
k: common_vendor.t(item.content.levelName || "-"),
l: common_vendor.n(getLevelTagClass(item.content)),
m: common_vendor.t(item.content.tagName),
n: common_vendor.t(item.content.description),
o: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
p: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return {
a: idx,
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
};
})
} : {}, {
q: common_vendor.t(item.content.legalBasis)
}) : item.type === "assign" ? {
s: common_vendor.t(item.content.assigneeName),
t: common_vendor.t(item.content.deadline)
} : item.type === "rectify" ? common_vendor.e({
w: common_vendor.t(item.content.rectifyStatusName),
x: common_vendor.t(item.content.rectifyPlan),
y: common_vendor.t(item.content.rectifyResult),
z: common_vendor.t(item.content.rectificationMeasures),
A: common_vendor.t(item.content.controlMeasures),
B: common_vendor.t(item.content.deadline),
C: common_vendor.t(item.content.rectifierNames),
D: common_vendor.t(item.content.managerNames),
E: common_vendor.t(formatCost(item.content.planCost)),
F: common_vendor.t(formatCost(item.content.actualCost)),
G: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
H: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image"
}, file.fileType === "image" ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || "附件")
}, {
f: idx
});
})
} : {}, {
I: item.content.signPath
}, item.content.signPath ? {
J: resolveFileUrl(item.content.signPath),
K: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
L: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {}) : item.type === "verify" ? common_vendor.e({
N: common_vendor.t(item.content.resultName),
O: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
P: item.content.remark
}, item.content.remark ? {
Q: common_vendor.t(item.content.remark)
} : {}, {
R: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
S: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image"
}, file.fileType === "image" ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || "附件")
}, {
f: idx
});
})
} : {}, {
T: item.content.signPath
}, item.content.signPath ? {
U: resolveFileUrl(item.content.signPath),
V: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
W: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {}) : item.type === "writeoff" ? common_vendor.e({
Y: common_vendor.t(item.content.resultName),
Z: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
aa: item.content.remark
}, item.content.remark ? {
ab: common_vendor.t(item.content.remark)
} : {}, {
ac: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
ad: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image"
}, file.fileType === "image" ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || "附件")
}, {
f: idx
});
})
} : {}, {
ae: item.content.signPath
}, item.content.signPath ? {
af: resolveFileUrl(item.content.signPath),
ag: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
ah: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {}) : {}, {
r: item.type === "assign",
v: item.type === "rectify",
M: item.type === "verify",
X: item.type === "writeoff",
ai: "node-" + index,
aj: "hazard-node-" + index,
ak: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
});
}),
j: common_vendor.unref(contentScrollIntoView),
k: common_vendor.unref(scrollWithAnimation),
l: common_vendor.o((...args) => common_vendor.unref(onContentScroll) && common_vendor.unref(onContentScroll)(...args)),
m: common_vendor.o((...args) => common_vendor.unref(onScrollToLower) && common_vendor.unref(onScrollToLower)(...args))
}, {
f: common_vendor.unref(historyList).length === 0,
n: common_vendor.gei(_ctx, "")
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f38c3cb4"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanel.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,331 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.hazard-detail-panel.data-v-f38c3cb4 {
display: flex;
flex-direction: column;
height: 100vh;
background: #ebf2fc;
overflow: hidden;
}
.status-bar.data-v-f38c3cb4 {
flex-shrink: 0;
background: #f5f7fa;
border-bottom: 1rpx solid #e4e7ed;
padding: 20rpx 24rpx;
}
.hazard-title.data-v-f38c3cb4 {
font-size: 32rpx;
font-weight: 600;
color: #303133;
line-height: 1.4;
margin-bottom: 16rpx;
word-break: break-all;
}
.status-row.data-v-f38c3cb4 {
display: flex;
align-items: center;
justify-content: space-between;
gap: 24rpx;
font-size: 24rpx;
color: #909399;
}
.info-item.data-v-f38c3cb4 {
line-height: 1.5;
flex-shrink: 0;
}
.info-item--right.data-v-f38c3cb4 {
text-align: right;
}
.status-meta.data-v-f38c3cb4 {
display: flex;
align-items: center;
gap: 12rpx;
flex-shrink: 0;
}
.info-label.data-v-f38c3cb4 {
line-height: 1.5;
}
.status-tag.data-v-f38c3cb4 {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
line-height: 1.4;
white-space: nowrap;
}
.status-blue.data-v-f38c3cb4 {
background: #ecf5ff;
border: 2rpx solid #b3d8ff;
color: #409eff;
}
.status-green.data-v-f38c3cb4 {
background: #f0f9eb;
border: 2rpx solid #c2e7b0;
color: #67c23a;
}
.status-orange.data-v-f38c3cb4 {
background: #fff7e6;
border: 2rpx solid #ffd591;
color: #fa8c16;
}
.status-red.data-v-f38c3cb4 {
background: #fef0f0;
border: 2rpx solid #fbc4c4;
color: #f56c6c;
}
.status-yellow.data-v-f38c3cb4 {
background: #fdf6ec;
border: 2rpx solid #f5dab1;
color: #e6a23c;
}
.status-gray.data-v-f38c3cb4 {
background: #f4f4f5;
border: 2rpx solid #d3d4d6;
color: #909399;
}
.level-tag.data-v-f38c3cb4 {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: 500;
line-height: 1.4;
white-space: nowrap;
}
.level-normal.data-v-f38c3cb4 {
background: #fffbe6;
border: 2rpx solid #ffe58f;
color: #faad14;
}
.level-major.data-v-f38c3cb4 {
background: #fff1f0;
border: 2rpx solid #ffa39e;
color: #f5222d;
}
.loading-wrap.data-v-f38c3cb4,
.empty-wrap.data-v-f38c3cb4 {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.loading-text.data-v-f38c3cb4,
.empty-text.data-v-f38c3cb4 {
font-size: 28rpx;
color: #909399;
}
.detail-body.data-v-f38c3cb4 {
flex: 1;
display: flex;
min-height: 0;
overflow: hidden;
}
.steps-column.data-v-f38c3cb4 {
width: 168rpx;
flex-shrink: 0;
height: 100%;
background: #fff;
border-right: 1rpx solid #ebeef5;
}
.step-item.data-v-f38c3cb4 {
padding: 0 16rpx;
}
.step-track.data-v-f38c3cb4 {
display: flex;
flex-direction: column;
align-items: center;
padding: 24rpx 0 0;
}
.step-dot.data-v-f38c3cb4 {
width: 72rpx;
height: 72rpx;
border-radius: 50%;
background: #dcdfe6;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
transition: background 0.2s;
}
.step-dot--active.data-v-f38c3cb4 {
background: #409eff;
}
.step-dot-text.data-v-f38c3cb4 {
font-size: 22rpx;
font-weight: 600;
color: #606266;
text-align: center;
line-height: 1.2;
}
.step-item--active .step-dot-text.data-v-f38c3cb4 {
color: #fff;
}
.step-line.data-v-f38c3cb4 {
width: 4rpx;
height: 48rpx;
background: #e4e7ed;
margin: 8rpx 0;
}
.content-column.data-v-f38c3cb4 {
flex: 1;
min-width: 0;
height: 100%;
box-sizing: border-box;
}
.node-section.data-v-f38c3cb4 {
box-sizing: border-box;
padding: 20rpx 20rpx 0;
margin-bottom: 24rpx;
}
.node-section--last.data-v-f38c3cb4 {
padding-bottom: 40rpx;
margin-bottom: 0;
}
.detail-card.data-v-f38c3cb4 {
background: #fff;
border-radius: 16rpx;
border: 1rpx solid #ebeef5;
overflow: hidden;
}
.card-header.data-v-f38c3cb4 {
display: flex;
flex-direction: column;
gap: 8rpx;
padding: 20rpx;
background: linear-gradient(135deg, #4facfe 0%, #2668ea 100%);
}
.card-node-name.data-v-f38c3cb4 {
font-size: 30rpx;
font-weight: 600;
color: #fff;
line-height: 1.4;
}
.operator.data-v-f38c3cb4 {
font-size: 28rpx;
font-weight: 600;
color: #fff;
line-height: 1.5;
word-break: break-all;
}
.time.data-v-f38c3cb4 {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.85);
}
.card-body.data-v-f38c3cb4 {
padding: 24rpx;
}
.detail-row.data-v-f38c3cb4 {
display: flex;
flex-direction: column;
gap: 8rpx;
margin-bottom: 24rpx;
}
.detail-row.data-v-f38c3cb4:last-child {
margin-bottom: 0;
}
.detail-row--block.data-v-f38c3cb4 {
margin-bottom: 24rpx;
}
.label.data-v-f38c3cb4 {
display: flex;
align-items: center;
gap: 10rpx;
font-size: 24rpx;
color: #909399;
font-weight: 500;
}
.label.data-v-f38c3cb4::before {
content: "";
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background: #909399;
flex-shrink: 0;
}
.value.data-v-f38c3cb4 {
font-size: 28rpx;
color: #303133;
line-height: 1.6;
word-break: break-all;
}
.value--inline.data-v-f38c3cb4 {
display: flex;
align-items: center;
}
.area-dot.data-v-f38c3cb4 {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
margin-right: 12rpx;
flex-shrink: 0;
}
.attachment-list.data-v-f38c3cb4 {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
margin-top: 8rpx;
}
.attachment-img.data-v-f38c3cb4 {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
background: #f5f7fa;
}
.sign-img.data-v-f38c3cb4 {
width: 300rpx;
height: 160rpx;
margin-top: 8rpx;
border: 1rpx solid #e4e7ed;
border-radius: 8rpx;
background: #fafafa;
}
.file-link.data-v-f38c3cb4 {
display: inline-block;
padding: 12rpx 20rpx;
background: #f5f7fa;
border: 1rpx solid #e4e7ed;
border-radius: 8rpx;
color: #409eff;
font-size: 24rpx;
}
.result-tag.data-v-f38c3cb4 {
align-self: flex-start;
padding: 6rpx 16rpx;
border-radius: 6rpx;
font-size: 24rpx;
}
.result-tag--pass.data-v-f38c3cb4 {
background: #f0f9eb;
color: #67c23a;
}
.result-tag--fail.data-v-f38c3cb4 {
background: #fef0f0;
color: #f56c6c;
}

View File

@@ -0,0 +1,265 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_request = require("../../request/request.js");
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
const components_hazardDetail_useHazardDetailScroll = require("./useHazardDetailScroll.js");
const _sfc_main = {
__name: "HazardDetailPanelV2",
props: {
detail: {
type: Object,
default: () => ({})
},
loading: {
type: Boolean,
default: false
},
bodyHeight: {
type: Number,
default: 0
}
},
setup(__props) {
const props = __props;
const { detail, loading } = common_vendor.toRefs(props);
const {
historyList,
activeIndex,
contentScrollIntoView,
stepScrollIntoView,
scrollWithAnimation,
onContentScroll,
onScrollToLower,
scrollToNode,
scheduleMeasureLayout
} = components_hazardDetail_useHazardDetailScroll.useHazardDetailScroll(detail, loading);
const scrollAreaStyle = common_vendor.computed(() => {
const height = props.bodyHeight > 0 ? props.bodyHeight : 400;
return { height: `${height}px` };
});
const detailBodyStyle = common_vendor.computed(() => {
const height = props.bodyHeight > 0 ? props.bodyHeight : 400;
return { height: `${height}px` };
});
common_vendor.watch(
() => props.bodyHeight,
(height) => {
if (height > 0) {
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 100);
}
}
);
const LEVEL_CLASS_MAP = {
2: "level-normal",
3: "level-major"
};
const LEVEL_NAME_CLASS_MAP = {
一般: "level-normal",
一般隐患: "level-normal",
重大: "level-major",
重大隐患: "level-major"
};
const getLevelTagClass = (content) => {
const level = content == null ? void 0 : content.level;
const levelName = content == null ? void 0 : content.levelName;
if (level != null && LEVEL_CLASS_MAP[level]) {
return LEVEL_CLASS_MAP[level];
}
if (levelName && LEVEL_NAME_CLASS_MAP[levelName]) {
return LEVEL_NAME_CLASS_MAP[levelName];
}
return "";
};
const resolveFileUrl = (path) => request_request.toImageUrl(path);
const formatCost = (cost) => {
if (cost == null || cost === "")
return "-";
const num = Number(cost);
return Number.isNaN(num) ? "-" : `${num}`;
};
const previewSingle = (path) => {
const url = resolveFileUrl(path);
if (!url)
return;
common_vendor.index.previewImage({ current: url, urls: [url] });
};
const previewImages = (attachments, index) => {
const urls = (attachments || []).filter((f) => f.fileType === "image" || !f.fileType).map((f) => resolveFileUrl(f.filePath)).filter(Boolean);
if (!urls.length)
return;
common_vendor.index.previewImage({ current: urls[index] || urls[0], urls });
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(loading)
}, common_vendor.unref(loading) ? {} : common_vendor.unref(historyList).length === 0 ? {} : {
c: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.unref(components_hazardDetail_hazardDetail.getStepIconPath)(item.type, common_vendor.unref(activeIndex) === index),
b: common_vendor.unref(activeIndex) === index ? 1 : "",
c: common_vendor.t(item.nodeName),
d: common_vendor.unref(activeIndex) === index ? 1 : "",
e: index < common_vendor.unref(historyList).length - 1
}, index < common_vendor.unref(historyList).length - 1 ? {} : {}, {
f: "step-" + index,
g: "hazard-step-" + index,
h: common_vendor.unref(activeIndex) === index ? 1 : "",
i: common_vendor.o(($event) => common_vendor.unref(scrollToNode)(index), "step-" + index)
});
}),
d: common_vendor.s(scrollAreaStyle.value),
e: common_vendor.unref(stepScrollIntoView),
f: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.titlePrefix),
b: common_vendor.t(item.operator),
c: common_vendor.t(item.time),
d: item.type === "submit" && item.content.levelName
}, item.type === "submit" && item.content.levelName ? {
e: common_vendor.t(item.content.levelName),
f: common_vendor.n(getLevelTagClass(item.content))
} : {}, {
g: item.type === "submit"
}, item.type === "submit" ? common_vendor.e({
h: common_vendor.t(item.content.title),
i: common_vendor.t(item.content.source),
j: item.content.areaColor
}, item.content.areaColor ? {
k: item.content.areaColor
} : {}, {
l: common_vendor.t(item.content.areaName),
m: common_vendor.t(item.content.address),
n: common_vendor.t(item.content.levelName || "-"),
o: common_vendor.n(getLevelTagClass(item.content)),
p: common_vendor.t(item.content.tagName),
q: common_vendor.t(item.content.description),
r: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
s: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return {
a: idx,
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
};
})
} : {}, {
t: common_vendor.t(item.content.legalBasis)
}) : item.type === "assign" ? {
w: common_vendor.t(item.content.assigneeName),
x: common_vendor.t(item.content.deadline)
} : item.type === "rectify" ? common_vendor.e({
z: common_vendor.t(item.content.rectifyStatusName),
A: common_vendor.t(item.content.rectifyPlan),
B: common_vendor.t(item.content.rectifyResult),
C: common_vendor.t(item.content.rectificationMeasures),
D: common_vendor.t(item.content.controlMeasures),
E: common_vendor.t(item.content.deadline),
F: common_vendor.t(item.content.rectifierNames),
G: common_vendor.t(item.content.managerNames),
H: common_vendor.t(formatCost(item.content.planCost)),
I: common_vendor.t(formatCost(item.content.actualCost)),
J: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
K: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image"
}, file.fileType === "image" ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || "附件")
}, {
f: idx
});
})
} : {}, {
L: item.content.signPath
}, item.content.signPath ? {
M: resolveFileUrl(item.content.signPath),
N: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
O: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {}) : item.type === "verify" ? common_vendor.e({
Q: common_vendor.t(item.content.resultName),
R: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
S: item.content.remark
}, item.content.remark ? {
T: common_vendor.t(item.content.remark)
} : {}, {
U: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
V: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image"
}, file.fileType === "image" ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || "附件")
}, {
f: idx
});
})
} : {}, {
W: item.content.signPath
}, item.content.signPath ? {
X: resolveFileUrl(item.content.signPath),
Y: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
Z: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {}) : item.type === "writeoff" ? common_vendor.e({
ab: common_vendor.t(item.content.resultName),
ac: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
ad: item.content.remark
}, item.content.remark ? {
ae: common_vendor.t(item.content.remark)
} : {}, {
af: item.content.attachments && item.content.attachments.length
}, item.content.attachments && item.content.attachments.length ? {
ag: common_vendor.f(item.content.attachments, (file, idx, i1) => {
return common_vendor.e({
a: file.fileType === "image"
}, file.fileType === "image" ? {
b: resolveFileUrl(file.filePath),
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
} : {
e: common_vendor.t(file.fileName || "附件")
}, {
f: idx
});
})
} : {}, {
ah: item.content.signPath
}, item.content.signPath ? {
ai: resolveFileUrl(item.content.signPath),
aj: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
ak: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
} : {}) : {}, {
v: item.type === "assign",
y: item.type === "rectify",
P: item.type === "verify",
aa: item.type === "writeoff",
al: "node-" + index,
am: "hazard-node-" + index,
an: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
});
}),
g: common_vendor.s(scrollAreaStyle.value),
h: common_vendor.unref(contentScrollIntoView),
i: common_vendor.unref(scrollWithAnimation),
j: common_vendor.o((...args) => common_vendor.unref(onContentScroll) && common_vendor.unref(onContentScroll)(...args)),
k: common_vendor.o((...args) => common_vendor.unref(onScrollToLower) && common_vendor.unref(onScrollToLower)(...args)),
l: common_vendor.s(detailBodyStyle.value)
}, {
b: common_vendor.unref(historyList).length === 0,
m: common_vendor.gei(_ctx, "")
});
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-361ef447"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,292 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.hazard-detail-panel-v2.data-v-361ef447 {
flex: 1;
min-height: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.loading-wrap.data-v-361ef447,
.empty-wrap.data-v-361ef447 {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
min-height: 0;
}
.loading-text.data-v-361ef447,
.empty-text.data-v-361ef447 {
font-size: 28rpx;
color: #909399;
}
.detail-body.data-v-361ef447 {
display: flex;
gap: 20rpx;
align-items: stretch;
overflow: hidden;
box-sizing: border-box;
}
.steps-card.data-v-361ef447 {
width: 140rpx;
flex-shrink: 0;
background: #fff;
border-radius: 20rpx;
box-sizing: border-box;
}
.step-item.data-v-361ef447 {
padding: 0 12rpx;
}
.step-track.data-v-361ef447 {
display: flex;
flex-direction: column;
align-items: center;
padding: 28rpx 0 0;
}
.step-dot.data-v-361ef447 {
width: 66rpx;
height: 66rpx;
border-radius: 50%;
background: #f3f3f3;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
}
.step-dot--active.data-v-361ef447 {
background: #2667e9;
}
.step-icon.data-v-361ef447 {
width: 36rpx;
height: 36rpx;
}
.step-label.data-v-361ef447 {
margin-top: 12rpx;
font-size: 24rpx;
color: #999;
line-height: 1.2;
}
.step-label--active.data-v-361ef447 {
color: #2667e9;
font-weight: 600;
}
.step-line.data-v-361ef447 {
width: 0;
height: 40rpx;
margin: 10rpx 0;
border-left: 2rpx dashed #dcdfe6;
}
.content-column.data-v-361ef447 {
flex: 1;
width: 0;
min-height: 0;
box-sizing: border-box;
}
.content-scroll.data-v-361ef447 {
width: 100%;
box-sizing: border-box;
}
.node-section.data-v-361ef447 {
box-sizing: border-box;
padding: 0;
margin-bottom: 24rpx;
}
.node-section--last.data-v-361ef447 {
padding-bottom: 40rpx;
margin-bottom: 0;
}
.detail-card.data-v-361ef447 {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
padding: 28rpx 38rpx;
box-sizing: border-box;
}
.card-header-v2.data-v-361ef447 {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16rpx;
padding: 0;
}
.card-header-main.data-v-361ef447 {
flex: 1;
min-width: 0;
}
.operator.data-v-361ef447 {
font-size: 28rpx;
font-weight: 600;
color: #303133;
line-height: 1.5;
word-break: break-all;
}
.time.data-v-361ef447 {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
color: #999;
line-height: 1.4;
}
.level-badge.data-v-361ef447 {
flex-shrink: 0;
padding: 6rpx 16rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
white-space: nowrap;
}
.level-badge.level-normal.data-v-361ef447 {
background: #fff7e6;
border: 2rpx solid #ffd591;
color: #fa8c16;
}
.level-badge.level-major.data-v-361ef447 {
background: #fff1f0;
border: 2rpx solid #ffa39e;
color: #f5222d;
}
.card-divider.data-v-361ef447 {
height: 0;
margin: 20rpx 0;
border-top: 2rpx dashed #eee;
}
.card-body.data-v-361ef447 {
padding: 0;
}
.detail-row-v2.data-v-361ef447 {
display: flex;
align-items: flex-start;
justify-content: flex-start;
gap: 24rpx;
padding: 18rpx 0;
}
.detail-row-v2--block.data-v-361ef447 {
flex-wrap: wrap;
}
.label.data-v-361ef447 {
flex-shrink: 0;
font-size: 26rpx;
color: #999;
line-height: 1.5;
}
.value.data-v-361ef447 {
flex: 1;
min-width: 0;
font-size: 26rpx;
color: #333;
line-height: 1.6;
text-align: left;
word-break: break-all;
}
.value--inline.data-v-361ef447 {
display: flex;
align-items: center;
}
.area-dot.data-v-361ef447 {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
margin-right: 12rpx;
flex-shrink: 0;
}
.level-tag.data-v-361ef447 {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: 500;
line-height: 1.4;
white-space: nowrap;
}
.level-normal.data-v-361ef447 {
background: #fff7e6;
border: 2rpx solid #ffd591;
color: #fa8c16;
}
.level-major.data-v-361ef447 {
background: #fff1f0;
border: 2rpx solid #ffa39e;
color: #f5222d;
}
.tag-badge.data-v-361ef447 {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
background: #eef3ff;
border: 2rpx solid #aac5fc;
color: #2667e9;
}
.attachment-list.data-v-361ef447 {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
flex: 1;
min-width: 0;
}
.attachment-img.data-v-361ef447 {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
background: #f5f7fa;
}
.sign-img.data-v-361ef447 {
width: 300rpx;
height: 160rpx;
border: 1rpx solid #e4e7ed;
border-radius: 8rpx;
background: #fafafa;
flex: 1;
min-width: 0;
max-width: 100%;
}
.file-link.data-v-361ef447 {
display: inline-block;
padding: 12rpx 20rpx;
background: #f5f7fa;
border: 1rpx solid #e4e7ed;
border-radius: 8rpx;
color: #2667e9;
font-size: 24rpx;
}
.result-tag.data-v-361ef447 {
padding: 6rpx 16rpx;
border-radius: 6rpx;
font-size: 24rpx;
}
.result-tag--pass.data-v-361ef447 {
background: #f0f9eb;
color: #67c23a;
}
.result-tag--fail.data-v-361ef447 {
background: #fef0f0;
color: #f56c6c;
}

View File

@@ -0,0 +1,203 @@
"use strict";
const HAZARD_NODE_TYPES = {
SUBMIT: "submit",
ASSIGN: "assign",
RECTIFY: "rectify",
VERIFY: "verify",
WRITEOFF: "writeoff"
};
const HAZARD_STATUS_CLASS_MAP = {
1: "status-blue",
2: "status-orange",
3: "status-red",
4: "status-yellow",
5: "status-green"
};
const STATUS_NAME_CLASS_MAP = {
待交办: "status-blue",
待整改: "status-orange",
整改中: "status-orange",
待验收: "status-red",
待销号: "status-yellow",
已完成: "status-green",
已销号: "status-green"
};
const LEVEL_NAME_MAP = {
2: "一般隐患",
3: "重大隐患"
};
function getLevelName(level) {
return LEVEL_NAME_MAP[level] || "未知";
}
function getStatusClass(status, statusName) {
if (statusName && STATUS_NAME_CLASS_MAP[statusName]) {
return STATUS_NAME_CLASS_MAP[statusName];
}
return HAZARD_STATUS_CLASS_MAP[status] || "";
}
function getStepIconPath(type, active = false) {
const baseMap = {
submit: "tijiao",
assign: "jiaoban",
rectify: "zhenggai",
verify: "yanshou",
writeoff: "xiaohao"
};
const base = baseMap[type] || "tijiao";
if (base === "zhenggai") {
return active ? "/static/yinhuan_detail/zhenggai_selected.png" : "/static/yinhuan_detail/zhenggai__unselected.png";
}
return `/static/yinhuan_detail/${base}__${active ? "selected" : "unselected"}.png`;
}
function formatNameList(names, fallback = "-") {
if (Array.isArray(names) && names.length) {
return names.join("、");
}
if (typeof names === "string" && names.trim()) {
const parts = names.split(/[,,、]/).map((s) => s.trim()).filter(Boolean);
return parts.length ? parts.join("、") : names;
}
return fallback;
}
function isWriteoffRecord(record) {
if (!record)
return false;
return record.type === 2 || record.typeName === "销号";
}
function buildVerifyNode(record) {
return {
type: HAZARD_NODE_TYPES.VERIFY,
nodeName: "验收",
titlePrefix: "验收",
operator: record.verifierName || "-",
time: record.verifyTime || "-",
content: {
resultName: record.resultName || "-",
remark: record.remark || "",
attachments: record.attachments || [],
signPath: record.signPath || "",
verifyDeptName: record.verifyDeptName || "-"
}
};
}
function buildWriteoffNode(record) {
return {
type: HAZARD_NODE_TYPES.WRITEOFF,
nodeName: "销号",
titlePrefix: "销号",
operator: record.verifierName || "-",
time: record.verifyTime || "-",
content: {
resultName: record.resultName || "-",
remark: record.remark || "",
attachments: record.attachments || [],
signPath: record.signPath || "",
writeoffDeptName: record.writeoffDeptName || "-"
}
};
}
function appendAuditNodes(list, records, seenIds) {
(records || []).forEach((record) => {
if (!record)
return;
const key = record.verifyId ?? record.id;
if (key != null) {
if (seenIds.has(key))
return;
seenIds.add(key);
}
list.push(isWriteoffRecord(record) ? buildWriteoffNode(record) : buildVerifyNode(record));
});
}
function resolveWriteoffRecords(flow) {
return flow.writeOffs || flow.writeoffs || [];
}
function resolveRectifierNames(rectify) {
if (!rectify)
return "-";
if (Array.isArray(rectify.rectifierNames) && rectify.rectifierNames.length) {
return rectify.rectifierNames.join("、");
}
if (Array.isArray(rectify.memberNames) && rectify.memberNames.length) {
return rectify.memberNames.join("、");
}
return formatNameList(rectify.rectifierName, "-");
}
function generateHazardHistory(data) {
if (!data)
return [];
const list = [];
list.push({
type: HAZARD_NODE_TYPES.SUBMIT,
nodeName: "提交",
titlePrefix: "提交",
operator: data.reporterName || "-",
time: data.createdAt || "-",
content: {
title: data.title || "-",
source: data.source || "-",
areaName: data.areaName || "-",
areaColor: data.areaColor || "",
address: data.address || "-",
level: data.level,
levelName: data.levelName || getLevelName(data.level),
tagName: data.tagName || "-",
description: data.description || "-",
attachments: data.attachments || [],
legalBasis: data.legalBasis || data.regulationName || "-",
reporterPhone: data.reporterPhone || "-",
reportDeptName: data.reportDeptName || "-"
}
});
if (data.assignFlows && data.assignFlows.length > 0) {
data.assignFlows.forEach((flow) => {
if (flow.assignId) {
list.push({
type: HAZARD_NODE_TYPES.ASSIGN,
nodeName: "交办",
titlePrefix: "交办",
operator: flow.assignerName || "-",
time: flow.assignTime || "-",
content: {
assigneeName: flow.assigneeName || "-",
deadline: flow.deadline || "-",
assignDeptName: flow.assignDeptName || "-",
assignRemark: flow.assignRemark || "-",
priorityName: flow.priorityName || "-"
}
});
}
if (flow.rectify) {
list.push({
type: HAZARD_NODE_TYPES.RECTIFY,
nodeName: "整改",
titlePrefix: "整改",
operator: flow.rectify.rectifierName || "-",
time: flow.rectify.rectifyTime || "-",
content: {
rectifyPlan: flow.rectify.rectifyPlan || "-",
rectifyResult: flow.rectify.rectifyResult || "-",
rectificationMeasures: flow.rectify.rectificationMeasures || "-",
controlMeasures: flow.rectify.controlMeasures || "-",
deadline: flow.deadline || "-",
rectifierNames: resolveRectifierNames(flow.rectify),
managerNames: formatNameList(flow.rectify.managerNames, "-"),
planCost: flow.rectify.planCost,
actualCost: flow.rectify.actualCost,
attachments: flow.rectify.attachments || [],
signPath: flow.rectify.signPath || "",
rectifyStatusName: flow.rectify.rectifyStatusName || "-"
}
});
}
const seenAuditIds = /* @__PURE__ */ new Set();
appendAuditNodes(list, flow.verifies || [], seenAuditIds);
appendAuditNodes(list, resolveWriteoffRecords(flow), seenAuditIds);
});
}
return list;
}
exports.generateHazardHistory = generateHazardHistory;
exports.getStatusClass = getStatusClass;
exports.getStepIconPath = getStepIconPath;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/hazardDetail.js.map

View File

@@ -0,0 +1,144 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
function useHazardDetailScroll(detailSource, loadingSource) {
const instance = common_vendor.getCurrentInstance();
const queryScope = (instance == null ? void 0 : instance.proxy) || instance;
const historyList = common_vendor.ref([]);
const activeIndex = common_vendor.ref(0);
const sectionOffsets = common_vendor.ref([0]);
const contentViewHeight = common_vendor.ref(0);
const contentScrollIntoView = common_vendor.ref("");
const stepScrollIntoView = common_vendor.ref("");
const scrollWithAnimation = common_vendor.ref(true);
const isProgrammaticScroll = common_vendor.ref(false);
let measureLayoutTimer = null;
const measureLayout = () => {
if (!historyList.value.length)
return;
common_vendor.nextTick$1(() => {
const query = common_vendor.index.createSelectorQuery().in(queryScope);
query.select(".content-scroll").boundingClientRect();
query.select(".content-scroll").scrollOffset();
query.selectAll(".node-section").boundingClientRect();
query.exec((res) => {
const containerRect = res == null ? void 0 : res[0];
const scrollOffset = res == null ? void 0 : res[1];
const sections = (res == null ? void 0 : res[2]) || [];
if (!containerRect || !sections.length)
return;
contentViewHeight.value = containerRect.height || 0;
const baseScrollTop = (scrollOffset == null ? void 0 : scrollOffset.scrollTop) || 0;
sectionOffsets.value = sections.map(
(section) => section.top - containerRect.top + baseScrollTop
);
});
});
};
const scheduleMeasureLayout = () => {
clearTimeout(measureLayoutTimer);
measureLayoutTimer = setTimeout(() => {
measureLayout();
}, 80);
};
const rebuildHistory = (data) => {
historyList.value = components_hazardDetail_hazardDetail.generateHazardHistory(data);
activeIndex.value = 0;
contentScrollIntoView.value = "";
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 300);
};
const syncActiveIndex = (scrollTop, scrollHeight = 0) => {
const count = historyList.value.length;
if (!count)
return;
if (scrollHeight > 0 && contentViewHeight.value > 0) {
if (scrollTop + contentViewHeight.value >= scrollHeight - 60) {
if (activeIndex.value !== count - 1) {
activeIndex.value = count - 1;
}
return;
}
}
const offsets = sectionOffsets.value;
if (!offsets.length)
return;
let idx = 0;
for (let i = offsets.length - 1; i >= 0; i--) {
if (scrollTop >= offsets[i] - 80) {
idx = i;
break;
}
}
if (idx !== activeIndex.value) {
activeIndex.value = idx;
}
};
const onContentScroll = (e) => {
if (isProgrammaticScroll.value)
return;
const { scrollTop = 0, scrollHeight = 0 } = e.detail || {};
syncActiveIndex(scrollTop, scrollHeight);
scheduleMeasureLayout();
};
const onScrollToLower = () => {
const count = historyList.value.length;
if (count > 0 && activeIndex.value !== count - 1) {
activeIndex.value = count - 1;
}
};
const scrollToNode = (index) => {
if (index < 0 || index >= historyList.value.length)
return;
isProgrammaticScroll.value = true;
scrollWithAnimation.value = true;
activeIndex.value = index;
contentScrollIntoView.value = "hazard-node-" + index;
setTimeout(() => {
contentScrollIntoView.value = "";
isProgrammaticScroll.value = false;
scheduleMeasureLayout();
}, 350);
};
common_vendor.watch(
() => typeof loadingSource === "function" ? loadingSource() : loadingSource == null ? void 0 : loadingSource.value,
(loading) => {
if (!loading) {
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 300);
}
}
);
common_vendor.watch(
() => typeof detailSource === "function" ? detailSource() : detailSource == null ? void 0 : detailSource.value,
(val) => rebuildHistory(val),
{ immediate: true, deep: true }
);
common_vendor.watch(activeIndex, (index) => {
stepScrollIntoView.value = "hazard-step-" + index;
setTimeout(() => {
stepScrollIntoView.value = "";
}, 300);
});
common_vendor.watch(
() => historyList.value.length,
() => scheduleMeasureLayout()
);
common_vendor.onReady(() => {
scheduleMeasureLayout();
setTimeout(scheduleMeasureLayout, 300);
});
return {
historyList,
activeIndex,
contentScrollIntoView,
stepScrollIntoView,
scrollWithAnimation,
onContentScroll,
onScrollToLower,
scrollToNode,
scheduleMeasureLayout
};
}
exports.useHazardDetailScroll = useHazardDetailScroll;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/useHazardDetailScroll.js.map

View File

@@ -1,177 +1,111 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
require("../../request/request.js");
const utils_upload = require("../../utils/upload.js");
const request_three_one_api_area = require("../../request/three_one_api/area.js");
const utils_draftCache = require("../../utils/draftCache.js");
const utils_useDraftCache = require("../../utils/useDraftCache.js");
const components_hazard_hazardForm = require("../../components/hazard/hazardForm.js");
if (!Array) {
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_choose2 = common_vendor.resolveComponent("up-choose");
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_up_choose2 + _easycom_up_upload2 + _easycom_up_input2 + _easycom_u_popup2)();
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2)();
}
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.js";
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + _easycom_up_choose + _easycom_up_upload + _easycom_up_input + _easycom_u_popup)();
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + HazardFormPopup)();
}
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
const _sfc_main = {
__name: "Inspectionresult",
setup(__props) {
const oneTableId = common_vendor.ref("");
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const checkData = common_vendor.ref(null);
const hazardFormRef = common_vendor.ref(null);
const showHazardPopup = common_vendor.ref(false);
const hazardPayload = common_vendor.ref(components_hazard_hazardForm.createEmptyHazardPayload());
const radiolist1 = common_vendor.reactive([
{
name: "常",
value: 1,
disabled: false
},
{
name: "异常",
value: 2,
disabled: false
},
{
name: "不涉及",
value: 3,
disabled: false
}
{ name: "正常", value: 1, disabled: false },
{ name: "常", value: 2, disabled: false },
{ name: "不涉及", value: 3, disabled: false }
]);
const radiovalue1 = common_vendor.ref("");
const value1 = common_vendor.ref("");
const normalizeInspectionDraft = (data) => {
if (!data)
return { radiovalue1: "", value1: "", hazardPayload: components_hazard_hazardForm.createEmptyHazardPayload() };
if (!data.hazardPayload && data.hazardFormData) {
data.hazardPayload = {
formData: data.hazardFormData,
address: data.hazardAddress || "",
lng: data.hazardLng || 0,
lat: data.hazardLat || 0,
areaId: "",
areaName: "",
fileList: data.hazardFileList || []
};
}
return {
radiovalue1: data.radiovalue1 || "",
value1: data.value1 || "",
hazardPayload: data.hazardPayload || components_hazard_hazardForm.createEmptyHazardPayload()
};
};
const inspectionDraftHasContent = (data) => {
var _a, _b;
const normalized = normalizeInspectionDraft(data);
const payload = normalized.hazardPayload;
return !!(normalized.radiovalue1 || normalized.value1 || ((_a = payload.formData) == null ? void 0 : _a.title) || ((_b = payload.formData) == null ? void 0 : _b.description) || payload.fileList && payload.fileList.length > 0);
};
const {
showRestoreBanner,
clear: clearDraft,
restore: restoreDraft,
bindAutoSave
} = utils_useDraftCache.useDraftCache({
getKey: () => {
var _a;
return utils_draftCache.buildDraftKey(
utils_draftCache.DRAFT_NS.INSPECTION_RESULT,
oneTableId.value,
(_a = checkData.value) == null ? void 0 : _a.currentIndex
);
},
getPayload: () => ({
radiovalue1: radiovalue1.value,
value1: value1.value,
hazardPayload: JSON.parse(JSON.stringify(hazardPayload.value))
}),
hasContent: inspectionDraftHasContent,
applyPayload: (data) => {
const normalized = normalizeInspectionDraft(data);
radiovalue1.value = normalized.radiovalue1;
value1.value = normalized.value1;
hazardPayload.value = normalized.hazardPayload;
common_vendor.nextTick$1(() => {
var _a;
(_a = hazardFormRef.value) == null ? void 0 : _a.applyPayload(normalized.hazardPayload);
});
},
clearForm: () => {
radiovalue1.value = "";
value1.value = "";
clearHazard();
},
canSave: () => !!oneTableId.value,
requireInitialized: true
});
bindAutoSave(() => [radiovalue1.value, value1.value, hazardPayload.value]);
const groupChange = (n) => {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:312", "groupChange", n);
if (n !== "异常") {
clearHazard();
}
};
const radioChange = (n) => {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:320", "radioChange", n);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:207", "radioChange", n);
};
const value1 = common_vendor.ref("");
const showHazardPopup = common_vendor.ref(false);
const hazardFormData = common_vendor.reactive({
title: "",
level: 0,
source: 0,
description: "",
tagIndex: 0,
regulationId: null,
// 法律依据ID
regulationName: ""
// 法律依据名称(显示用)
});
const hazardAddress = common_vendor.ref("");
const hazardLng = common_vendor.ref(0);
const hazardLat = common_vendor.ref(0);
const showAreaPicker = common_vendor.ref(false);
const areaList = common_vendor.ref([]);
const selectedAreaId = common_vendor.ref("");
const selectedAreaName = common_vendor.ref("");
const tempAreaId = common_vendor.ref("");
const showLawPopup = common_vendor.ref(false);
const lawKeyword = common_vendor.ref("");
const selectedLawId = common_vendor.ref(null);
const selectedLawName = common_vendor.ref("");
const lawList = common_vendor.ref([]);
const lawLoading = common_vendor.ref(false);
const lawPageNum = common_vendor.ref(1);
const lawPageSize = common_vendor.ref(10);
const hasMoreLaw = common_vendor.ref(true);
const openLawPopup = () => {
showLawPopup.value = true;
if (lawList.value.length === 0) {
fetchRegulationList();
}
};
const fetchRegulationList = async (isLoadMore = false) => {
if (lawLoading.value)
return;
lawLoading.value = true;
try {
const params = {
pageNum: lawPageNum.value,
pageSize: lawPageSize.value,
status: 1
// 启用状态
};
if (lawKeyword.value && lawKeyword.value.trim()) {
params.keyword = lawKeyword.value.trim();
}
const res = await request_api.getRegulationList(params);
if (res.code === 0) {
const records = res.data.records || res.data || [];
if (isLoadMore) {
lawList.value = [...lawList.value, ...records];
} else {
lawList.value = records;
}
const total = res.data.total || 0;
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:399", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
};
const searchRegulation = () => {
lawPageNum.value = 1;
lawList.value = [];
hasMoreLaw.value = true;
fetchRegulationList();
};
const loadMoreLaw = () => {
if (!hasMoreLaw.value || lawLoading.value)
return;
lawPageNum.value++;
fetchRegulationList(true);
};
const selectLaw = (item) => {
selectedLawId.value = item.id;
selectedLawName.value = item.depict || item.keyword || "";
};
const confirmLaw = () => {
if (selectedLawId.value) {
hazardFormData.regulationId = selectedLawId.value;
hazardFormData.regulationName = selectedLawName.value;
}
showLawPopup.value = false;
};
const fetchAreaList = async () => {
try {
const res = await request_three_one_api_area.getAreaList();
if (res.code === 0 && res.data && res.data.records) {
areaList.value = res.data.records;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:443", "获取区域列表失败:", error);
}
};
const confirmAreaSelect = () => {
if (tempAreaId.value) {
selectedAreaId.value = tempAreaId.value;
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
selectedAreaName.value = selected ? selected.name : "";
}
showAreaPicker.value = false;
};
const hazardFileList = common_vendor.ref([]);
const levelChooseRef = common_vendor.ref(null);
const aiAnalyzing = common_vendor.ref(false);
const hasHazardData = common_vendor.computed(() => {
return hazardFormData.title && hazardFileList.value.length > 0;
});
const hasHazardData = common_vendor.computed(() => components_hazard_hazardForm.hasValidHazardPayload(hazardPayload.value));
const progressPercent = common_vendor.computed(() => {
if (!checkData.value)
return 0;
@@ -179,149 +113,24 @@ const _sfc_main = {
const total = checkData.value.totalCount || 1;
return Math.round(current / total * 100);
});
const levelOptions = common_vendor.ref([
// { id: 1, title: '轻微隐患' },
{ id: 2, title: "一般隐患" },
{ id: 3, title: "重大隐患" }
]);
const sourceOptions = common_vendor.ref([
{ id: 1, title: "部门检查" },
{ id: 2, title: "都导检查" },
{ id: 3, title: "企业自查" },
{ id: 4, title: "行业互查" }
]);
const tagOptions = common_vendor.ref([]);
const fetchTagOptions = async () => {
try {
const res = await request_api.getHiddenDangerLabelList();
if (res.code === 0) {
tagOptions.value = res.data.map((item) => ({
id: item.id,
title: item.name
}));
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:508", "获取标签列表失败:", error);
}
};
const openHazardPopup = () => {
showHazardPopup.value = true;
};
const editHazard = () => {
showHazardPopup.value = true;
};
const onHazardConfirm = (payload) => {
if (payload) {
hazardPayload.value = JSON.parse(JSON.stringify(payload));
}
};
const clearHazard = () => {
hazardFormData.regulationId = null;
hazardFormData.regulationName = "";
selectedLawId.value = null;
selectedLawName.value = "";
hazardFormData.title = "";
hazardFormData.level = 0;
hazardFormData.source = 0;
hazardFormData.description = "";
hazardFormData.tagIndex = 0;
hazardAddress.value = "";
hazardLng.value = 0;
hazardLat.value = 0;
hazardFileList.value = [];
selectedAreaId.value = "";
selectedAreaName.value = "";
};
const confirmHazard = () => {
if (hazardFileList.value.length === 0) {
common_vendor.index.showToast({ title: "请上传隐患图片", icon: "none" });
return;
}
if (!hazardFormData.title) {
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
return;
}
if (!hazardAddress.value) {
common_vendor.index.showToast({ title: "请输入隐患位置", icon: "none" });
return;
}
if (!hazardFormData.description) {
common_vendor.index.showToast({ title: "请输入隐患描述", icon: "none" });
return;
}
showHazardPopup.value = false;
common_vendor.index.showToast({ title: "隐患信息已暂存", icon: "success" });
};
const chooseLocation = () => {
showHazardPopup.value = false;
setTimeout(() => {
common_vendor.index.chooseLocation({
success: (res) => {
hazardAddress.value = res.address + (res.name ? `(${res.name})` : "");
hazardLng.value = res.longitude;
hazardLat.value = res.latitude;
showHazardPopup.value = true;
},
fail: (err) => {
showHazardPopup.value = true;
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({ title: "选择位置失败", icon: "none" });
}
}
});
}, 300);
};
const inspectionUploadInstance = common_vendor.getCurrentInstance();
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(hazardFileList, {
watermark: {
canvasId: "watermarkCanvas",
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance: inspectionUploadInstance
}
});
const handleAiAnalyze = async () => {
const imageFiles = hazardFileList.value.filter((f) => {
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
});
if (imageFiles.length === 0) {
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
return;
}
const fullImageUrl = imageFiles[0].url;
aiAnalyzing.value = true;
try {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:612", "开始调用AI分析接口图片地址:", fullImageUrl);
const analyzeRes = await request_api.analyzeHazardImage({
imageUrl: fullImageUrl
});
if (analyzeRes.code === 0 && analyzeRes.data) {
const aiData = analyzeRes.data;
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:619", "AI分析结果:", aiData);
if (aiData.title)
hazardFormData.title = aiData.title;
if (aiData.description)
hazardFormData.description = aiData.description;
if (aiData.level) {
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 1, "一般隐患": 1, "重大": 2, "重大隐患": 2 };
const levelIndex = levelMap[aiData.level];
if (levelIndex !== void 0) {
hazardFormData.level = levelIndex;
common_vendor.nextTick$1(() => {
if (levelChooseRef.value && levelChooseRef.value.$data) {
levelChooseRef.value.$data.currentIndex = levelIndex;
}
});
}
}
common_vendor.index.showToast({ title: "AI分析完成已自动填充", icon: "success", duration: 2e3 });
} else {
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:642", "AI分析接口调用失败:", error);
common_vendor.index.showToast({ title: "AI分析失败请重试", icon: "none" });
} finally {
aiAnalyzing.value = false;
}
var _a;
hazardPayload.value = components_hazard_hazardForm.createEmptyHazardPayload();
(_a = hazardFormRef.value) == null ? void 0 : _a.resetForm();
};
const handleSubmit = async () => {
var _a, _b, _c, _d, _e;
var _a, _b, _c, _d;
if (!radiovalue1.value) {
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
return;
@@ -339,40 +148,23 @@ const _sfc_main = {
try {
common_vendor.index.showLoading({ title: "提交中..." });
if (radiovalue1.value === "异常" && hasHazardData.value) {
const attachments = hazardFileList.value.filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file));
const selectedTag = tagOptions.value[hazardFormData.tagIndex];
const tagId = selectedTag ? selectedTag.id : null;
const hazardParams = {
taskId: (_a = checkData.value) == null ? void 0 : _a.taskId,
checkPointId: (_b = checkData.value) == null ? void 0 : _b.checkPointId,
title: hazardFormData.title,
level: ((_c = levelOptions.value[hazardFormData.level]) == null ? void 0 : _c.id) || 2,
lng: hazardLng.value || 0,
lat: hazardLat.value || 0,
address: hazardAddress.value || "",
areaId: selectedAreaId.value || null,
// 隐患区域ID
description: hazardFormData.description || "",
source: ((_d = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _d.title) || "",
tagId,
attachments,
regulationId: hazardFormData.regulationId || null
};
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:705", "隐患参数:", hazardParams);
const payload = ((_a = hazardFormRef.value) == null ? void 0 : _a.getPayload()) || hazardPayload.value;
const hazardParams = components_hazard_hazardForm.buildHiddenDangerParams(payload, {
taskId: (_b = checkData.value) == null ? void 0 : _b.taskId,
checkPointId: (_c = checkData.value) == null ? void 0 : _c.checkPointId
});
const hazardRes = await request_api.addHiddenDanger(hazardParams);
if (hazardRes.code !== 0) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: hazardRes.msg || "新增隐患失败", icon: "none" });
return;
}
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:714", "新增隐患成功");
}
const submitParams = {
taskId: (_e = checkData.value) == null ? void 0 : _e.taskId,
taskId: (_d = checkData.value) == null ? void 0 : _d.taskId,
result: resultValue,
remark: value1.value
};
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:723", "提交参数:", submitParams);
const res = await request_api.submitCheckResult(submitParams);
common_vendor.index.hideLoading();
if (res.code === 0) {
@@ -397,7 +189,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:758", "提交失败:", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:306", "提交失败:", error);
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
}
};
@@ -409,164 +201,19 @@ const _sfc_main = {
const getCheckData = async () => {
try {
const res = await request_api.enterCheckPlan(oneTableId.value);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:777", "检查项数据:", res);
if (res.code === 0) {
checkData.value = res.data;
restoreDraft();
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:784", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:325", error);
}
};
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const isInitialized = common_vendor.ref(false);
const getDraftKey = () => {
var _a;
return `draft_inspection_result_${oneTableId.value || ""}_${((_a = checkData.value) == null ? void 0 : _a.currentIndex) || ""}`;
};
const saveDraft = () => {
if (isRestoring.value || !isInitialized.value) {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:799", "【草稿Debug - 巡检】saveDraft 被跳过:", { isRestoring: isRestoring.value, isInitialized: isInitialized.value });
return;
}
const key = getDraftKey();
const hasContent = radiovalue1.value || value1.value || hazardFormData.title || hazardFormData.description || hazardFileList.value.length > 0;
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:809", "【草稿Debug - 巡检】尝试自动保存草稿. Key:", key, "是否有实质内容:", !!hasContent, "当前数据:", {
radiovalue1: radiovalue1.value,
value1: value1.value,
title: hazardFormData.title,
description: hazardFormData.description,
fileCount: hazardFileList.value.length
});
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:819", "【草稿Debug - 巡检】当前表单为空,自动删除本地缓存 Key:", key);
hasDraft.value = false;
return;
}
const data = {
radiovalue1: radiovalue1.value,
value1: value1.value,
hazardFormData: {
title: hazardFormData.title,
level: hazardFormData.level,
source: hazardFormData.source,
description: hazardFormData.description,
tagIndex: hazardFormData.tagIndex
},
hazardFileList: hazardFileList.value,
hazardAddress: hazardAddress.value,
hazardLng: hazardLng.value,
hazardLat: hazardLat.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:840", "【草稿Debug - 巡检】成功保存草稿到 LocalStorage, Key:", key);
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:847", "【草稿Debug - 巡检】手动清空草稿, Key:", key);
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
radiovalue1.value = "";
value1.value = "";
hazardFormData.title = "";
hazardFormData.level = 0;
hazardFormData.source = 0;
hazardFormData.description = "";
hazardFormData.tagIndex = 0;
hazardFileList.value = [];
hazardAddress.value = "";
hazardLng.value = 0;
hazardLat.value = 0;
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:877", "【草稿Debug - 巡检】尝试恢复草稿, Key:", key, "获取本地缓存结果:", !!cached);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.radiovalue1 || data.value1 || data.hazardFormData.title || data.hazardFormData.description || data.hazardFileList && data.hazardFileList.length > 0;
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:887", "【草稿Debug - 巡检】解析本地缓存成功, 是否有实质内容:", !!hasContent, "缓存数据:", data);
if (!hasContent) {
isInitialized.value = true;
return;
}
isRestoring.value = true;
radiovalue1.value = data.radiovalue1 || "";
value1.value = data.value1 || "";
hazardFormData.title = data.hazardFormData.title || "";
hazardFormData.level = data.hazardFormData.level || 0;
hazardFormData.source = data.hazardFormData.source || 0;
hazardFormData.description = data.hazardFormData.description || "";
hazardFormData.tagIndex = data.hazardFormData.tagIndex || 0;
hazardFileList.value = data.hazardFileList || [];
hazardAddress.value = data.hazardAddress || "";
hazardLng.value = data.hazardLng || 0;
hazardLat.value = data.hazardLat || 0;
hasDraft.value = true;
showRestoreBanner.value = true;
common_vendor.nextTick$1(() => {
isRestoring.value = false;
isInitialized.value = true;
if (levelChooseRef.value && levelChooseRef.value.$data) {
levelChooseRef.value.$data.currentIndex = hazardFormData.level;
}
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:914", "【草稿Debug - 巡检】UI与多选组件状态同步重绘完毕");
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:923", "【草稿Debug - 巡检】解析草稿异常:", e);
isRestoring.value = false;
isInitialized.value = true;
}
} else {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:928", "【草稿Debug - 巡检】本地无任何缓存, 页面已安全标记为 initialized");
isInitialized.value = true;
}
};
common_vendor.watch(
() => [
radiovalue1.value,
value1.value,
hazardFormData.title,
hazardFormData.level,
hazardFormData.source,
hazardFormData.description,
hazardFormData.tagIndex,
hazardAddress.value,
hazardFileList.value
],
() => {
if (oneTableId.value) {
saveDraft();
}
},
{ deep: true }
);
common_vendor.onLoad((options) => {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:955", "接收到的参数:", options);
if (options.id) {
oneTableId.value = options.id;
getCheckData();
}
fetchTagOptions();
fetchAreaList();
});
return (_ctx, _cache) => {
var _a, _b, _c, _d;
@@ -605,17 +252,17 @@ const _sfc_main = {
}, !hasHazardData.value ? {
m: common_vendor.o(openHazardPopup)
} : common_vendor.e({
n: common_vendor.t(hazardFormData.title),
o: common_vendor.t((_c = levelOptions.value[hazardFormData.level]) == null ? void 0 : _c.title),
p: hazardFormData.level === 0 ? 1 : "",
q: hazardFormData.level === 1 ? 1 : "",
r: hazardFormData.level === 2 ? 1 : "",
s: common_vendor.t(((_d = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _d.title) || "-"),
t: common_vendor.t(hazardAddress.value || "-"),
v: common_vendor.t(hazardFormData.description || "-"),
w: hazardFileList.value.length > 0
}, hazardFileList.value.length > 0 ? {
x: common_vendor.t(hazardFileList.value.length)
n: common_vendor.t(hazardPayload.value.formData.title),
o: common_vendor.t((_c = common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS)[hazardPayload.value.formData.level]) == null ? void 0 : _c.title),
p: hazardPayload.value.formData.level === 0 ? 1 : "",
q: hazardPayload.value.formData.level === 1 ? 1 : "",
r: hazardPayload.value.formData.level === 2 ? 1 : "",
s: common_vendor.t(((_d = common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS)[hazardPayload.value.formData.source]) == null ? void 0 : _d.title) || "-"),
t: common_vendor.t(hazardPayload.value.address || "-"),
v: common_vendor.t(hazardPayload.value.formData.description || "-"),
w: hazardPayload.value.fileList.length > 0
}, hazardPayload.value.fileList.length > 0 ? {
x: common_vendor.t(hazardPayload.value.fileList.length)
} : {}, {
y: common_vendor.o(editHazard),
z: common_vendor.o(clearHazard)
@@ -626,138 +273,22 @@ const _sfc_main = {
modelValue: value1.value
}),
C: common_vendor.o(handleSubmit),
D: common_vendor.o(($event) => showHazardPopup.value = false),
E: showRestoreBanner.value
}, showRestoreBanner.value ? {
F: common_vendor.o(($event) => clearDraft(true))
} : {}, {
G: common_vendor.o(($event) => hazardFormData.source = $event),
H: common_vendor.p({
options: sourceOptions.value,
wrap: false,
["item-width"]: "152rpx",
["item-height"]: "64rpx",
modelValue: hazardFormData.source
D: common_vendor.sr(hazardFormRef, "643afff0-3", {
"k": "hazardFormRef"
}),
I: common_vendor.o(common_vendor.unref(afterRead)),
J: common_vendor.o(common_vendor.unref(deletePic)),
K: common_vendor.p({
fileList: hazardFileList.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
L: canvasWidth.value,
M: canvasHeight.value,
N: canvasWidth.value + "px",
O: canvasHeight.value + "px",
P: !aiAnalyzing.value
}, !aiAnalyzing.value ? {} : {}, {
Q: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
R: aiAnalyzing.value,
S: aiAnalyzing.value,
T: common_vendor.o(handleAiAnalyze),
U: common_vendor.o(($event) => hazardFormData.title = $event),
V: common_vendor.p({
placeholder: "请输入内容",
border: "surround",
modelValue: hazardFormData.title
}),
W: common_vendor.sr(levelChooseRef, "643afff0-7,643afff0-3", {
"k": "levelChooseRef"
}),
X: common_vendor.o(($event) => hazardFormData.level = $event),
Y: common_vendor.p({
options: levelOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: hazardFormData.level
}),
Z: common_vendor.o(($event) => hazardAddress.value = $event),
aa: common_vendor.p({
placeholder: "请输入地址",
border: "surround",
modelValue: hazardAddress.value
}),
ab: common_vendor.o(chooseLocation),
ac: common_vendor.t(hazardFormData.regulationName || "请选择法律依据"),
ad: !hazardFormData.regulationName ? 1 : "",
ae: common_vendor.o(openLawPopup),
af: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
ag: !selectedAreaName.value ? 1 : "",
ah: common_vendor.o(($event) => showAreaPicker.value = true),
ai: common_vendor.o(($event) => hazardFormData.description = $event),
aj: common_vendor.p({
placeholder: "请输入内容",
modelValue: hazardFormData.description
}),
ak: common_vendor.o(($event) => hazardFormData.tagIndex = $event),
al: common_vendor.p({
options: tagOptions.value,
modelValue: hazardFormData.tagIndex
}),
am: common_vendor.o(($event) => showHazardPopup.value = false),
an: common_vendor.o(confirmHazard),
ao: common_vendor.o(($event) => showHazardPopup.value = false),
ap: common_vendor.p({
E: common_vendor.o(onHazardConfirm),
F: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true)),
G: common_vendor.o(($event) => showHazardPopup.value = $event),
H: common_vendor.o(($event) => hazardPayload.value = $event),
I: common_vendor.p({
title: "填写隐患信息",
mode: "collect",
["body-height"]: "60vh",
["show-draft-banner"]: common_vendor.unref(showRestoreBanner),
show: showHazardPopup.value,
mode: "center",
round: "20",
safeAreaInsetBottom: false
modelValue: hazardPayload.value
}),
aq: common_vendor.o(($event) => showLawPopup.value = false),
ar: common_vendor.o(searchRegulation),
as: lawKeyword.value,
at: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
av: common_vendor.o(searchRegulation),
aw: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
ay: common_vendor.f(lawList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis),
c: selectedLawId.value === item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => selectLaw(item), item.id)
};
}),
az: lawLoading.value
}, lawLoading.value ? {} : {}), {
ax: !lawLoading.value && lawList.value.length === 0,
aA: common_vendor.o(loadMoreLaw),
aB: common_vendor.o(($event) => showLawPopup.value = false),
aC: common_vendor.o(confirmLaw),
aD: common_vendor.o(($event) => showLawPopup.value = false),
aE: common_vendor.p({
show: showLawPopup.value,
mode: "center",
round: "20",
safeAreaInsetBottom: false
}),
aF: common_vendor.o(($event) => showAreaPicker.value = false),
aG: common_vendor.o(confirmAreaSelect),
aH: common_vendor.f(areaList.value, (item, k0, i0) => {
return common_vendor.e({
a: item.color,
b: common_vendor.t(item.name),
c: tempAreaId.value === item.id
}, tempAreaId.value === item.id ? {} : {}, {
d: item.id,
e: tempAreaId.value === item.id ? 1 : "",
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
});
}),
aI: areaList.value.length === 0
}, areaList.value.length === 0 ? {} : {}, {
aJ: common_vendor.o(($event) => showAreaPicker.value = false),
aK: common_vendor.p({
show: showAreaPicker.value,
mode: "bottom",
round: "20"
}),
aL: common_vendor.gei(_ctx, "")
J: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -4,9 +4,6 @@
"u-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"u-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
"hazard-form-popup": "../../components/hazard/HazardFormPopup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -170,278 +170,4 @@
background: #FFF1F0;
border: 2rpx solid #FFA39E;
color: #F5222D;
}
.popup-content.data-v-643afff0 {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.popup-header.data-v-643afff0 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.popup-header .popup-title.data-v-643afff0 {
font-size: 32rpx;
color: #333;
}
.popup-header .popup-close.data-v-643afff0 {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.popup-body.data-v-643afff0 {
padding: 30rpx;
}
.source-choose-scroll.data-v-643afff0 {
width: 100%;
overflow: hidden;
}
.source-choose-scroll.data-v-643afff0 .up-choose {
width: 100%;
white-space: nowrap;
}
.source-choose-scroll.data-v-643afff0 .u-tag-wrapper {
margin-right: 12rpx;
}
.source-choose-scroll.data-v-643afff0 .u-tag {
display: flex !important;
align-items: center !important;
justify-content: center !important;
box-sizing: border-box;
padding: 0 8rpx !important;
line-height: normal !important;
}
.source-choose-scroll.data-v-643afff0 .u-tag__content {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
.source-choose-scroll.data-v-643afff0 .u-tag__text {
font-size: 24rpx !important;
line-height: 1.3 !important;
text-align: center;
}
.ai-btn-wrapper.data-v-643afff0 {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-643afff0 {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-643afff0::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-643afff0 {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-643afff0 {
opacity: 0.7;
}
.popup-footer.data-v-643afff0 {
display: flex;
border-top: 1rpx solid #eee;
}
.popup-footer button.data-v-643afff0 {
flex: 1;
height: 90rpx;
margin: 0 !important;
padding: 0 !important;
line-height: 90rpx;
border-radius: 0;
font-size: 30rpx;
}
.popup-footer button.data-v-643afff0::after {
border: none;
}
.popup-footer .btn-cancel.data-v-643afff0 {
background: #fff;
color: #666;
}
.popup-footer .btn-confirm.data-v-643afff0 {
color: #fff;
}
.address-box.data-v-643afff0 {
display: flex;
align-items: center;
gap: 20rpx;
}
.address-box .address-input-wrapper.data-v-643afff0 {
flex: 1;
}
.address-box .btn-address.data-v-643afff0 {
flex-shrink: 0;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
font-size: 26rpx;
border-radius: 8rpx;
color: #fff;
}
.address-box .btn-address.data-v-643afff0::after {
border: none;
}
.select-trigger.data-v-643afff0 {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
}
.select-trigger .select-value.data-v-643afff0 {
flex: 1;
font-size: 28rpx;
color: #333;
}
.select-trigger .select-value.placeholder.data-v-643afff0 {
color: #c0c4cc;
}
.picker-popup.data-v-643afff0 {
background: #fff;
}
.picker-popup .picker-header.data-v-643afff0 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.picker-popup .picker-header .picker-cancel.data-v-643afff0 {
font-size: 28rpx;
color: #999;
}
.picker-popup .picker-header .picker-title.data-v-643afff0 {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.picker-popup .picker-header .picker-confirm.data-v-643afff0 {
font-size: 28rpx;
color: #2667E9;
}
.picker-popup .picker-body.data-v-643afff0 {
max-height: 600rpx;
padding: 0 30rpx;
}
.picker-popup .picker-item.data-v-643afff0 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 0;
border-bottom: 1rpx solid #f5f5f5;
font-size: 30rpx;
color: #333;
}
.picker-popup .picker-item.data-v-643afff0:last-child {
border-bottom: none;
}
.picker-popup .picker-item.picker-item-active.data-v-643afff0 {
color: #2667E9;
}
.law-popup.data-v-643afff0 {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
max-height: 80vh;
}
.law-popup .popup-header.data-v-643afff0 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.law-popup .popup-header .popup-title.data-v-643afff0 {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.law-popup .popup-header .popup-close.data-v-643afff0 {
font-size: 40rpx;
color: #999;
cursor: pointer;
}
.search-box.data-v-643afff0 {
display: flex;
align-items: center;
background: #F5F5F5;
border-radius: 40rpx;
padding: 16rpx 24rpx;
margin: 20rpx 30rpx;
}
.search-box .search-icon.data-v-643afff0 {
font-size: 28rpx;
color: #999;
margin-right: 12rpx;
}
.search-box .search-input.data-v-643afff0 {
flex: 1;
font-size: 28rpx;
background: transparent;
border: none;
}
.search-box .search-btn.data-v-643afff0 {
color: #2667E9;
font-size: 26rpx;
margin-left: 16rpx;
cursor: pointer;
}
.loading-tip.data-v-643afff0, .empty-tip.data-v-643afff0 {
text-align: center;
padding: 40rpx;
color: #999;
font-size: 26rpx;
}
.law-list.data-v-643afff0 {
max-height: 500rpx;
padding: 0 30rpx;
}
.law-item.data-v-643afff0 {
padding: 24rpx;
border: 2rpx solid #E5E5E5;
border-radius: 12rpx;
margin-bottom: 16rpx;
font-size: 28rpx;
color: #333;
text-align: left;
}
.law-item .law-title.data-v-643afff0 {
line-height: 1.5;
margin-bottom: 8rpx;
font-weight: bold;
}
.law-item .law-basis.data-v-643afff0 {
font-size: 24rpx;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.law-item-active.data-v-643afff0 {
border-color: #2667E9;
background: #F0F6FF;
}
.area-color-dot.data-v-643afff0 {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
margin-right: 16rpx;
}

View File

@@ -0,0 +1,645 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_draftCache = require("../../utils/draftCache.js");
const utils_useDraftCache = require("../../utils/useDraftCache.js");
const components_hazard_hazardForm = require("../../components/hazard/hazardForm.js");
if (!Array) {
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_icon2 + _easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_u_popup2)();
}
const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_icon + _easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + HazardFormPopup + _easycom_u_popup)();
}
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
const TASK_STATUS_SUBMITTED = 2;
const _sfc_main = {
__name: "detail",
setup(__props) {
const oneTableId = common_vendor.ref("");
const tableId = common_vendor.ref("");
const taskDate = common_vendor.ref("");
const planName = common_vendor.ref("");
const loading = common_vendor.ref(true);
const checkItemList = common_vendor.ref([]);
const answerList = common_vendor.ref([]);
const sessionSubmittedTaskIds = common_vendor.ref(/* @__PURE__ */ new Set());
const showHazardPopup = common_vendor.ref(false);
const showCheckSheet = common_vendor.ref(false);
const activeHazardIndex = common_vendor.ref(-1);
const hazardFormRef = common_vendor.ref(null);
const editingHazardPayload = common_vendor.ref(components_hazard_hazardForm.createEmptyHazardPayload());
const resultOptions = [
{ name: "正常", value: 1 },
{ name: "异常", value: 2 },
{ name: "不涉及", value: 3 }
];
const syncSubmittedTaskIds = (list) => {
const next = new Set(sessionSubmittedTaskIds.value);
(list || []).forEach((item) => {
if ((item == null ? void 0 : item.status) === TASK_STATUS_SUBMITTED && item.taskId != null) {
next.add(item.taskId);
}
});
sessionSubmittedTaskIds.value = next;
};
const isItemSubmitted = (item) => {
if (!item)
return false;
if (item.status === TASK_STATUS_SUBMITTED)
return true;
if (item.taskId != null && sessionSubmittedTaskIds.value.has(item.taskId))
return true;
return false;
};
const getResultLabel = (result) => {
const opt = resultOptions.find((o) => o.value === result);
return (opt == null ? void 0 : opt.name) || "-";
};
const getResultTagClass = (result) => {
if (result === 1)
return "result-tag--normal";
if (result === 2)
return "result-tag--abnormal";
if (result === 3)
return "result-tag--na";
return "";
};
const viewHazardDetail = (item) => {
if (!(item == null ? void 0 : item.hazardId)) {
common_vendor.index.showToast({ title: "暂无隐患信息", icon: "none" });
return;
}
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}`
});
};
common_vendor.computed(() => {
var _a;
return planName.value || ((_a = checkItemList.value[0]) == null ? void 0 : _a.itemName) || "检查表";
});
common_vendor.computed(() => {
var _a;
return ((_a = checkItemList.value[0]) == null ? void 0 : _a.industryName) || "";
});
const createEmptyAnswer = () => ({
resultLabel: "",
result: null,
remark: "",
hazardPayload: components_hazard_hazardForm.createEmptyHazardPayload()
});
const normalizeSheetAnswer = (answer) => {
if (!answer)
return createEmptyAnswer();
const hazardPayload = answer.hazardPayload || components_hazard_hazardForm.createEmptyHazardPayload();
const empty = components_hazard_hazardForm.createEmptyHazardPayload();
return {
resultLabel: answer.resultLabel || "",
result: answer.result ?? null,
remark: answer.remark || "",
hazardPayload: {
formData: {
...empty.formData,
...hazardPayload.formData || {}
},
address: hazardPayload.address || "",
lng: hazardPayload.lng || 0,
lat: hazardPayload.lat || 0,
areaId: hazardPayload.areaId || "",
areaName: hazardPayload.areaName || "",
fileList: Array.isArray(hazardPayload.fileList) ? [...hazardPayload.fileList] : [],
tagOptions: Array.isArray(hazardPayload.tagOptions) ? [...hazardPayload.tagOptions] : []
}
};
};
const syncAnswerFields = (answer) => {
const normalized = normalizeSheetAnswer(answer);
if (!normalized.resultLabel && normalized.result != null) {
const opt = resultOptions.find((o) => o.value === normalized.result);
if (opt)
normalized.resultLabel = opt.name;
} else if (normalized.resultLabel && normalized.result == null) {
const opt = resultOptions.find((o) => o.name === normalized.resultLabel);
if (opt)
normalized.result = opt.value;
}
return normalized;
};
const buildAnswerFromTask = (item) => {
const answer = createEmptyAnswer();
if (!isItemSubmitted(item)) {
return answer;
}
answer.result = item.result;
answer.remark = item.remark || "";
const opt = resultOptions.find((o) => o.value === item.result);
if (opt) {
answer.resultLabel = opt.name;
}
if (item.result === 2 && item.hazardName) {
const sourceIndex = components_hazard_hazardForm.SOURCE_OPTIONS.findIndex((o) => o.title === item.source);
answer.hazardPayload = {
...components_hazard_hazardForm.createEmptyHazardPayload(),
formData: {
...components_hazard_hazardForm.createEmptyHazardPayload().formData,
title: item.hazardName || "",
description: item.hazardDesc || "",
source: sourceIndex >= 0 ? sourceIndex : 0
},
address: item.hazardAddress || ""
};
}
return syncAnswerFields(answer);
};
const isAnswerFilled = (answer) => {
if (!answer)
return false;
return !!(answer.resultLabel || answer.result != null);
};
const hasAnswerDraftContent = (answer) => {
var _a, _b;
if (!answer)
return false;
const normalized = normalizeSheetAnswer(answer);
const hazard = normalized.hazardPayload;
return !!(normalized.resultLabel || normalized.result != null || normalized.remark || ((_a = hazard.formData) == null ? void 0 : _a.title) || ((_b = hazard.formData) == null ? void 0 : _b.description) || hazard.fileList && hazard.fileList.length > 0);
};
const buildDraftAnswers = () => {
return checkItemList.value.map((item, index) => {
if (isItemSubmitted(item))
return null;
const answer = answerList.value[index] || createEmptyAnswer();
if (!hasAnswerDraftContent(answer))
return null;
return {
taskId: item.taskId,
...JSON.parse(JSON.stringify(answer))
};
}).filter(Boolean);
};
const pruneDraftSubmitted = (taskIds = []) => {
var _a;
const key = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.INSPECTION_SHEET, oneTableId.value, taskDate.value);
const { data } = utils_draftCache.loadDraftWithFallback(key);
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length))
return;
const submittedSet = new Set(taskIds);
const remainingAnswers = data.answers.filter(
(answer) => (answer == null ? void 0 : answer.taskId) == null || !submittedSet.has(answer.taskId)
);
if (!remainingAnswers.length) {
utils_draftCache.removeDraft(key);
return;
}
utils_draftCache.saveDraftToStorage(key, {
...data,
answers: remainingAnswers
});
};
const isItemPendingSubmit = (index) => {
const item = checkItemList.value[index];
return !isItemSubmitted(item) && isAnswerFilled(answerList.value[index]);
};
const submittedCount = common_vendor.computed(() => {
return checkItemList.value.filter(isItemSubmitted).length;
});
const pendingSubmitCount = common_vendor.computed(() => {
return checkItemList.value.filter((item, index) => isItemPendingSubmit(index)).length;
});
const uncheckedCount = common_vendor.computed(() => {
return Math.max(checkItemList.value.length - submittedCount.value - pendingSubmitCount.value, 0);
});
const getSheetCellClass = (index) => {
const item = checkItemList.value[index];
if (isItemSubmitted(item))
return "check-sheet-cell--submitted";
if (isItemPendingSubmit(index))
return "check-sheet-cell--pending";
return "";
};
const progressPercent = common_vendor.computed(() => {
if (!checkItemList.value.length)
return 0;
return Math.round(submittedCount.value / checkItemList.value.length * 100);
});
const sheetDraftHasContent = (data) => {
var _a;
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length))
return false;
return data.answers.some((answer) => hasAnswerDraftContent(answer));
};
const {
showRestoreBanner,
clear: clearDraft,
restore: restoreDraft,
bindAutoSave
} = utils_useDraftCache.useDraftCache({
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.INSPECTION_SHEET, oneTableId.value, taskDate.value),
getPayload: () => ({
oneTableId: oneTableId.value,
taskDate: taskDate.value,
planName: planName.value,
answers: buildDraftAnswers()
}),
hasContent: sheetDraftHasContent,
applyPayload: (data) => {
var _a;
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length) || !checkItemList.value.length)
return;
answerList.value = checkItemList.value.map((item, index) => {
if (isItemSubmitted(item)) {
return buildAnswerFromTask(item);
}
const savedByIndex = data.answers[index];
if (savedByIndex && sheetDraftHasContent({ answers: [savedByIndex] })) {
return syncAnswerFields(savedByIndex);
}
if (item.taskId != null && item.taskId !== "") {
const savedByTaskId = data.answers.find((a) => a.taskId === item.taskId);
if (savedByTaskId) {
return syncAnswerFields(savedByTaskId);
}
}
return createEmptyAnswer();
});
if (data.planName && !planName.value) {
planName.value = data.planName;
}
},
clearForm: () => {
answerList.value = checkItemList.value.map((item) => isItemSubmitted(item) ? buildAnswerFromTask(item) : createEmptyAnswer());
},
canSave: () => !!oneTableId.value && !!taskDate.value && checkItemList.value.length > 0,
requireInitialized: true
});
bindAutoSave(() => answerList.value);
const onResultChange = (index, label) => {
const answer = answerList.value[index];
if (!answer)
return;
answer.resultLabel = label;
const selected = resultOptions.find((opt) => opt.name === label);
answer.result = selected ? selected.value : null;
if (label !== "异常") {
answer.hazardPayload = components_hazard_hazardForm.createEmptyHazardPayload();
}
};
const hazardFormExtraParams = common_vendor.computed(() => {
var _a;
const index = activeHazardIndex.value;
const taskId = index >= 0 ? (_a = checkItemList.value[index]) == null ? void 0 : _a.taskId : "";
return {
locationDraftKey: `hazard_location_${oneTableId.value}_${taskDate.value}_${taskId || index}`
};
});
const hasHazardData = (index) => {
var _a;
return components_hazard_hazardForm.hasValidHazardPayload((_a = answerList.value[index]) == null ? void 0 : _a.hazardPayload);
};
const openHazardPopup = (index) => {
var _a;
activeHazardIndex.value = index;
editingHazardPayload.value = JSON.parse(JSON.stringify(
((_a = answerList.value[index]) == null ? void 0 : _a.hazardPayload) ?? components_hazard_hazardForm.createEmptyHazardPayload()
));
showHazardPopup.value = true;
};
const closeHazardPopup = () => {
showHazardPopup.value = false;
activeHazardIndex.value = -1;
editingHazardPayload.value = components_hazard_hazardForm.createEmptyHazardPayload();
};
const onHazardConfirm = (payload) => {
const index = activeHazardIndex.value;
const data = payload || editingHazardPayload.value;
if (index >= 0 && data && answerList.value[index]) {
answerList.value[index].hazardPayload = JSON.parse(JSON.stringify(data));
}
closeHazardPopup();
};
const clearHazard = (index) => {
if (answerList.value[index]) {
answerList.value[index].hazardPayload = components_hazard_hazardForm.createEmptyHazardPayload();
}
};
const openCheckSheet = () => {
showCheckSheet.value = true;
};
const closeCheckSheet = () => {
showCheckSheet.value = false;
};
const handleSheetSubmit = () => {
closeCheckSheet();
handleSubmitAll();
};
const scrollToItem = (index) => {
closeCheckSheet();
common_vendor.nextTick$1(() => {
common_vendor.index.pageScrollTo({
selector: `#check-item-${index}`,
duration: 300,
offsetTop: -80
});
});
};
const getFilledAnswerIndices = () => {
const indices = [];
for (let i = 0; i < checkItemList.value.length; i++) {
if (!isItemSubmitted(checkItemList.value[i]) && isAnswerFilled(answerList.value[i])) {
indices.push(i);
}
}
return indices;
};
const validateFilledAnswers = () => {
const indices = getFilledAnswerIndices();
if (!indices.length) {
common_vendor.index.showToast({ title: "请先填写待提交的检查项", icon: "none" });
return null;
}
for (const index of indices) {
const answer = answerList.value[index];
if (answer.resultLabel === "异常" && !components_hazard_hazardForm.hasValidHazardPayload(answer.hazardPayload)) {
common_vendor.index.showToast({ title: `${index + 1} 项为异常,请填写隐患信息`, icon: "none" });
return null;
}
}
return indices;
};
const buildSubmitPayload = (filledIndices) => {
return filledIndices.filter((index) => !isItemSubmitted(checkItemList.value[index])).map((index) => {
const item = checkItemList.value[index];
const answer = syncAnswerFields(answerList.value[index]);
const payload = {
taskId: item.taskId,
result: answer.result,
remark: answer.remark || ""
};
if (answer.resultLabel === "异常" && components_hazard_hazardForm.hasValidHazardPayload(answer.hazardPayload)) {
payload.hazard = components_hazard_hazardForm.buildHiddenDangerParams(answer.hazardPayload, {
taskId: item.taskId,
checkPointId: item.checkPointId
});
}
return payload;
});
};
const goToListPage = () => {
common_vendor.index.navigateBack();
};
const handleSubmitAll = async () => {
const filledIndices = validateFilledAnswers();
if (!filledIndices)
return;
const submitList = buildSubmitPayload(filledIndices);
if (!submitList.length) {
common_vendor.index.showToast({ title: "没有可提交的新检查项", icon: "none" });
return;
}
try {
common_vendor.index.showLoading({ title: "提交中..." });
const res = await request_api.submitAllTask(submitList);
common_vendor.index.hideLoading();
if (res.code === 0) {
const nextSubmitted = new Set(sessionSubmittedTaskIds.value);
submitList.forEach((item) => {
if (item.taskId != null) {
nextSubmitted.add(item.taskId);
}
});
sessionSubmittedTaskIds.value = nextSubmitted;
pruneDraftSubmitted(submitList.map((item) => item.taskId));
common_vendor.index.showToast({
title: `已成功提交 ${submitList.length}`,
icon: "success"
});
setTimeout(() => {
goToListPage();
}, 1500);
} else {
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/Inspectionresult/detail.vue:730", "提交失败:", error);
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
}
};
const fetchDetail = async () => {
var _a;
if (!oneTableId.value || !taskDate.value) {
loading.value = false;
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
return;
}
loading.value = true;
try {
const res = await request_api.getAllTask(oneTableId.value, taskDate.value);
if (res.code === 0) {
const list = Array.isArray(res.data) ? res.data : ((_a = res.data) == null ? void 0 : _a.records) || [];
syncSubmittedTaskIds(list);
checkItemList.value = list;
answerList.value = list.map((item) => buildAnswerFromTask(item));
restoreDraft();
} else {
common_vendor.index.showToast({ title: res.msg || "获取检查项失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/detail.vue:754", "获取检查项失败:", error);
common_vendor.index.showToast({ title: "获取检查项失败", icon: "none" });
} finally {
loading.value = false;
}
};
common_vendor.onLoad((options) => {
if (options.oneTableId) {
oneTableId.value = options.oneTableId;
} else if (options.id) {
oneTableId.value = options.id;
}
if (options.taskDate) {
taskDate.value = decodeURIComponent(options.taskDate).split(" ")[0];
}
if (options.name) {
planName.value = decodeURIComponent(options.name);
}
if (options.tableId) {
tableId.value = options.tableId;
}
fetchDetail();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: loading.value
}, loading.value ? {} : !checkItemList.value.length ? {} : common_vendor.e({
c: common_vendor.t(checkItemList.value.length),
d: common_vendor.t(submittedCount.value),
e: common_vendor.t(pendingSubmitCount.value),
f: common_vendor.t(uncheckedCount.value),
g: progressPercent.value + "%",
h: common_vendor.p({
name: "grid",
size: "22",
color: "#2667E9"
}),
i: common_vendor.o(openCheckSheet),
j: common_vendor.unref(showRestoreBanner)
}, common_vendor.unref(showRestoreBanner) ? {
k: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
} : {}, {
l: common_vendor.f(checkItemList.value, (item, index, i0) => {
var _a, _b;
return common_vendor.e({
a: common_vendor.t(index + 1),
b: isItemSubmitted(item)
}, isItemSubmitted(item) ? {} : isItemPendingSubmit(index) ? {} : {}, {
c: isItemPendingSubmit(index),
d: common_vendor.t(item.name),
e: item.point || "",
f: isItemSubmitted(item)
}, isItemSubmitted(item) ? common_vendor.e({
g: common_vendor.t(getResultLabel(item.result)),
h: common_vendor.n(getResultTagClass(item.result)),
i: item.remark
}, item.remark ? {
j: common_vendor.t(item.remark)
} : {}, {
k: item.result === 2
}, item.result === 2 ? common_vendor.e({
l: item.hazardName
}, item.hazardName ? {
m: common_vendor.t(item.hazardName)
} : {}, {
n: item.source
}, item.source ? {
o: common_vendor.t(item.source)
} : {}, {
p: item.hazardAddress
}, item.hazardAddress ? {
q: common_vendor.t(item.hazardAddress)
} : {}, {
r: item.hazardDesc
}, item.hazardDesc ? {
s: common_vendor.t(item.hazardDesc)
} : {}) : {}, {
t: item.result === 2 && item.hazardId
}, item.result === 2 && item.hazardId ? {
v: common_vendor.o(($event) => viewHazardDetail(item), "check-item-" + index)
} : {}) : common_vendor.e({
w: common_vendor.f(resultOptions, (opt, optIndex, i1) => {
return {
a: optIndex,
b: "1b3bf21b-2-" + i0 + "-" + i1 + "," + ("1b3bf21b-1-" + i0),
c: common_vendor.p({
customStyle: {
marginBottom: "8px",
marginRight: "24rpx"
},
label: opt.name,
name: opt.name
})
};
}),
x: common_vendor.o((label) => onResultChange(index, label), "check-item-" + index),
y: "1b3bf21b-1-" + i0,
z: common_vendor.o(($event) => answerList.value[index].resultLabel = $event, "check-item-" + index),
A: common_vendor.p({
placement: "row",
modelValue: answerList.value[index].resultLabel
}),
B: answerList.value[index].resultLabel === "异常"
}, answerList.value[index].resultLabel === "异常" ? common_vendor.e({
C: !hasHazardData(index)
}, !hasHazardData(index) ? {
D: common_vendor.o(($event) => openHazardPopup(index), "check-item-" + index)
} : common_vendor.e({
E: common_vendor.t(answerList.value[index].hazardPayload.formData.title),
F: common_vendor.t((_a = common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS)[answerList.value[index].hazardPayload.formData.level]) == null ? void 0 : _a.title),
G: answerList.value[index].hazardPayload.formData.level === 0 ? 1 : "",
H: answerList.value[index].hazardPayload.formData.level === 1 ? 1 : "",
I: answerList.value[index].hazardPayload.formData.level === 2 ? 1 : "",
J: common_vendor.t(((_b = common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS)[answerList.value[index].hazardPayload.formData.source]) == null ? void 0 : _b.title) || "-"),
K: common_vendor.t(answerList.value[index].hazardPayload.address || "-"),
L: common_vendor.t(answerList.value[index].hazardPayload.formData.description || "-"),
M: answerList.value[index].hazardPayload.fileList.length > 0
}, answerList.value[index].hazardPayload.fileList.length > 0 ? {
N: common_vendor.t(answerList.value[index].hazardPayload.fileList.length)
} : {}, {
O: common_vendor.o(($event) => openHazardPopup(index), "check-item-" + index),
P: common_vendor.o(($event) => clearHazard(index), "check-item-" + index)
})) : {}, {
Q: "1b3bf21b-3-" + i0,
R: common_vendor.o(($event) => answerList.value[index].remark = $event, "check-item-" + index),
S: common_vendor.p({
placeholder: "请输入备注信息",
modelValue: answerList.value[index].remark
})
}), {
T: "check-item-" + index,
U: "check-item-" + index,
V: isItemSubmitted(item) ? 1 : ""
});
}),
m: pendingSubmitCount.value > 0
}, pendingSubmitCount.value > 0 ? {
n: common_vendor.t(pendingSubmitCount.value),
o: common_vendor.o(handleSubmitAll)
} : {}), {
b: !checkItemList.value.length,
p: activeHazardIndex.value >= 0
}, activeHazardIndex.value >= 0 ? {
q: common_vendor.sr(hazardFormRef, "1b3bf21b-4", {
"k": "hazardFormRef"
}),
r: common_vendor.o(onHazardConfirm),
s: common_vendor.o(($event) => showHazardPopup.value = $event),
t: common_vendor.o(($event) => editingHazardPayload.value = $event),
v: common_vendor.p({
title: "填写隐患信息",
mode: "collect",
["body-height"]: "60vh",
["extra-params"]: hazardFormExtraParams.value,
show: showHazardPopup.value,
modelValue: editingHazardPayload.value
})
} : {}, {
w: common_vendor.t(checkItemList.value.length),
x: common_vendor.f(checkItemList.value, (item, index, i0) => {
return {
a: common_vendor.t(index + 1),
b: "sheet-nav-" + index,
c: common_vendor.n(getSheetCellClass(index)),
d: common_vendor.o(($event) => scrollToItem(index), "sheet-nav-" + index)
};
}),
y: common_vendor.t(submittedCount.value),
z: common_vendor.t(pendingSubmitCount.value),
A: common_vendor.t(uncheckedCount.value),
B: pendingSubmitCount.value > 0
}, pendingSubmitCount.value > 0 ? {
C: common_vendor.o(handleSheetSubmit)
} : {}, {
D: common_vendor.o(closeCheckSheet),
E: common_vendor.p({
show: showCheckSheet.value,
mode: "bottom",
round: "20",
["safe-area-inset-bottom"]: true
}),
F: common_vendor.gei(_ctx, "")
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1b3bf21b"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionresult/detail.js.map

View File

@@ -0,0 +1,11 @@
{
"navigationBarTitleText": "排查详情",
"usingComponents": {
"up-icon": "../../uni_modules/uview-plus/components/u-icon/u-icon",
"u-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"u-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"hazard-form-popup": "../../components/hazard/HazardFormPopup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,455 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-1b3bf21b {
min-height: 100vh;
background: #EBF2FC;
padding-bottom: 40rpx;
}
.page-content.data-v-1b3bf21b {
padding-bottom: 40rpx;
}
.empty-tip.data-v-1b3bf21b {
font-size: 28rpx;
}
.sheet-header.data-v-1b3bf21b {
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
}
.float-nav.data-v-1b3bf21b {
position: -webkit-sticky;
position: sticky;
top: 0;
left: 0;
right: 0;
z-index: 100;
background: #fff;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
padding: 20rpx 24rpx;
}
.float-nav-body.data-v-1b3bf21b {
display: flex;
align-items: center;
gap: 20rpx;
}
.float-nav-main.data-v-1b3bf21b {
flex: 1;
min-width: 0;
}
.sheet-nav-btn.data-v-1b3bf21b {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 72rpx;
height: 72rpx;
background: #eef3ff;
border-radius: 16rpx;
}
.question-card.data-v-1b3bf21b {
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
}
.question-card--submitted.data-v-1b3bf21b {
background: #f8faf8;
border: 1rpx solid #e8f5e9;
}
.question-header-row.data-v-1b3bf21b {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
}
.question-index.data-v-1b3bf21b {
display: inline-block;
padding: 4rpx 16rpx;
font-size: 24rpx;
color: #2667E9;
background: #EEF3FF;
border-radius: 8rpx;
}
.submitted-tag.data-v-1b3bf21b {
padding: 4rpx 16rpx;
font-size: 22rpx;
color: #52c41a;
background: #f6ffed;
border: 1rpx solid #b7eb8f;
border-radius: 8rpx;
white-space: nowrap;
}
.pending-tag.data-v-1b3bf21b {
padding: 4rpx 16rpx;
font-size: 22rpx;
color: #2667e9;
background: #eef3ff;
border: 1rpx solid #adc6ff;
border-radius: 8rpx;
white-space: nowrap;
}
.readonly-block.data-v-1b3bf21b,
.answer-panel.data-v-1b3bf21b {
padding: 20rpx;
background: #f7f8fa;
border: 1rpx solid #e8e8e8;
border-radius: 12rpx;
}
.readonly-row.data-v-1b3bf21b {
display: flex;
align-items: center;
gap: 16rpx;
margin-bottom: 12rpx;
font-size: 26rpx;
line-height: 1.6;
}
.readonly-row.data-v-1b3bf21b:last-child {
margin-bottom: 0;
}
.readonly-row--stack.data-v-1b3bf21b {
align-items: flex-start;
}
.hazard-summary.data-v-1b3bf21b {
margin-top: 16rpx;
padding-top: 16rpx;
border-top: 1rpx dashed #e0e0e0;
}
.readonly-label.data-v-1b3bf21b {
flex-shrink: 0;
color: #999;
min-width: 120rpx;
}
.readonly-value.data-v-1b3bf21b {
flex: 1;
color: #333;
word-break: break-all;
}
.result-tag.data-v-1b3bf21b {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: 500;
line-height: 1.4;
white-space: nowrap;
}
.result-tag--normal.data-v-1b3bf21b {
background: #f6ffed;
border: 1rpx solid #b7eb8f;
color: #52c41a;
}
.result-tag--abnormal.data-v-1b3bf21b {
background: #fff1f0;
border: 1rpx solid #ffa39e;
color: #f5222d;
}
.result-tag--na.data-v-1b3bf21b {
background: #f5f5f5;
border: 1rpx solid #d9d9d9;
color: #8c8c8c;
}
.view-hazard-btn.data-v-1b3bf21b {
margin-top: 20rpx;
width: 100%;
height: 72rpx;
line-height: 72rpx;
font-size: 28rpx;
color: #2667e9;
background: #fff;
border: 1rpx solid #adc6ff;
border-radius: 12rpx;
}
.view-hazard-btn.data-v-1b3bf21b::after {
border: none;
}
.progress-text.data-v-1b3bf21b {
display: flex;
align-items: baseline;
margin-bottom: 16rpx;
}
.progress-text .current-index.data-v-1b3bf21b {
font-size: 26rpx;
font-weight: bold;
color: #2667E9;
}
.progress-text .total-count.data-v-1b3bf21b {
font-size: 24rpx;
color: #999;
}
.progress-line.data-v-1b3bf21b {
height: 12rpx;
background: #E5E5E5;
border-radius: 6rpx;
overflow: hidden;
}
.progress-inner.data-v-1b3bf21b {
height: 100%;
background: linear-gradient(90deg, #2667E9, #5B9BFF);
border-radius: 6rpx;
transition: width 0.3s ease;
}
.hazard-section.data-v-1b3bf21b {
border-top: 1rpx solid #eee;
padding-top: 20rpx;
}
.hazard-tip.data-v-1b3bf21b {
display: flex;
align-items: center;
padding: 16rpx 20rpx;
background: #FFF7E6;
border: 1rpx solid #FFE7BA;
border-radius: 8rpx;
margin-bottom: 20rpx;
}
.hazard-tip .text-orange.data-v-1b3bf21b {
color: #FA8C16;
font-size: 26rpx;
}
.hazard-btn.data-v-1b3bf21b {
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
border: 2rpx dashed #2667E9;
border-radius: 12rpx;
background: #F5F9FF;
}
.hazard-btn .text-blue.data-v-1b3bf21b {
color: #2667E9;
font-size: 28rpx;
}
.hazard-card.data-v-1b3bf21b {
background: #F5F9FF;
border: 1rpx solid #D6E4FF;
border-radius: 12rpx;
overflow: hidden;
}
.hazard-card .card-header.data-v-1b3bf21b {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
border-bottom: 1rpx solid #E8E8E8;
background: #fff;
}
.hazard-card .card-body.data-v-1b3bf21b {
padding: 20rpx;
}
.hazard-card .card-body .info-row.data-v-1b3bf21b {
display: flex;
margin-bottom: 12rpx;
font-size: 26rpx;
}
.hazard-card .card-body .info-row.data-v-1b3bf21b:last-child {
margin-bottom: 0;
}
.hazard-card .card-body .info-row .text-gray.data-v-1b3bf21b {
flex-shrink: 0;
color: #999;
}
.hazard-card .card-body .info-row .description-text.data-v-1b3bf21b {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.hazard-card .card-footer.data-v-1b3bf21b {
display: flex;
border-top: 1rpx solid #E8E8E8;
background: #fff;
}
.hazard-card .card-footer button.data-v-1b3bf21b {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
border-radius: 0;
}
.hazard-card .card-footer button.data-v-1b3bf21b::after {
border: none;
}
.hazard-card .card-footer .btn-edit.data-v-1b3bf21b {
background: #fff;
color: #2667E9;
border-right: 1rpx solid #E8E8E8;
}
.hazard-card .card-footer .btn-clear.data-v-1b3bf21b {
background: #fff;
color: #F56C6C;
}
.level-tag.data-v-1b3bf21b {
padding: 4rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
}
.level-minor.data-v-1b3bf21b {
background: #F6FFED;
border: 2rpx solid #B7EB8F;
color: #52C41A;
}
.level-normal.data-v-1b3bf21b {
background: #FFF7E6;
border: 2rpx solid #FFD591;
color: #FA8C16;
}
.level-major.data-v-1b3bf21b {
background: #FFF1F0;
border: 2rpx solid #FFA39E;
color: #F5222D;
}
.submit-btn.data-v-1b3bf21b {
margin-bottom: 40rpx;
}
.draft-banner.data-v-1b3bf21b {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 24rpx;
font-size: 24rpx;
color: #fa8c16;
background: #fff7eb;
border: 1rpx solid #ffe4cc;
border-radius: 12rpx;
}
.draft-banner-left.data-v-1b3bf21b {
display: flex;
align-items: center;
flex: 1;
min-width: 0;
}
.draft-banner-icon.data-v-1b3bf21b {
margin-right: 10rpx;
}
.draft-banner-action.data-v-1b3bf21b {
flex-shrink: 0;
margin-left: 16rpx;
color: #2667e9;
font-weight: bold;
}
.check-sheet-popup.data-v-1b3bf21b {
padding: 32rpx 32rpx calc(24rpx + env(safe-area-inset-bottom));
background: #fff;
}
.check-sheet-header.data-v-1b3bf21b {
margin-bottom: 24rpx;
}
.check-sheet-title.data-v-1b3bf21b {
font-size: 34rpx;
font-weight: bold;
color: #333;
}
.check-sheet-subtitle.data-v-1b3bf21b {
margin-top: 8rpx;
font-size: 26rpx;
color: #999;
}
.check-sheet-grid-wrap.data-v-1b3bf21b {
max-height: 52vh;
}
.check-sheet-grid.data-v-1b3bf21b {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
padding-bottom: 8rpx;
}
.check-sheet-cell.data-v-1b3bf21b {
width: calc((100% - 80rpx) / 5);
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #666;
background: #fff;
border: 2rpx solid #e5e5e5;
border-radius: 12rpx;
box-sizing: border-box;
}
.check-sheet-cell--pending.data-v-1b3bf21b {
color: #fff;
background: #2667e9;
border-color: #2667e9;
}
.check-sheet-cell--submitted.data-v-1b3bf21b {
color: #52c41a;
background: #f6ffed;
border-color: #b7eb8f;
}
.check-sheet-footer.data-v-1b3bf21b {
display: flex;
align-items: center;
justify-content: space-between;
gap: 24rpx;
margin-top: 28rpx;
padding-top: 24rpx;
border-top: 1rpx solid #f0f0f0;
}
.check-sheet-legend.data-v-1b3bf21b {
display: flex;
align-items: center;
gap: 32rpx;
flex: 1;
min-width: 0;
font-size: 26rpx;
color: #666;
}
.check-sheet-submit-btn.data-v-1b3bf21b {
flex-shrink: 0;
height: 72rpx;
line-height: 72rpx;
padding: 0 36rpx;
margin: 0;
font-size: 28rpx;
font-weight: 500;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668ea 100%);
border-radius: 36rpx;
border: none;
box-shadow: 0 4rpx 16rpx rgba(38, 104, 234, 0.3);
}
.check-sheet-submit-btn.data-v-1b3bf21b::after {
border: none;
}
.legend-item.data-v-1b3bf21b {
display: flex;
align-items: center;
gap: 12rpx;
}
.legend-dot.data-v-1b3bf21b {
width: 28rpx;
height: 28rpx;
border-radius: 8rpx;
box-sizing: border-box;
}
.legend-dot--submitted.data-v-1b3bf21b {
background: #f6ffed;
border: 2rpx solid #b7eb8f;
}
.legend-dot--pending.data-v-1b3bf21b {
background: #2667e9;
border: 2rpx solid #2667e9;
}
.legend-dot--todo.data-v-1b3bf21b {
background: #fff;
border: 2rpx solid #e5e5e5;
}

View File

@@ -0,0 +1,138 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
if (!Array) {
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
_easycom_u_navbar2();
}
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
if (!Math) {
_easycom_u_navbar();
}
const _sfc_main = {
__name: "list",
setup(__props) {
const loading = common_vendor.ref(true);
const checkPlanData = common_vendor.ref([]);
const tableId = common_vendor.ref("");
const planName = common_vendor.ref("");
const listParams = {
pageNum: 1,
pageSize: 100,
name: ""
};
const formatDate = (dateStr) => {
if (!dateStr)
return "";
return String(dateStr).split(" ")[0];
};
const formatProgress = (progress) => {
const num = Number(progress);
if (Number.isNaN(num))
return 0;
return Math.min(100, Math.max(0, num));
};
const fetchList = async () => {
var _a;
if (!tableId.value) {
loading.value = false;
checkPlanData.value = [];
return;
}
loading.value = true;
try {
const res = await request_api.getPlanTableDetail({
...listParams,
tableId: tableId.value
});
if (res.code === 0) {
checkPlanData.value = ((_a = res.data) == null ? void 0 : _a.records) || [];
} else {
common_vendor.index.showToast({ title: res.msg || "获取检查清单失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/list.vue:138", "获取检查清单失败:", error);
common_vendor.index.showToast({ title: "获取检查清单失败", icon: "none" });
} finally {
loading.value = false;
}
};
const startCheck = (item) => {
const oneTableId = item.id;
const taskDate = formatDate(item.taskDate);
if (!oneTableId || !taskDate) {
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
return;
}
const name = item.name || planName.value || "";
const tableIdQuery = tableId.value ? `&tableId=${tableId.value}` : "";
common_vendor.index.navigateTo({
url: `/pages/Inspectionresult/detail?oneTableId=${oneTableId}&taskDate=${encodeURIComponent(taskDate)}&name=${encodeURIComponent(name)}${tableIdQuery}`
});
};
common_vendor.onLoad((options) => {
if (options.tableId) {
tableId.value = options.tableId;
}
if (options.name) {
planName.value = decodeURIComponent(options.name);
}
});
common_vendor.onShow(() => {
fetchList();
});
const goHome = () => {
common_vendor.index.switchTab({
url: "/pages/index/index"
});
};
common_vendor.onBackPress(() => {
goHome();
return true;
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(goHome),
b: common_vendor.p({
title: "检查列表",
placeholder: true,
safeAreaInsetTop: true,
bgColor: "#3375e6",
titleColor: "#ffffff",
leftIconColor: "#ffffff",
autoBack: false
}),
c: loading.value
}, loading.value ? {} : !tableId.value ? {} : checkPlanData.value.length === 0 ? {} : {
f: common_vendor.f(checkPlanData.value, (item, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(item.name || planName.value || "检查任务"),
b: common_vendor.t(item.runModeName),
c: common_vendor.t(item.cycle),
d: item.taskDate
}, item.taskDate ? {
e: common_vendor.t(formatDate(item.taskDate))
} : {}, {
f: common_vendor.t(formatDate(item.planStartTime)),
g: common_vendor.t(formatDate(item.planEndTime)),
h: formatProgress(item.progress) + "%",
i: common_vendor.t(formatProgress(item.progress)),
j: common_vendor.t(item.totalCount ?? 0),
k: common_vendor.t(item.pendingCount ?? 0),
l: common_vendor.t(item.unusualNum ?? 0),
m: common_vendor.t(item.finishedCount ?? 0),
n: common_vendor.o(($event) => startCheck(item), item.id || item.taskDate),
o: item.id || item.taskDate
});
})
}, {
d: !tableId.value,
e: checkPlanData.value.length === 0,
g: common_vendor.gei(_ctx, "")
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-52eec896"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionresult/list.js.map

View File

@@ -0,0 +1,7 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "检查列表",
"usingComponents": {
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['page', 'data-v-52eec896', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><u-navbar wx:if="{{b}}" class="data-v-52eec896" virtualHostClass="data-v-52eec896" bindleftClick="{{a}}" u-i="52eec896-0" bind:__l="__l" u-p="{{b}}"/><view class="page-content padding data-v-52eec896"><view wx:if="{{c}}" class="empty-tip text-gray text-center padding data-v-52eec896">加载中...</view><view wx:elif="{{d}}" class="empty-tip text-gray text-center padding data-v-52eec896"> 请从首页检查计划进入 </view><view wx:elif="{{e}}" class="empty-tip text-gray text-center padding data-v-52eec896"> 暂无检查任务 </view><block wx:else><view wx:for="{{f}}" wx:for-item="item" wx:key="o" class="plan-card margin-bottom data-v-52eec896"><view class="plan-header data-v-52eec896"><text class="plan-header-title data-v-52eec896">{{item.a}}</text></view><view class="plan-body data-v-52eec896"><view class="flex data-v-52eec896"><view class="border-border margin-right-xs data-v-52eec896">{{item.b}}完成</view><view class="border-border data-v-52eec896">{{item.c}}</view></view><view wx:if="{{item.d}}" class="flex text-gray margin-top data-v-52eec896"><view class="data-v-52eec896">任务日期:</view><view class="data-v-52eec896" style="color:#333333">{{item.e}}</view></view><view class="flex text-gray margin-top data-v-52eec896"><view class="data-v-52eec896">计划时间:</view><view class="data-v-52eec896" style="color:#333333">{{item.f}}至{{item.g}}</view></view><view class="flex margin-top align-center data-v-52eec896"><view class="data-v-52eec896" style="color:#B5B5B5">完成进度:</view><view class="flex align-center margin-left-sm data-v-52eec896"><view class="cu-progress round data-v-52eec896"><view class="bg-green data-v-52eec896" style="{{'width:' + item.h}}"></view></view><text class="margin-left-sm data-v-52eec896">{{item.i}}%</text></view></view><view class="plan-stats margin-top data-v-52eec896"><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-orange data-v-52eec896">{{item.j}}</view><view class="plan-stat-label data-v-52eec896">总检项</view></view><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-yellow data-v-52eec896">{{item.k}}</view><view class="plan-stat-label data-v-52eec896">待排查</view></view><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-red data-v-52eec896">{{item.l}}</view><view class="plan-stat-label data-v-52eec896">异常数</view></view><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-blue data-v-52eec896">{{item.m}}</view><view class="plan-stat-label data-v-52eec896">已完成</view></view></view><view class="margin-top margin-bottom flex justify-end data-v-52eec896"><button class="cu-btn round lg bg-blue data-v-52eec896" catchtap="{{item.n}}"> 检查处置 </button></view></view></view></block></view></view>

View File

@@ -0,0 +1,105 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-52eec896 {
min-height: 100vh;
background: #EBF2FC;
}
.empty-tip.data-v-52eec896 {
font-size: 28rpx;
}
.plan-card.data-v-52eec896 {
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.06);
}
.plan-header.data-v-52eec896 {
background: linear-gradient(135deg, #4A90E2 0%, #2667E9 100%);
padding: 24rpx 30rpx;
display: flex;
align-items: center;
}
.plan-header .plan-header-title.data-v-52eec896 {
color: #fff;
font-size: 30rpx;
font-weight: bold;
}
.plan-body.data-v-52eec896 {
padding: 24rpx 30rpx 10rpx 30rpx;
background: #fff;
}
.plan-stats.data-v-52eec896 {
display: flex;
background: #F5F7FA;
border-radius: 12rpx;
border: 1rpx solid #E8ECF0;
overflow: hidden;
}
.plan-stats .plan-stat-item.data-v-52eec896 {
flex: 1;
text-align: center;
padding: 20rpx 0;
border-right: 1rpx solid #E8ECF0;
}
.plan-stats .plan-stat-item.data-v-52eec896:last-child {
border-right: none;
}
.plan-stats .plan-stat-num.data-v-52eec896 {
font-size: 36rpx;
font-weight: bold;
}
.plan-stats .plan-stat-label.data-v-52eec896 {
font-size: 24rpx;
color: #666;
margin-top: 8rpx;
}
.cu-progress.data-v-52eec896 {
width: 300rpx;
height: 20rpx;
background: #ebeef5;
border-radius: 100rpx;
overflow: hidden;
}
.cu-progress view.data-v-52eec896 {
height: 100%;
border-radius: 100rpx;
transition: width 0.3s ease;
}
.bg-green.data-v-52eec896 {
background: #2667E9;
}
.border-border.data-v-52eec896 {
padding: 10rpx;
background: #EEF3FF;
border-radius: 4rpx;
border: 2rpx solid #AAC5FC;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
color: #2667E9;
}

View File

@@ -158,7 +158,7 @@ const _sfc_main = {
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_assets._imports_0$1,
a: common_assets._imports_0$2,
b: common_vendor.t(searchForm.startDate || "请选择"),
c: common_vendor.n(searchForm.startDate ? "date-value" : "date-placeholder"),
d: common_vendor.o(($event) => showStartDatePicker.value = true),
@@ -190,7 +190,7 @@ const _sfc_main = {
modelValue: searchForm.deptName
}),
t: common_vendor.o(handleSearch),
v: common_assets._imports_1,
v: common_assets._imports_1$1,
w: common_vendor.t(statistics.total),
x: common_vendor.t(statistics.overdue),
y: common_vendor.t(statistics.onTimeCompleted),

View File

@@ -45,8 +45,20 @@ const _sfc_main = {
const onSwitchChange = (e) => {
workdaySwitch.value = e.detail.value;
};
const startDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
const endDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
const getTodayTimestamp = () => {
const now = /* @__PURE__ */ new Date();
return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
};
const todayMinDate = common_vendor.computed(() => getTodayTimestamp());
const endDateMinDate = common_vendor.computed(() => {
if (formData.startDate) {
const [year, month, day] = formData.startDate.split("-").map(Number);
return new Date(year, month - 1, day).getTime();
}
return getTodayTimestamp();
});
const startDateValue = common_vendor.ref(getTodayTimestamp());
const endDateValue = common_vendor.ref(getTodayTimestamp());
const showDeptPicker = common_vendor.ref(false);
const showTypePicker = common_vendor.ref(false);
const showModePicker = common_vendor.ref(false);
@@ -103,7 +115,7 @@ const _sfc_main = {
executorList.value = res.data || [];
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:505", "获取部门用户失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:522", "获取部门用户失败:", error);
}
};
const toggleExecutorSelect = (item) => {
@@ -132,7 +144,7 @@ const _sfc_main = {
initDeptCascader(res.data);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:543", "获取部门树失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:560", "获取部门树失败:", error);
}
};
const initDeptCascader = (data) => {
@@ -184,19 +196,42 @@ const _sfc_main = {
}
showCyclePicker.value = false;
};
const formatDateTime = (timestamp) => {
const formatDate = (timestamp) => {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
return `${year}-${month}-${day}`;
};
const parseDateValue = (dateStr) => {
if (!dateStr)
return 0;
const [datePart] = dateStr.split(" ");
const [year, month, day] = datePart.split("-").map(Number);
return new Date(year, month - 1, day).getTime();
};
const openStartDatePicker = () => {
const today = getTodayTimestamp();
if (startDateValue.value < today) {
startDateValue.value = today;
}
showStartDatePicker.value = true;
};
const openEndDatePicker = () => {
const minDate = endDateMinDate.value;
if (endDateValue.value < minDate) {
endDateValue.value = minDate;
}
showEndDatePicker.value = true;
};
const onStartDateConfirm = (e) => {
const selectedDate = formatDateTime(e.value);
if (formData.endDate && new Date(selectedDate) > new Date(formData.endDate)) {
const selectedDate = formatDate(e.value);
const todayStr = formatDate(getTodayTimestamp());
if (selectedDate < todayStr) {
common_vendor.index.showToast({ title: "开始时间不能早于今天", icon: "none" });
return;
}
if (formData.endDate && parseDateValue(selectedDate) > parseDateValue(formData.endDate)) {
common_vendor.index.showToast({ title: "开始时间不能晚于结束时间", icon: "none" });
return;
}
@@ -204,8 +239,8 @@ const _sfc_main = {
showStartDatePicker.value = false;
};
const onEndDateConfirm = (e) => {
const selectedDate = formatDateTime(e.value);
if (formData.startDate && new Date(selectedDate) < new Date(formData.startDate)) {
const selectedDate = formatDate(e.value);
if (formData.startDate && parseDateValue(selectedDate) < parseDateValue(formData.startDate)) {
common_vendor.index.showToast({ title: "结束时间不能早于开始时间", icon: "none" });
return;
}
@@ -249,7 +284,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:700", "删除检查项失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:740", "删除检查项失败:", error);
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
}
} else {
@@ -325,7 +360,7 @@ const _sfc_main = {
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:787", "获取法规列表失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:827", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
@@ -405,7 +440,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:887", "添加检查项失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:927", "添加检查项失败:", error);
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
}
};
@@ -454,7 +489,7 @@ const _sfc_main = {
hasMoreLibrary.value = libraryList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:947", "获取检查库列表失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:987", "获取检查库列表失败:", error);
} finally {
libraryLoading.value = false;
}
@@ -557,7 +592,7 @@ const _sfc_main = {
selectedLibraries.value = [];
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1067", "获取检查库详情失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1107", "获取检查库详情失败:", error);
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
}
};
@@ -590,7 +625,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请选择计划时间", icon: "none" });
return;
}
if (new Date(formData.endDate) < new Date(formData.startDate)) {
if (parseDateValue(formData.endDate) < parseDateValue(formData.startDate)) {
common_vendor.index.showToast({ title: "结束时间不能早于开始时间", icon: "none" });
return;
}
@@ -634,8 +669,8 @@ const _sfc_main = {
// 从检查库选择的库id数组
cycle: cycleMap[formData.cycleName] || 1,
isWeekend: workdaySwitch.value ? 1 : 2,
planStartTime: formData.startDate,
planEndTime: formData.endDate
planStartTime: `${formData.startDate} 00:00:00`,
planEndTime: `${formData.endDate} 23:59:59`
};
if (formData.modeName === "指定人员" && formData.executorIds.length > 0) {
params.executorId = formData.executorIds[0];
@@ -654,7 +689,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1185", "保存失败:", error);
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1225", "保存失败:", error);
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
}
};
@@ -727,26 +762,28 @@ const _sfc_main = {
N: common_vendor.o(onSwitchChange),
O: common_vendor.t(formData.startDate || "请选择开始时间"),
P: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"),
Q: common_vendor.o(($event) => showStartDatePicker.value = true),
Q: common_vendor.o(openStartDatePicker),
R: common_vendor.o(onStartDateConfirm),
S: common_vendor.o(($event) => showStartDatePicker.value = false),
T: common_vendor.o(($event) => showStartDatePicker.value = false),
U: common_vendor.o(($event) => startDateValue.value = $event),
V: common_vendor.p({
show: showStartDatePicker.value,
mode: "datetime",
mode: "date",
minDate: todayMinDate.value,
modelValue: startDateValue.value
}),
W: common_vendor.t(formData.endDate || "请选择结束时间"),
X: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"),
Y: common_vendor.o(($event) => showEndDatePicker.value = true),
Y: common_vendor.o(openEndDatePicker),
Z: common_vendor.o(onEndDateConfirm),
aa: common_vendor.o(($event) => showEndDatePicker.value = false),
ab: common_vendor.o(($event) => showEndDatePicker.value = false),
ac: common_vendor.o(($event) => endDateValue.value = $event),
ad: common_vendor.p({
show: showEndDatePicker.value,
mode: "datetime",
mode: "date",
minDate: endDateMinDate.value,
modelValue: endDateValue.value
}),
ae: common_vendor.t(checkItemCount.value),

View File

@@ -1,32 +1,20 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_three_one_api_area = require("../../request/three_one_api/area.js");
require("../../request/request.js");
const utils_upload = require("../../utils/upload.js");
if (!Array) {
const _easycom_up_choose2 = common_vendor.resolveComponent("up-choose");
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_choose2 + _easycom_up_upload2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
}
const _easycom_up_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.js";
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_up_choose + _easycom_up_upload + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
HazardFormPopup();
}
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
const _sfc_main = {
__name: "Inspection",
setup(__props) {
const showAddPopup = common_vendor.ref(false);
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const levelChooseRef = common_vendor.ref(null);
const taskId = common_vendor.ref("");
const checkPointId = common_vendor.ref("");
const hazardExtraParams = common_vendor.computed(() => ({
taskId: taskId.value,
checkPointId: checkPointId.value
}));
const userRole = common_vendor.ref("");
const canAcceptance = common_vendor.computed(() => {
return userRole.value === "admin" || userRole.value === "manage";
@@ -37,15 +25,12 @@ const _sfc_main = {
if (userInfoStr) {
const userInfo = JSON.parse(userInfoStr);
userRole.value = userInfo.role || "";
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:286", "当前用户角色:", userRole.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:289", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:100", "获取用户信息失败:", error);
}
};
getUserRole();
const taskId = common_vendor.ref("");
const checkPointId = common_vendor.ref("");
const fetchTaskInfo = async (oneTableId) => {
try {
const startRes = await request_api.enterCheckPlan(oneTableId);
@@ -58,7 +43,7 @@ const _sfc_main = {
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:314", "获取任务信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:117", "获取任务信息失败:", error);
}
};
common_vendor.onLoad((options) => {
@@ -66,259 +51,6 @@ const _sfc_main = {
fetchTaskInfo(options.id);
}
});
const formData = common_vendor.reactive({
title: "",
// 隐患标题
level: 0,
// 隐患等级索引
description: "",
// 隐患描述
tagIndex: 0,
// 隐患标签索引
source: 0,
// 隐患来源
regulationId: null,
// 法律依据ID
regulationName: ""
// 法律依据名称(显示用)
});
common_vendor.ref(0);
const lng = common_vendor.ref(0);
const lat = common_vendor.ref(0);
const selectedAddress = common_vendor.ref("");
const showAreaPicker = common_vendor.ref(false);
const areaList = common_vendor.ref([]);
const selectedAreaId = common_vendor.ref("");
const selectedAreaName = common_vendor.ref("");
const tempAreaId = common_vendor.ref("");
const showLawPopup = common_vendor.ref(false);
const lawKeyword = common_vendor.ref("");
const selectedLawId = common_vendor.ref(null);
const selectedLawName = common_vendor.ref("");
const lawList = common_vendor.ref([]);
const lawLoading = common_vendor.ref(false);
const lawPageNum = common_vendor.ref(1);
const lawPageSize = common_vendor.ref(10);
const hasMoreLaw = common_vendor.ref(true);
const openLawPopup = () => {
showLawPopup.value = true;
if (lawList.value.length === 0) {
fetchRegulationList();
}
};
const fetchRegulationList = async (isLoadMore = false) => {
if (lawLoading.value)
return;
lawLoading.value = true;
try {
const params = {
pageNum: lawPageNum.value,
pageSize: lawPageSize.value,
status: 1
// 启用状态
};
if (lawKeyword.value && lawKeyword.value.trim()) {
params.keyword = lawKeyword.value.trim();
}
const res = await request_api.getRegulationList(params);
if (res.code === 0) {
const records = res.data.records || res.data || [];
if (isLoadMore) {
lawList.value = [...lawList.value, ...records];
} else {
lawList.value = records;
}
const total = res.data.total || 0;
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:397", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
};
const searchRegulation = () => {
lawPageNum.value = 1;
lawList.value = [];
hasMoreLaw.value = true;
fetchRegulationList();
};
const loadMoreLaw = () => {
if (!hasMoreLaw.value || lawLoading.value)
return;
lawPageNum.value++;
fetchRegulationList(true);
};
const selectLaw = (item) => {
selectedLawId.value = item.id;
selectedLawName.value = item.depict || item.keyword || "";
};
const confirmLaw = () => {
if (selectedLawId.value) {
formData.regulationId = selectedLawId.value;
formData.regulationName = selectedLawName.value;
}
showLawPopup.value = false;
};
const fetchAreaList = async () => {
try {
const res = await request_three_one_api_area.getAreaList();
if (res.code === 0 && res.data && res.data.records) {
areaList.value = res.data.records;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:441", "获取区域列表失败:", error);
}
};
fetchAreaList();
const confirmAreaSelect = () => {
if (tempAreaId.value) {
selectedAreaId.value = tempAreaId.value;
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
selectedAreaName.value = selected ? selected.name : "";
}
showAreaPicker.value = false;
};
const chooseLocation = () => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:457", "chooseLocation called");
showAddPopup.value = false;
setTimeout(() => {
common_vendor.index.getLocation({
type: "gcj02",
// 使用国测局坐标系(腾讯地图使用)
success: (locationRes) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:466", "获取当前位置成功:", locationRes);
common_vendor.index.chooseLocation({
latitude: locationRes.latitude,
longitude: locationRes.longitude,
success: (res) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:472", "选择位置成功:", 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:481", "选择位置失败:", err);
showAddPopup.value = true;
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({
title: "选择位置失败",
icon: "none"
});
}
}
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:495", "获取当前位置失败:", err);
common_vendor.index.chooseLocation({
success: (res) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:499", "选择位置成功:", 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:506", "选择位置失败:", chooseErr);
showAddPopup.value = true;
if (chooseErr.errMsg && chooseErr.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({
title: "选择位置失败",
icon: "none"
});
}
}
});
}
});
}, 300);
};
const handleAdd = async () => {
var _a, _b;
if (!formData.title) {
common_vendor.index.showToast({
title: "请输入隐患标题",
icon: "none"
});
return;
}
if (fileList1.value.length === 0) {
common_vendor.index.showToast({
title: "请上传隐患图片/视频",
icon: "none"
});
return;
}
const attachments = fileList1.value.filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file));
const selectedTag = tagOptions.value[formData.tagIndex];
const tagId = selectedTag ? selectedTag.id : null;
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:546", "innnn", sourceOptions);
const params = {
title: formData.title,
//标题
level: ((_a = levelOptions.value[formData.level]) == null ? void 0 : _a.id) || 2,
// 2.一般隐患 3.重大隐患
lng: lng.value || 0,
//经度
lat: lat.value || 0,
//纬度
address: selectedAddress.value || "",
//详细地址
areaId: selectedAreaId.value || null,
//隐患区域ID
description: formData.description || "",
//隐患描述
tagId,
//隐患标签ID
taskId: taskId.value,
//关联任务ID
checkPointId: checkPointId.value,
//关联检查点ID
source: ((_b = sourceOptions.value[formData.source]) == null ? void 0 : _b.title) || "",
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
attachments,
//附件列表(图片/视频)
regulationId: formData.regulationId || null
// 法律依据ID
};
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:565", "提交的参数:", params);
try {
const res = await request_api.addHiddenDanger(params);
if (res.code === 0) {
common_vendor.index.showToast({
title: "新增成功",
icon: "success"
});
showAddPopup.value = false;
formData.title = "";
formData.level = 0;
formData.description = "";
formData.tagIndex = 0;
selectedAddress.value = "";
selectedAreaId.value = "";
selectedAreaName.value = "";
fileList1.value = [];
formData.regulationId = null;
formData.regulationName = "";
selectedLawId.value = null;
selectedLawName.value = "";
fetchHiddenDangerList();
} else {
common_vendor.index.showToast({
title: res.msg || "新增失败",
icon: "none"
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:598", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
const hiddenDangerList = common_vendor.ref([]);
const fetchHiddenDangerList = async () => {
try {
@@ -332,7 +64,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:619", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:140", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -342,6 +74,13 @@ const _sfc_main = {
common_vendor.onShow(() => {
fetchHiddenDangerList();
});
const openAddPopup = () => {
showAddPopup.value = true;
};
const onHazardAddSuccess = () => {
showAddPopup.value = false;
fetchHiddenDangerList();
};
const details = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
@@ -369,128 +108,6 @@ const _sfc_main = {
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
});
};
const fileList1 = common_vendor.ref([]);
const uploadInstance = common_vendor.getCurrentInstance();
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList1, {
watermark: {
canvasId: "watermarkCanvas",
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance: uploadInstance
}
});
const aiAnalyzing = common_vendor.ref(false);
const handleAiAnalyze = async () => {
const imageFiles = fileList1.value.filter((f) => {
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
});
if (imageFiles.length === 0) {
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
return;
}
const fullImageUrl = imageFiles[0].url;
aiAnalyzing.value = true;
try {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:690", "开始调用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:698", "AI分析结果:", aiData);
if (aiData.title)
formData.title = aiData.title;
if (aiData.description)
formData.description = aiData.description;
if (aiData.level) {
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 0, "一般隐患": 0, "重大": 1, "重大隐患": 1 };
const levelIndex = levelMap[aiData.level];
if (levelIndex !== void 0) {
formData.level = levelIndex;
common_vendor.nextTick$1(() => {
if (levelChooseRef.value && levelChooseRef.value.$data) {
levelChooseRef.value.$data.currentIndex = levelIndex;
}
});
}
}
common_vendor.index.showToast({ title: "AI分析完成已自动填充", icon: "success", duration: 2e3 });
} else {
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:721", "AI分析接口调用失败:", error);
common_vendor.index.showToast({ title: "AI分析失败请重试", icon: "none" });
} finally {
aiAnalyzing.value = false;
}
};
const tagOptions = common_vendor.ref([]);
const fetchTagOptions = async () => {
try {
const res = await request_api.getHiddenDangerLabelList();
if (res.code === 0) {
tagOptions.value = res.data.map((item) => ({
id: item.id,
title: item.name
}));
} else {
common_vendor.index.showToast({
title: res.msg || "获取标签列表失败",
icon: "none"
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:744", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
fetchTagOptions();
const levelOptions = common_vendor.ref([
// {
// id: 1,
// title: '轻微隐患'
// },
{
id: 2,
title: "一般隐患"
},
{
id: 3,
title: "重大隐患"
}
]);
const sourceOptions = common_vendor.ref([
{
id: 1,
title: "部门检查"
},
{
id: 2,
title: "都导检查"
},
{
id: 3,
title: "企业自查"
},
{
id: 4,
title: "行业互查"
}
]);
common_vendor.watch(() => formData.source, (newVal) => {
const selected = sourceOptions.value[newVal];
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:791", "隐患来源选择结果:", {
索引: newVal,
选中项: selected,
id: selected == null ? void 0 : selected.id,
title: selected == null ? void 0 : selected.title
});
});
const statusTabs = common_vendor.ref([
{ label: "全部", value: null },
{ label: "待交办", value: 1 },
@@ -555,135 +172,16 @@ const _sfc_main = {
t: item.hazardId
});
}),
d: common_vendor.o(($event) => showAddPopup.value = true),
e: common_vendor.o(($event) => showAddPopup.value = false),
f: common_vendor.o(($event) => formData.source = $event),
d: common_vendor.o(openAddPopup),
e: common_vendor.o(onHazardAddSuccess),
f: common_vendor.o(($event) => showAddPopup.value = $event),
g: common_vendor.p({
options: sourceOptions.value,
wrap: false,
["item-width"]: "152rpx",
["item-height"]: "64rpx",
modelValue: formData.source
title: "新增隐患排查",
mode: "direct",
["extra-params"]: hazardExtraParams.value,
show: showAddPopup.value
}),
h: common_vendor.o(common_vendor.unref(afterRead)),
i: common_vendor.o(common_vendor.unref(deletePic)),
j: common_vendor.p({
fileList: fileList1.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
k: canvasWidth.value,
l: canvasHeight.value,
m: canvasWidth.value + "px",
n: canvasHeight.value + "px",
o: !aiAnalyzing.value
}, !aiAnalyzing.value ? {} : {}, {
p: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
q: aiAnalyzing.value,
r: aiAnalyzing.value,
s: common_vendor.o(handleAiAnalyze),
t: common_vendor.o(($event) => formData.title = $event),
v: common_vendor.p({
placeholder: "请输入内容",
border: "surround",
modelValue: formData.title
}),
w: common_vendor.sr(levelChooseRef, "b44c631d-4,b44c631d-0", {
"k": "levelChooseRef"
}),
x: common_vendor.o(($event) => formData.level = $event),
y: common_vendor.p({
options: levelOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: formData.level
}),
z: common_vendor.o(($event) => selectedAddress.value = $event),
A: common_vendor.p({
placeholder: "请输入地址",
border: "surround",
modelValue: selectedAddress.value
}),
B: common_vendor.o(chooseLocation),
C: common_vendor.t(formData.regulationName || "请选择法律依据"),
D: !formData.regulationName ? 1 : "",
E: common_vendor.o(openLawPopup),
F: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
G: !selectedAreaName.value ? 1 : "",
H: common_vendor.o(($event) => showAreaPicker.value = true),
I: common_vendor.o(($event) => formData.description = $event),
J: common_vendor.p({
placeholder: "请输入内容",
modelValue: formData.description
}),
K: common_vendor.o(($event) => formData.tagIndex = $event),
L: common_vendor.p({
options: tagOptions.value,
modelValue: formData.tagIndex
}),
M: common_vendor.o(($event) => showAddPopup.value = false),
N: common_vendor.o(handleAdd),
O: common_vendor.o(($event) => showAddPopup.value = false),
P: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20",
["safe-area-inset-bottom"]: false
}),
Q: common_vendor.o(($event) => showLawPopup.value = false),
R: common_vendor.o(searchRegulation),
S: lawKeyword.value,
T: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
U: common_vendor.o(searchRegulation),
V: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
X: common_vendor.f(lawList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis),
c: selectedLawId.value === item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => selectLaw(item), item.id)
};
}),
Y: lawLoading.value
}, lawLoading.value ? {} : {}), {
W: !lawLoading.value && lawList.value.length === 0,
Z: common_vendor.o(loadMoreLaw),
aa: common_vendor.o(($event) => showLawPopup.value = false),
ab: common_vendor.o(confirmLaw),
ac: common_vendor.o(($event) => showLawPopup.value = false),
ad: common_vendor.p({
show: showLawPopup.value,
mode: "center",
round: "20",
["safe-area-inset-bottom"]: false
}),
ae: common_vendor.o(($event) => showAreaPicker.value = false),
af: common_vendor.o(confirmAreaSelect),
ag: common_vendor.f(areaList.value, (item, k0, i0) => {
return common_vendor.e({
a: item.color,
b: common_vendor.t(item.name),
c: tempAreaId.value === item.id
}, tempAreaId.value === item.id ? {} : {}, {
d: item.id,
e: tempAreaId.value === item.id ? 1 : "",
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
});
}),
ah: areaList.value.length === 0
}, areaList.value.length === 0 ? {} : {}, {
ai: common_vendor.o(($event) => showAreaPicker.value = false),
aj: common_vendor.p({
show: showAreaPicker.value,
mode: "bottom",
round: "20"
}),
ak: common_vendor.gei(_ctx, "")
h: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -1,10 +1,6 @@
{
"navigationBarTitleText": "隐患排查",
"usingComponents": {
"up-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
"hazard-form-popup": "../../components/hazard/HazardFormPopup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -79,232 +79,6 @@
border: 2rpx solid #FFA39E;
color: #F5222D;
}
.ai-btn-wrapper.data-v-b44c631d {
display: flex;
justify-content: flex-end;
}
.ai-analyze-btn.data-v-b44c631d {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
padding: 0 32rpx;
font-size: 28rpx;
color: #fff;
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
border-radius: 36rpx;
border: none;
}
.ai-analyze-btn.data-v-b44c631d::after {
border: none;
}
.ai-analyze-btn .ai-btn-icon.data-v-b44c631d {
margin-right: 8rpx;
font-size: 30rpx;
}
.ai-analyze-btn[disabled].data-v-b44c631d {
opacity: 0.7;
}
.popup-content.data-v-b44c631d {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.popup-header.data-v-b44c631d {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.popup-header .popup-title.data-v-b44c631d {
font-size: 32rpx;
color: #333;
}
.popup-header .popup-close.data-v-b44c631d {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.popup-body.data-v-b44c631d {
padding: 30rpx;
max-height: 900rpx;
overflow-y: auto;
}
.source-choose-scroll.data-v-b44c631d {
width: 100%;
overflow: hidden;
}
.source-choose-scroll.data-v-b44c631d .up-choose {
width: 100%;
white-space: nowrap;
}
.source-choose-scroll.data-v-b44c631d .u-tag-wrapper {
margin-right: 12rpx;
}
.source-choose-scroll.data-v-b44c631d .u-tag {
display: flex !important;
align-items: center !important;
justify-content: center !important;
box-sizing: border-box;
padding: 0 8rpx !important;
line-height: normal !important;
}
.source-choose-scroll.data-v-b44c631d .u-tag__content {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
.source-choose-scroll.data-v-b44c631d .u-tag__text {
font-size: 24rpx !important;
line-height: 1.3 !important;
text-align: center;
}
.popup-footer.data-v-b44c631d {
display: flex;
border-top: 1rpx solid #eee;
}
.popup-footer button.data-v-b44c631d {
flex: 1;
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
font-size: 30rpx;
}
.popup-footer button.data-v-b44c631d::after {
border: none;
}
.popup-footer .btn-cancel.data-v-b44c631d {
background: #fff;
color: #666;
}
.popup-footer .btn-confirm.data-v-b44c631d {
color: #fff;
}
.address-box.data-v-b44c631d {
display: flex;
align-items: center;
gap: 20rpx;
}
.address-box .address-input-wrapper.data-v-b44c631d {
flex: 1;
}
.address-box .btn-address.data-v-b44c631d {
flex-shrink: 0;
height: 70rpx;
line-height: 70rpx;
padding: 0 30rpx;
font-size: 26rpx;
border-radius: 8rpx;
color: #fff;
}
.address-box .btn-address.data-v-b44c631d::after {
border: none;
}
.select-trigger.data-v-b44c631d {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
}
.select-trigger .select-value.data-v-b44c631d {
flex: 1;
font-size: 28rpx;
color: #333;
}
.select-trigger .select-value.placeholder.data-v-b44c631d {
color: #c0c4cc;
}
.picker-popup.data-v-b44c631d {
background: #fff;
}
.picker-popup .picker-header.data-v-b44c631d {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.picker-popup .picker-header .picker-cancel.data-v-b44c631d {
font-size: 28rpx;
color: #999;
}
.picker-popup .picker-header .picker-title.data-v-b44c631d {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.picker-popup .picker-header .picker-confirm.data-v-b44c631d {
font-size: 28rpx;
color: #2667E9;
}
.picker-popup .picker-body.data-v-b44c631d {
max-height: 600rpx;
padding: 0 30rpx;
}
.picker-popup .picker-item.data-v-b44c631d {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 0;
border-bottom: 1rpx solid #f5f5f5;
font-size: 30rpx;
color: #333;
}
.picker-popup .picker-item.data-v-b44c631d:last-child {
border-bottom: none;
}
.picker-popup .picker-item.picker-item-active.data-v-b44c631d {
color: #2667E9;
}
.area-color-dot.data-v-b44c631d {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
margin-right: 16rpx;
}
.address-popup.data-v-b44c631d {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.address-popup-body.data-v-b44c631d {
padding: 30rpx;
max-height: 500rpx;
}
.address-popup-body .search-box.data-v-b44c631d {
margin-bottom: 20rpx;
}
.address-popup-body .search-box .search-input.data-v-b44c631d {
width: 100%;
background: #f5f5f5;
border-radius: 8rpx;
padding: 16rpx 20rpx;
font-size: 28rpx;
}
.address-popup-body .address-list.data-v-b44c631d {
max-height: 350rpx;
overflow-y: auto;
}
.address-popup-body .address-item.data-v-b44c631d {
padding: 24rpx 20rpx;
border-bottom: 1rpx solid #eee;
font-size: 26rpx;
color: #333;
}
.address-popup-body .address-item.data-v-b44c631d:last-child {
border-bottom: none;
}
.address-popup-body .address-item.address-item-active.data-v-b44c631d {
background: #EBF2FC;
color: #2667E9;
}
.status-tabs.data-v-b44c631d {
position: fixed;
top: 0;
@@ -346,114 +120,6 @@
background: #2667E9;
border-radius: 3rpx;
}
.law-popup.data-v-b44c631d {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
max-height: 80vh;
}
.law-popup .popup-header.data-v-b44c631d {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.law-popup .popup-header .popup-title.data-v-b44c631d {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.law-popup .popup-header .popup-close.data-v-b44c631d {
font-size: 40rpx;
color: #999;
cursor: pointer;
}
.search-box.data-v-b44c631d {
display: flex;
align-items: center;
background: #F5F5F5;
border-radius: 40rpx;
padding: 16rpx 24rpx;
margin: 20rpx 30rpx;
}
.search-box .search-icon.data-v-b44c631d {
font-size: 28rpx;
color: #999;
margin-right: 12rpx;
}
.search-box .search-input.data-v-b44c631d {
flex: 1;
font-size: 28rpx;
background: transparent;
border: none;
}
.search-box .search-btn.data-v-b44c631d {
color: #2667E9;
font-size: 26rpx;
margin-left: 16rpx;
cursor: pointer;
}
.loading-tip.data-v-b44c631d, .empty-tip.data-v-b44c631d {
text-align: center;
padding: 40rpx;
color: #999;
font-size: 26rpx;
}
.law-list.data-v-b44c631d {
max-height: 400rpx;
padding: 0 30rpx;
}
.law-item.data-v-b44c631d {
padding: 24rpx;
border: 2rpx solid #E5E5E5;
border-radius: 12rpx;
margin-bottom: 16rpx;
font-size: 28rpx;
color: #333;
}
.law-item .law-title.data-v-b44c631d {
line-height: 1.5;
margin-bottom: 8rpx;
font-weight: bold;
}
.law-item .law-basis.data-v-b44c631d {
font-size: 24rpx;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.law-item-active.data-v-b44c631d {
border-color: #2667E9;
background: #F0F6FF;
}
.popup-footer.data-v-b44c631d {
display: flex;
padding: 30rpx;
border-top: 1rpx solid #eee;
gap: 20rpx;
}
.popup-footer button.data-v-b44c631d {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
border-radius: 40rpx;
}
.popup-footer button.data-v-b44c631d::after {
border: none;
}
.popup-footer .btn-cancel.data-v-b44c631d {
background: #f5f5f5;
color: #666;
}
.popup-footer .btn-confirm.data-v-b44c631d {
background: #2667E9;
color: #fff;
}
/**
* 这里是uni-app内置的常用样式变量
*
@@ -480,7 +146,6 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* 全局样式覆盖 up-tag 文字居中 */
.card-actions {
margin-top: 20rpx;
}
@@ -492,7 +157,4 @@
white-space: nowrap !important;
flex-shrink: 0 !important;
width: auto !important;
}
.u-tag {
justify-content: center !important;
}

View File

@@ -2,6 +2,8 @@
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_request = require("../../request/request.js");
const utils_draftCache = require("../../utils/draftCache.js");
const utils_useDraftCache = require("../../utils/useDraftCache.js");
const utils_upload = require("../../utils/upload.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
@@ -58,12 +60,122 @@ const _sfc_main = {
const signatureRef = common_vendor.ref(null);
const isSignatureEmpty = common_vendor.ref(true);
const isSubmitting = common_vendor.ref(false);
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const isInitialized = common_vendor.ref(false);
const signaturePaths = common_vendor.ref([]);
const getDraftKey = () => `draft_accept_${rectifyId.value || ""}`;
const signatureLocalPath = common_vendor.ref("");
const isDraftExporting = common_vendor.ref(false);
let signatureExportTimer = null;
const applySignatureFromServer = (signPath) => {
const url = signPath ? utils_upload.toSubmitFileUrl(signPath) : "";
if (!url) {
showCanvas.value = true;
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
isSignatureEmpty.value = true;
return;
}
signatureServerPath.value = url;
signatureUrl.value = url;
signatureLocalPath.value = "";
showCanvas.value = false;
isSignatureEmpty.value = false;
};
const applySignatureFromLocal = (localPath) => {
if (!localPath)
return;
signatureLocalPath.value = localPath;
signatureUrl.value = localPath;
signatureServerPath.value = "";
showCanvas.value = false;
isSignatureEmpty.value = false;
};
const acceptDraftHasContent = (data) => {
const form = data.formData || {};
return !!(form.verifyRemark || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signatureLocalPath || data.signaturePaths && data.signaturePaths.length > 0);
};
const {
showRestoreBanner,
clear: clearDraft,
restore: restoreDraft,
save: saveDraft,
bindAutoSave
} = utils_useDraftCache.useDraftCache({
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.ACCEPT, rectifyId.value),
getFallbackKeys: () => {
const primary = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.ACCEPT, rectifyId.value);
const compact = utils_draftCache.buildDraftKeyCompact(utils_draftCache.DRAFT_NS.ACCEPT, rectifyId.value);
return compact !== primary ? [compact] : [];
},
getPayload: () => ({
formData: {
result: formData.result,
verifyRemark: formData.verifyRemark
},
fileList1: fileList1.value,
signatureServerPath: signatureServerPath.value,
signatureUrl: signatureUrl.value,
signatureLocalPath: signatureLocalPath.value,
showCanvas: showCanvas.value,
signaturePaths: signaturePaths.value
}),
hasContent: acceptDraftHasContent,
applyPayload: (data) => {
const form = data.formData || {};
formData.result = form.result !== void 0 ? form.result : 1;
formData.verifyRemark = form.verifyRemark || "";
fileList1.value = data.fileList1 || [];
signaturePaths.value = data.signaturePaths || [];
if (data.signatureServerPath || data.signatureUrl) {
applySignatureFromServer(data.signatureServerPath || data.signatureUrl);
} else if (data.signatureLocalPath) {
applySignatureFromLocal(data.signatureLocalPath);
} else {
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
isSignatureEmpty.value = true;
}
},
clearForm: () => {
formData.result = 1;
formData.verifyRemark = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
showCanvas.value = true;
signaturePaths.value = [];
if (signatureRef.value) {
signatureRef.value.clear();
}
},
canSave: () => !!rectifyId.value,
requireInitialized: true,
onAfterRestore: (data) => {
var _a;
if (data.signatureServerPath || data.signatureUrl || data.signatureLocalPath) {
return;
}
if (((_a = data.signaturePaths) == null ? void 0 : _a.length) > 0) {
setTimeout(() => {
if (signatureRef.value) {
isSignatureEmpty.value = false;
}
}, 450);
}
}
});
bindAutoSave(() => [
formData.result,
formData.verifyRemark,
fileList1.value,
signatureServerPath.value,
signatureUrl.value,
signatureLocalPath.value,
showCanvas.value,
signaturePaths.value
]);
const getFullPath = (filePath) => {
if (!filePath)
return "";
@@ -123,14 +235,14 @@ const _sfc_main = {
const assign = resolveAssignWithRectify(res.data.assigns);
if (assign == null ? void 0 : assign.rectify) {
applyRectifyData(assign.rectify);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:240", "整改记录:", rectifyData);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:241", "整改附件:", rectifyAttachments.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:370", "整改记录:", rectifyData);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:371", "整改附件:", rectifyAttachments.value);
}
} else {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:247", "获取隐患详情失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:377", "获取隐患详情失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
@@ -157,7 +269,7 @@ const _sfc_main = {
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
signatureRef.value.confirm();
} else {
if (!signatureServerPath.value) {
if (!signatureServerPath.value && !signatureLocalPath.value) {
common_vendor.index.showToast({
title: "请进行电子签名",
icon: "none"
@@ -166,7 +278,18 @@ const _sfc_main = {
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
await executeSubmit();
try {
if (!signatureServerPath.value && signatureLocalPath.value) {
const { url } = await utils_upload.uploadToCloud(signatureLocalPath.value);
applySignatureFromServer(url);
}
await executeSubmit();
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:431", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
}
};
const executeSubmit = async () => {
@@ -179,7 +302,7 @@ const _sfc_main = {
signPath: signatureServerPath.value || ""
// 电子签名路径
};
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:311", "提交验收参数:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:452", "提交验收参数:", params);
try {
const res = await request_api.acceptanceRectification(params);
common_vendor.index.hideLoading();
@@ -200,7 +323,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:333", "验收失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:474", "验收失败:", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -218,125 +341,45 @@ const _sfc_main = {
instance: acceptUploadInstance
}
});
const saveDraft = () => {
if (isRestoring.value || !isInitialized.value)
return;
const key = getDraftKey();
const hasContent = formData.verifyRemark || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
return;
}
const data = {
formData: {
result: formData.result,
verifyRemark: formData.verifyRemark
},
fileList1: fileList1.value,
signatureServerPath: signatureServerPath.value,
signatureUrl: signatureUrl.value,
showCanvas: showCanvas.value,
signaturePaths: signaturePaths.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
hasDraft.value = true;
const onSignatureStart = () => {
isSignatureEmpty.value = false;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
formData.result = 1;
formData.verifyRemark = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
showCanvas.value = true;
signaturePaths.value = [];
if (signatureRef.value) {
signatureRef.value.clear();
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
const onSignatureSigning = () => {
isSignatureEmpty.value = false;
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.formData.verifyRemark || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
if (!hasContent) {
isInitialized.value = true;
return;
}
isRestoring.value = true;
formData.result = data.formData.result !== void 0 ? data.formData.result : 1;
formData.verifyRemark = data.formData.verifyRemark || "";
fileList1.value = data.fileList1 || [];
signatureServerPath.value = data.signatureServerPath || "";
signatureUrl.value = data.signatureUrl || "";
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
signaturePaths.value = data.signaturePaths || [];
hasDraft.value = true;
showRestoreBanner.value = true;
if (signaturePaths.value.length > 0) {
setTimeout(() => {
if (signatureRef.value) {
isSignatureEmpty.value = false;
}
}, 450);
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
isInitialized.value = true;
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:466", "解析草稿失败:", e);
isRestoring.value = false;
isInitialized.value = true;
}
} else {
isInitialized.value = true;
}
};
common_vendor.watch(
() => [
formData.result,
formData.verifyRemark,
fileList1.value,
signatureServerPath.value,
signaturePaths.value
],
() => {
if (rectifyId.value) {
saveDraft();
}
},
{ deep: true }
);
const clearSignature = () => {
const onSignatureClear = () => {
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
};
const scheduleSignatureDraftExport = () => {
clearTimeout(signatureExportTimer);
signatureExportTimer = setTimeout(() => {
if (!showCanvas.value || isSignatureEmpty.value || !signatureRef.value || isSubmitting.value || isDraftExporting.value) {
return;
}
isDraftExporting.value = true;
signatureRef.value.confirm();
}, 600);
};
const onSignatureEnd = () => {
isSignatureEmpty.value = false;
scheduleSignatureDraftExport();
};
const clearSignature = () => {
clearTimeout(signatureExportTimer);
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
if (signatureRef.value) {
signatureRef.value.clear();
}
};
const reSign = () => {
clearTimeout(signatureExportTimer);
isSignatureEmpty.value = true;
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
signatureLocalPath.value = "";
common_vendor.nextTick$1(() => {
if (signatureRef.value) {
signatureRef.value.clear();
@@ -344,28 +387,39 @@ const _sfc_main = {
});
};
const onSignatureConfirm = async (tempFilePath) => {
if (isDraftExporting.value) {
isDraftExporting.value = false;
applySignatureFromLocal(tempFilePath);
saveDraft();
return;
}
try {
const { url } = await utils_upload.uploadToCloud(tempFilePath);
signatureServerPath.value = url;
signatureUrl.value = url;
showCanvas.value = false;
isSignatureEmpty.value = false;
applySignatureFromServer(url);
saveDraft();
if (isSubmitting.value) {
await executeSubmit();
}
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:536", "签名上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:583", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
common_vendor.onHide(() => {
if (showCanvas.value && !isSignatureEmpty.value && signatureRef.value && !isDraftExporting.value) {
isDraftExporting.value = true;
signatureRef.value.confirm();
}
saveDraft();
});
common_vendor.onLoad((options) => {
try {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:547", "获取系统信息失败:", e);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:602", "获取系统信息失败:", e);
}
if (options.rectifyId) {
rectifyId.value = options.rectifyId;
@@ -376,7 +430,7 @@ const _sfc_main = {
if (options.assignId) {
assignId.value = options.assignId;
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:558", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:613", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
fetchDetail();
restoreDraft();
});
@@ -429,19 +483,22 @@ const _sfc_main = {
A: common_vendor.o(reSign)
}, {
B: !showCanvas.value
}, !showCanvas.value ? {
}, !showCanvas.value ? common_vendor.e({
C: signatureUrl.value
} : {}, {
D: showCanvas.value
}, signatureUrl.value ? {
D: signatureUrl.value
} : {}) : {}, {
E: showCanvas.value
}, showCanvas.value ? {
E: common_vendor.sr(signatureRef, "39f9b795-2", {
F: common_vendor.sr(signatureRef, "39f9b795-2", {
"k": "signatureRef"
}),
F: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
G: common_vendor.o(($event) => isSignatureEmpty.value = false),
H: common_vendor.o(($event) => isSignatureEmpty.value = false),
I: common_vendor.o(($event) => isSignatureEmpty.value = true),
J: common_vendor.p({
G: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
H: common_vendor.o(onSignatureStart),
I: common_vendor.o(onSignatureSigning),
J: common_vendor.o(onSignatureEnd),
K: common_vendor.o(onSignatureClear),
L: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
@@ -450,9 +507,9 @@ const _sfc_main = {
enableHistory: false
})
} : {}, {
K: common_vendor.o(handleCancel),
L: common_vendor.o(handleSubmit),
M: common_vendor.gei(_ctx, "")
M: common_vendor.o(handleCancel),
N: common_vendor.o(handleSubmit),
O: common_vendor.gei(_ctx, "")
});
};
}

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,8 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_draftCache = require("../../utils/draftCache.js");
const utils_useDraftCache = require("../../utils/useDraftCache.js");
if (!Array) {
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
@@ -75,19 +77,42 @@ const _sfc_main = {
const showDatePicker = common_vendor.ref(false);
const dateValue = common_vendor.ref(Date.now());
const selectedDate = common_vendor.ref("");
const {
showRestoreBanner,
clear: clearDraft,
restore: restoreDraft,
bindAutoSave
} = utils_useDraftCache.useDraftCache({
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.ASSIGN, hazardId.value),
getPayload: () => ({
selectedDate: selectedDate.value,
dateValue: dateValue.value
}),
hasContent: (payload) => !!payload.selectedDate,
applyPayload: (payload) => {
selectedDate.value = payload.selectedDate || "";
dateValue.value = payload.dateValue || Date.now();
},
clearForm: () => {
selectedDate.value = "";
dateValue.value = Date.now();
},
canSave: () => !!hazardId.value
});
bindAutoSave(() => [selectedDate.value]);
const fetchDeptUsers = async () => {
try {
const res = await request_api.getDepartmentPersonUsers();
if (res.code === 0 && res.data) {
deptList.value = res.data;
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:172", "部门人员树:", deptList.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:200", "部门人员树:", deptList.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:175", "获取部门人员失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:203", "获取部门人员失败:", error);
}
};
const onDateConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:181", "选择的日期时间:", e);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:209", "选择的日期时间:", e);
const date = new Date(e.value);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -120,7 +145,7 @@ const _sfc_main = {
assignRemark: ""
// 交办备注(可选)
};
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:217", "提交数据:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:245", "提交数据:", params);
try {
const res = await request_api.assignHiddenDanger(params);
if (res.code === 0) {
@@ -133,82 +158,10 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:231", "交办失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:259", "交办失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const getDraftKey = () => `draft_assign_${hazardId.value || ""}`;
const saveDraft = () => {
if (isRestoring.value)
return;
const key = getDraftKey();
const hasContent = selectedDate.value;
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
return;
}
const data = {
selectedDate: selectedDate.value,
dateValue: dateValue.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
selectedDate.value = "";
dateValue.value = Date.now();
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.selectedDate;
if (!hasContent)
return;
isRestoring.value = true;
selectedDate.value = data.selectedDate || "";
dateValue.value = data.dateValue || Date.now();
hasDraft.value = true;
showRestoreBanner.value = true;
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:306", "解析草稿失败:", e);
isRestoring.value = false;
}
}
};
common_vendor.watch(
() => [selectedDate.value],
() => {
if (hazardId.value) {
saveDraft();
}
}
);
common_vendor.onLoad((options) => {
if (options.hazardId)
hazardId.value = options.hazardId;
@@ -219,9 +172,9 @@ const _sfc_main = {
});
return (_ctx, _cache) => {
return common_vendor.e({
a: showRestoreBanner.value
}, showRestoreBanner.value ? {
b: common_vendor.o(($event) => clearDraft(true))
a: common_vendor.unref(showRestoreBanner)
}, common_vendor.unref(showRestoreBanner) ? {
b: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
} : {}, {
c: common_vendor.t(selectedUser.value || "请选择整改责任人"),
d: !selectedUser.value ? 1 : "",

View File

@@ -0,0 +1,106 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const request_api = require("../../request/api.js");
if (!Array) {
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
_easycom_u_navbar2();
}
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
if (!Math) {
(_easycom_u_navbar + HazardDetailPanelV2)();
}
const HazardDetailPanelV2 = () => "../../components/hazardDetail/HazardDetailPanelV2.js";
const _sfc_main = {
__name: "detail2",
setup(__props) {
const instance = common_vendor.getCurrentInstance();
const queryScope = (instance == null ? void 0 : instance.proxy) || instance;
const detailData = common_vendor.ref({});
const loading = common_vendor.ref(false);
const panelBodyHeight = common_vendor.ref(0);
const calcPanelBodyHeight = () => {
common_vendor.nextTick$1(() => {
const query = common_vendor.index.createSelectorQuery().in(queryScope);
query.select(".panel-wrap").boundingClientRect();
query.exec((res) => {
const rect = res == null ? void 0 : res[0];
if ((rect == null ? void 0 : rect.height) > 0) {
panelBodyHeight.value = Math.floor(rect.height);
return;
}
const sys = common_vendor.index.getSystemInfoSync();
panelBodyHeight.value = Math.floor(sys.windowHeight * 0.55);
});
});
};
const loadDetail = async (hazardId) => {
loading.value = true;
try {
const res = await request_api.getHazardDetail(hazardId);
if (res.code === 0 && res.data) {
detailData.value = res.data;
} else {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/detail2.vue:85", "获取隐患详情失败:", error);
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
} finally {
loading.value = false;
calcPanelBodyHeight();
setTimeout(calcPanelBodyHeight, 100);
setTimeout(calcPanelBodyHeight, 400);
}
};
common_vendor.onReady(() => {
calcPanelBodyHeight();
setTimeout(calcPanelBodyHeight, 100);
setTimeout(calcPanelBodyHeight, 400);
});
common_vendor.watch(loading, (isLoading) => {
if (!isLoading) {
calcPanelBodyHeight();
setTimeout(calcPanelBodyHeight, 100);
setTimeout(calcPanelBodyHeight, 400);
}
});
common_vendor.onLoad((options) => {
if (options.hazardId) {
loadDetail(options.hazardId);
return;
}
common_vendor.index.showToast({ title: "缺少隐患ID", icon: "none" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
});
return (_ctx, _cache) => {
return {
a: common_vendor.p({
title: "查看隐患",
placeholder: true,
safeAreaInsetTop: true,
bgColor: "transparent",
titleColor: "#ffffff",
leftIconColor: "#ffffff",
autoBack: true,
border: false
}),
b: common_assets._imports_0$1,
c: common_vendor.t(detailData.value.statusName || "-"),
d: common_assets._imports_1,
e: common_vendor.t(detailData.value.createdAt || "-"),
f: common_vendor.p({
detail: detailData.value,
loading: loading.value,
["body-height"]: panelBodyHeight.value
}),
g: common_vendor.gei(_ctx, "")
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-364026f2"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/detail2.js.map

View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "隐患详情",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"disableScroll": true,
"usingComponents": {
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar",
"hazard-detail-panel-v2": "../../components/hazardDetail/HazardDetailPanelV2"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['page', 'data-v-364026f2', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><view class="top-gradient-wrap data-v-364026f2"><u-navbar wx:if="{{a}}" class="data-v-364026f2" virtualHostClass="data-v-364026f2" u-i="364026f2-0" bind:__l="__l" u-p="{{a}}"/><view class="summary-card data-v-364026f2"><view class="summary-side summary-side--left data-v-364026f2"><image class="summary-icon data-v-364026f2" src="{{b}}" mode="aspectFit"/><view class="summary-icon-gap data-v-364026f2"><view class="summary-text data-v-364026f2"><view class="summary-label data-v-364026f2">隐患状态</view><view class="summary-status data-v-364026f2">{{c}}</view></view></view></view><view class="summary-divider data-v-364026f2"></view><view class="summary-side summary-side--right data-v-364026f2"><image class="summary-icon data-v-364026f2" src="{{d}}" mode="aspectFit"/><view class="summary-text data-v-364026f2"><view class="summary-label data-v-364026f2">提交日期</view><view class="summary-date data-v-364026f2">{{e}}</view></view></view></view></view><view class="panel-wrap data-v-364026f2"><hazard-detail-panel-v2 wx:if="{{f}}" class="data-v-364026f2" virtualHostClass="data-v-364026f2" u-i="364026f2-1" bind:__l="__l" u-p="{{f}}"/></view></view>

View File

@@ -0,0 +1,132 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page.data-v-364026f2 {
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
box-sizing: border-box;
background: #f5f7fa;
}
/* 渐变只覆盖导航栏 + 顶部卡片区域,在卡片下沿开始淡出 */
.top-gradient-wrap.data-v-364026f2 {
flex-shrink: 0;
background: linear-gradient(180deg, #046CEA 0%, #2158C8 28.44%, rgba(4, 107, 234, 0) 100%);
}
.summary-card.data-v-364026f2 {
margin: 32rpx 30rpx 0;
padding: 28rpx 30rpx 32rpx;
background: #fff;
border-radius: 20rpx;
display: flex;
align-items: flex-start;
box-sizing: border-box;
}
.summary-side.data-v-364026f2 {
display: flex;
align-items: flex-start;
}
.summary-side--left.data-v-364026f2 {
flex-shrink: 0;
align-items: center;
}
.summary-side--left .summary-text.data-v-364026f2 {
padding-top: 0;
padding-bottom: 0;
}
.summary-side--right.data-v-364026f2 {
flex: 1;
min-width: 0;
align-items: center;
}
.summary-side--right .summary-icon.data-v-364026f2 {
margin-right: 22rpx;
}
.summary-side--right .summary-text.data-v-364026f2 {
flex: 1;
min-width: 0;
padding-top: 0;
padding-bottom: 0;
}
/* 图标右边缘到竖线 = 169rpx文字靠左右侧留白 */
.summary-icon-gap.data-v-364026f2 {
width: 149rpx;
flex-shrink: 0;
box-sizing: border-box;
}
.summary-icon.data-v-364026f2 {
width: 55rpx;
height: 65rpx;
flex-shrink: 0;
}
.summary-side--left .summary-icon.data-v-364026f2 {
margin-right: 22rpx;
}
.summary-text.data-v-364026f2 {
flex-shrink: 0;
box-sizing: border-box;
}
.summary-label.data-v-364026f2 {
font-size: 24rpx;
color: #8f9ca2;
line-height: 34rpx;
}
.summary-status.data-v-364026f2 {
margin-top: 8rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
}
.summary-date.data-v-364026f2 {
margin-top: 8rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
white-space: nowrap;
}
.summary-divider.data-v-364026f2 {
width: 2rpx;
height: 72rpx;
flex-shrink: 0;
background: #eee;
margin-right: 40rpx;
}
.panel-wrap.data-v-364026f2 {
flex: 1;
min-height: 0;
height: 0;
margin-top: 12rpx;
padding: 0 30rpx 30rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}

View File

@@ -1,6 +1,8 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const utils_draftCache = require("../../utils/draftCache.js");
const utils_useDraftCache = require("../../utils/useDraftCache.js");
const utils_upload = require("../../utils/upload.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
@@ -38,8 +40,13 @@ const _sfc_main = {
const signatureRef = common_vendor.ref(null);
const isSignatureEmpty = common_vendor.ref(true);
const isSubmitting = common_vendor.ref(false);
const signatureLocalPath = common_vendor.ref("");
const isDraftExporting = common_vendor.ref(false);
let signatureExportTimer = null;
const clearSignature = () => {
clearTimeout(signatureExportTimer);
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
if (signatureRef.value) {
signatureRef.value.clear();
}
@@ -55,23 +62,60 @@ const _sfc_main = {
showCanvas.value = true;
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
isSignatureEmpty.value = true;
return;
}
signatureServerPath.value = url;
signatureUrl.value = url;
signatureLocalPath.value = "";
showCanvas.value = false;
isSignatureEmpty.value = false;
};
const applySignatureFromLocal = (localPath) => {
if (!localPath)
return;
signatureLocalPath.value = localPath;
signatureUrl.value = localPath;
signatureServerPath.value = "";
showCanvas.value = false;
isSignatureEmpty.value = false;
};
const onSignatureStart = () => {
isSignatureEmpty.value = false;
};
const onSignatureSigning = () => {
isSignatureEmpty.value = false;
};
const onSignatureClear = () => {
isSignatureEmpty.value = true;
signatureLocalPath.value = "";
};
const scheduleSignatureDraftExport = () => {
clearTimeout(signatureExportTimer);
signatureExportTimer = setTimeout(() => {
if (!showCanvas.value || isSignatureEmpty.value || !signatureRef.value || isSubmitting.value || isDraftExporting.value) {
return;
}
isDraftExporting.value = true;
signatureRef.value.confirm();
}, 600);
};
const onSignatureEnd = () => {
isSignatureEmpty.value = false;
scheduleSignatureDraftExport();
};
const onSignatureImageError = () => {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:321", "签名图片加载失败:", signatureUrl.value);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:376", "签名图片加载失败:", signatureUrl.value);
common_vendor.index.showToast({ title: "签名图片加载失败", icon: "none" });
};
const reSign = () => {
clearTimeout(signatureExportTimer);
isSignatureEmpty.value = true;
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
signatureLocalPath.value = "";
common_vendor.nextTick$1(() => {
if (signatureRef.value) {
signatureRef.value.clear();
@@ -345,11 +389,11 @@ const _sfc_main = {
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:633", "获取安全管理人员列表失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:690", "获取安全管理人员列表失败:", error);
}
};
const fetchRectifyDeptUsers = async () => {
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:639", "当前hazardId:", hazardId.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:696", "当前hazardId:", hazardId.value);
try {
const res = await request_api.getDeptUsersWithSubordinates({ hazardId: hazardId.value });
if (res.code === 0 && res.data) {
@@ -357,10 +401,10 @@ const _sfc_main = {
if (selectedUserIds.value.length > 0) {
syncSelectedUsersFromIds(selectedUserIds.value);
}
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:647", "整改责任人部门树:", deptList.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:704", "整改责任人部门树:", deptList.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:650", "获取整改责任人列表失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:707", "获取整改责任人列表失败:", error);
}
};
const fetchPersonnelLists = async () => {
@@ -419,7 +463,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:721", "提交整改失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:778", "提交整改失败:", error);
common_vendor.index.showToast({
title: "操作失败",
icon: "none"
@@ -429,16 +473,23 @@ const _sfc_main = {
}
};
const onSignatureConfirm = async (tempFilePath) => {
if (isDraftExporting.value) {
isDraftExporting.value = false;
applySignatureFromLocal(tempFilePath);
saveDraft();
return;
}
try {
const { url } = await utils_upload.uploadToCloud(tempFilePath);
applySignatureFromServer(url);
saveDraft();
if (isSubmitting.value) {
await executeSubmit();
}
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:743", "签名上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:808", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
@@ -504,7 +555,7 @@ const _sfc_main = {
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
signatureRef.value.confirm();
} else {
if (!signatureServerPath.value) {
if (!signatureServerPath.value && !signatureLocalPath.value) {
common_vendor.index.showToast({
title: "请进行电子签名",
icon: "none"
@@ -513,7 +564,18 @@ const _sfc_main = {
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
await executeSubmit();
try {
if (!signatureServerPath.value && signatureLocalPath.value) {
const { url } = await utils_upload.uploadToCloud(signatureLocalPath.value);
applySignatureFromServer(url);
}
await executeSubmit();
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:899", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
}
};
const fetchRectifyDetail = async () => {
@@ -536,7 +598,7 @@ const _sfc_main = {
applyRectifyTimeValue(data.rectifyTime);
}
const signPath = resolveSignPathFromData(data);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:926", "整改详情签名路径:", signPath);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:1002", "整改详情签名路径:", signPath);
applySignatureFromServer(signPath);
hazardId.value = data.hazardId || "";
assignId.value = data.assignId || "";
@@ -562,7 +624,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:960", "获取整改详情失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1036", "获取整改详情失败:", error);
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
}
};
@@ -593,28 +655,31 @@ const _sfc_main = {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:997", "AI生成整改方案失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1073", "AI生成整改方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
}
};
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const signaturePaths = common_vendor.ref([]);
const getDraftKey = () => `draft_rectify_${hazardId.value || ""}_${rectifyId.value || ""}`;
const saveDraft = () => {
if (isRestoring.value)
return;
const key = getDraftKey();
const hasContent = formData.rectifyPlan || formData.rectificationMeasures || formData.controlMeasures || formData.rectifyResult || formData.planCost || formData.actualCost || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
return;
}
const data = {
const rectifyDraftHasContent = (data) => {
const form = data.formData || {};
return !!(form.rectifyPlan || form.rectificationMeasures || form.controlMeasures || form.rectifyResult || form.planCost || form.actualCost || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signatureLocalPath || data.signaturePaths && data.signaturePaths.length > 0);
};
const {
showRestoreBanner,
clear: clearDraft,
restore: restoreDraft,
save: saveDraft,
bindAutoSave
} = utils_useDraftCache.useDraftCache({
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.RECTIFY, hazardId.value, rectifyId.value),
getFallbackKeys: () => {
const primary = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.RECTIFY, hazardId.value, rectifyId.value);
const compact = utils_draftCache.buildDraftKeyCompact(utils_draftCache.DRAFT_NS.RECTIFY, hazardId.value, rectifyId.value);
return compact !== primary ? [compact] : [];
},
getPayload: () => ({
formData: {
rectifyPlan: formData.rectifyPlan,
rectificationMeasures: formData.rectificationMeasures,
@@ -626,110 +691,88 @@ const _sfc_main = {
fileList1: fileList1.value,
signatureServerPath: signatureServerPath.value,
signatureUrl: signatureUrl.value,
signatureLocalPath: signatureLocalPath.value,
showCanvas: showCanvas.value,
signaturePaths: signaturePaths.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
formData.rectifyPlan = "";
formData.rectificationMeasures = "";
formData.controlMeasures = "";
formData.rectifyResult = "";
formData.planCost = "";
formData.actualCost = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
showCanvas.value = true;
signaturePaths.value = [];
if (signatureRef.value) {
signatureRef.value.clear();
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.formData.rectifyPlan || data.formData.rectificationMeasures || data.formData.controlMeasures || data.formData.rectifyResult || data.formData.planCost || data.formData.actualCost || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
if (!hasContent)
return;
isRestoring.value = true;
formData.rectifyPlan = data.formData.rectifyPlan || "";
formData.rectificationMeasures = data.formData.rectificationMeasures || "";
formData.controlMeasures = data.formData.controlMeasures || "";
formData.rectifyResult = data.formData.rectifyResult || "";
formData.planCost = data.formData.planCost || "";
formData.actualCost = data.formData.actualCost || "";
fileList1.value = data.fileList1 || [];
signaturePaths.value = data.signaturePaths || [];
if (data.signatureServerPath || data.signatureUrl) {
applySignatureFromServer(data.signatureServerPath || data.signatureUrl);
} else if (data.showCanvas === false) {
showCanvas.value = false;
}
hasDraft.value = true;
showRestoreBanner.value = true;
if (signaturePaths.value.length > 0) {
setTimeout(() => {
if (signatureRef.value) {
isSignatureEmpty.value = false;
}
}, 450);
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1145", "解析草稿失败:", e);
isRestoring.value = false;
}
}
};
common_vendor.watch(
() => [
formData.rectifyPlan,
formData.rectificationMeasures,
formData.controlMeasures,
formData.rectifyResult,
formData.planCost,
formData.actualCost,
fileList1.value,
signatureServerPath.value,
signaturePaths.value
],
() => {
if (hazardId.value || rectifyId.value) {
saveDraft();
}),
hasContent: rectifyDraftHasContent,
applyPayload: (data) => {
const form = data.formData || {};
formData.rectifyPlan = form.rectifyPlan || "";
formData.rectificationMeasures = form.rectificationMeasures || "";
formData.controlMeasures = form.controlMeasures || "";
formData.rectifyResult = form.rectifyResult || "";
formData.planCost = form.planCost || "";
formData.actualCost = form.actualCost || "";
fileList1.value = data.fileList1 || [];
signaturePaths.value = data.signaturePaths || [];
if (data.signatureServerPath || data.signatureUrl) {
applySignatureFromServer(data.signatureServerPath || data.signatureUrl);
} else if (data.signatureLocalPath) {
applySignatureFromLocal(data.signatureLocalPath);
} else if (data.showCanvas === false) {
showCanvas.value = false;
}
},
{ deep: true }
);
clearForm: () => {
formData.rectifyPlan = "";
formData.rectificationMeasures = "";
formData.controlMeasures = "";
formData.rectifyResult = "";
formData.planCost = "";
formData.actualCost = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
signatureLocalPath.value = "";
showCanvas.value = true;
signaturePaths.value = [];
if (signatureRef.value) {
signatureRef.value.clear();
}
},
canSave: () => !!(hazardId.value || rectifyId.value),
onAfterRestore: (data) => {
var _a;
if (data.signatureServerPath || data.signatureUrl || data.signatureLocalPath) {
return;
}
if (((_a = data.signaturePaths) == null ? void 0 : _a.length) > 0) {
setTimeout(() => {
if (signatureRef.value) {
isSignatureEmpty.value = false;
}
}, 450);
}
}
});
bindAutoSave(() => [
formData.rectifyPlan,
formData.rectificationMeasures,
formData.controlMeasures,
formData.rectifyResult,
formData.planCost,
formData.actualCost,
fileList1.value,
signatureServerPath.value,
signatureUrl.value,
signatureLocalPath.value,
showCanvas.value,
signaturePaths.value
]);
common_vendor.onHide(() => {
if (showCanvas.value && !isSignatureEmpty.value && signatureRef.value && !isDraftExporting.value) {
isDraftExporting.value = true;
signatureRef.value.confirm();
}
saveDraft();
});
common_vendor.onLoad((options) => {
try {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1178", "获取系统信息失败:", e);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1207", "获取系统信息失败:", e);
}
if (options.hazardId) {
hazardId.value = options.hazardId;
@@ -753,9 +796,9 @@ const _sfc_main = {
});
return (_ctx, _cache) => {
return common_vendor.e({
a: showRestoreBanner.value
}, showRestoreBanner.value ? {
b: common_vendor.o(($event) => clearDraft(true))
a: common_vendor.unref(showRestoreBanner)
}, common_vendor.unref(showRestoreBanner) ? {
b: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
} : {}, {
c: !aiGenerating.value
}, !aiGenerating.value ? {} : {}, {
@@ -944,10 +987,11 @@ const _sfc_main = {
"k": "signatureRef"
}),
aA: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
aB: common_vendor.o(($event) => isSignatureEmpty.value = false),
aC: common_vendor.o(($event) => isSignatureEmpty.value = false),
aD: common_vendor.o(($event) => isSignatureEmpty.value = true),
aE: common_vendor.p({
aB: common_vendor.o(onSignatureStart),
aC: common_vendor.o(onSignatureSigning),
aD: common_vendor.o(onSignatureEnd),
aE: common_vendor.o(onSignatureClear),
aF: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
@@ -956,9 +1000,9 @@ const _sfc_main = {
enableHistory: false
})
} : {}, {
aF: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
aG: common_vendor.o(handleSubmit),
aH: common_vendor.gei(_ctx, "")
aG: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
aH: common_vendor.o(handleSubmit),
aI: common_vendor.gei(_ctx, "")
});
};
}

File diff suppressed because one or more lines are too long

View File

@@ -1,116 +1,48 @@
"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");
(_easycom_up_input2 + _easycom_up_textarea2)();
}
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
if (!Math) {
(_easycom_up_input + _easycom_up_textarea)();
HazardDetailPanel();
}
const HazardDetailPanel = () => "../../components/hazardDetail/HazardDetailPanel.js";
const _sfc_main = {
__name: "view",
setup(__props) {
const detailData = common_vendor.reactive({
hazardId: "",
assignId: "",
title: "",
level: 0,
levelName: "",
source: "",
description: "",
address: "",
areaName: "",
areaColor: "",
tagName: "",
legalBasis: "",
regulationName: "",
attachments: []
});
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;
common_vendor.index.previewImage({
current: index,
urls: detailData.attachments.map((item) => getFullPath(item.filePath))
});
};
const fetchDetail = async (hazardId, assignId) => {
const detailData = common_vendor.ref({});
const loading = common_vendor.ref(false);
const loadDetail = async (hazardId) => {
loading.value = true;
try {
const params = { hazardId };
if (assignId)
params.assignId = assignId;
const res = await request_api.getHiddenDangerDetail(params);
const res = await request_api.getHazardDetail(hazardId);
if (res.code === 0 && res.data) {
Object.assign(detailData, res.data);
detailData.value = res.data;
} else {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:138", "获取隐患详情失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:26", "获取隐患详情失败:", error);
} finally {
loading.value = false;
}
};
common_vendor.onLoad((options) => {
if (options.hazardId) {
fetchDetail(options.hazardId, options.assignId);
loadDetail(options.hazardId);
return;
}
common_vendor.index.showToast({ title: "缺少隐患ID", icon: "none" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(detailData.source || "暂无"),
b: detailData.attachments && detailData.attachments.length > 0
}, detailData.attachments && detailData.attachments.length > 0 ? {
c: common_vendor.f(detailData.attachments, (img, idx, i0) => {
return {
a: idx,
b: getFullPath(img.filePath),
c: common_vendor.o(($event) => previewHazardImage(idx), idx)
};
})
} : {}, {
d: common_vendor.o(($event) => detailData.title = $event),
e: common_vendor.p({
disabled: true,
disabledColor: "#F6F6F6",
border: "surround",
placeholder: "暂无",
modelValue: detailData.title
return {
a: common_vendor.p({
detail: detailData.value,
loading: loading.value
}),
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: 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
}),
r: common_vendor.t(detailData.tagName || "暂无"),
s: common_vendor.gei(_ctx, "")
});
b: common_vendor.gei(_ctx, "")
};
};
}
};

View File

@@ -1,7 +1,6 @@
{
"navigationBarTitleText": "查看隐患",
"usingComponents": {
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
"hazard-detail-panel": "../../components/hazardDetail/HazardDetailPanel"
}
}

View File

@@ -1 +1 @@
<view class="{{['padding', 'page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{s}}"><view class="padding bg-white radius data-v-4d631e68"><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">检查形式</view><view class="text-red data-v-4d631e68">*</view></view><view class="read-only-box data-v-4d631e68">{{a}}</view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患图片</view><view class="text-red data-v-4d631e68">*</view></view><view class="margin-bottom data-v-4d631e68"><view wx:if="{{b}}" class="margin-top-xs data-v-4d631e68"><view class="flex data-v-4d631e68" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{c}}" wx:for-item="img" wx:key="a" class="data-v-4d631e68" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill" bindtap="{{img.c}}"></image></view></view><view wx:else class="text-gray text-sm data-v-4d631e68">暂无图片</view><view class="text-gray text-sm margin-top-xs data-v-4d631e68">必填:请上传现场照片作为隐患证据</view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患标题</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{e}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" bindupdateModelValue="{{d}}" u-p="{{e}}"/><view class="text-sm text-gray margin-top-xs data-v-4d631e68">请用简洁的语言概括隐患要点</view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患等级</view><view class="text-red data-v-4d631e68">*</view></view><view class="flex col-2 data-v-4d631e68" style="gap:10rpx"><view class="{{[f, 'level-item', 'data-v-4d631e68']}}">一般隐患</view><view class="{{[g, 'level-item', 'data-v-4d631e68']}}">重大隐患</view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患位置</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{i}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-1" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"/><view class="text-gray text-sm margin-top-xs data-v-4d631e68">如办公楼3层东侧消防通道、生产车间A区设备旁等或点击"选择地址"按钮在地图上选择</view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">法律依据</view></view><view class="read-only-select data-v-4d631e68"><view class="{{['select-value', 'data-v-4d631e68', k && 'placeholder']}}">{{j}}</view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患区域</view></view><view class="read-only-select data-v-4d631e68"><view class="flex align-center data-v-4d631e68"><view wx:if="{{l}}" class="area-color-dot data-v-4d631e68" style="{{'background-color:' + m}}"></view><view class="{{['select-value', 'data-v-4d631e68', o && 'placeholder']}}">{{n}}</view></view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患描述</view><view class="text-red data-v-4d631e68">*</view></view><up-textarea wx:if="{{q}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-2" bind:__l="__l" bindupdateModelValue="{{p}}" u-p="{{q}}"></up-textarea><view class="text-gray text-sm margin-top-xs data-v-4d631e68">请详细说明隐患现状、潜在风险及影响范围</view><view class="text-gray margin-bottom margin-top data-v-4d631e68">隐患标签</view><view class="read-only-box data-v-4d631e68">{{r}}</view></view></view>
<view class="{{['page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{b}}"><hazard-detail-panel wx:if="{{a}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" u-p="{{a}}"/></view>

View File

@@ -26,40 +26,5 @@
/* 文章场景相关 */
.page.data-v-4d631e68 {
min-height: 100vh;
background: #EBF2FC;
}
.read-only-box.data-v-4d631e68 {
background: #f5f5f5;
border-radius: 8rpx;
padding: 20rpx 24rpx;
font-size: 28rpx;
color: #333;
}
.read-only-select.data-v-4d631e68 {
background: #f5f5f5;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
}
.read-only-select .select-value.data-v-4d631e68 {
font-size: 28rpx;
color: #333;
line-height: 1.5;
word-break: break-all;
}
.read-only-select .select-value.placeholder.data-v-4d631e68 {
color: #999;
}
.level-item.data-v-4d631e68 {
padding: 16rpx 40rpx;
border-radius: 8rpx;
text-align: center;
font-size: 28rpx;
}
.area-color-dot.data-v-4d631e68 {
width: 24rpx;
height: 24rpx;
border-radius: 50%;
margin-right: 16rpx;
flex-shrink: 0;
background: #ebf2fc;
}

View File

@@ -6,13 +6,16 @@ const request_three_one_api_info = require("../../request/three_one_api/info.js"
const request_request = require("../../request/request.js");
if (!Array) {
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
_easycom_u_navbar2();
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
(_easycom_u_navbar2 + _easycom_u_icon2)();
}
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
const _easycom_u_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
if (!Math) {
_easycom_u_navbar();
(_easycom_u_navbar + _easycom_u_icon)();
}
const defaultAvatar = "https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg";
const PLAN_INITIAL_SIZE = 4;
const _sfc_main = {
__name: "index",
setup(__props) {
@@ -51,7 +54,7 @@ const _sfc_main = {
}
}
} catch (e) {
common_vendor.index.__f__("error", "at pages/index/index.vue:229", "获取用户信息失败:", e);
common_vendor.index.__f__("error", "at pages/index/index.vue:245", "获取用户信息失败:", e);
try {
const storedUserInfo = common_vendor.index.getStorageSync("userInfo");
if (storedUserInfo) {
@@ -66,7 +69,7 @@ const _sfc_main = {
userInfo.phone = info.phone || "";
}
} catch (storageError) {
common_vendor.index.__f__("error", "at pages/index/index.vue:245", "从本地存储获取用户信息失败:", storageError);
common_vendor.index.__f__("error", "at pages/index/index.vue:261", "从本地存储获取用户信息失败:", storageError);
}
}
};
@@ -111,14 +114,41 @@ const _sfc_main = {
}
return allMenuList;
});
const ViewDetails = (item) => {
const formatProgress = (progress) => {
const num = Number(progress);
if (Number.isNaN(num))
return 0;
return Math.min(100, Math.max(0, num));
};
const getTodayDateStr = () => {
const date = /* @__PURE__ */ new Date();
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, "0");
const d = String(date.getDate()).padStart(2, "0");
return `${y}-${m}-${d}`;
};
const goTodayInspect = (item) => {
const oneTableId = item.id;
const taskDate = getTodayDateStr();
const tableId = item.tableId ?? item.id;
if (!oneTableId || !taskDate) {
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
return;
}
const name = item.name || "";
const tableIdQuery = tableId ? `&tableId=${tableId}` : "";
common_vendor.index.navigateTo({
url: `/pages/plandetail/plandetail?id=${item.id}`
url: `/pages/Inspectionresult/detail?oneTableId=${oneTableId}&taskDate=${encodeURIComponent(taskDate)}&name=${encodeURIComponent(name)}${tableIdQuery}`
});
};
const goDetails = (item) => {
const goPlanCheckList = (item) => {
const tableId = item.tableId ?? item.id;
if (!tableId) {
common_vendor.index.showToast({ title: "缺少检查表ID", icon: "none" });
return;
}
common_vendor.index.navigateTo({
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
url: `/pages/Inspectionresult/list?tableId=${tableId}&name=${encodeURIComponent(item.name || "")}`
});
};
const handleMenuClick = (item) => {
@@ -142,23 +172,78 @@ const _sfc_main = {
};
const checkPlanParams = common_vendor.ref({
pageNum: 1,
pageSize: 10,
pageSize: PLAN_INITIAL_SIZE,
name: ""
});
const checkPlanData = common_vendor.ref([]);
const checkPlanTotal = common_vendor.ref(0);
const planShowAll = common_vendor.ref(false);
const expandedPlanMap = common_vendor.ref({});
const hasMoreCheckPlans = common_vendor.computed(() => {
return !planShowAll.value && checkPlanTotal.value > PLAN_INITIAL_SIZE;
});
const initPlanExpandedState = (records = [], { reset = false, expandFirst = false } = {}) => {
const map = reset ? {} : { ...expandedPlanMap.value };
records.forEach((item, index) => {
if (reset) {
map[item.id] = expandFirst && index === 0;
} else if (!(item.id in map)) {
map[item.id] = false;
}
});
expandedPlanMap.value = map;
};
const isPlanExpanded = (id) => !!expandedPlanMap.value[id];
const togglePlanExpand = (id) => {
expandedPlanMap.value = {
...expandedPlanMap.value,
[id]: !expandedPlanMap.value[id]
};
};
const getCheckPlanLists = async () => {
var _a, _b;
planShowAll.value = false;
try {
const res = await request_api.getCheckPlanList(checkPlanParams.value);
common_vendor.index.__f__("log", "at pages/index/index.vue:339", res);
const res = await request_api.getCheckPlanList({
pageNum: 1,
pageSize: PLAN_INITIAL_SIZE,
name: checkPlanParams.value.name
});
if (res.code === 0) {
checkPlanData.value = res.data.records;
const records = ((_a = res.data) == null ? void 0 : _a.records) || [];
checkPlanTotal.value = Number(((_b = res.data) == null ? void 0 : _b.total) ?? records.length);
checkPlanData.value = records;
initPlanExpandedState(records, { reset: true, expandFirst: true });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:344", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:431", error);
} finally {
loading.value = false;
}
};
const loadMoreCheckPlans = async () => {
var _a;
if (!hasMoreCheckPlans.value)
return;
try {
const res = await request_api.getCheckPlanList({
pageNum: 1,
pageSize: checkPlanTotal.value,
name: checkPlanParams.value.name
});
if (res.code === 0) {
const records = ((_a = res.data) == null ? void 0 : _a.records) || [];
initPlanExpandedState(records);
checkPlanData.value = records;
planShowAll.value = true;
} else {
common_vendor.index.showToast({ title: res.msg || "加载失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:454", error);
common_vendor.index.showToast({ title: "加载失败", icon: "none" });
}
};
const formatDate = (dateStr) => {
if (!dateStr)
return "";
@@ -197,13 +282,13 @@ const _sfc_main = {
const getHiddenDangerLists = async () => {
try {
const res = await request_api.getHiddenDangerList(hiddenDangerParams.value);
common_vendor.index.__f__("log", "at pages/index/index.vue:403", res);
common_vendor.index.__f__("log", "at pages/index/index.vue:512", res);
if (res.code === 0) {
hiddenDangerData.value = res.data.records;
common_vendor.index.__f__("log", "at pages/index/index.vue:406", hiddenDangerData.value, 1111);
common_vendor.index.__f__("log", "at pages/index/index.vue:515", hiddenDangerData.value, 1111);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:409", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:518", error);
} finally {
loading.value = false;
}
@@ -213,7 +298,7 @@ const _sfc_main = {
});
const viewHazardDetail = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
url: `/pages/hiddendanger/detail2?hazardId=${item.hazardId}&assignId=${item.assignId || ""}`
});
};
const goRectification = (item) => {
@@ -237,7 +322,7 @@ const _sfc_main = {
return common_vendor.e({
a: common_assets._imports_0,
b: common_vendor.p({
title: "三查一曝光",
title: "湘西州“三个一”安全管理平台",
placeholder: false,
fixed: false,
safeAreaInsetTop: true,
@@ -259,27 +344,39 @@ const _sfc_main = {
}),
g: checkPlanData.value.length === 0
}, checkPlanData.value.length === 0 ? {} : {}, {
h: common_vendor.f(checkPlanData.value, (item, index, i0) => {
return common_vendor.e({
h: common_vendor.f(checkPlanData.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.t(item.runModeName),
c: common_vendor.t(item.cycle),
d: common_vendor.t(formatDate(item.planStartTime)),
e: common_vendor.t(formatDate(item.planEndTime)),
f: item.progress + "%",
g: common_vendor.t(item.progress),
h: common_vendor.t(item.totalCount),
i: common_vendor.t(item.totalCount - item.finishedCount),
j: common_vendor.t(item.finishedCount),
k: common_vendor.o(($event) => ViewDetails(item), item.id),
l: item.finishedCount < item.totalCount
}, item.finishedCount < item.totalCount ? {
m: common_vendor.o(($event) => goDetails(item), item.id)
} : {}, {
n: item.id
});
b: "1cf27b2a-1-" + i0,
c: common_vendor.p({
name: isPlanExpanded(item.id) ? "arrow-down" : "arrow-up",
color: "#ffffff",
size: "18"
}),
d: common_vendor.o(($event) => togglePlanExpand(item.id), item.id),
e: common_vendor.o(($event) => togglePlanExpand(item.id), item.id),
f: common_vendor.t(item.runModeName),
g: common_vendor.t(item.cycle),
h: common_vendor.t(formatDate(item.planStartTime)),
i: common_vendor.t(formatDate(item.planEndTime)),
j: formatProgress(item.progress) + "%",
k: common_vendor.t(formatProgress(item.progress)),
l: common_vendor.t(item.pendingCount ?? 0),
m: common_vendor.t(item.waitCheckNum ?? 0),
n: common_vendor.t(item.unusualNum ?? 0),
o: common_vendor.t(item.finishedCount ?? 0),
p: common_vendor.o(($event) => goTodayInspect(item), item.id),
q: common_vendor.o(($event) => goPlanCheckList(item), item.id),
r: isPlanExpanded(item.id),
s: !isPlanExpanded(item.id) ? 1 : "",
t: item.id
};
}),
i: common_vendor.f(dangerTabs.value, (tab, index, i0) => {
i: hasMoreCheckPlans.value
}, hasMoreCheckPlans.value ? {
j: common_vendor.o(loadMoreCheckPlans)
} : {}, {
k: common_vendor.f(dangerTabs.value, (tab, index, i0) => {
return {
a: common_vendor.t(tab.label),
b: activeDangerTab.value === index ? 1 : "",
@@ -287,9 +384,9 @@ const _sfc_main = {
d: common_vendor.o(($event) => switchDangerTab(index), index)
};
}),
j: filteredDangerData.value.length === 0
l: filteredDangerData.value.length === 0
}, filteredDangerData.value.length === 0 ? {} : {}, {
k: common_vendor.f(filteredDangerData.value, (item, index, i0) => {
m: common_vendor.f(filteredDangerData.value, (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.title),
b: common_vendor.t(item.levelName),
@@ -316,7 +413,7 @@ const _sfc_main = {
q: item.hazardId
});
}),
l: common_vendor.gei(_ctx, "")
n: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -1,8 +1,9 @@
{
"navigationBarTitleText": "三查一曝光",
"navigationBarTitleText": "湘西州“三个一”安全管理平台",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"usingComponents": {
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar"
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar",
"u-icon": "../../uni_modules/uview-plus/components/u-icon/u-icon"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -139,6 +139,14 @@
border-radius: 20rpx;
padding: 20rpx;
}
.inspect-list-btn.data-v-1cf27b2a {
margin: 0;
padding: 0 24rpx;
height: 56rpx;
line-height: 56rpx;
font-size: 24rpx;
flex-shrink: 0;
}
.plan-card.data-v-1cf27b2a {
border-radius: 16rpx;
overflow: hidden;
@@ -149,6 +157,7 @@
padding: 24rpx 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.plan-header .plan-header-icon.data-v-1cf27b2a {
width: 36rpx;
@@ -156,14 +165,34 @@
margin-right: 12rpx;
}
.plan-header .plan-header-title.data-v-1cf27b2a {
flex: 1;
min-width: 0;
padding-right: 16rpx;
color: #fff;
font-size: 30rpx;
font-weight: bold;
}
.plan-toggle-btn.data-v-1cf27b2a {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 48rpx;
height: 48rpx;
}
.plan-body.data-v-1cf27b2a {
padding: 24rpx 30rpx 10rpx 30rpx;
background: #fff;
}
.plan-body--collapsed.data-v-1cf27b2a {
padding-bottom: 24rpx;
}
.plan-load-more.data-v-1cf27b2a {
text-align: center;
padding: 24rpx 0 8rpx;
font-size: 28rpx;
color: #2667E9;
}
.plan-stats.data-v-1cf27b2a {
display: flex;
background: #F5F7FA;

View File

@@ -147,10 +147,10 @@ const _sfc_main = {
a: common_vendor.p({
isBack: true
}),
b: common_assets._imports_0$5,
b: common_assets._imports_0$6,
c: phone.value,
d: common_vendor.o(($event) => phone.value = $event.detail.value),
e: common_assets._imports_1$3,
e: common_assets._imports_1$4,
f: !showPassword.value,
g: password.value,
h: common_vendor.o(($event) => password.value = $event.detail.value),

View File

@@ -75,11 +75,11 @@ const _sfc_main = {
};
return (_ctx, _cache) => {
return {
a: common_assets._imports_0$4,
b: common_assets._imports_0$5,
a: common_assets._imports_0$5,
b: common_assets._imports_0$6,
c: username.value,
d: common_vendor.o(($event) => username.value = $event.detail.value),
e: common_assets._imports_1$3,
e: common_assets._imports_1$4,
f: showPassword.value,
g: password.value,
h: common_vendor.o(($event) => password.value = $event.detail.value),

View File

@@ -1 +1 @@
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{l}}"><view class="header data-v-e4e4508d"><image src="{{a}}" class="bg-image data-v-e4e4508d"></image><view class="padding login data-v-e4e4508d"><view class="text-xl text-black text-bold data-v-e4e4508d">账号登录</view><view class="padding-top data-v-e4e4508d">欢迎登录三查一曝光平台</view></view></view><view class="list data-v-e4e4508d"><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{b}}"></image><input class="sl-input data-v-e4e4508d" type="text" placeholder="请输入用户名" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{e}}"></image><input class="sl-input data-v-e4e4508d" type="text" maxlength="32" placeholder="请输入密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><image class="eye-img data-v-e4e4508d" src="{{i}}" bindtap="{{j}}"></image></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button></view></view>
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{l}}"><view class="header data-v-e4e4508d"><image src="{{a}}" class="bg-image data-v-e4e4508d"></image><view class="padding login data-v-e4e4508d"><view class="text-xl text-black text-bold data-v-e4e4508d">账号登录</view><view class="padding-top data-v-e4e4508d">欢迎登录湘西州“三个一”安全管理平台</view></view></view><view class="list data-v-e4e4508d"><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{b}}"></image><input class="sl-input data-v-e4e4508d" type="text" placeholder="请输入用户名" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{e}}"></image><input class="sl-input data-v-e4e4508d" type="text" maxlength="32" placeholder="请输入密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><image class="eye-img data-v-e4e4508d" src="{{i}}" bindtap="{{j}}"></image></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button></view></view>

View File

@@ -9,7 +9,7 @@ const _sfc_main = {
return common_vendor.e({
a: success
}, {
b: common_assets._imports_0$6
b: common_assets._imports_0$7
}, {
d: common_vendor.gei(_ctx, "")
});

View File

@@ -39,10 +39,10 @@ const _sfc_main = {
const userInfoStr = common_vendor.index.getStorageSync("userInfo");
if (userInfoStr) {
userInfo.value = JSON.parse(userInfoStr);
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:147", "用户信息:", userInfo.value);
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:166", "用户信息:", userInfo.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:150", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:169", "获取用户信息失败:", error);
}
};
const list = common_vendor.ref([]);
@@ -51,43 +51,103 @@ const _sfc_main = {
const res = await request_api.getMemberList();
if (res.code === 0 && res.data) {
list.value = res.data;
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:163", "成员列表:", res.data);
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:182", "成员列表:", res.data);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:166", "获取成员列表失败:", error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:185", "获取成员列表失败:", error);
}
};
const showPopup = common_vendor.ref(false);
const showRolePicker = common_vendor.ref(false);
const showPostPicker = common_vendor.ref(false);
const selectedRoleName = common_vendor.ref("");
const selectedPostName = common_vendor.ref("");
const formData = common_vendor.reactive({
username: "",
nickname: "",
phone: "",
password: "",
roleType: ""
roleType: "",
postId: ""
});
const roleColumns = common_vendor.reactive([
["管理员", "普通成员"]
]);
const roleMap = {
"管理员": "manage",
"普通成员": "common"
const roleOptions = common_vendor.ref([]);
const roleColumns = common_vendor.ref([[]]);
const postOptions = common_vendor.ref([]);
const postColumns = common_vendor.ref([[]]);
const postPlaceholder = common_vendor.computed(() => {
if (!userInfo.value.deptId)
return "请先登录并确认部门信息";
return postOptions.value.length ? "请选择岗位" : "暂无可用岗位";
});
const openAddMemberPopup = async () => {
getUserInfo();
const deptId = userInfo.value.deptId;
if (!deptId) {
common_vendor.index.showToast({ title: "缺少部门信息,无法添加成员", icon: "none" });
return;
}
try {
common_vendor.index.showLoading({ title: "加载中..." });
const [optionsRes, postRes] = await Promise.all([
request_api.getSystemUserFormOptions(),
request_api.listPostByDeptId(deptId)
]);
common_vendor.index.hideLoading();
if (optionsRes.code !== 0 || !Array.isArray(optionsRes.roles) || !optionsRes.roles.length) {
common_vendor.index.showToast({ title: optionsRes.msg || "获取角色列表失败", icon: "none" });
return;
}
roleOptions.value = optionsRes.roles.filter((item) => item.status === "0");
roleColumns.value = [roleOptions.value.map((item) => item.roleName)];
const posts = postRes.data || postRes.rows || [];
postOptions.value = posts.filter((item) => item.status === "0");
postColumns.value = [postOptions.value.map((item) => item.postName)];
showPopup.value = true;
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:251", "获取表单选项失败:", error);
common_vendor.index.showToast({
title: (error == null ? void 0 : error.msg) || "获取表单选项失败",
icon: "none"
});
}
};
const openPostPicker = () => {
if (!postOptions.value.length) {
common_vendor.index.showToast({ title: "当前部门暂无可用岗位", icon: "none" });
return;
}
showPostPicker.value = true;
};
const onRoleConfirm = (e) => {
if (e.value && e.value.length > 0) {
selectedRoleName.value = e.value[0];
formData.roleType = roleMap[e.value[0]];
const roleName = e.value[0];
const role = roleOptions.value.find((item) => item.roleName === roleName);
selectedRoleName.value = roleName;
formData.roleType = (role == null ? void 0 : role.roleKey) || "";
}
showRolePicker.value = false;
};
const onPostConfirm = (e) => {
if (e.value && e.value.length > 0) {
const postName = e.value[0];
const post = postOptions.value.find((item) => item.postName === postName);
selectedPostName.value = postName;
formData.postId = (post == null ? void 0 : post.postId) ?? "";
}
showPostPicker.value = false;
};
const resetForm = () => {
formData.username = "";
formData.nickname = "";
formData.phone = "";
formData.password = "";
formData.roleType = "";
formData.postId = "";
selectedRoleName.value = "";
selectedPostName.value = "";
postOptions.value = [];
postColumns.value = [[]];
};
const handleSubmit = async () => {
if (!formData.username) {
@@ -102,13 +162,23 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请选择角色类型", icon: "none" });
return;
}
getUserInfo();
const deptId = userInfo.value.deptId;
if (!deptId) {
common_vendor.index.showToast({ title: "缺少部门信息,无法添加成员", icon: "none" });
return;
}
const params = {
userName: formData.username,
nickName: formData.nickname || "",
phonenumber: formData.phone || "",
password: formData.password,
roleType: formData.roleType
roleType: formData.roleType,
deptId
};
if (formData.postId) {
params.postId = formData.postId;
}
try {
const res = await request_api.addMember(params);
if (res.code === 0) {
@@ -120,7 +190,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "添加失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:249", "添加成员失败:", error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:349", "添加成员失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
@@ -147,7 +217,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: result.msg || `${actionText}失败`, icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:280", `${actionText}成员失败:`, error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:380", `${actionText}成员失败:`, error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
}
@@ -174,7 +244,7 @@ const _sfc_main = {
h: index < list.value.length - 1 ? 1 : ""
};
}),
d: common_vendor.o(($event) => showPopup.value = true),
d: common_vendor.o(openAddMemberPopup),
e: common_vendor.o(($event) => showPopup.value = false),
f: common_vendor.o(($event) => formData.username = $event),
g: common_vendor.p({
@@ -205,23 +275,33 @@ const _sfc_main = {
n: common_vendor.t(selectedRoleName.value || "请选择角色类型"),
o: common_vendor.n(selectedRoleName.value ? "" : "text-gray"),
p: common_vendor.o(($event) => showRolePicker.value = true),
q: common_vendor.o(($event) => showPopup.value = false),
r: common_vendor.o(handleSubmit),
s: common_vendor.o(($event) => showPopup.value = false),
t: common_vendor.p({
q: common_vendor.t(selectedPostName.value || postPlaceholder.value),
r: common_vendor.n(selectedPostName.value ? "" : "text-gray"),
s: common_vendor.o(openPostPicker),
t: common_vendor.o(($event) => showPopup.value = false),
v: common_vendor.o(handleSubmit),
w: common_vendor.o(($event) => showPopup.value = false),
x: common_vendor.p({
show: showPopup.value,
mode: "center",
round: "20",
safeAreaInsetBottom: false
}),
v: common_vendor.o(onRoleConfirm),
w: common_vendor.o(($event) => showRolePicker.value = false),
x: common_vendor.o(($event) => showRolePicker.value = false),
y: common_vendor.p({
show: showRolePicker.value,
columns: roleColumns
y: common_vendor.o(onPostConfirm),
z: common_vendor.o(($event) => showPostPicker.value = false),
A: common_vendor.o(($event) => showPostPicker.value = false),
B: common_vendor.p({
show: showPostPicker.value,
columns: postColumns.value
}),
z: common_vendor.gei(_ctx, "")
C: common_vendor.o(onRoleConfirm),
D: common_vendor.o(($event) => showRolePicker.value = false),
E: common_vendor.o(($event) => showRolePicker.value = false),
F: common_vendor.p({
show: showRolePicker.value,
columns: roleColumns.value
}),
G: common_vendor.gei(_ctx, "")
};
};
}

View File

@@ -1 +1 @@
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{z}}"><view class="member-card bg-white radius data-v-06d9f81b"><view class="card-header data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-line data-v-06d9f81b"></view><view class="text-bold margin-left-sm data-v-06d9f81b">{{a}}</view></view><view class="role-tag data-v-06d9f81b">{{b}}</view></view><view class="member-list data-v-06d9f81b"><view wx:for="{{c}}" wx:for-item="item" wx:key="g" class="{{['member-item', 'data-v-06d9f81b', item.h && 'border-bottom']}}"><view class="cu-avatar radius lg bg-gray data-v-06d9f81b" style="background-image:url(https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png)"></view><view class="member-info data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><text class="member-name data-v-06d9f81b">{{item.a}}</text><view class="{{['status-tag', 'data-v-06d9f81b', item.c]}}">{{item.b}}</view></view><view class="member-phone text-gray data-v-06d9f81b"><text class="data-v-06d9f81b">手机:{{item.d}}</text></view></view><button class="btn-lock bg-blue data-v-06d9f81b" bindtap="{{item.f}}">{{item.e}}</button></view></view><view class="add-btn-wrapper data-v-06d9f81b"><button class="add-btn data-v-06d9f81b" bindtap="{{d}}"><text class="cuIcon-add data-v-06d9f81b"></text><text class="data-v-06d9f81b">添加成员</text></button></view></view><u-popup wx:if="{{t}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{s}}" u-i="06d9f81b-0" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{e}}">×</view></view><scroll-view class="popup-body data-v-06d9f81b" scroll-y><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{g}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-1,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><up-input wx:if="{{i}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-2,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><up-input wx:if="{{k}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{m}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-4,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">角色类型<text class="text-red data-v-06d9f81b">*</text></view><view class="form-select data-v-06d9f81b" bindtap="{{p}}"><text class="{{['data-v-06d9f81b', o]}}">{{n}}</text><text class="cuIcon-unfold data-v-06d9f81b"></text></view></view><view class="data-v-06d9f81b" style="height:40rpx"></view></scroll-view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{r}}">确定</button></view></view></u-popup><up-picker wx:if="{{y}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{v}}" bindcancel="{{w}}" bindclose="{{x}}" u-i="06d9f81b-5" bind:__l="__l" u-p="{{y}}"></up-picker><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-6" bind:__l="__l"/></view>
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{G}}"><view class="member-card bg-white radius data-v-06d9f81b"><view class="card-header data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-line data-v-06d9f81b"></view><view class="text-bold margin-left-sm data-v-06d9f81b">{{a}}</view></view><view class="role-tag data-v-06d9f81b">{{b}}</view></view><view class="member-list data-v-06d9f81b"><view wx:for="{{c}}" wx:for-item="item" wx:key="g" class="{{['member-item', 'data-v-06d9f81b', item.h && 'border-bottom']}}"><view class="cu-avatar radius lg bg-gray data-v-06d9f81b" style="background-image:url(https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png)"></view><view class="member-info data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><text class="member-name data-v-06d9f81b">{{item.a}}</text><view class="{{['status-tag', 'data-v-06d9f81b', item.c]}}">{{item.b}}</view></view><view class="member-phone text-gray data-v-06d9f81b"><text class="data-v-06d9f81b">手机:{{item.d}}</text></view></view><button class="btn-lock bg-blue data-v-06d9f81b" bindtap="{{item.f}}">{{item.e}}</button></view></view><view class="add-btn-wrapper data-v-06d9f81b"><button class="add-btn data-v-06d9f81b" bindtap="{{d}}"><text class="cuIcon-add data-v-06d9f81b"></text><text class="data-v-06d9f81b">添加成员</text></button></view></view><u-popup wx:if="{{x}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{w}}" u-i="06d9f81b-0" bind:__l="__l" u-p="{{x}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{e}}">×</view></view><scroll-view class="popup-body data-v-06d9f81b" scroll-y><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{g}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-1,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><up-input wx:if="{{i}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-2,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><up-input wx:if="{{k}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{m}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-4,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">角色类型<text class="text-red data-v-06d9f81b">*</text></view><view class="form-select data-v-06d9f81b" bindtap="{{p}}"><text class="{{['data-v-06d9f81b', o]}}">{{n}}</text><text class="cuIcon-unfold data-v-06d9f81b"></text></view></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">岗位</view><view class="form-select data-v-06d9f81b" bindtap="{{s}}"><text class="{{['data-v-06d9f81b', r]}}">{{q}}</text><text class="cuIcon-unfold data-v-06d9f81b"></text></view></view><view class="data-v-06d9f81b" style="height:40rpx"></view></scroll-view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{t}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{v}}">确定</button></view></view></u-popup><up-picker wx:if="{{B}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{y}}" bindcancel="{{z}}" bindclose="{{A}}" u-i="06d9f81b-5" bind:__l="__l" u-p="{{B}}"></up-picker><up-picker wx:if="{{F}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{C}}" bindcancel="{{D}}" bindclose="{{E}}" u-i="06d9f81b-6" bind:__l="__l" u-p="{{F}}"></up-picker><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-7" bind:__l="__l"/></view>

View File

@@ -4,8 +4,8 @@ const common_assets = require("../../common/assets.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {
a: common_assets._imports_0$3,
b: common_assets._imports_1$2,
a: common_assets._imports_0$4,
b: common_assets._imports_1$3,
c: common_vendor.gei(_ctx, "")
};
}

View File

@@ -82,9 +82,9 @@ const _sfc_main = {
b: getImageUrl(userInfo.avatar) || defaultAvatar,
c: common_vendor.t(userInfo.nickName || "未设置昵称"),
d: common_vendor.t(userInfo.phonenumber || "未绑定手机"),
e: common_assets._imports_0$2,
e: common_assets._imports_0$3,
f: common_vendor.o(($event) => editinfo()),
g: common_assets._imports_1$1,
g: common_assets._imports_1$2,
h: common_vendor.o(($event) => editinfo()),
i: common_assets._imports_2,
j: common_vendor.o(($event) => Account()),

View File

@@ -7,12 +7,26 @@ function getCheckPlanList(params) {
data: params
});
}
function getPlanTableDetail(params) {
return request_request.requestAPI({
url: "/frontend/plan/tableDetail",
method: "GET",
data: params
});
}
function enterCheckPlan(oneTableId) {
return request_request.requestAPI({
url: `/frontend/task/start/${oneTableId}`,
method: "GET"
});
}
function getAllTask(oneTableId, taskDate) {
const date = String(taskDate || "").split(" ")[0];
return request_request.requestAPI({
url: `/frontend/task/getAllTask/${oneTableId}/${date}`,
method: "GET"
});
}
function getCheckTaskDetail(taskId) {
return request_request.requestAPI({
url: `/frontend/task/detail/${taskId}`,
@@ -26,6 +40,13 @@ function submitCheckResult(params) {
data: params
});
}
function submitAllTask(data) {
return request_request.requestAPI({
url: "/frontend/task/submitAll",
method: "POST",
data
});
}
function addHiddenDanger(params) {
return request_request.requestAPI({
url: "/frontend/hazard/add",
@@ -66,6 +87,12 @@ function getHiddenDangerDetail(params) {
data: filteredParams
});
}
function getHazardDetail(hazardId) {
return request_request.requestAPI({
url: `/admin/hazard/detail/${hazardId}`,
method: "GET"
});
}
function getHiddenDangerList(params) {
return request_request.requestAPI({
url: "/frontend/hazard/my/list",
@@ -128,6 +155,20 @@ function lockOrUnlockMember(params) {
data: params
});
}
function getSystemUserFormOptions() {
return request_request.requestAPI({
url: "/system/user/",
method: "GET",
loadingText: false
});
}
function listPostByDeptId(deptId) {
return request_request.requestAPI({
url: `/system/post/listByDeptId/${deptId}`,
method: "GET",
loadingText: false
});
}
function applyDelete(params) {
return request_request.requestAPI({
url: "/frontend/hazard/writeoff/apply",
@@ -317,6 +358,7 @@ exports.enterCheckPlan = enterCheckPlan;
exports.generateRectifyPlan = generateRectifyPlan;
exports.generateWriteoffContent = generateWriteoffContent;
exports.getAcceptanceList = getAcceptanceList;
exports.getAllTask = getAllTask;
exports.getCheckItemList = getCheckItemList;
exports.getCheckItemListDetail = getCheckItemListDetail;
exports.getCheckPlanList = getCheckPlanList;
@@ -327,6 +369,7 @@ exports.getDeptUsers = getDeptUsers;
exports.getDeptUsersWithSubordinates = getDeptUsersWithSubordinates;
exports.getEnterpriseinfo = getEnterpriseinfo;
exports.getEnterprisetype = getEnterprisetype;
exports.getHazardDetail = getHazardDetail;
exports.getHiddenDangerDetail = getHiddenDangerDetail;
exports.getHiddenDangerLabelList = getHiddenDangerLabelList;
exports.getHiddenDangerList = getHiddenDangerList;
@@ -335,13 +378,17 @@ exports.getMemberList = getMemberList;
exports.getMyHiddenDangerList = getMyHiddenDangerList;
exports.getMyWriteOffList = getMyWriteOffList;
exports.getParentDepts = getParentDepts;
exports.getPlanTableDetail = getPlanTableDetail;
exports.getQiniuUploadToken = getQiniuUploadToken;
exports.getRectifyDetail = getRectifyDetail;
exports.getRegulationList = getRegulationList;
exports.getSystemUserFormOptions = getSystemUserFormOptions;
exports.getWriteOffApplyDetail = getWriteOffApplyDetail;
exports.getindustry = getindustry;
exports.listPostByDeptId = listPostByDeptId;
exports.lockOrUnlockMember = lockOrUnlockMember;
exports.login = login;
exports.submitAllTask = submitAllTask;
exports.submitCheckResult = submitCheckResult;
exports.submitRectification = submitRectification;
exports.updateEnterprise = updateEnterprise;

View File

@@ -1,7 +1,7 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const request_luchRequest_core_Request = require("./luch-request/core/Request.js");
const baseUrl = "http://192.168.1.168:5004";
const baseUrl = "https://yingji.hexieapi.com/prod-api";
const imageBaseUrl = baseUrl.replace(/\/prod-api\/?$/, "");
new request_luchRequest_core_Request.Request({
baseURL: baseUrl,
@@ -60,7 +60,7 @@ const requestAPI = (config) => {
success: (res) => {
common_vendor.index.hideLoading();
if (res.statusCode !== 200) {
common_vendor.index.__f__("error", "at request/request.js:86", "HTTP错误:", res.statusCode);
common_vendor.index.__f__("error", "at request/request.js:88", "HTTP错误:", res.statusCode);
reject(`HTTP_${res.statusCode}`);
return;
}
@@ -79,7 +79,7 @@ const requestAPI = (config) => {
reject({ code: 401, msg: "登录已过期" });
} else {
const errorMsg = res.data.msg || res.data.message || res.data.error || res.msg || "请求失败";
common_vendor.index.__f__("error", "at request/request.js:111", "接口错误:", res.data);
common_vendor.index.__f__("error", "at request/request.js:113", "接口错误:", res.data);
showToast(errorMsg);
reject({ code: res.data.code, msg: errorMsg, data: res.data });
}
@@ -88,7 +88,7 @@ const requestAPI = (config) => {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at request/request.js:122", "网络请求失败:", err);
common_vendor.index.__f__("error", "at request/request.js:124", "网络请求失败:", err);
common_vendor.index.hideLoading();
if (err.errMsg && err.errMsg.includes("request:fail")) {
showToast("网络连接失败,请检查网络设置");

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

View File

@@ -1,110 +0,0 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "up-choose",
props: {
options: {
type: Array,
default: () => {
return [];
}
},
modelValue: {
type: [Number, String, Array],
default: false
},
type: {
type: [String],
default: "radio"
},
itemWidth: {
type: [String],
default: "auto"
},
itemHeight: {
type: [String],
default: "50px"
},
itemPadding: {
type: [String],
default: "8px"
},
labelName: {
type: String,
default: "title"
},
valueName: {
type: String,
default: "value"
},
customClick: {
type: Boolean,
default: false
},
// 是否换行
wrap: {
type: Boolean,
default: true
}
},
data() {
return {
currentIndex: ""
};
},
created: function() {
this.currentIndex = this.modelValue;
},
emits: ["update:modelValue", "custom-click"],
methods: {
change(index) {
if (this.customClick) {
this.$emit("custom-click", index);
} else {
this.currentIndex = index;
this.$emit("update:modelValue", index);
}
}
}
};
if (!Array) {
const _easycom_up_tag2 = common_vendor.resolveComponent("up-tag");
_easycom_up_tag2();
}
const _easycom_up_tag = () => "../u-tag/u-tag.js";
if (!Math) {
_easycom_up_tag();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.f($props.options, (item, index, i0) => {
return {
a: common_vendor.t(item[$props.labelName]),
b: common_vendor.n($data.currentIndex === index ? "active" : ""),
c: common_vendor.o(($event) => $options.change(index), item.id),
d: "03109c79-0-" + i0,
e: common_vendor.p({
type: index == $data.currentIndex ? "primary" : "info",
size: "large",
plain: index == $data.currentIndex ? false : true,
height: $props.itemHeight
}),
f: "d-" + i0,
g: common_vendor.r("d", {
item,
index
}, i0),
h: item.id
};
}),
b: $props.itemWidth,
c: $props.itemPadding,
d: $props.itemWidth,
e: $props.wrap === false,
f: common_vendor.n($props.wrap ? "up-choose-wrap" : "up-choose-nowrap"),
g: common_vendor.gei(_ctx, "")
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-03109c79"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-choose/u-choose.js.map

View File

@@ -1,6 +0,0 @@
{
"component": true,
"usingComponents": {
"up-tag": "../u-tag/u-tag"
}
}

View File

@@ -1 +0,0 @@
<scroll-view scroll-x="{{e}}" class="{{['data-v-03109c79', 'up-choose', f, virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><block wx:for="{{a}}" wx:for-item="item" wx:key="h"><view class="data-v-03109c79" style="{{'width:' + d + ';' + ('display:' + 'inline-block')}}"><block wx:if="{{$slots.d}}"><slot name="{{item.f}}"></slot></block><block wx:else><up-tag wx:if="{{item.e}}" u-s="{{['d']}}" class="{{['data-v-03109c79', item.b]}}" virtualHostClass="{{['data-v-03109c79', item.b]}}" style="{{'width:' + b + ';' + ('padding:' + c)}}" virtualHostStyle="{{'width:' + b + ';' + ('padding:' + c)}}" bindclick="{{item.c}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e}}">{{item.a}}</up-tag></block></view></block></scroll-view>

View File

@@ -1,39 +0,0 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.up-choose.data-v-03109c79 .up-tag {
font-weight: 600;
}
.up-choose.data-v-03109c79:last-child {
margin-right: 0;
}
.up-choose-wrap.data-v-03109c79 {
flex-wrap: wrap;
}
.up-choose-nowrap.data-v-03109c79 {
flex-wrap: nowrap;
white-space: nowrap;
}

View File

@@ -1,119 +0,0 @@
"use strict";
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
props: {
// 标签类型info、primary、success、warning、error
type: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.type
},
// 不可用
disabled: {
type: [Boolean, String],
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.disabled
},
// 标签的大小largemediummini
size: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.size
},
// tag的形状circle两边半圆形, square方形带圆角
shape: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.shape
},
// 标签文字
text: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.text
},
// 背景颜色,默认为空字符串,即不处理
bgColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.bgColor
},
// 标签字体颜色,默认为空字符串,即不处理
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.color
},
// 标签的边框颜色
borderColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.borderColor
},
// 关闭按钮图标的颜色
closeColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.closeColor
},
// 点击时返回的索引值,用于区分例遍的数组哪个元素被点击了
name: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.name
},
// // 模式选择dark|light|plain
// mode: {
// type: String,
// default: 'light'
// },
// 镂空时是否填充背景色
plainFill: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.plainFill
},
// 是否镂空
plain: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.plain
},
// 是否可关闭
closable: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.closable
},
// 是否显示
show: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.show
},
// 内置图标,或绝对路径的图片
icon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.icon
},
// 图标颜色
iconColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.iconColor
},
// 自定义尺寸字体大小
textSize: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.textSize
},
// 自定义尺寸高度
height: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.height
},
// 自定义尺寸padding
padding: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.padding
},
// 自定义尺寸
borderRadius: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.borderRadius
},
// 自动计算背景色
autoBgColor: {
type: Number,
default: () => uni_modules_uviewPlus_libs_config_props.props.tag.autoBgColor
}
}
});
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-tag/props.js.map

View File

@@ -1,162 +0,0 @@
"use strict";
const uni_modules_uviewPlus_components_uTag_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-tag",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uTag_props.props],
data() {
return {};
},
computed: {
style() {
const style = {};
if (this.bgColor) {
style.backgroundColor = this.bgColor;
}
if (this.color) {
style.color = this.color;
}
if (this.borderColor) {
style.borderColor = this.borderColor;
}
if (this.height) {
style.height = uni_modules_uviewPlus_libs_function_index.addUnit(this.height);
style.lineHeight = uni_modules_uviewPlus_libs_function_index.addUnit(this.height);
}
if (this.padding) {
style.padding = this.padding;
}
if (this.borderRadius) {
style.borderRadius = uni_modules_uviewPlus_libs_function_index.addUnit(this.borderRadius);
}
if (this.autoBgColor > 0 && this.color) {
style.backgroundColor = this.getBagColor(this.color);
}
return style;
},
// nvue下文本颜色无法继承父元素
textColor() {
const style = {};
if (this.color) {
style.color = this.color;
}
if (this.textSize) {
style.textSize = uni_modules_uviewPlus_libs_function_index.addUnit(this.textSize);
}
return style;
},
imgStyle() {
const width = this.size === "large" ? "17px" : this.size === "medium" ? "15px" : "13px";
return {
width,
height: width
};
},
// 文本的样式
closeSize() {
const size = this.size === "large" ? 15 : this.size === "medium" ? 13 : 12;
return size;
},
// 图标大小
iconSize() {
const size = this.size === "large" ? 21 : this.size === "medium" ? 19 : 16;
return size;
},
// 图标颜色
elIconColor() {
return this.iconColor ? this.iconColor : this.plain ? this.type : "#ffffff";
}
},
emits: ["click", "close"],
methods: {
testImage: uni_modules_uviewPlus_libs_function_test.test.image,
// 点击关闭按钮
closeHandler() {
this.$emit("close", this.name);
},
// 点击标签
clickHandler() {
this.$emit("click", this.name);
},
// 根据颜色计算浅色作为背景
getBagColor(darkColor) {
return uni_modules_uviewPlus_libs_function_index.genLightColor(darkColor, this.autoBgColor);
}
}
};
if (!Array) {
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
const _easycom_u_transition2 = common_vendor.resolveComponent("u-transition");
(_easycom_up_icon2 + _easycom_u_transition2)();
}
const _easycom_up_icon = () => "../u-icon/u-icon.js";
const _easycom_u_transition = () => "../u-transition/u-transition.js";
if (!Math) {
(_easycom_up_icon + _easycom_u_transition)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.icon
}, _ctx.icon ? common_vendor.e({
b: $options.testImage(_ctx.icon)
}, $options.testImage(_ctx.icon) ? {
c: _ctx.icon,
d: common_vendor.s($options.imgStyle)
} : {
e: common_vendor.p({
color: $options.elIconColor,
name: _ctx.icon,
size: $options.iconSize
})
}) : {}, {
f: !_ctx.$slots.content
}, !_ctx.$slots.content ? common_vendor.e({
g: !_ctx.$slots.default && !_ctx.$slots.$default
}, !_ctx.$slots.default && !_ctx.$slots.$default ? {
h: common_vendor.t(_ctx.text),
i: common_vendor.s($options.textColor),
j: common_vendor.n(`u-tag__text--${_ctx.type}`),
k: common_vendor.n(_ctx.plain && `u-tag__text--${_ctx.type}--plain`),
l: common_vendor.n(`u-tag__text--${_ctx.size}`)
} : {
m: common_vendor.s($options.textColor),
n: common_vendor.n(`u-tag__text--${_ctx.type}`),
o: common_vendor.n(_ctx.plain && `u-tag__text--${_ctx.type}--plain`),
p: common_vendor.n(`u-tag__text--${_ctx.size}`)
}) : {}, {
q: common_vendor.n(`u-tag--${_ctx.shape}`),
r: common_vendor.n(!_ctx.plain && `u-tag--${_ctx.type}`),
s: common_vendor.n(_ctx.plain && `u-tag--${_ctx.type}--plain`),
t: common_vendor.n(`u-tag--${_ctx.size}`),
v: common_vendor.n(_ctx.plain && _ctx.plainFill && `u-tag--${_ctx.type}--plain--fill`),
w: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
x: common_vendor.s({
marginRight: _ctx.closable ? "10px" : 0,
marginTop: _ctx.closable ? "10px" : 0
}),
y: common_vendor.s($options.style),
z: _ctx.closable
}, _ctx.closable ? {
A: common_vendor.p({
name: "close",
size: $options.closeSize,
color: "#ffffff"
}),
B: common_vendor.n(`u-tag__close--${_ctx.size}`),
C: common_vendor.o((...args) => $options.closeHandler && $options.closeHandler(...args)),
D: _ctx.closeColor
} : {}, {
E: common_vendor.p({
mode: "fade",
show: _ctx.show
}),
F: common_vendor.gei(_ctx, "")
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2fd891bb"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-tag/u-tag.js.map

View File

@@ -1,7 +0,0 @@
{
"component": true,
"usingComponents": {
"up-icon": "../u-icon/u-icon",
"u-transition": "../u-transition/u-transition"
}
}

View File

@@ -1 +0,0 @@
<u-transition wx:if="{{E}}" u-s="{{['d']}}" u-i="2fd891bb-0" bind:__l="__l" u-p="{{E}}" class="{{['data-v-2fd891bb', virtualHostClass]}}" virtualHostClass="{{['data-v-2fd891bb', virtualHostClass]}}" style="{{'display:inline-flex' + ';' + virtualHostStyle}}" virtualHostStyle="{{'display:inline-flex' + ';' + virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" virtualHostHidden="{{virtualHostHidden || false}}" id="{{F}}" virtualHostId="{{F}}"><view class="u-tag-wrapper cursor-pointer data-v-2fd891bb"><view class="{{['u-tag', 'data-v-2fd891bb', q, r, s, t, v]}}" catchtap="{{w}}" style="{{x + ';' + y}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><view wx:if="{{a}}" class="u-tag__icon data-v-2fd891bb"><image wx:if="{{b}}" class="data-v-2fd891bb" src="{{c}}" style="{{d}}"></image><up-icon wx:else class="data-v-2fd891bb" virtualHostClass="data-v-2fd891bb" u-i="2fd891bb-1,2fd891bb-0" bind:__l="__l" u-p="{{e||''}}"></up-icon></view></block><view class="u-tag__content data-v-2fd891bb"><slot name="content"></slot><block wx:if="{{f}}"><text wx:if="{{g}}" style="{{i}}" class="{{['u-tag__text', 'data-v-2fd891bb', j, k, l]}}">{{h}}</text><text wx:else style="{{m}}" class="{{['u-tag__text', 'data-v-2fd891bb', n, o, p]}}"><slot></slot></text></block></view></view><view wx:if="{{z}}" class="{{['u-tag__close', 'data-v-2fd891bb', B]}}" catchtap="{{C}}" style="{{'background-color:' + D}}"><up-icon wx:if="{{A}}" class="data-v-2fd891bb" virtualHostClass="data-v-2fd891bb" u-i="2fd891bb-2,2fd891bb-0" bind:__l="__l" u-p="{{A}}"></up-icon></view></view></u-transition>

View File

@@ -1,186 +0,0 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.u-tag-wrapper.data-v-2fd891bb {
position: relative;
}
.u-tag.data-v-2fd891bb {
display: flex;
flex-direction: row;
align-items: center;
border-style: solid;
}
.u-tag--circle.data-v-2fd891bb {
border-radius: 100px;
}
.u-tag--square.data-v-2fd891bb {
border-radius: 3px;
}
.u-tag__icon.data-v-2fd891bb {
margin-right: 4px;
}
.u-tag__text--mini.data-v-2fd891bb {
font-size: 12px;
line-height: 12px;
}
.u-tag__text--medium.data-v-2fd891bb {
font-size: 13px;
line-height: 13px;
}
.u-tag__text--large.data-v-2fd891bb {
font-size: 15px;
line-height: 15px;
}
.u-tag--mini.data-v-2fd891bb {
height: 22px;
line-height: 22px;
padding: 0 5px;
}
.u-tag--medium.data-v-2fd891bb {
height: 26px;
line-height: 22px;
padding: 0 10px;
}
.u-tag--large.data-v-2fd891bb {
height: 32px;
line-height: 32px;
padding: 0 15px;
}
.u-tag--primary.data-v-2fd891bb {
background-color: #3c9cff;
border-width: 1px;
border-color: #3c9cff;
}
.u-tag--primary--plain.data-v-2fd891bb {
border-width: 1px;
border-color: #3c9cff;
}
.u-tag--primary--plain--fill.data-v-2fd891bb {
background-color: #ecf5ff;
}
.u-tag__text--primary.data-v-2fd891bb {
color: #FFFFFF;
}
.u-tag__text--primary--plain.data-v-2fd891bb {
color: #3c9cff;
}
.u-tag--error.data-v-2fd891bb {
background-color: #f56c6c;
border-width: 1px;
border-color: #f56c6c;
}
.u-tag--error--plain.data-v-2fd891bb {
border-width: 1px;
border-color: #f56c6c;
}
.u-tag--error--plain--fill.data-v-2fd891bb {
background-color: #fef0f0;
}
.u-tag__text--error.data-v-2fd891bb {
color: #FFFFFF;
}
.u-tag__text--error--plain.data-v-2fd891bb {
color: #f56c6c;
}
.u-tag--warning.data-v-2fd891bb {
background-color: #f9ae3d;
border-width: 1px;
border-color: #f9ae3d;
}
.u-tag--warning--plain.data-v-2fd891bb {
border-width: 1px;
border-color: #f9ae3d;
}
.u-tag--warning--plain--fill.data-v-2fd891bb {
background-color: #fdf6ec;
}
.u-tag__text--warning.data-v-2fd891bb {
color: #FFFFFF;
}
.u-tag__text--warning--plain.data-v-2fd891bb {
color: #f9ae3d;
}
.u-tag--success.data-v-2fd891bb {
background-color: #5ac725;
border-width: 1px;
border-color: #5ac725;
}
.u-tag--success--plain.data-v-2fd891bb {
border-width: 1px;
border-color: #5ac725;
}
.u-tag--success--plain--fill.data-v-2fd891bb {
background-color: #f5fff0;
}
.u-tag__text--success.data-v-2fd891bb {
color: #FFFFFF;
}
.u-tag__text--success--plain.data-v-2fd891bb {
color: #5ac725;
}
.u-tag--info.data-v-2fd891bb {
background-color: #909399;
border-width: 1px;
border-color: #909399;
}
.u-tag--info--plain.data-v-2fd891bb {
border-width: 1px;
border-color: #909399;
}
.u-tag--info--plain--fill.data-v-2fd891bb {
background-color: #f4f4f5;
}
.u-tag__text--info.data-v-2fd891bb {
color: #FFFFFF;
}
.u-tag__text--info--plain.data-v-2fd891bb {
color: #909399;
}
.u-tag__close.data-v-2fd891bb {
position: absolute;
z-index: 999;
top: 10px;
right: 10px;
border-radius: 100px;
background-color: #C6C7CB;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
transform: scale(0.6) translate(80%, -80%);
}
.u-tag__close--mini.data-v-2fd891bb {
width: 18px;
height: 18px;
}
.u-tag__close--medium.data-v-2fd891bb {
width: 22px;
height: 22px;
}
.u-tag__close--large.data-v-2fd891bb {
width: 25px;
height: 25px;
}

View File

@@ -584,7 +584,6 @@ exports.deepClone = deepClone;
exports.deepMerge = deepMerge;
exports.error = error;
exports.formValidate = formValidate;
exports.genLightColor = genLightColor;
exports.getProperty = getProperty;
exports.getPx = getPx;
exports.getWindowInfo = getWindowInfo;

View File

@@ -0,0 +1,80 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const DRAFT_NS = {
ASSIGN: "draft_assign",
ACCEPT: "draft_accept",
RECTIFY: "draft_rectify",
INSPECTION_RESULT: "draft_inspection_result",
INSPECTION_SHEET: "draft_inspection_sheet"
};
function buildDraftKey(namespace, ...parts) {
return [namespace, ...parts.map((p) => String(p ?? ""))].join("_");
}
function buildDraftKeyCompact(namespace, ...parts) {
return [namespace, ...parts.map((p) => String(p ?? "")).filter(Boolean)].join("_");
}
function loadDraftWithFallback(primaryKey, fallbackKeys = []) {
const primary = loadDraft(primaryKey);
if (primary) {
return { data: primary, key: primaryKey, fromFallback: false };
}
for (const fallbackKey of fallbackKeys) {
if (!fallbackKey || fallbackKey === primaryKey)
continue;
const fallback = loadDraft(fallbackKey);
if (fallback) {
return { data: fallback, key: primaryKey, fromFallback: true, fallbackKey };
}
}
return { data: null, key: primaryKey, fromFallback: false };
}
function loadDraft(key) {
if (!key)
return null;
const raw = common_vendor.index.getStorageSync(key);
if (!raw)
return null;
try {
return typeof raw === "string" ? JSON.parse(raw) : raw;
} catch (error) {
common_vendor.index.__f__("error", "at utils/draftCache.js:61", "[draftCache] 解析草稿失败:", key, error);
return null;
}
}
function saveDraftToStorage(key, data) {
if (!key)
return;
common_vendor.index.setStorageSync(
key,
JSON.stringify({
...data,
updatedAt: Date.now()
})
);
}
function removeDraft(key) {
if (!key)
return;
common_vendor.index.removeStorageSync(key);
}
function defaultHasContent(payload) {
if (!payload || typeof payload !== "object")
return false;
return Object.entries(payload).some(([key, value]) => {
if (key === "updatedAt")
return false;
if (Array.isArray(value))
return value.length > 0;
if (value && typeof value === "object")
return Object.keys(value).length > 0;
return value !== "" && value != null;
});
}
exports.DRAFT_NS = DRAFT_NS;
exports.buildDraftKey = buildDraftKey;
exports.buildDraftKeyCompact = buildDraftKeyCompact;
exports.defaultHasContent = defaultHasContent;
exports.loadDraftWithFallback = loadDraftWithFallback;
exports.removeDraft = removeDraft;
exports.saveDraftToStorage = saveDraftToStorage;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/draftCache.js.map

View File

@@ -0,0 +1,114 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const utils_draftCache = require("./draftCache.js");
function useDraftCache(options) {
const {
getKey,
getPayload,
hasContent = utils_draftCache.defaultHasContent,
applyPayload,
clearForm,
canSave = () => true,
requireInitialized = false,
restoreToast = "已自动恢复您上次未提交的内容",
clearToast = "草稿已清空",
showRestoreToast = true,
onAfterRestore,
getFallbackKeys
} = options;
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const isInitialized = common_vendor.ref(false);
const finishRestoreState = (callback) => {
common_vendor.nextTick$1(() => {
isRestoring.value = false;
isInitialized.value = true;
callback == null ? void 0 : callback();
});
};
const save = () => {
if (isRestoring.value)
return;
if (requireInitialized && !isInitialized.value)
return;
if (!canSave())
return;
const key = getKey();
const payload = getPayload();
if (!hasContent(payload)) {
utils_draftCache.removeDraft(key);
hasDraft.value = false;
return;
}
utils_draftCache.saveDraftToStorage(key, payload);
hasDraft.value = true;
};
const clear = (showToast = true) => {
utils_draftCache.removeDraft(getKey());
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
clearForm();
finishRestoreState();
if (showToast) {
common_vendor.index.showToast({ title: clearToast, icon: "none" });
}
};
const restore = () => {
const key = getKey();
const { data, fromFallback, fallbackKey } = utils_draftCache.loadDraftWithFallback(
key,
(getFallbackKeys == null ? void 0 : getFallbackKeys()) || []
);
if (!data || !hasContent(data)) {
isInitialized.value = true;
return false;
}
isRestoring.value = true;
try {
applyPayload(data);
hasDraft.value = true;
showRestoreBanner.value = true;
onAfterRestore == null ? void 0 : onAfterRestore(data);
if (fromFallback && fallbackKey) {
utils_draftCache.saveDraftToStorage(key, data);
utils_draftCache.removeDraft(fallbackKey);
}
finishRestoreState(() => {
if (showRestoreToast) {
common_vendor.index.showToast({
title: restoreToast,
icon: "none",
duration: 2500
});
}
});
return true;
} catch (error) {
common_vendor.index.__f__("error", "at utils/useDraftCache.js:128", "[useDraftCache] 恢复草稿失败:", error);
isRestoring.value = false;
isInitialized.value = true;
return false;
}
};
const bindAutoSave = (source, watchOptions = {}) => {
common_vendor.watch(
source,
() => save(),
{ deep: true, ...watchOptions }
);
};
return {
hasDraft,
showRestoreBanner,
isRestoring,
isInitialized,
save,
clear,
restore,
bindAutoSave
};
}
exports.useDraftCache = useDraftCache;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/useDraftCache.js.map