v1.2.1版本,优化调整了很多,整改验收阶段新加字段
This commit is contained in:
39
unpackage/dist/dev/mp-weixin/app.js
vendored
39
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -79,23 +79,34 @@ common_vendor.index.addInterceptor("chooseImage", {
|
||||
res.tempFiles = validTempFiles;
|
||||
}
|
||||
});
|
||||
const UPLOAD_ALLOWED_EXTENSIONS = ["bmp", "gif", "jpg", "jpeg", "png", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", "rar", "zip", "gz", "bz2", "mp4", "avi", "rmvb", "pdf"];
|
||||
const QINIU_UPLOAD_HOST_MARKERS = ["qiniup.com", "qbox.me"];
|
||||
function validateUploadLocalFileExt(filePath) {
|
||||
if (!filePath)
|
||||
return true;
|
||||
const cleanPath = filePath.split("?")[0];
|
||||
const ext = cleanPath.split(".").pop().toLowerCase();
|
||||
if (!UPLOAD_ALLOWED_EXTENSIONS.includes(ext)) {
|
||||
common_vendor.index.showToast({
|
||||
title: `不支持 .${ext} 格式,请上传合规的文件或图片`,
|
||||
icon: "none",
|
||||
duration: 3e3
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
common_vendor.index.addInterceptor("uploadFile", {
|
||||
invoke(args) {
|
||||
const filePath = args.filePath;
|
||||
if (filePath) {
|
||||
const cleanPath = filePath.split("?")[0];
|
||||
const ext = cleanPath.split(".").pop().toLowerCase();
|
||||
const allowedExtensions = ["bmp", "gif", "jpg", "jpeg", "png", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", "rar", "zip", "gz", "bz2", "mp4", "avi", "rmvb", "pdf"];
|
||||
if (!allowedExtensions.includes(ext)) {
|
||||
common_vendor.index.showToast({
|
||||
title: `不支持 .${ext} 格式,请上传合规的文件或图片`,
|
||||
icon: "none",
|
||||
duration: 3e3
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const uploadUrl = args.url || "";
|
||||
const isQiniuUpload = QINIU_UPLOAD_HOST_MARKERS.some((m) => uploadUrl.includes(m));
|
||||
if (isQiniuUpload) {
|
||||
return validateUploadLocalFileExt(args.filePath) ? args : false;
|
||||
}
|
||||
return args;
|
||||
if (uploadUrl.includes("/frontend/attachment/upload")) {
|
||||
return validateUploadLocalFileExt(args.filePath) ? args : false;
|
||||
}
|
||||
return validateUploadLocalFileExt(args.filePath) ? args : false;
|
||||
}
|
||||
});
|
||||
function createApp() {
|
||||
|
||||
@@ -7103,9 +7103,9 @@ function isConsoleWritable() {
|
||||
return isWritable;
|
||||
}
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "172.19.160.1,192.168.1.144,127.0.0.1";
|
||||
const hosts = "192.168.1.144,127.0.0.1,172.17.192.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_8CbDJg";
|
||||
const id = "mp-weixin_Capuq2";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
@@ -26,29 +26,30 @@ const _sfc_main = {
|
||||
const emit = __emit;
|
||||
const formData = common_vendor.reactive({
|
||||
name: "",
|
||||
color: "#FF5733"
|
||||
color: "#D92121"
|
||||
});
|
||||
const presetColors = [
|
||||
"#2563eb",
|
||||
"#ef4444",
|
||||
"#10b981",
|
||||
"#f59e0b",
|
||||
"#6366f1",
|
||||
"#ec4899",
|
||||
"#06b6d4",
|
||||
"#84cc16",
|
||||
"#f97316",
|
||||
"#4f46e5",
|
||||
"#dc2626",
|
||||
"#f59e0b",
|
||||
"#d97706",
|
||||
"#8b5cf6",
|
||||
"#db2777"
|
||||
{ name: "红色", value: "#D92121" },
|
||||
{ name: "橙色", value: "#FF8822" },
|
||||
{ name: "黄色", value: "#FFCC00" },
|
||||
{ name: "蓝色", value: "#165DFF" }
|
||||
];
|
||||
const presetColorValues = presetColors.map((item) => item.value);
|
||||
const selectedColorLabel = common_vendor.computed(() => {
|
||||
const found = presetColors.find((item) => item.value === formData.color);
|
||||
return found ? `${found.name} ${found.value}` : formData.color;
|
||||
});
|
||||
const normalizeColor = (color) => {
|
||||
if (!color)
|
||||
return presetColors[0].value;
|
||||
const upper = String(color).toUpperCase();
|
||||
const matched = presetColorValues.find((v) => v.toUpperCase() === upper);
|
||||
return matched || presetColors[0].value;
|
||||
};
|
||||
common_vendor.watch(() => props.editData, (newVal) => {
|
||||
if (newVal && Object.keys(newVal).length > 0) {
|
||||
formData.name = newVal.name || "";
|
||||
formData.color = newVal.color || "#FF5733";
|
||||
formData.color = normalizeColor(newVal.color);
|
||||
}
|
||||
}, { immediate: true, deep: true });
|
||||
common_vendor.watch(() => props.visible, (newVal) => {
|
||||
@@ -61,7 +62,7 @@ const _sfc_main = {
|
||||
};
|
||||
const resetForm = () => {
|
||||
formData.name = "";
|
||||
formData.color = "#FF5733";
|
||||
formData.color = "#D92121";
|
||||
};
|
||||
const handleClose = () => {
|
||||
emit("update:visible", false);
|
||||
@@ -72,8 +73,8 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: "请输入区域名称", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.color) {
|
||||
common_vendor.index.showToast({ title: "请选择区域颜色", icon: "none" });
|
||||
if (!presetColorValues.includes(formData.color)) {
|
||||
common_vendor.index.showToast({ title: "请从预设颜色中选择", icon: "none" });
|
||||
return;
|
||||
}
|
||||
emit("submit", {
|
||||
@@ -90,23 +91,23 @@ const _sfc_main = {
|
||||
d: formData.name,
|
||||
e: common_vendor.o(($event) => formData.name = $event.detail.value),
|
||||
f: formData.color,
|
||||
g: common_vendor.o(($event) => formData.color = $event.detail.value),
|
||||
h: formData.color,
|
||||
i: common_vendor.f(presetColors, (color, index, i0) => {
|
||||
g: common_vendor.t(selectedColorLabel.value),
|
||||
h: common_vendor.f(presetColors, (item, k0, i0) => {
|
||||
return {
|
||||
a: color + index,
|
||||
b: formData.color === color ? 1 : "",
|
||||
c: color,
|
||||
d: common_vendor.o(($event) => selectColor(color), color + index)
|
||||
a: formData.color === item.value ? 1 : "",
|
||||
b: item.value,
|
||||
c: common_vendor.t(item.name),
|
||||
d: item.value,
|
||||
e: common_vendor.o(($event) => selectColor(item.value), item.value)
|
||||
};
|
||||
}),
|
||||
j: common_vendor.o(handleClose),
|
||||
k: common_vendor.o(handleSubmit),
|
||||
l: __props.loading,
|
||||
m: common_vendor.o(() => {
|
||||
i: common_vendor.o(handleClose),
|
||||
j: common_vendor.o(handleSubmit),
|
||||
k: __props.loading,
|
||||
l: common_vendor.o(() => {
|
||||
}),
|
||||
n: common_vendor.o(handleClose),
|
||||
o: common_vendor.gei(_ctx, "")
|
||||
m: common_vendor.o(handleClose),
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
} : {});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view wx:if="{{a}}" bindtap="{{n}}" class="{{['popup-mask', 'data-v-fbf56c15', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{o}}"><view class="popup-content data-v-fbf56c15" catchtap="{{m}}"><view class="popup-header data-v-fbf56c15"><view class="popup-title text-bold data-v-fbf56c15">{{b}}</view><view class="popup-close data-v-fbf56c15" bindtap="{{c}}">×</view></view><view class="popup-body data-v-fbf56c15"><view class="flex margin-bottom-sm data-v-fbf56c15"><view class="data-v-fbf56c15">区域名称</view><view class="text-red data-v-fbf56c15">*</view></view><input class="form-input data-v-fbf56c15" placeholder="请输入区域名称" value="{{d}}" bindinput="{{e}}"/><view class="flex margin-bottom-sm margin-top data-v-fbf56c15"><view class="data-v-fbf56c15">区域颜色</view><view class="text-red data-v-fbf56c15">*</view></view><view class="flex align-center data-v-fbf56c15"><input class="color-input flex-sub data-v-fbf56c15" placeholder="#FF5733" value="{{f}}" bindinput="{{g}}"/><view class="color-preview data-v-fbf56c15" style="{{'background-color:' + h}}"></view></view><view class="margin-top margin-bottom-sm text-gray data-v-fbf56c15">预设颜色</view><view class="color-grid data-v-fbf56c15"><view wx:for="{{i}}" wx:for-item="color" wx:key="a" class="{{['color-item', 'data-v-fbf56c15', color.b && 'color-item-active']}}" style="{{'background-color:' + color.c}}" bindtap="{{color.d}}"></view></view></view><view class="popup-footer data-v-fbf56c15"><button class="btn-cancel data-v-fbf56c15" bindtap="{{j}}">取消</button><button class="btn-confirm bg-blue data-v-fbf56c15" bindtap="{{k}}" loading="{{l}}">确定</button></view></view></view>
|
||||
<view wx:if="{{a}}" bindtap="{{m}}" class="{{['popup-mask', 'data-v-fbf56c15', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{n}}"><view class="popup-content data-v-fbf56c15" catchtap="{{l}}"><view class="popup-header data-v-fbf56c15"><view class="popup-title text-bold data-v-fbf56c15">{{b}}</view><view class="popup-close data-v-fbf56c15" bindtap="{{c}}">×</view></view><view class="popup-body data-v-fbf56c15"><view class="flex margin-bottom-sm data-v-fbf56c15"><view class="data-v-fbf56c15">区域名称</view><view class="text-red data-v-fbf56c15">*</view></view><input class="form-input data-v-fbf56c15" placeholder="请输入区域名称" value="{{d}}" bindinput="{{e}}"/><view class="flex margin-bottom-sm margin-top data-v-fbf56c15"><view class="data-v-fbf56c15">区域颜色</view><view class="text-red data-v-fbf56c15">*</view></view><view class="flex align-center margin-bottom-sm data-v-fbf56c15"><view class="color-preview data-v-fbf56c15" style="{{'background-color:' + f}}"></view><text class="margin-left-sm text-gray data-v-fbf56c15">{{g}}</text></view><view class="margin-bottom-sm text-gray data-v-fbf56c15">请选择颜色</view><view class="color-grid data-v-fbf56c15"><view wx:for="{{h}}" wx:for-item="item" wx:key="d" class="color-option data-v-fbf56c15" bindtap="{{item.e}}"><view class="{{['color-item', 'data-v-fbf56c15', item.a && 'color-item-active']}}" style="{{'background-color:' + item.b}}"></view><text class="color-label data-v-fbf56c15">{{item.c}}</text></view></view></view><view class="popup-footer data-v-fbf56c15"><button class="btn-cancel data-v-fbf56c15" bindtap="{{i}}">取消</button><button class="btn-confirm bg-blue data-v-fbf56c15" bindtap="{{j}}" loading="{{k}}">确定</button></view></view></view>
|
||||
@@ -90,34 +90,38 @@
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.color-input.data-v-fbf56c15 {
|
||||
height: 70rpx;
|
||||
padding: 0 20rpx;
|
||||
border: 2rpx solid #dadbde;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.color-preview.data-v-fbf56c15 {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-left: 20rpx;
|
||||
flex-shrink: 0;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
}
|
||||
.color-grid.data-v-fbf56c15 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
justify-content: space-between;
|
||||
gap: 24rpx 0;
|
||||
}
|
||||
.color-option.data-v-fbf56c15 {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.color-item.data-v-fbf56c15 {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
border: 4rpx solid transparent;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.color-label.data-v-fbf56c15 {
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
.color-item-active.data-v-fbf56c15 {
|
||||
border-color: #333;
|
||||
box-shadow: 0 0 0 4rpx rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_three_one_api_license = require("../../request/three_one_api/license.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_u_datetime_picker2 = common_vendor.resolveComponent("u-datetime-picker");
|
||||
@@ -62,7 +63,7 @@ const _sfc_main = {
|
||||
licenseList.value = res.data.records || [];
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:249", "获取证照列表失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:250", "获取证照列表失败:", err);
|
||||
}
|
||||
};
|
||||
const loadDeptList = async () => {
|
||||
@@ -72,7 +73,7 @@ const _sfc_main = {
|
||||
deptList.value = res.data || [];
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:261", "获取部门列表失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:262", "获取部门列表失败:", err);
|
||||
}
|
||||
};
|
||||
const openAddPopup = () => {
|
||||
@@ -102,7 +103,7 @@ const _sfc_main = {
|
||||
showAddPopup.value = true;
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:301", "获取证照详情失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:302", "获取证照详情失败:", err);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -120,7 +121,7 @@ const _sfc_main = {
|
||||
loadLicenseList();
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:323", "删除失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:324", "删除失败:", err);
|
||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
||||
} finally {
|
||||
showDeleteModal.value = false;
|
||||
@@ -173,13 +174,13 @@ const _sfc_main = {
|
||||
const onDateConfirm = (e) => {
|
||||
const timestamp = datePickerValue.value;
|
||||
if (!timestamp || isNaN(timestamp)) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:396", "无效的日期值:", timestamp);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:397", "无效的日期值:", timestamp);
|
||||
showDatePicker.value = false;
|
||||
return;
|
||||
}
|
||||
const date = new Date(timestamp);
|
||||
if (isNaN(date.getTime())) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:405", "无效的日期:", date);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:406", "无效的日期:", date);
|
||||
showDatePicker.value = false;
|
||||
return;
|
||||
}
|
||||
@@ -206,39 +207,21 @@ const _sfc_main = {
|
||||
}
|
||||
});
|
||||
};
|
||||
const uploadImage = (filePath) => {
|
||||
common_vendor.index.showLoading({ title: "上传中..." });
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (uploadRes) => {
|
||||
common_vendor.index.hideLoading();
|
||||
try {
|
||||
const data = JSON.parse(uploadRes.data);
|
||||
if (data.code === 0 && data.data) {
|
||||
formData.photo = data.data.url || data.data;
|
||||
common_vendor.index.showToast({ title: "上传成功", icon: "success" });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: data.msg || "上传失败", icon: "none" });
|
||||
formData.photoPreview = "";
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:461", "解析上传结果失败:", e);
|
||||
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
||||
formData.photoPreview = "";
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:468", "上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
||||
formData.photoPreview = "";
|
||||
}
|
||||
});
|
||||
const uploadImage = async (filePath) => {
|
||||
try {
|
||||
const { url } = await utils_upload.uploadSingleWithLoading(filePath);
|
||||
formData.photo = url;
|
||||
formData.photoPreview = url;
|
||||
common_vendor.index.showToast({ title: "上传成功", icon: "success" });
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:447", "上传失败:", e);
|
||||
formData.photo = "";
|
||||
formData.photoPreview = "";
|
||||
common_vendor.index.showToast({
|
||||
title: (e == null ? void 0 : e.msg) || (e == null ? void 0 : e.message) || "上传失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const removeImage = () => {
|
||||
formData.photo = "";
|
||||
@@ -276,7 +259,7 @@ const _sfc_main = {
|
||||
loadLicenseList();
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:521", "提交失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:503", "提交失败:", err);
|
||||
common_vendor.index.showToast({ title: "操作失败", icon: "none" });
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_watermark = require("../../utils/watermark.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");
|
||||
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_up_choose2 = common_vendor.resolveComponent("up-choose");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_up_upload2 + _easycom_up_input2 + _easycom_up_choose2 + _easycom_u_popup2)();
|
||||
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_up_choose2 + _easycom_up_upload2 + _easycom_up_input2 + _easycom_u_popup2)();
|
||||
}
|
||||
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_up_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.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_upload + _easycom_up_input + _easycom_up_choose + _easycom_u_popup)();
|
||||
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + _easycom_up_choose + _easycom_up_upload + _easycom_up_input + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspectionresult",
|
||||
@@ -50,13 +50,13 @@ const _sfc_main = {
|
||||
]);
|
||||
const radiovalue1 = common_vendor.ref("");
|
||||
const groupChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:305", "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:313", "radioChange", n);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:320", "radioChange", n);
|
||||
};
|
||||
const value1 = common_vendor.ref("");
|
||||
const showHazardPopup = common_vendor.ref(false);
|
||||
@@ -120,7 +120,7 @@ const _sfc_main = {
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:392", "获取法规列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:399", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ const _sfc_main = {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:436", "获取区域列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:443", "获取区域列表失败:", error);
|
||||
}
|
||||
};
|
||||
const confirmAreaSelect = () => {
|
||||
@@ -185,10 +185,10 @@ const _sfc_main = {
|
||||
{ id: 3, title: "重大隐患" }
|
||||
]);
|
||||
const sourceOptions = common_vendor.ref([
|
||||
{ id: 1, title: "随手拍" },
|
||||
{ id: 2, title: "企业自查" },
|
||||
{ id: 3, title: "行业互查" },
|
||||
{ id: 4, title: "专家诊查" }
|
||||
{ id: 1, title: "部门检查" },
|
||||
{ id: 2, title: "都导检查" },
|
||||
{ id: 3, title: "企业自查" },
|
||||
{ id: 4, title: "行业互查" }
|
||||
]);
|
||||
const tagOptions = common_vendor.ref([]);
|
||||
const fetchTagOptions = async () => {
|
||||
@@ -201,7 +201,7 @@ const _sfc_main = {
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:501", "获取标签列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:508", "获取标签列表失败:", error);
|
||||
}
|
||||
};
|
||||
const openHazardPopup = () => {
|
||||
@@ -266,70 +266,15 @@ const _sfc_main = {
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
const deletePic = (event) => {
|
||||
hazardFileList.value.splice(event.index, 1);
|
||||
};
|
||||
const afterRead = async (event) => {
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = hazardFileList.value.length;
|
||||
lists.map((item) => {
|
||||
hazardFileList.value.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中"
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
let watermarkedUrl = lists[i].url;
|
||||
try {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
watermarkedUrl = await utils_watermark.addTimestampWatermark({
|
||||
tempFilePath: lists[i].url,
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:609", "加水印失败,将使用原图上传:", e);
|
||||
}
|
||||
const result = await uploadFilePromise(watermarkedUrl);
|
||||
let item = hazardFileList.value[fileListLen];
|
||||
const serverPath = typeof result === "string" ? result : (result == null ? void 0 : result.url) || (result == null ? void 0 : result.path) || "";
|
||||
hazardFileList.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: request_request.toImageUrl(serverPath),
|
||||
serverPath
|
||||
});
|
||||
fileListLen++;
|
||||
const inspectionUploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(hazardFileList, {
|
||||
watermark: {
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance: inspectionUploadInstance
|
||||
}
|
||||
};
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:644", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
const handleAiAnalyze = async () => {
|
||||
const imageFiles = hazardFileList.value.filter((f) => {
|
||||
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
|
||||
@@ -341,13 +286,13 @@ const _sfc_main = {
|
||||
const fullImageUrl = imageFiles[0].url;
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:665", "开始调用AI分析接口,图片地址:", fullImageUrl);
|
||||
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:672", "AI分析结果:", aiData);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:619", "AI分析结果:", aiData);
|
||||
if (aiData.title)
|
||||
hazardFormData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
@@ -369,14 +314,14 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:695", "AI分析接口调用失败:", 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;
|
||||
}
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
var _a, _b, _c, _d;
|
||||
var _a, _b, _c, _d, _e;
|
||||
if (!radiovalue1.value) {
|
||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
||||
return;
|
||||
@@ -394,57 +339,40 @@ const _sfc_main = {
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "提交中..." });
|
||||
if (radiovalue1.value === "异常" && hasHazardData.value) {
|
||||
const attachments = hazardFileList.value.map((file) => {
|
||||
let url = "";
|
||||
if (typeof file.url === "string") {
|
||||
url = file.url;
|
||||
} else if (file.url && typeof file.url === "object") {
|
||||
url = file.url.url || file.url.path || "";
|
||||
}
|
||||
if (typeof url === "string" && url.startsWith("http")) {
|
||||
url = url.replace(request_request.imageBaseUrl, "");
|
||||
}
|
||||
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
|
||||
return {
|
||||
fileName: fileName || "",
|
||||
filePath: url || "",
|
||||
fileType: file.type || "image/png",
|
||||
fileSize: file.size || 0
|
||||
};
|
||||
});
|
||||
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: hazardFormData.level + 1,
|
||||
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: ((_c = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _c.title) || "",
|
||||
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:773", "隐患参数:", hazardParams);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:705", "隐患参数:", hazardParams);
|
||||
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:782", "新增隐患成功");
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:714", "新增隐患成功");
|
||||
}
|
||||
const submitParams = {
|
||||
taskId: (_d = checkData.value) == null ? void 0 : _d.taskId,
|
||||
taskId: (_e = checkData.value) == null ? void 0 : _e.taskId,
|
||||
result: resultValue,
|
||||
remark: value1.value
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:791", "提交参数:", submitParams);
|
||||
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) {
|
||||
@@ -469,7 +397,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:826", "提交失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:758", "提交失败:", error);
|
||||
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -481,13 +409,13 @@ 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:845", "检查项数据:", res);
|
||||
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:852", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:784", error);
|
||||
}
|
||||
};
|
||||
const hasDraft = common_vendor.ref(false);
|
||||
@@ -500,12 +428,12 @@ const _sfc_main = {
|
||||
};
|
||||
const saveDraft = () => {
|
||||
if (isRestoring.value || !isInitialized.value) {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:867", "【草稿Debug - 巡检】saveDraft 被跳过:", { isRestoring: isRestoring.value, isInitialized: 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:877", "【草稿Debug - 巡检】尝试自动保存草稿. Key:", key, "是否有实质内容:", !!hasContent, "当前数据:", {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:809", "【草稿Debug - 巡检】尝试自动保存草稿. Key:", key, "是否有实质内容:", !!hasContent, "当前数据:", {
|
||||
radiovalue1: radiovalue1.value,
|
||||
value1: value1.value,
|
||||
title: hazardFormData.title,
|
||||
@@ -514,7 +442,7 @@ const _sfc_main = {
|
||||
});
|
||||
if (!hasContent) {
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:887", "【草稿Debug - 巡检】当前表单为空,自动删除本地缓存 Key:", key);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:819", "【草稿Debug - 巡检】当前表单为空,自动删除本地缓存 Key:", key);
|
||||
hasDraft.value = false;
|
||||
return;
|
||||
}
|
||||
@@ -534,12 +462,12 @@ const _sfc_main = {
|
||||
hazardLat: hazardLat.value
|
||||
};
|
||||
common_vendor.index.setStorageSync(key, JSON.stringify(data));
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:908", "【草稿Debug - 巡检】成功保存草稿到 LocalStorage, Key:", key);
|
||||
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:915", "【草稿Debug - 巡检】手动清空草稿, Key:", key);
|
||||
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;
|
||||
@@ -565,12 +493,12 @@ const _sfc_main = {
|
||||
const restoreDraft = () => {
|
||||
const key = getDraftKey();
|
||||
const cached = common_vendor.index.getStorageSync(key);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:945", "【草稿Debug - 巡检】尝试恢复草稿, Key:", key, "获取本地缓存结果:", !!cached);
|
||||
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:955", "【草稿Debug - 巡检】解析本地缓存成功, 是否有实质内容:", !!hasContent, "缓存数据:", data);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:887", "【草稿Debug - 巡检】解析本地缓存成功, 是否有实质内容:", !!hasContent, "缓存数据:", data);
|
||||
if (!hasContent) {
|
||||
isInitialized.value = true;
|
||||
return;
|
||||
@@ -595,7 +523,7 @@ const _sfc_main = {
|
||||
if (levelChooseRef.value && levelChooseRef.value.$data) {
|
||||
levelChooseRef.value.$data.currentIndex = hazardFormData.level;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:982", "【草稿Debug - 巡检】UI与多选组件状态同步重绘完毕!");
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:914", "【草稿Debug - 巡检】UI与多选组件状态同步重绘完毕!");
|
||||
});
|
||||
common_vendor.index.showToast({
|
||||
title: "已自动恢复您上次未提交的内容",
|
||||
@@ -603,12 +531,12 @@ const _sfc_main = {
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:991", "【草稿Debug - 巡检】解析草稿异常:", 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:996", "【草稿Debug - 巡检】本地无任何缓存, 页面已安全标记为 initialized");
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:928", "【草稿Debug - 巡检】本地无任何缓存, 页面已安全标记为 initialized");
|
||||
isInitialized.value = true;
|
||||
}
|
||||
};
|
||||
@@ -632,7 +560,7 @@ const _sfc_main = {
|
||||
{ deep: true }
|
||||
);
|
||||
common_vendor.onLoad((options) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:1023", "接收到的参数:", options);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:955", "接收到的参数:", options);
|
||||
if (options.id) {
|
||||
oneTableId.value = options.id;
|
||||
getCheckData();
|
||||
@@ -703,50 +631,50 @@ const _sfc_main = {
|
||||
}, showRestoreBanner.value ? {
|
||||
F: common_vendor.o(($event) => clearDraft(true))
|
||||
} : {}, {
|
||||
G: common_vendor.o(afterRead),
|
||||
H: common_vendor.o(deletePic),
|
||||
I: common_vendor.p({
|
||||
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
|
||||
}),
|
||||
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
|
||||
}),
|
||||
J: canvasWidth.value,
|
||||
K: canvasHeight.value,
|
||||
L: canvasWidth.value + "px",
|
||||
M: canvasHeight.value + "px",
|
||||
N: !aiAnalyzing.value
|
||||
L: canvasWidth.value,
|
||||
M: canvasHeight.value,
|
||||
N: canvasWidth.value + "px",
|
||||
O: canvasHeight.value + "px",
|
||||
P: !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) => hazardFormData.title = $event),
|
||||
T: common_vendor.p({
|
||||
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
|
||||
}),
|
||||
U: common_vendor.sr(levelChooseRef, "643afff0-6,643afff0-3", {
|
||||
W: common_vendor.sr(levelChooseRef, "643afff0-7,643afff0-3", {
|
||||
"k": "levelChooseRef"
|
||||
}),
|
||||
V: common_vendor.o(($event) => hazardFormData.level = $event),
|
||||
W: common_vendor.p({
|
||||
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
|
||||
}),
|
||||
X: common_vendor.o(($event) => hazardFormData.source = $event),
|
||||
Y: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: hazardFormData.source
|
||||
}),
|
||||
Z: common_vendor.o(($event) => hazardAddress.value = $event),
|
||||
aa: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
"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",
|
||||
"up-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -196,6 +196,36 @@
|
||||
.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;
|
||||
|
||||
@@ -41,7 +41,7 @@ const _sfc_main = {
|
||||
currentEditId.value = item.id;
|
||||
editData.value = {
|
||||
name: res.data.name || "",
|
||||
color: res.data.color || "#FF5733"
|
||||
color: res.data.color || "#D92121"
|
||||
};
|
||||
showPopup.value = true;
|
||||
}
|
||||
|
||||
@@ -3,37 +3,27 @@ const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
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_picker2 + _easycom_up_datetime_picker2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
(_easycom_up_picker2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.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_picker + _easycom_up_datetime_picker + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
|
||||
(_easycom_up_picker + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "application",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const showHazardPicker = common_vendor.ref(false);
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const showDeptPicker = common_vendor.ref(false);
|
||||
const selectedHazard = common_vendor.ref("");
|
||||
const selectedHazardId = common_vendor.ref("");
|
||||
const hazardColumns = common_vendor.ref([["暂无数据"]]);
|
||||
const acceptanceHazardList = common_vendor.ref([]);
|
||||
const hazardList = common_vendor.ref([]);
|
||||
const selectedDeptName = common_vendor.ref("");
|
||||
const selectedDeptId = common_vendor.ref("");
|
||||
const deptColumns = common_vendor.ref([["暂无数据"]]);
|
||||
const deptList = common_vendor.ref([]);
|
||||
const dateValue = common_vendor.ref(Date.now());
|
||||
const aiGenerating = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
rectifyDeadline: "",
|
||||
@@ -54,10 +44,10 @@ const _sfc_main = {
|
||||
const res = await request_api.getMyWriteOffList();
|
||||
if (res.code === 0 && res.data) {
|
||||
hazardList.value = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:174", "销号申请列表:", res.data);
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:137", "销号申请列表:", res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:177", "获取销号申请列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:140", "获取销号申请列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchAcceptanceList = async () => {
|
||||
@@ -71,86 +61,40 @@ const _sfc_main = {
|
||||
} else {
|
||||
hazardColumns.value = [["暂无可申请销号的隐患"]];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:194", "可申请销号的隐患列表:", list);
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:157", "可申请销号的隐患列表:", list);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:197", "获取可申请销号隐患列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:160", "获取可申请销号隐患列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchDeptList = async () => {
|
||||
try {
|
||||
const res = await request_api.getDepartmentPersonUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
const users = [];
|
||||
res.data.forEach((dept) => {
|
||||
if (dept.users && dept.users.length > 0) {
|
||||
dept.users.forEach((user) => {
|
||||
users.push({
|
||||
userId: user.userId,
|
||||
deptId: dept.deptId,
|
||||
name: `${user.nickName}(${dept.deptName})`
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
deptList.value = users;
|
||||
if (users.length > 0) {
|
||||
deptColumns.value = [users.map((item) => item.name)];
|
||||
} else {
|
||||
deptColumns.value = [["暂无人员数据"]];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:225", "部门人员列表:", users);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:228", "获取部门人员列表失败:", error);
|
||||
}
|
||||
};
|
||||
const onDeptConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:234", "选择的人员:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
selectedDeptName.value = e.value[0];
|
||||
const index = e.indexs[0];
|
||||
if (deptList.value[index]) {
|
||||
selectedDeptId.value = deptList.value[index].deptId;
|
||||
formData.responsibleDeptId = deptList.value[index].deptId;
|
||||
}
|
||||
}
|
||||
showDeptPicker.value = false;
|
||||
};
|
||||
const openAddPopup = () => {
|
||||
resetForm();
|
||||
fetchAcceptanceList();
|
||||
fetchDeptList();
|
||||
showAddPopup.value = true;
|
||||
};
|
||||
const fillHazardRelatedFields = (hazard) => {
|
||||
formData.rectifyDeadline = hazard.deadline || "";
|
||||
selectedDeptName.value = hazard.deptName || "";
|
||||
formData.responsiblePerson = hazard.rectifierName || "";
|
||||
formData.responsibleDeptId = hazard.deptId || "";
|
||||
};
|
||||
const onHazardConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:257", "选择的隐患:", e);
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:181", "选择的隐患:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
selectedHazard.value = e.value[0];
|
||||
const index = e.indexs[0];
|
||||
if (acceptanceHazardList.value[index]) {
|
||||
selectedHazardId.value = acceptanceHazardList.value[index].hazardId;
|
||||
const hazard = acceptanceHazardList.value[index];
|
||||
if (hazard) {
|
||||
selectedHazardId.value = hazard.hazardId;
|
||||
fillHazardRelatedFields(hazard);
|
||||
}
|
||||
}
|
||||
showHazardPicker.value = false;
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:271", "选择的日期时间:", e);
|
||||
const date = new Date(e.value);
|
||||
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");
|
||||
formData.rectifyDeadline = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
showDatePicker.value = false;
|
||||
};
|
||||
const resetForm = () => {
|
||||
selectedHazard.value = "";
|
||||
selectedHazardId.value = "";
|
||||
selectedDeptName.value = "";
|
||||
selectedDeptId.value = "";
|
||||
formData.rectifyDeadline = "";
|
||||
formData.responsibleDeptId = "";
|
||||
formData.responsiblePerson = "";
|
||||
@@ -196,7 +140,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:345", "AI生成销号方案失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:255", "AI生成销号方案失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI生成失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiGenerating.value = false;
|
||||
@@ -223,7 +167,7 @@ const _sfc_main = {
|
||||
selfVerifyContent: formData.selfVerifyContent || ""
|
||||
// 责任单位自行验收情况
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:370", "提交数据:", params);
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:280", "提交数据:", params);
|
||||
try {
|
||||
const res = await request_api.applyDelete(params);
|
||||
if (res.code === 0) {
|
||||
@@ -235,43 +179,51 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:384", "申请失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:294", "申请失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const editor = () => {
|
||||
const editor = (item) => {
|
||||
if (!(item == null ? void 0 : item.id)) {
|
||||
common_vendor.index.showToast({ title: "缺少申请ID", icon: "none" });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/closeout/editor"
|
||||
url: `/pages/closeout/editor?applyId=${item.id}`
|
||||
});
|
||||
};
|
||||
const getStatusClass = (status) => {
|
||||
switch (status) {
|
||||
case "待审核":
|
||||
return "status-pending";
|
||||
case "已通过":
|
||||
return "status-passed";
|
||||
case "已驳回":
|
||||
return "status-rejected";
|
||||
default:
|
||||
return "status-pending";
|
||||
}
|
||||
const getStatusClass = (item) => {
|
||||
const statusName = (item == null ? void 0 : item.verifyResultName) || "";
|
||||
if (statusName === "待审核")
|
||||
return "status-pending";
|
||||
if (statusName === "审核通过" || statusName === "已通过")
|
||||
return "status-passed";
|
||||
if (statusName === "审核驳回" || statusName === "已驳回")
|
||||
return "status-rejected";
|
||||
if (statusName === "已重新申请")
|
||||
return "status-reapply";
|
||||
if ((item == null ? void 0 : item.verifyResult) === 1)
|
||||
return "status-passed";
|
||||
if ((item == null ? void 0 : item.verifyResult) === 2)
|
||||
return "status-rejected";
|
||||
return "status-default";
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
fetchWriteOffList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(hazardList.value, (item, index, i0) => {
|
||||
a: common_vendor.f(hazardList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.hazardTitle),
|
||||
b: common_vendor.t(item.verifyResultName || "未知"),
|
||||
c: common_vendor.n(getStatusClass(item.verifyResultName)),
|
||||
c: common_vendor.n(getStatusClass(item)),
|
||||
d: common_vendor.t(item.hazardCreatedAt),
|
||||
e: common_vendor.t(item.responsibleDeptName),
|
||||
f: common_vendor.t(item.responsiblePerson),
|
||||
g: common_vendor.t(item.createdAt),
|
||||
h: common_vendor.o(($event) => editor(), index),
|
||||
i: index
|
||||
h: common_vendor.o(($event) => editor(item), item.hazardId || item.id),
|
||||
i: item.hazardId || item.id
|
||||
};
|
||||
}),
|
||||
b: common_vendor.o(openAddPopup),
|
||||
@@ -280,73 +232,50 @@ const _sfc_main = {
|
||||
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
|
||||
f: common_vendor.o(($event) => showHazardPicker.value = true)
|
||||
}, {}, {
|
||||
k: common_vendor.t(formData.rectifyDeadline || "请选择整改时限"),
|
||||
k: common_vendor.t(formData.rectifyDeadline || "请先选择隐患"),
|
||||
l: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
|
||||
m: common_vendor.o(($event) => showDatePicker.value = true)
|
||||
}, {}, {
|
||||
s: common_vendor.t(selectedDeptName.value || "请选择隐患治理责任单位"),
|
||||
t: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
|
||||
v: common_vendor.o(($event) => showDeptPicker.value = true)
|
||||
}, {}, {
|
||||
A: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
B: common_vendor.p({
|
||||
placeholder: "请输入主要负责人",
|
||||
modelValue: formData.responsiblePerson
|
||||
}),
|
||||
C: !aiGenerating.value
|
||||
m: common_vendor.t(selectedDeptName.value || "请先选择隐患"),
|
||||
n: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
|
||||
o: common_vendor.t(formData.responsiblePerson || "请先选择隐患"),
|
||||
p: common_vendor.n(formData.responsiblePerson ? "" : "text-gray"),
|
||||
q: !aiGenerating.value
|
||||
}, !aiGenerating.value ? {} : {}, {
|
||||
D: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
|
||||
E: aiGenerating.value,
|
||||
F: aiGenerating.value,
|
||||
G: common_vendor.o(handleAiGenerate),
|
||||
H: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
|
||||
I: common_vendor.p({
|
||||
r: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI 生成销号方案"),
|
||||
s: aiGenerating.value,
|
||||
t: aiGenerating.value,
|
||||
v: common_vendor.o(handleAiGenerate),
|
||||
w: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
|
||||
x: common_vendor.p({
|
||||
placeholder: "请输入主要治理内容",
|
||||
modelValue: formData.mainTreatmentContent
|
||||
}),
|
||||
J: common_vendor.o(($event) => formData.treatmentResult = $event),
|
||||
K: common_vendor.p({
|
||||
y: common_vendor.o(($event) => formData.treatmentResult = $event),
|
||||
z: common_vendor.p({
|
||||
placeholder: "请输入隐患治理完成情况",
|
||||
modelValue: formData.treatmentResult
|
||||
}),
|
||||
L: common_vendor.o(($event) => formData.selfVerifyContent = $event),
|
||||
M: common_vendor.p({
|
||||
A: common_vendor.o(($event) => formData.selfVerifyContent = $event),
|
||||
B: common_vendor.p({
|
||||
placeholder: "请输入隐患治理责任单位自行验收的情况",
|
||||
modelValue: formData.selfVerifyContent
|
||||
}),
|
||||
N: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
O: common_vendor.o(handleAdd),
|
||||
P: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
Q: common_vendor.p({
|
||||
C: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
D: common_vendor.o(handleAdd),
|
||||
E: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
F: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
safeAreaInsetBottom: false
|
||||
}),
|
||||
R: common_vendor.o(onHazardConfirm),
|
||||
S: common_vendor.o(($event) => showHazardPicker.value = false),
|
||||
T: common_vendor.o(($event) => showHazardPicker.value = false),
|
||||
U: common_vendor.p({
|
||||
G: common_vendor.o(onHazardConfirm),
|
||||
H: common_vendor.o(($event) => showHazardPicker.value = false),
|
||||
I: common_vendor.o(($event) => showHazardPicker.value = false),
|
||||
J: common_vendor.p({
|
||||
show: showHazardPicker.value,
|
||||
columns: hazardColumns.value
|
||||
}),
|
||||
V: common_vendor.o(onDateConfirm),
|
||||
W: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
X: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
Y: common_vendor.o(($event) => dateValue.value = $event),
|
||||
Z: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: dateValue.value
|
||||
}),
|
||||
aa: common_vendor.o(onDeptConfirm),
|
||||
ab: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
ac: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
ad: common_vendor.p({
|
||||
show: showDeptPicker.value,
|
||||
columns: deptColumns.value
|
||||
}),
|
||||
ae: common_vendor.gei(_ctx, "")
|
||||
K: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
"navigationBarTitleText": "销号申请",
|
||||
"usingComponents": {
|
||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"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
@@ -51,6 +51,14 @@
|
||||
background: #FFF1F0;
|
||||
color: #F5222D;
|
||||
}
|
||||
.status-reapply.data-v-4b6250eb {
|
||||
background: #E6F7FF;
|
||||
color: #1890FF;
|
||||
}
|
||||
.status-default.data-v-4b6250eb {
|
||||
background: #F5F5F5;
|
||||
color: #8C8C8C;
|
||||
}
|
||||
.popup-content.data-v-4b6250eb {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
@@ -134,4 +142,8 @@
|
||||
}
|
||||
.picker-input text.data-v-4b6250eb {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.picker-input.readonly.data-v-4b6250eb {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
@@ -1,134 +1,158 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
_easycom_up_input2();
|
||||
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_input + _easycom_up_textarea)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "editor",
|
||||
setup(__props) {
|
||||
const getPageOptions = () => {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
return (currentPage == null ? void 0 : currentPage.options) || {};
|
||||
};
|
||||
const pageId = common_vendor.ref("");
|
||||
const canEdit = common_vendor.ref(false);
|
||||
const applyId = common_vendor.ref("");
|
||||
const signatureUrl = common_vendor.ref("");
|
||||
const formData = common_vendor.reactive({
|
||||
id: "",
|
||||
hazardId: "",
|
||||
hazardTitle: "",
|
||||
// 隐患标题
|
||||
hazardCreatedAt: "",
|
||||
// 隐患日期
|
||||
responsibleDeptName: "",
|
||||
// 隐患治理责任单位
|
||||
responsiblePerson: "",
|
||||
// 主要负责人
|
||||
createdAt: "",
|
||||
// 创建时间
|
||||
statusName: ""
|
||||
// 状态
|
||||
hazardName: "",
|
||||
deadline: "",
|
||||
responsibilityUnit: "",
|
||||
mainPerson: "",
|
||||
mainGovernanceContent: "",
|
||||
governanceCompleteContent: "",
|
||||
status: "",
|
||||
rejectReason: ""
|
||||
});
|
||||
const statusText = common_vendor.computed(() => {
|
||||
const val = Number(formData.status);
|
||||
if (val === 1)
|
||||
return "通过";
|
||||
if (val === 2)
|
||||
return "不通过";
|
||||
return "";
|
||||
});
|
||||
const hasRejectReason = common_vendor.computed(() => Boolean(String(formData.rejectReason || "").trim()));
|
||||
const hasSignature = common_vendor.computed(() => Boolean(signatureUrl.value));
|
||||
const applySignature = (signPath) => {
|
||||
signatureUrl.value = signPath ? utils_upload.toSubmitFileUrl(signPath) : "";
|
||||
};
|
||||
const previewSignature = () => {
|
||||
if (!signatureUrl.value)
|
||||
return;
|
||||
common_vendor.index.previewImage({
|
||||
urls: [signatureUrl.value],
|
||||
current: signatureUrl.value
|
||||
});
|
||||
};
|
||||
const onSignatureImageError = () => {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/editor.vue:94", "签名图片加载失败:", signatureUrl.value);
|
||||
};
|
||||
const fetchDetail = async (id) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:56", "=== fetchDetail 被调用 ===, id:", id);
|
||||
if (!id) {
|
||||
common_vendor.index.showToast({ title: "缺少申请ID", icon: "none" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await request_api.getMyWriteOffList();
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:59", "接口返回:", res);
|
||||
if (res.code === 0 && res.data && res.data.length > 0) {
|
||||
const list = res.data;
|
||||
let data = null;
|
||||
if (id) {
|
||||
data = list.find((item) => item.id == id);
|
||||
}
|
||||
if (!data) {
|
||||
data = list[0];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:72", "绑定数据:", data);
|
||||
formData.id = data.id;
|
||||
formData.hazardId = data.hazardId;
|
||||
formData.hazardTitle = data.hazardTitle || "";
|
||||
formData.hazardCreatedAt = data.hazardCreatedAt || "";
|
||||
formData.responsibleDeptName = data.responsibleDeptName || "";
|
||||
formData.responsiblePerson = data.responsiblePerson || "";
|
||||
formData.createdAt = data.createdAt || "";
|
||||
formData.statusName = data.statusName || "";
|
||||
if (data.status == 1 || data.statusName === "待审核") {
|
||||
canEdit.value = true;
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:86", "状态为待审核,可以编辑");
|
||||
} else {
|
||||
canEdit.value = false;
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:89", "状态为已审核,不可编辑");
|
||||
}
|
||||
common_vendor.index.showLoading({ title: "加载中..." });
|
||||
const res = await request_api.getWriteOffApplyDetail(id);
|
||||
if (res.code === 0 && res.data) {
|
||||
const data = res.data;
|
||||
formData.hazardId = data.hazardId || "";
|
||||
formData.hazardName = data.hazardName || "";
|
||||
formData.deadline = data.deadline || "";
|
||||
formData.responsibilityUnit = data.responsibilityUnit || "";
|
||||
formData.mainPerson = data.mainPerson || "";
|
||||
formData.mainGovernanceContent = data.mainGovernanceContent || "";
|
||||
formData.governanceCompleteContent = data.governanceCompleteContent || "";
|
||||
formData.status = data.status ?? "";
|
||||
formData.rejectReason = data.rejectReason || "";
|
||||
applySignature(data.signPath);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/editor.vue:93", "获取详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/closeout/editor.vue:121", "获取销号申请详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
} finally {
|
||||
common_vendor.index.hideLoading();
|
||||
}
|
||||
};
|
||||
const handleCancel = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:114", "=== onLoad 触发 ===");
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:115", "options:", options);
|
||||
pageId.value = (options == null ? void 0 : options.id) || "";
|
||||
fetchDetail(pageId.value);
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:122", "=== onMounted 触发 ===");
|
||||
if (!pageId.value) {
|
||||
const options = getPageOptions();
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:125", "备用获取参数:", options);
|
||||
pageId.value = (options == null ? void 0 : options.id) || "";
|
||||
fetchDetail(pageId.value);
|
||||
}
|
||||
applyId.value = (options == null ? void 0 : options.applyId) || "";
|
||||
fetchDetail(applyId.value);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => formData.hazardTitle = $event),
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o(($event) => formData.hazardName = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "",
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardTitle
|
||||
modelValue: formData.hazardName
|
||||
}),
|
||||
c: common_vendor.o(($event) => formData.hazardCreatedAt = $event),
|
||||
c: common_vendor.o(($event) => formData.deadline = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "",
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardCreatedAt
|
||||
modelValue: formData.deadline
|
||||
}),
|
||||
e: common_vendor.o(($event) => formData.responsibleDeptName = $event),
|
||||
e: common_vendor.o(($event) => formData.responsibilityUnit = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsibleDeptName
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
modelValue: formData.responsibilityUnit
|
||||
}),
|
||||
g: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
g: common_vendor.o(($event) => formData.mainPerson = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsiblePerson
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
modelValue: formData.mainPerson
|
||||
}),
|
||||
i: common_vendor.o(($event) => formData.createdAt = $event),
|
||||
i: common_vendor.o(($event) => formData.mainGovernanceContent = $event),
|
||||
j: common_vendor.p({
|
||||
placeholder: "",
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
modelValue: formData.createdAt
|
||||
autoHeight: true,
|
||||
modelValue: formData.mainGovernanceContent
|
||||
}),
|
||||
k: common_vendor.o(($event) => formData.statusName = $event),
|
||||
k: common_vendor.o(($event) => formData.governanceCompleteContent = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "",
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
modelValue: formData.statusName
|
||||
autoHeight: true,
|
||||
modelValue: formData.governanceCompleteContent
|
||||
}),
|
||||
m: common_vendor.o(handleCancel),
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
m: common_vendor.p({
|
||||
modelValue: statusText.value,
|
||||
placeholder: "暂无",
|
||||
disabled: true
|
||||
}),
|
||||
n: hasRejectReason.value
|
||||
}, hasRejectReason.value ? {
|
||||
o: common_vendor.o(($event) => formData.rejectReason = $event),
|
||||
p: common_vendor.p({
|
||||
placeholder: "暂无",
|
||||
disabled: true,
|
||||
autoHeight: true,
|
||||
modelValue: formData.rejectReason
|
||||
})
|
||||
} : {}, {
|
||||
q: hasSignature.value
|
||||
}, hasSignature.value ? {
|
||||
r: signatureUrl.value,
|
||||
s: common_vendor.o(previewSignature),
|
||||
t: common_vendor.o(onSignatureImageError)
|
||||
} : {}, {
|
||||
v: common_vendor.o(handleCancel),
|
||||
w: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "销号详情",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-bbd4165b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{n}}"><view class="padding bg-white radius data-v-bbd4165b"><view class="flex margin-bottom data-v-bbd4165b"><view class="text-gray data-v-bbd4165b">隐患</view></view><up-input wx:if="{{b}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患日期</view><up-input wx:if="{{d}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患治理责任单位</view><up-input wx:if="{{f}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">主要负责人</view><up-input wx:if="{{h}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">创建时间</view><up-input wx:if="{{j}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-4" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">状态</view><up-input wx:if="{{l}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-5" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-input><view class="flex justify-center margin-top-xl data-v-bbd4165b" style="gap:30rpx"><button class="round cu-btn lg data-v-bbd4165b" bindtap="{{m}}">返回</button></view></view></view>
|
||||
<view class="{{['padding', 'page', 'data-v-bbd4165b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{w}}"><view class="padding bg-white radius data-v-bbd4165b"><view class="text-gray margin-bottom data-v-bbd4165b">隐患名称</view><up-input wx:if="{{b}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">整改时限</view><up-input wx:if="{{d}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患治理责任单位</view><up-input wx:if="{{f}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">主要负责人</view><up-input wx:if="{{h}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="text-gray margin-bottom margin-top data-v-bbd4165b">主要治理内容</view><up-textarea wx:if="{{j}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-4" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="text-gray margin-bottom margin-top data-v-bbd4165b">隐患治理完成内容</view><up-textarea wx:if="{{l}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-5" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-textarea><view class="text-gray margin-bottom margin-top data-v-bbd4165b">状态</view><up-input wx:if="{{m}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-6" bind:__l="__l" u-p="{{m}}"></up-input><block wx:if="{{n}}"><view class="text-gray margin-bottom margin-top data-v-bbd4165b">驳回理由</view><up-textarea wx:if="{{p}}" class="data-v-bbd4165b" virtualHostClass="data-v-bbd4165b" u-i="bbd4165b-7" bind:__l="__l" bindupdateModelValue="{{o}}" u-p="{{p}}"></up-textarea></block><block wx:if="{{q}}"><view class="text-gray margin-bottom margin-top data-v-bbd4165b">电子签名</view><view class="signature-box data-v-bbd4165b"><image src="{{r}}" class="signature-img data-v-bbd4165b" mode="aspectFit" bindtap="{{s}}" binderror="{{t}}"></image></view></block><view class="flex justify-center margin-top-xl data-v-bbd4165b"><button class="round cu-btn lg data-v-bbd4165b" bindtap="{{v}}">返回</button></view></view></view>
|
||||
@@ -27,4 +27,16 @@
|
||||
.page.data-v-bbd4165b {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.signature-box.data-v-bbd4165b {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
background: #f8f8f8;
|
||||
border: 1rpx dashed #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.signature-img.data-v-bbd4165b {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
|
||||
@@ -198,11 +198,7 @@ const _sfc_main = {
|
||||
if (enterpriseInfo.value.certificates) {
|
||||
try {
|
||||
const certs = JSON.parse(enterpriseInfo.value.certificates);
|
||||
certificateFiles.value = certs.map((cert) => ({
|
||||
url: cert.filePath || cert.url,
|
||||
name: cert.fileName || cert.name,
|
||||
status: "success"
|
||||
}));
|
||||
certificateFiles.value = certs.map((cert) => utils_upload.mapServerFileToUploadItem(cert));
|
||||
} catch (e) {
|
||||
certificateFiles.value = [];
|
||||
}
|
||||
@@ -211,55 +207,7 @@ const _sfc_main = {
|
||||
}
|
||||
showPopup.value = true;
|
||||
};
|
||||
const afterRead = async (event) => {
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = certificateFiles.value.length;
|
||||
lists.forEach((item) => {
|
||||
certificateFiles.value.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中"
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await uploadFilePromise(lists[i].url);
|
||||
let item = certificateFiles.value[fileListLen];
|
||||
certificateFiles.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result
|
||||
});
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
const deleteCertificate = (event) => {
|
||||
certificateFiles.value.splice(event.index, 1);
|
||||
};
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:586", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const { afterRead, deletePic: deleteCertificate } = utils_upload.createUploadListHandlers(certificateFiles);
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.name) {
|
||||
common_vendor.index.showToast({ title: "请输入企业名称", icon: "none" });
|
||||
@@ -273,9 +221,9 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: "请选择行业类型", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const certificates = certificateFiles.value.map((file) => ({
|
||||
fileName: file.name || file.url.split("/").pop(),
|
||||
filePath: file.url
|
||||
const certificates = certificateFiles.value.filter((f) => f.status === "success").map((file) => ({
|
||||
fileName: file.name || (file.serverPath || file.url || "").split("/").pop(),
|
||||
filePath: file.serverPath || file.url
|
||||
}));
|
||||
const params = {
|
||||
deptId: Number(formData.deptId) || Number(getDeptId()),
|
||||
@@ -324,7 +272,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:667", "提交失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:611", "提交失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none"
|
||||
@@ -454,8 +402,8 @@ const _sfc_main = {
|
||||
aB: common_vendor.o(($event) => formData.safetyManager = $event.detail.value),
|
||||
aC: formData.safetyManagerPhone,
|
||||
aD: common_vendor.o(($event) => formData.safetyManagerPhone = $event.detail.value),
|
||||
aE: common_vendor.o(afterRead),
|
||||
aF: common_vendor.o(deleteCertificate),
|
||||
aE: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
aF: common_vendor.o(common_vendor.unref(deleteCertificate)),
|
||||
aG: common_vendor.p({
|
||||
fileList: certificateFiles.value,
|
||||
name: "certificate",
|
||||
|
||||
@@ -103,7 +103,7 @@ const _sfc_main = {
|
||||
executorList.value = res.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:496", "获取部门用户失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:505", "获取部门用户失败:", error);
|
||||
}
|
||||
};
|
||||
const toggleExecutorSelect = (item) => {
|
||||
@@ -132,7 +132,7 @@ const _sfc_main = {
|
||||
initDeptCascader(res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:534", "获取部门树失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:543", "获取部门树失败:", error);
|
||||
}
|
||||
};
|
||||
const initDeptCascader = (data) => {
|
||||
@@ -213,11 +213,22 @@ const _sfc_main = {
|
||||
showEndDatePicker.value = false;
|
||||
};
|
||||
const manualCheckItems = common_vendor.ref([]);
|
||||
const checkItems = common_vendor.ref([]);
|
||||
const libraryCheckItems = common_vendor.ref([]);
|
||||
const checkItemCount = common_vendor.computed(() => {
|
||||
const libraryCount = checkItems.value.reduce((sum, item) => sum + item.count, 0);
|
||||
return manualCheckItems.value.length + libraryCount;
|
||||
return manualCheckItems.value.length + libraryCheckItems.value.length;
|
||||
});
|
||||
const getExistingPointIds = () => {
|
||||
const ids = /* @__PURE__ */ new Set();
|
||||
manualCheckItems.value.forEach((item) => {
|
||||
if (item.id)
|
||||
ids.add(Number(item.id));
|
||||
});
|
||||
libraryCheckItems.value.forEach((item) => {
|
||||
if (item.pointId)
|
||||
ids.add(Number(item.pointId));
|
||||
});
|
||||
return ids;
|
||||
};
|
||||
const deleteManualCheckItem = (item, index) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
@@ -238,7 +249,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:681", "删除检查项失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:700", "删除检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
||||
}
|
||||
} else {
|
||||
@@ -249,14 +260,14 @@ const _sfc_main = {
|
||||
}
|
||||
});
|
||||
};
|
||||
const deleteCheckItem = (index) => {
|
||||
const deleteLibraryCheckItem = (index) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该检查项吗?",
|
||||
confirmColor: "#F56C6C",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
checkItems.value.splice(index, 1);
|
||||
libraryCheckItems.value.splice(index, 1);
|
||||
common_vendor.index.showToast({ title: "删除成功", icon: "success" });
|
||||
}
|
||||
}
|
||||
@@ -314,7 +325,7 @@ const _sfc_main = {
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:768", "获取法规列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:787", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
@@ -394,7 +405,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:868", "添加检查项失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:887", "添加检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -443,7 +454,7 @@ const _sfc_main = {
|
||||
hasMoreLibrary.value = libraryList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:928", "获取检查库列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:947", "获取检查库列表失败:", error);
|
||||
} finally {
|
||||
libraryLoading.value = false;
|
||||
}
|
||||
@@ -468,6 +479,61 @@ const _sfc_main = {
|
||||
selectedLibraries.value.push(item.id);
|
||||
}
|
||||
};
|
||||
const fetchLibraryDetailAll = async (libraryId) => {
|
||||
const pageSize = 50;
|
||||
let pageNum = 1;
|
||||
let allRecords = [];
|
||||
let total = 0;
|
||||
while (true) {
|
||||
const res = await request_api.getCheckItemListDetail({
|
||||
id: libraryId,
|
||||
pageNum,
|
||||
pageSize
|
||||
});
|
||||
if (res.code !== 0 || !res.data)
|
||||
break;
|
||||
const records = res.data.records || [];
|
||||
total = Number(res.data.total) || 0;
|
||||
allRecords = [...allRecords, ...records];
|
||||
if (records.length === 0 || allRecords.length >= total)
|
||||
break;
|
||||
pageNum += 1;
|
||||
}
|
||||
return allRecords;
|
||||
};
|
||||
const getLibraryDisplayName = (libraryId, records) => {
|
||||
const library = libraryList.value.find((item) => String(item.id) === String(libraryId));
|
||||
if (library == null ? void 0 : library.name)
|
||||
return library.name;
|
||||
if (records.length > 0)
|
||||
return records[0].name || "";
|
||||
return "";
|
||||
};
|
||||
const appendLibraryRecords = (libraryId, records, sourceLibraryName) => {
|
||||
const existingPointIds = getExistingPointIds();
|
||||
let addedCount = 0;
|
||||
records.forEach((record) => {
|
||||
if (!record.pointId)
|
||||
return;
|
||||
const pointId = Number(record.pointId);
|
||||
if (existingPointIds.has(pointId))
|
||||
return;
|
||||
existingPointIds.add(pointId);
|
||||
libraryCheckItems.value.push({
|
||||
pointId,
|
||||
itemId: record.itemId,
|
||||
sourceLibraryId: libraryId,
|
||||
sourceLibraryName,
|
||||
name: record.name || "",
|
||||
point: record.point || "",
|
||||
industry: record.industry || "",
|
||||
leadDept: record.leadDept || "",
|
||||
regulation: record.regulation || ""
|
||||
});
|
||||
addedCount += 1;
|
||||
});
|
||||
return addedCount;
|
||||
};
|
||||
const addSelectedLibrary = async () => {
|
||||
if (selectedLibraries.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请选择检查库", icon: "none" });
|
||||
@@ -475,28 +541,23 @@ const _sfc_main = {
|
||||
}
|
||||
common_vendor.index.showLoading({ title: "加载中..." });
|
||||
try {
|
||||
let totalAdded = 0;
|
||||
for (const id of selectedLibraries.value) {
|
||||
const res = await request_api.getCheckItemListDetail({ id });
|
||||
if (res.code === 0 && res.data) {
|
||||
const records = res.data.records || [];
|
||||
const total = res.data.total || 0;
|
||||
const tableName = records.length > 0 ? records[0].name : "";
|
||||
checkItems.value.push({
|
||||
itemId: id,
|
||||
tableName,
|
||||
count: total,
|
||||
details: records
|
||||
// 保存详情数据,以便后续使用
|
||||
});
|
||||
}
|
||||
const records = await fetchLibraryDetailAll(id);
|
||||
const sourceLibraryName = getLibraryDisplayName(id, records);
|
||||
totalAdded += appendLibraryRecords(id, records, sourceLibraryName);
|
||||
}
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
|
||||
if (totalAdded === 0) {
|
||||
common_vendor.index.showToast({ title: "没有可添加的新检查项", icon: "none" });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showToast({ title: `已添加${totalAdded}项`, icon: "success" });
|
||||
showLibraryPopup.value = false;
|
||||
selectedLibraries.value = [];
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:993", "获取检查库详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1067", "获取检查库详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -536,16 +597,12 @@ const _sfc_main = {
|
||||
const items = [];
|
||||
manualCheckItems.value.forEach((item) => {
|
||||
if (item.id) {
|
||||
items.push(item.id);
|
||||
items.push(Number(item.id));
|
||||
}
|
||||
});
|
||||
checkItems.value.forEach((lib) => {
|
||||
if (lib.details && lib.details.length > 0) {
|
||||
lib.details.forEach((detail) => {
|
||||
if (detail.itemId) {
|
||||
items.push(detail.itemId);
|
||||
}
|
||||
});
|
||||
libraryCheckItems.value.forEach((item) => {
|
||||
if (item.pointId) {
|
||||
items.push(Number(item.pointId));
|
||||
}
|
||||
});
|
||||
if (items.length === 0) {
|
||||
@@ -562,12 +619,9 @@ const _sfc_main = {
|
||||
"每月一次": 3,
|
||||
"每季度一次": 4
|
||||
};
|
||||
const itemIds = [];
|
||||
checkItems.value.forEach((lib) => {
|
||||
if (lib.itemId) {
|
||||
itemIds.push(lib.itemId);
|
||||
}
|
||||
});
|
||||
const itemIds = [...new Set(
|
||||
libraryCheckItems.value.map((item) => item.sourceLibraryId).filter(Boolean).map((id) => Number(id))
|
||||
)];
|
||||
const params = {
|
||||
name: formData.name,
|
||||
deptId: formData.deptId,
|
||||
@@ -600,7 +654,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1117", "保存失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1185", "保存失败:", error);
|
||||
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -708,12 +762,14 @@ const _sfc_main = {
|
||||
f: "manual-" + index
|
||||
};
|
||||
}),
|
||||
ah: common_vendor.f(checkItems.value, (item, index, i0) => {
|
||||
ah: common_vendor.f(libraryCheckItems.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.tableName),
|
||||
b: common_vendor.t(item.count),
|
||||
c: common_vendor.o(($event) => deleteCheckItem(index), "lib-" + index),
|
||||
d: "lib-" + index
|
||||
a: common_vendor.t(item.sourceLibraryName || "-"),
|
||||
b: common_vendor.t(item.name),
|
||||
c: common_vendor.t(item.point),
|
||||
d: common_vendor.t(item.regulation || "-"),
|
||||
e: common_vendor.o(($event) => deleteLibraryCheckItem(index), "lib-" + item.pointId),
|
||||
f: "lib-" + item.pointId
|
||||
};
|
||||
}),
|
||||
ai: common_vendor.o(($event) => showAddPopup.value = true),
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -135,10 +135,12 @@
|
||||
.check-card .check-action .btn-delete.data-v-98282eb3::after {
|
||||
border: none;
|
||||
}
|
||||
.manual-card.data-v-98282eb3 {
|
||||
.manual-card.data-v-98282eb3,
|
||||
.library-card.data-v-98282eb3 {
|
||||
padding-top: 50rpx;
|
||||
}
|
||||
.manual-card .card-tag.data-v-98282eb3 {
|
||||
.manual-card .card-tag.data-v-98282eb3,
|
||||
.library-card .card-tag.data-v-98282eb3 {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
@@ -148,6 +150,9 @@
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 0 0 12rpx 0;
|
||||
}
|
||||
.library-card .library-tag.data-v-98282eb3 {
|
||||
background: #67C23A;
|
||||
}
|
||||
.add-btns.data-v-98282eb3 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
|
||||
@@ -39,18 +40,13 @@ const _sfc_main = {
|
||||
]);
|
||||
const radiovalue1 = common_vendor.ref("矿山开采");
|
||||
const groupChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:86", "groupChange", n);
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:87", "groupChange", n);
|
||||
};
|
||||
const radioChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:90", "radioChange", n);
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:91", "radioChange", n);
|
||||
};
|
||||
const fileList1 = common_vendor.ref([]);
|
||||
const afterRead = (event) => {
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:96", event);
|
||||
};
|
||||
const deletePic = (event) => {
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:99", event);
|
||||
};
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList1);
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(_ctx.change),
|
||||
@@ -186,8 +182,8 @@ const _sfc_main = {
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
ab: common_vendor.o(afterRead),
|
||||
ac: common_vendor.o(deletePic),
|
||||
ab: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
ac: common_vendor.o(common_vendor.unref(deletePic)),
|
||||
ad: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
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_watermark = require("../../utils/watermark.js");
|
||||
const request_request = require("../../request/request.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_choose2 = common_vendor.resolveComponent("up-choose");
|
||||
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_choose2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
(_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_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.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_choose + _easycom_up_textarea + _easycom_u_popup)();
|
||||
(_easycom_up_choose + _easycom_up_upload + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspection",
|
||||
@@ -37,10 +37,10 @@ const _sfc_main = {
|
||||
if (userInfoStr) {
|
||||
const userInfo = JSON.parse(userInfoStr);
|
||||
userRole.value = userInfo.role || "";
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:283", "当前用户角色:", userRole.value);
|
||||
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:286", "获取用户信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:289", "获取用户信息失败:", error);
|
||||
}
|
||||
};
|
||||
getUserRole();
|
||||
@@ -58,7 +58,7 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:311", "获取任务信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:314", "获取任务信息失败:", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
@@ -132,7 +132,7 @@ const _sfc_main = {
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:394", "获取法规列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:397", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ const _sfc_main = {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:438", "获取区域列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:441", "获取区域列表失败:", error);
|
||||
}
|
||||
};
|
||||
fetchAreaList();
|
||||
@@ -180,26 +180,26 @@ const _sfc_main = {
|
||||
showAreaPicker.value = false;
|
||||
};
|
||||
const chooseLocation = () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:454", "chooseLocation called");
|
||||
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:463", "获取当前位置成功:", 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:469", "选择位置成功:", 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:478", "选择位置失败:", 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({
|
||||
@@ -211,17 +211,17 @@ const _sfc_main = {
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:492", "获取当前位置失败:", 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:496", "选择位置成功:", 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:503", "选择位置失败:", 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({
|
||||
@@ -251,19 +251,10 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const attachments = fileList1.value.map((file) => {
|
||||
const path = file.serverPath || "";
|
||||
const fileName = path ? path.split("/").pop() : file.name || "";
|
||||
return {
|
||||
fileName: fileName || "",
|
||||
filePath: path,
|
||||
fileType: file.type || "image/png",
|
||||
fileSize: file.size || 0
|
||||
};
|
||||
});
|
||||
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:550", "innnn", sourceOptions);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:546", "innnn", sourceOptions);
|
||||
const params = {
|
||||
title: formData.title,
|
||||
//标题
|
||||
@@ -292,7 +283,7 @@ const _sfc_main = {
|
||||
regulationId: formData.regulationId || null
|
||||
// 法律依据ID
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:569", "提交的参数:", params);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:565", "提交的参数:", params);
|
||||
try {
|
||||
const res = await request_api.addHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
@@ -321,7 +312,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:602", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:598", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
@@ -341,7 +332,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:623", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:619", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
@@ -357,9 +348,11 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
const Rectification = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
let url = `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`;
|
||||
if (item.deadline) {
|
||||
url += `&deadline=${encodeURIComponent(item.deadline)}`;
|
||||
}
|
||||
common_vendor.index.navigateTo({ url });
|
||||
};
|
||||
const editRectification = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
@@ -377,71 +370,15 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
const fileList1 = common_vendor.ref([]);
|
||||
const deletePic = (event) => {
|
||||
fileList1.value.splice(event.index, 1);
|
||||
};
|
||||
const afterRead = async (event) => {
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = fileList1.value.length;
|
||||
lists.map((item) => {
|
||||
fileList1.value.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中"
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
let watermarkedUrl = lists[i].url;
|
||||
try {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
watermarkedUrl = await utils_watermark.addTimestampWatermark({
|
||||
tempFilePath: lists[i].url,
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:697", "加水印失败,将使用原图上传:", e);
|
||||
}
|
||||
const result = await uploadFilePromise(watermarkedUrl);
|
||||
let item = fileList1.value[fileListLen];
|
||||
const serverPath = typeof result === "string" ? result : (result == null ? void 0 : result.url) || (result == null ? void 0 : result.path) || "";
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
// url: baseUrl + serverPath,
|
||||
url: request_request.toImageUrl(serverPath),
|
||||
serverPath
|
||||
});
|
||||
fileListLen++;
|
||||
const uploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList1, {
|
||||
watermark: {
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance: uploadInstance
|
||||
}
|
||||
};
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:732", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
const aiAnalyzing = common_vendor.ref(false);
|
||||
const handleAiAnalyze = async () => {
|
||||
const imageFiles = fileList1.value.filter((f) => {
|
||||
@@ -454,14 +391,14 @@ const _sfc_main = {
|
||||
const fullImageUrl = imageFiles[0].url;
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:754", "开始调用AI分析接口,图片地址:", fullImageUrl);
|
||||
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:762", "AI分析结果:", aiData);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:698", "AI分析结果:", aiData);
|
||||
if (aiData.title)
|
||||
formData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
@@ -483,7 +420,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:785", "AI分析接口调用失败:", 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;
|
||||
@@ -505,7 +442,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:808", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:744", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
@@ -530,24 +467,24 @@ const _sfc_main = {
|
||||
const sourceOptions = common_vendor.ref([
|
||||
{
|
||||
id: 1,
|
||||
title: "随手拍"
|
||||
title: "部门检查"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "企业自查"
|
||||
title: "都导检查"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "行业互查"
|
||||
title: "企业自查"
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "专家诊查"
|
||||
title: "行业互查"
|
||||
}
|
||||
]);
|
||||
common_vendor.watch(() => formData.source, (newVal) => {
|
||||
const selected = sourceOptions.value[newVal];
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:855", "隐患来源选择结果:", {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:791", "隐患来源选择结果:", {
|
||||
索引: newVal,
|
||||
选中项: selected,
|
||||
id: selected == null ? void 0 : selected.id,
|
||||
@@ -620,50 +557,50 @@ const _sfc_main = {
|
||||
}),
|
||||
d: common_vendor.o(($event) => showAddPopup.value = true),
|
||||
e: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
f: common_vendor.o(afterRead),
|
||||
g: common_vendor.o(deletePic),
|
||||
h: common_vendor.p({
|
||||
f: common_vendor.o(($event) => formData.source = $event),
|
||||
g: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "152rpx",
|
||||
["item-height"]: "64rpx",
|
||||
modelValue: formData.source
|
||||
}),
|
||||
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
|
||||
}),
|
||||
i: canvasWidth.value,
|
||||
j: canvasHeight.value,
|
||||
k: canvasWidth.value + "px",
|
||||
l: canvasHeight.value + "px",
|
||||
m: !aiAnalyzing.value
|
||||
k: canvasWidth.value,
|
||||
l: canvasHeight.value,
|
||||
m: canvasWidth.value + "px",
|
||||
n: canvasHeight.value + "px",
|
||||
o: !aiAnalyzing.value
|
||||
}, !aiAnalyzing.value ? {} : {}, {
|
||||
n: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
|
||||
o: aiAnalyzing.value,
|
||||
p: aiAnalyzing.value,
|
||||
q: common_vendor.o(handleAiAnalyze),
|
||||
r: common_vendor.o(($event) => formData.title = $event),
|
||||
s: common_vendor.p({
|
||||
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
|
||||
}),
|
||||
t: common_vendor.sr(levelChooseRef, "b44c631d-3,b44c631d-0", {
|
||||
w: common_vendor.sr(levelChooseRef, "b44c631d-4,b44c631d-0", {
|
||||
"k": "levelChooseRef"
|
||||
}),
|
||||
v: common_vendor.o(($event) => formData.level = $event),
|
||||
w: common_vendor.p({
|
||||
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
|
||||
}),
|
||||
x: common_vendor.o(($event) => formData.source = $event),
|
||||
y: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: formData.source
|
||||
}),
|
||||
z: common_vendor.o(($event) => selectedAddress.value = $event),
|
||||
A: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
@@ -693,7 +630,8 @@ const _sfc_main = {
|
||||
P: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: false
|
||||
}),
|
||||
Q: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
R: common_vendor.o(searchRegulation),
|
||||
@@ -721,7 +659,8 @@ const _sfc_main = {
|
||||
ad: common_vendor.p({
|
||||
show: showLawPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: false
|
||||
}),
|
||||
ae: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
af: common_vendor.o(confirmAreaSelect),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"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-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
|
||||
"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
@@ -132,6 +132,36 @@
|
||||
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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_watermark = require("../../utils/watermark.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
@@ -23,8 +23,24 @@ const _sfc_main = {
|
||||
const assignId = common_vendor.ref("");
|
||||
const rectifyData = common_vendor.reactive({
|
||||
rectifyPlan: "",
|
||||
rectifyResult: ""
|
||||
rectificationMeasures: "",
|
||||
controlMeasures: "",
|
||||
rectifyResult: "",
|
||||
planCost: null,
|
||||
actualCost: null,
|
||||
rectifierName: "",
|
||||
rectifyStatusName: ""
|
||||
});
|
||||
const formatMoney = (value) => {
|
||||
if (value === null || value === void 0 || value === "") {
|
||||
return "暂无";
|
||||
}
|
||||
const num = Number(value);
|
||||
if (Number.isNaN(num)) {
|
||||
return "暂无";
|
||||
}
|
||||
return `${num.toFixed(2)} 元`;
|
||||
};
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const formData = common_vendor.reactive({
|
||||
result: 1,
|
||||
@@ -63,45 +79,61 @@ const _sfc_main = {
|
||||
urls
|
||||
});
|
||||
};
|
||||
const resolveAssignWithRectify = (assigns) => {
|
||||
if (!(assigns == null ? void 0 : assigns.length))
|
||||
return null;
|
||||
if (rectifyId.value) {
|
||||
const byRectifyId = assigns.find(
|
||||
(item) => item.rectify && String(item.rectify.rectifyId) === String(rectifyId.value)
|
||||
);
|
||||
if (byRectifyId)
|
||||
return byRectifyId;
|
||||
}
|
||||
if (assignId.value) {
|
||||
const byAssignId = assigns.find(
|
||||
(item) => String(item.assignId) === String(assignId.value) && item.rectify
|
||||
);
|
||||
if (byAssignId)
|
||||
return byAssignId;
|
||||
}
|
||||
return assigns.find((item) => item.rectify) || null;
|
||||
};
|
||||
const applyRectifyData = (rectify) => {
|
||||
if (!rectify)
|
||||
return;
|
||||
rectifyData.rectifyPlan = rectify.rectifyPlan || "";
|
||||
rectifyData.rectificationMeasures = rectify.rectificationMeasures || "";
|
||||
rectifyData.controlMeasures = rectify.controlMeasures || "";
|
||||
rectifyData.rectifyResult = rectify.rectifyResult || "";
|
||||
rectifyData.planCost = rectify.planCost ?? null;
|
||||
rectifyData.actualCost = rectify.actualCost ?? null;
|
||||
rectifyData.rectifierName = rectify.rectifierName || "";
|
||||
rectifyData.rectifyStatusName = rectify.rectifyStatusName || "";
|
||||
rectifyAttachments.value = rectify.attachments || [];
|
||||
};
|
||||
const fetchDetail = async () => {
|
||||
if (!hazardId.value || !assignId.value)
|
||||
if (!hazardId.value)
|
||||
return;
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId: hazardId.value, assignId: assignId.value });
|
||||
const res = await request_api.getHiddenDangerDetail({
|
||||
hazardId: hazardId.value,
|
||||
assignId: assignId.value
|
||||
});
|
||||
if (res.code === 0 && res.data) {
|
||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||
const assign = res.data.assigns[0];
|
||||
if (assign.rectify) {
|
||||
rectifyData.rectifyPlan = assign.rectify.rectifyPlan || "";
|
||||
rectifyData.rectifyResult = assign.rectify.rectifyResult || "";
|
||||
if (assign.rectify.attachments) {
|
||||
rectifyAttachments.value = assign.rectify.attachments;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:167", "整改记录:", rectifyData);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:168", "整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:175", "获取隐患详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:247", "获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.rectifyId) {
|
||||
rectifyId.value = options.rectifyId;
|
||||
}
|
||||
if (options.hazardId) {
|
||||
hazardId.value = options.hazardId;
|
||||
}
|
||||
if (options.assignId) {
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:190", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
||||
fetchDetail();
|
||||
});
|
||||
const handleCancel = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
@@ -138,24 +170,7 @@ const _sfc_main = {
|
||||
}
|
||||
};
|
||||
const executeSubmit = async () => {
|
||||
const attachments = fileList1.value.map((file) => {
|
||||
let url = "";
|
||||
if (typeof file.url === "string") {
|
||||
url = file.url;
|
||||
} else if (file.url && typeof file.url === "object") {
|
||||
url = file.url.url || file.url.path || "";
|
||||
}
|
||||
if (typeof url === "string" && url.startsWith("http")) {
|
||||
url = url.replace(request_request.imageBaseUrl, "");
|
||||
}
|
||||
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
|
||||
return {
|
||||
fileName: fileName || "",
|
||||
filePath: url || "",
|
||||
fileType: file.type || "image/png",
|
||||
fileSize: file.size || 0
|
||||
};
|
||||
});
|
||||
const attachments = fileList1.value.filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file));
|
||||
const params = {
|
||||
rectifyId: Number(rectifyId.value),
|
||||
result: formData.result,
|
||||
@@ -164,7 +179,7 @@ const _sfc_main = {
|
||||
signPath: signatureServerPath.value || ""
|
||||
// 电子签名路径
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:271", "提交验收参数:", params);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:311", "提交验收参数:", params);
|
||||
try {
|
||||
const res = await request_api.acceptanceRectification(params);
|
||||
common_vendor.index.hideLoading();
|
||||
@@ -185,7 +200,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:293", "验收失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:333", "验收失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
@@ -194,76 +209,15 @@ const _sfc_main = {
|
||||
isSubmitting.value = false;
|
||||
}
|
||||
};
|
||||
const deletePic = (event) => {
|
||||
fileList1.value.splice(event.index, 1);
|
||||
};
|
||||
const addWatermark = (tempFilePath) => {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
return utils_watermark.addTimestampWatermark({
|
||||
tempFilePath,
|
||||
const acceptUploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList1, {
|
||||
watermark: {
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance
|
||||
});
|
||||
};
|
||||
const afterRead = async (event) => {
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = fileList1.value.length;
|
||||
lists.map((item) => {
|
||||
fileList1.value.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "处理中..."
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
try {
|
||||
const watermarkedUrl = await addWatermark(lists[i].url);
|
||||
const result = await uploadFilePromise(watermarkedUrl);
|
||||
let item = fileList1.value[fileListLen];
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: request_request.toImageUrl(result.url || result.filePath || result)
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:352", "加水印或上传失败:", e);
|
||||
let item = fileList1.value[fileListLen];
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "failed",
|
||||
message: "处理失败"
|
||||
});
|
||||
}
|
||||
fileListLen++;
|
||||
instance: acceptUploadInstance
|
||||
}
|
||||
};
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:382", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
const saveDraft = () => {
|
||||
if (isRestoring.value || !isInitialized.value)
|
||||
return;
|
||||
@@ -349,7 +303,7 @@ const _sfc_main = {
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:502", "解析草稿失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:466", "解析草稿失败:", e);
|
||||
isRestoring.value = false;
|
||||
isInitialized.value = true;
|
||||
}
|
||||
@@ -391,17 +345,18 @@ const _sfc_main = {
|
||||
};
|
||||
const onSignatureConfirm = async (tempFilePath) => {
|
||||
try {
|
||||
const res = await uploadFilePromise(tempFilePath);
|
||||
const path = res && typeof res === "object" ? res.url || res.filePath || "" : res || "";
|
||||
signatureServerPath.value = path;
|
||||
signatureUrl.value = path.startsWith("http") ? path : request_request.baseUrl.replace("/api", "") + path;
|
||||
const { url } = await utils_upload.uploadToCloud(tempFilePath);
|
||||
signatureServerPath.value = url;
|
||||
signatureUrl.value = url;
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
if (isSubmitting.value) {
|
||||
await executeSubmit();
|
||||
}
|
||||
} catch (err) {
|
||||
isSubmitting.value = false;
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:573", "签名上传失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:536", "签名上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -410,7 +365,7 @@ const _sfc_main = {
|
||||
const sysInfo = common_vendor.index.getSystemInfoSync();
|
||||
signatureWidth.value = sysInfo.windowWidth - 40;
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:584", "获取系统信息失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:547", "获取系统信息失败:", e);
|
||||
}
|
||||
if (options.rectifyId) {
|
||||
rectifyId.value = options.rectifyId;
|
||||
@@ -421,17 +376,23 @@ const _sfc_main = {
|
||||
if (options.assignId) {
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:595", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:558", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
||||
fetchDetail();
|
||||
restoreDraft();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(rectifyData.rectifyPlan || "暂无"),
|
||||
b: common_vendor.t(rectifyData.rectifyResult || "暂无"),
|
||||
c: rectifyAttachments.value.length > 0
|
||||
b: common_vendor.t(rectifyData.rectificationMeasures || "暂无"),
|
||||
c: common_vendor.t(rectifyData.controlMeasures || "暂无"),
|
||||
d: common_vendor.t(rectifyData.rectifyResult || "暂无"),
|
||||
e: common_vendor.t(formatMoney(rectifyData.planCost)),
|
||||
f: common_vendor.t(formatMoney(rectifyData.actualCost)),
|
||||
g: common_vendor.t(rectifyData.rectifierName || "暂无"),
|
||||
h: common_vendor.t(rectifyData.rectifyStatusName || "暂无"),
|
||||
i: rectifyAttachments.value.length > 0
|
||||
}, rectifyAttachments.value.length > 0 ? {
|
||||
d: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
|
||||
j: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: getFullPath(img.filePath),
|
||||
@@ -439,48 +400,48 @@ const _sfc_main = {
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.n(formData.result === 1 ? "active" : ""),
|
||||
f: common_vendor.o(($event) => formData.result = 1),
|
||||
g: common_vendor.n(formData.result === 2 ? "active" : ""),
|
||||
h: common_vendor.o(($event) => formData.result = 2),
|
||||
i: common_vendor.o(($event) => formData.verifyRemark = $event),
|
||||
j: common_vendor.p({
|
||||
k: common_vendor.n(formData.result === 1 ? "active" : ""),
|
||||
l: common_vendor.o(($event) => formData.result = 1),
|
||||
m: common_vendor.n(formData.result === 2 ? "active" : ""),
|
||||
n: common_vendor.o(($event) => formData.result = 2),
|
||||
o: common_vendor.o(($event) => formData.verifyRemark = $event),
|
||||
p: common_vendor.p({
|
||||
placeholder: "请输入验收备注",
|
||||
modelValue: formData.verifyRemark
|
||||
}),
|
||||
k: common_vendor.o(afterRead),
|
||||
l: common_vendor.o(deletePic),
|
||||
m: common_vendor.p({
|
||||
q: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
r: common_vendor.o(common_vendor.unref(deletePic)),
|
||||
s: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
imageMode: "aspectFill",
|
||||
maxCount: 10
|
||||
}),
|
||||
n: canvasWidth.value,
|
||||
o: canvasHeight.value,
|
||||
p: canvasWidth.value + "px",
|
||||
q: canvasHeight.value + "px",
|
||||
r: showCanvas.value
|
||||
t: canvasWidth.value,
|
||||
v: canvasHeight.value,
|
||||
w: canvasWidth.value + "px",
|
||||
x: canvasHeight.value + "px",
|
||||
y: showCanvas.value
|
||||
}, showCanvas.value ? {
|
||||
s: common_vendor.o(clearSignature)
|
||||
z: common_vendor.o(clearSignature)
|
||||
} : {
|
||||
t: common_vendor.o(reSign)
|
||||
A: common_vendor.o(reSign)
|
||||
}, {
|
||||
v: !showCanvas.value
|
||||
B: !showCanvas.value
|
||||
}, !showCanvas.value ? {
|
||||
w: signatureUrl.value
|
||||
C: signatureUrl.value
|
||||
} : {}, {
|
||||
x: showCanvas.value
|
||||
D: showCanvas.value
|
||||
}, showCanvas.value ? {
|
||||
y: common_vendor.sr(signatureRef, "39f9b795-2", {
|
||||
E: common_vendor.sr(signatureRef, "39f9b795-2", {
|
||||
"k": "signatureRef"
|
||||
}),
|
||||
z: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
|
||||
A: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
B: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
C: common_vendor.o(($event) => isSignatureEmpty.value = true),
|
||||
D: common_vendor.p({
|
||||
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({
|
||||
width: signatureWidth.value,
|
||||
height: 160,
|
||||
backgroundColor: "#f8f8f8",
|
||||
@@ -489,9 +450,9 @@ const _sfc_main = {
|
||||
enableHistory: false
|
||||
})
|
||||
} : {}, {
|
||||
E: common_vendor.o(handleCancel),
|
||||
F: common_vendor.o(handleSubmit),
|
||||
G: common_vendor.gei(_ctx, "")
|
||||
K: common_vendor.o(handleCancel),
|
||||
L: common_vendor.o(handleSubmit),
|
||||
M: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,25 +2,76 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
(_easycom_up_picker2 + _easycom_up_datetime_picker2)();
|
||||
(_easycom_u_popup2 + _easycom_up_datetime_picker2)();
|
||||
}
|
||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_picker + _easycom_up_datetime_picker)();
|
||||
(_easycom_u_popup + _easycom_up_datetime_picker)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "assignment",
|
||||
setup(__props) {
|
||||
const hazardId = common_vendor.ref("");
|
||||
const assignId = common_vendor.ref("");
|
||||
const showUserPicker = common_vendor.ref(false);
|
||||
const showUserPopup = common_vendor.ref(false);
|
||||
const selectedUser = common_vendor.ref("");
|
||||
const selectedUserId = common_vendor.ref("");
|
||||
const userColumns = common_vendor.ref([["暂无数据"]]);
|
||||
const userList = common_vendor.ref([]);
|
||||
const deptList = common_vendor.ref([]);
|
||||
const activeDeptIndex = common_vendor.ref(0);
|
||||
const userPickerSelectedId = common_vendor.ref("");
|
||||
const formatUserDisplayName = (user) => {
|
||||
if (user.postName) {
|
||||
return `${user.nickName}_${user.postName}`;
|
||||
}
|
||||
return user.nickName || "";
|
||||
};
|
||||
const currentDeptUsers = common_vendor.computed(() => {
|
||||
const dept = deptList.value[activeDeptIndex.value];
|
||||
return (dept == null ? void 0 : dept.users) || [];
|
||||
});
|
||||
const userPickerSelectedText = common_vendor.computed(() => {
|
||||
if (!userPickerSelectedId.value)
|
||||
return "";
|
||||
for (const dept of deptList.value) {
|
||||
const user = (dept.users || []).find((u) => String(u.userId) === String(userPickerSelectedId.value));
|
||||
if (user)
|
||||
return formatUserDisplayName(user);
|
||||
}
|
||||
return "";
|
||||
});
|
||||
const deptHasSelectedUser = (dept) => {
|
||||
var _a;
|
||||
if (!userPickerSelectedId.value || !((_a = dept.users) == null ? void 0 : _a.length))
|
||||
return false;
|
||||
return dept.users.some((user) => String(user.userId) === String(userPickerSelectedId.value));
|
||||
};
|
||||
const onUserItemClick = (userId) => {
|
||||
userPickerSelectedId.value = String(userId);
|
||||
};
|
||||
const openUserPopup = () => {
|
||||
userPickerSelectedId.value = selectedUserId.value;
|
||||
const firstDeptWithUsers = deptList.value.findIndex((dept) => {
|
||||
var _a;
|
||||
return ((_a = dept.users) == null ? void 0 : _a.length) > 0;
|
||||
});
|
||||
activeDeptIndex.value = firstDeptWithUsers >= 0 ? firstDeptWithUsers : 0;
|
||||
showUserPopup.value = true;
|
||||
};
|
||||
const cancelUserSelect = () => {
|
||||
showUserPopup.value = false;
|
||||
};
|
||||
const confirmUserSelect = () => {
|
||||
if (!userPickerSelectedId.value) {
|
||||
common_vendor.index.showToast({ title: "请选择整改责任人", icon: "none" });
|
||||
return;
|
||||
}
|
||||
selectedUserId.value = String(userPickerSelectedId.value);
|
||||
selectedUser.value = userPickerSelectedText.value;
|
||||
showUserPopup.value = false;
|
||||
};
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const dateValue = common_vendor.ref(Date.now());
|
||||
const selectedDate = common_vendor.ref("");
|
||||
@@ -28,38 +79,15 @@ const _sfc_main = {
|
||||
try {
|
||||
const res = await request_api.getDepartmentPersonUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
const users = [];
|
||||
res.data.forEach((dept) => {
|
||||
if (dept.users && dept.users.length > 0) {
|
||||
dept.users.forEach((user) => {
|
||||
users.push({
|
||||
id: String(user.userId),
|
||||
name: `${user.nickName}(${dept.deptName})`
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
userList.value = users;
|
||||
userColumns.value = [users.map((u) => u.name)];
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:91", "整改人员列表:", users);
|
||||
deptList.value = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:172", "部门人员树:", deptList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:94", "获取部门人员失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:175", "获取部门人员失败:", error);
|
||||
}
|
||||
};
|
||||
const onUserConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:100", "选择的人员:", e);
|
||||
if (e.value && e.value.length > 0) {
|
||||
selectedUser.value = e.value[0];
|
||||
const user = userList.value.find((u) => u.name === e.value[0]);
|
||||
if (user) {
|
||||
selectedUserId.value = user.id;
|
||||
}
|
||||
}
|
||||
showUserPicker.value = false;
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:114", "选择的日期时间:", e);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:181", "选择的日期时间:", e);
|
||||
const date = new Date(e.value);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
@@ -92,7 +120,7 @@ const _sfc_main = {
|
||||
assignRemark: ""
|
||||
// 交办备注(可选)
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:150", "提交数据:", params);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:217", "提交数据:", params);
|
||||
try {
|
||||
const res = await request_api.assignHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
@@ -105,7 +133,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:164", "交办失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:231", "交办失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -168,7 +196,7 @@ const _sfc_main = {
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:239", "解析草稿失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:306", "解析草稿失败:", e);
|
||||
isRestoring.value = false;
|
||||
}
|
||||
}
|
||||
@@ -195,31 +223,63 @@ const _sfc_main = {
|
||||
}, showRestoreBanner.value ? {
|
||||
b: common_vendor.o(($event) => clearDraft(true))
|
||||
} : {}, {
|
||||
c: common_vendor.t(selectedUser.value || "请选择整改人员"),
|
||||
d: common_vendor.n(selectedUser.value ? "" : "text-gray"),
|
||||
e: common_vendor.o(($event) => showUserPicker.value = true),
|
||||
f: common_vendor.o(onUserConfirm),
|
||||
g: common_vendor.o(($event) => showUserPicker.value = false),
|
||||
h: common_vendor.o(($event) => showUserPicker.value = false),
|
||||
i: common_vendor.p({
|
||||
show: showUserPicker.value,
|
||||
columns: userColumns.value
|
||||
c: common_vendor.t(selectedUser.value || "请选择整改责任人"),
|
||||
d: !selectedUser.value ? 1 : "",
|
||||
e: common_vendor.o(openUserPopup),
|
||||
f: common_vendor.o(cancelUserSelect),
|
||||
g: userPickerSelectedId.value
|
||||
}, userPickerSelectedId.value ? {
|
||||
h: common_vendor.t(userPickerSelectedText.value)
|
||||
} : {}, {
|
||||
i: common_vendor.f(deptList.value, (dept, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(dept.deptName),
|
||||
b: deptHasSelectedUser(dept)
|
||||
}, deptHasSelectedUser(dept) ? {} : {}, {
|
||||
c: dept.deptId,
|
||||
d: common_vendor.n({
|
||||
active: activeDeptIndex.value === index
|
||||
}),
|
||||
e: common_vendor.o(($event) => activeDeptIndex.value = index, dept.deptId)
|
||||
});
|
||||
}),
|
||||
j: common_vendor.t(selectedDate.value || "请选择整改期限"),
|
||||
k: common_vendor.n(selectedDate.value ? "" : "text-gray"),
|
||||
l: common_vendor.o(($event) => showDatePicker.value = true),
|
||||
m: common_vendor.o(onDateConfirm),
|
||||
n: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
o: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
p: common_vendor.o(($event) => dateValue.value = $event),
|
||||
q: common_vendor.p({
|
||||
j: currentDeptUsers.value.length === 0
|
||||
}, currentDeptUsers.value.length === 0 ? {} : {
|
||||
k: common_vendor.f(currentDeptUsers.value, (user, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(formatUserDisplayName(user)),
|
||||
b: String(userPickerSelectedId.value) === String(user.userId)
|
||||
}, String(userPickerSelectedId.value) === String(user.userId) ? {} : {}, {
|
||||
c: "user-" + user.userId,
|
||||
d: String(userPickerSelectedId.value) === String(user.userId) ? 1 : "",
|
||||
e: common_vendor.o(($event) => onUserItemClick(user.userId), "user-" + user.userId)
|
||||
});
|
||||
})
|
||||
}, {
|
||||
l: "dept-users-" + activeDeptIndex.value,
|
||||
m: common_vendor.o(cancelUserSelect),
|
||||
n: common_vendor.o(confirmUserSelect),
|
||||
o: common_vendor.o(cancelUserSelect),
|
||||
p: common_vendor.p({
|
||||
show: showUserPopup.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
q: common_vendor.t(selectedDate.value || "请选择整改期限"),
|
||||
r: common_vendor.n(selectedDate.value ? "" : "text-gray"),
|
||||
s: common_vendor.o(($event) => showDatePicker.value = true),
|
||||
t: common_vendor.o(onDateConfirm),
|
||||
v: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
w: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
x: common_vendor.o(($event) => dateValue.value = $event),
|
||||
y: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: dateValue.value
|
||||
}),
|
||||
r: common_vendor.o(handleCancel),
|
||||
s: common_vendor.o(handleSubmit),
|
||||
t: common_vendor.gei(_ctx, "")
|
||||
z: common_vendor.o(handleCancel),
|
||||
A: common_vendor.o(handleSubmit),
|
||||
B: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "隐患交办",
|
||||
"usingComponents": {
|
||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{t}}"><view class="padding radius bg-white data-v-6209e844"><view wx:if="{{a}}" class="bg-orange-light text-orange padding-sm radius margin-bottom flex justify-between align-center data-v-6209e844" style="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"><view class="flex align-center data-v-6209e844" style="display:flex;flex-direction:row;align-items:center"><text class="cuIcon-info margin-right-xs data-v-6209e844" style="margin-right:10rpx"></text><text class="data-v-6209e844">已自动恢复您上次未提交的内容</text></view><text class="text-blue text-bold data-v-6209e844" style="cursor:pointer;padding:0 10rpx;color:#2667E9;font-weight:bold" bindtap="{{b}}">清空草稿</text></view><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">整改人员</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{e}}"><text class="{{['data-v-6209e844', d]}}">{{c}}</text></view><up-picker wx:if="{{i}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{f}}" bindcancel="{{g}}" bindclose="{{h}}" u-i="6209e844-0" bind:__l="__l" u-p="{{i}}"></up-picker><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{l}}"><text class="{{['data-v-6209e844', k]}}">{{j}}</text></view><up-datetime-picker wx:if="{{q}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{m}}" bindcancel="{{n}}" bindclose="{{o}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{p}}" u-p="{{q}}"></up-datetime-picker><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{r}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{s}}">确认</button></view></view></view>
|
||||
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{B}}"><view class="padding radius bg-white data-v-6209e844"><view wx:if="{{a}}" class="bg-orange-light text-orange padding-sm radius margin-bottom flex justify-between align-center data-v-6209e844" style="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"><view class="flex align-center data-v-6209e844" style="display:flex;flex-direction:row;align-items:center"><text class="cuIcon-info margin-right-xs data-v-6209e844" style="margin-right:10rpx"></text><text class="data-v-6209e844">已自动恢复您上次未提交的内容</text></view><text class="text-blue text-bold data-v-6209e844" style="cursor:pointer;padding:0 10rpx;color:#2667E9;font-weight:bold" bindtap="{{b}}">清空草稿</text></view><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">整改责任人</view><view class="text-red data-v-6209e844">*</view></view><view class="select-trigger data-v-6209e844" bindtap="{{e}}"><view class="{{['select-content', 'data-v-6209e844', d && 'text-gray']}}">{{c}}</view><text class="cuIcon-unfold data-v-6209e844"></text></view><u-popup wx:if="{{p}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" u-s="{{['d']}}" bindclose="{{o}}" u-i="6209e844-0" bind:__l="__l" u-p="{{p}}"><view class="user-popup cascader-user-popup data-v-6209e844"><view class="popup-header data-v-6209e844"><view class="popup-title text-bold data-v-6209e844">选择整改责任人</view><view class="popup-close data-v-6209e844" bindtap="{{f}}">×</view></view><view wx:if="{{g}}" class="selected-summary data-v-6209e844"><text class="summary-label data-v-6209e844">已选:</text><text class="summary-text data-v-6209e844">{{h}}</text></view><view class="cascader-body data-v-6209e844"><scroll-view class="cascader-col dept-col data-v-6209e844" scroll-y><view wx:for="{{i}}" wx:for-item="dept" wx:key="c" class="{{['data-v-6209e844', 'cascader-item', dept.d]}}" bindtap="{{dept.e}}"><text class="cascader-item-text data-v-6209e844">{{dept.a}}</text><text wx:if="{{dept.b}}" class="dept-dot data-v-6209e844"></text></view></scroll-view><scroll-view class="cascader-col user-col data-v-6209e844" scroll-y key="{{l}}"><view wx:if="{{j}}" class="empty-tip data-v-6209e844">该部门暂无人员</view><view wx:else class="data-v-6209e844"><view wx:for="{{k}}" wx:for-item="user" wx:key="c" class="{{['user-item', 'data-v-6209e844', user.d && 'active']}}" bindtap="{{user.e}}"><text class="user-item-text data-v-6209e844">{{user.a}}</text><text wx:if="{{user.b}}" class="cuIcon-check text-blue data-v-6209e844"></text></view></view></scroll-view></view><view class="popup-footer data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{m}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{n}}">确定</button></view></view></u-popup><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{s}}"><text class="{{['data-v-6209e844', r]}}">{{q}}</text></view><up-datetime-picker wx:if="{{y}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{t}}" bindcancel="{{v}}" bindclose="{{w}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{x}}" u-p="{{y}}"></up-datetime-picker><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{z}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{A}}">确认</button></view></view></view>
|
||||
@@ -39,6 +39,162 @@
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger.data-v-6209e844 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.select-trigger .select-content.data-v-6209e844 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.user-popup.data-v-6209e844 {
|
||||
background: #fff;
|
||||
}
|
||||
.user-popup .popup-header.data-v-6209e844 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.user-popup .popup-header .popup-title.data-v-6209e844 {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.user-popup .popup-header .popup-close.data-v-6209e844 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.user-popup.cascader-user-popup .selected-summary.data-v-6209e844 {
|
||||
padding: 16rpx 30rpx;
|
||||
background: #f5f7fa;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.user-popup.cascader-user-popup .selected-summary .summary-label.data-v-6209e844 {
|
||||
color: #909399;
|
||||
}
|
||||
.user-popup.cascader-user-popup .selected-summary .summary-text.data-v-6209e844 {
|
||||
color: #333;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-body.data-v-6209e844 {
|
||||
display: flex;
|
||||
height: 600rpx;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-col.data-v-6209e844 {
|
||||
height: 600rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.user-popup.cascader-user-popup .dept-col.data-v-6209e844 {
|
||||
width: 38%;
|
||||
background: #f7f8fa;
|
||||
border-right: 1rpx solid #eee;
|
||||
}
|
||||
.user-popup.cascader-user-popup .user-col.data-v-6209e844 {
|
||||
width: 62%;
|
||||
padding: 10rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item.data-v-6209e844 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 28rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #eef0f3;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item.active.data-v-6209e844 {
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item.active.data-v-6209e844::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 6rpx;
|
||||
background: #2667E9;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item-text.data-v-6209e844 {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.user-popup.cascader-user-popup .dept-dot.data-v-6209e844 {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: #2667E9;
|
||||
margin-left: 8rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.user-popup.cascader-user-popup .empty-tip.data-v-6209e844 {
|
||||
padding: 80rpx 20rpx;
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.user-popup .user-item.data-v-6209e844 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
.user-popup .user-item.data-v-6209e844:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.user-popup .user-item.active .user-item-text.data-v-6209e844 {
|
||||
color: #2667E9;
|
||||
font-weight: 600;
|
||||
}
|
||||
.user-popup .user-item .user-item-text.data-v-6209e844 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.user-popup .popup-footer.data-v-6209e844 {
|
||||
display: flex;
|
||||
gap: 24rpx;
|
||||
padding: 24rpx 30rpx;
|
||||
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
|
||||
background: #fff;
|
||||
}
|
||||
.user-popup .popup-footer button.data-v-6209e844 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 30rpx;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.user-popup .popup-footer button.data-v-6209e844::after {
|
||||
border: none;
|
||||
}
|
||||
.user-popup .popup-footer .btn-cancel.data-v-6209e844 {
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
border: 2rpx solid #2667E9;
|
||||
}
|
||||
.user-popup .popup-footer .btn-confirm.data-v-6209e844 {
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
.btn-group.data-v-6209e844 {
|
||||
display: flex;
|
||||
gap: 30rpx;
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_watermark = require("../../utils/watermark.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
const _easycom_up_checkbox2 = common_vendor.resolveComponent("up-checkbox");
|
||||
const _easycom_up_checkbox_group2 = common_vendor.resolveComponent("up-checkbox-group");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_wd_signature2 = common_vendor.resolveComponent("wd-signature");
|
||||
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_checkbox2 + _easycom_up_checkbox_group2 + _easycom_u_popup2 + _easycom_up_upload2 + _easycom_wd_signature2)();
|
||||
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_checkbox2 + _easycom_u_popup2 + _easycom_up_upload2 + _easycom_wd_signature2)();
|
||||
}
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
const _easycom_up_checkbox = () => "../../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js";
|
||||
const _easycom_up_checkbox_group = () => "../../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
const _easycom_wd_signature = () => "../../node-modules/wot-design-uni/components/wd-signature/wd-signature.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_checkbox + _easycom_up_checkbox_group + _easycom_u_popup + _easycom_up_upload + _easycom_wd_signature)();
|
||||
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_checkbox + _easycom_u_popup + _easycom_up_upload + _easycom_wd_signature)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "rectification",
|
||||
@@ -47,6 +44,29 @@ const _sfc_main = {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
};
|
||||
const resolveSignPathFromData = (data) => {
|
||||
if (!data)
|
||||
return "";
|
||||
return data.signPath || data.signUrl || data.signature || data.signatureUrl || data.signaturePath || "";
|
||||
};
|
||||
const applySignatureFromServer = (signPath) => {
|
||||
const url = signPath ? utils_upload.toSubmitFileUrl(signPath) : "";
|
||||
if (!url) {
|
||||
showCanvas.value = true;
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
isSignatureEmpty.value = true;
|
||||
return;
|
||||
}
|
||||
signatureServerPath.value = url;
|
||||
signatureUrl.value = url;
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const onSignatureImageError = () => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:321", "签名图片加载失败:", signatureUrl.value);
|
||||
common_vendor.index.showToast({ title: "签名图片加载失败", icon: "none" });
|
||||
};
|
||||
const reSign = () => {
|
||||
isSignatureEmpty.value = true;
|
||||
showCanvas.value = true;
|
||||
@@ -61,6 +81,10 @@ const _sfc_main = {
|
||||
const formData = common_vendor.reactive({
|
||||
rectifyPlan: "",
|
||||
// 整改方案
|
||||
rectificationMeasures: "",
|
||||
// 整改措施
|
||||
controlMeasures: "",
|
||||
// 管控措施
|
||||
rectifyResult: "",
|
||||
// 整改完成情况
|
||||
planCost: "",
|
||||
@@ -68,140 +92,309 @@ const _sfc_main = {
|
||||
actualCost: ""
|
||||
// 投资资金(实际)
|
||||
});
|
||||
const show = common_vendor.ref(false);
|
||||
const value1 = common_vendor.ref(Date.now());
|
||||
common_vendor.ref("");
|
||||
const cateList = common_vendor.ref([]);
|
||||
const selectedDeadlineDate = common_vendor.ref("");
|
||||
const showRectifyTimePicker = common_vendor.ref(false);
|
||||
const rectifyTimeValue = common_vendor.ref(Date.now());
|
||||
const selectedRectifyTime = common_vendor.ref("");
|
||||
const formatDateValue = (timestamp) => {
|
||||
if (!timestamp)
|
||||
return "";
|
||||
const date = new Date(timestamp);
|
||||
if (Number.isNaN(date.getTime()))
|
||||
return "";
|
||||
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}`;
|
||||
};
|
||||
const parseDeadlineToTimestamp = (deadline) => {
|
||||
if (!deadline)
|
||||
return null;
|
||||
const decoded = decodeURIComponent(String(deadline)).trim();
|
||||
const normalized = decoded.replace("T", " ").replace(/-/g, "/");
|
||||
const ts = new Date(normalized).getTime();
|
||||
return Number.isNaN(ts) ? null : ts;
|
||||
};
|
||||
const applyDeadlineFromOptions = (deadline) => {
|
||||
const ts = parseDeadlineToTimestamp(deadline);
|
||||
if (ts) {
|
||||
selectedDeadlineDate.value = formatDateValue(ts);
|
||||
} else if (deadline) {
|
||||
selectedDeadlineDate.value = String(deadline).trim().replace("T", " ");
|
||||
}
|
||||
};
|
||||
const parseIdList = (raw) => {
|
||||
if (raw === null || raw === void 0 || raw === "")
|
||||
return [];
|
||||
if (Array.isArray(raw)) {
|
||||
return raw.map((id) => String(id)).filter(Boolean);
|
||||
}
|
||||
return String(raw).split(",").map((id) => String(id).trim()).filter(Boolean);
|
||||
};
|
||||
const resolveManagerIdsFromDetail = (data) => {
|
||||
const ids = parseIdList(data.manageIds ?? data.managerIds);
|
||||
if (ids.length > 0)
|
||||
return ids;
|
||||
if (Array.isArray(data.managers) && data.managers.length > 0) {
|
||||
return data.managers.map((item) => String(item.userId)).filter(Boolean);
|
||||
}
|
||||
return [];
|
||||
};
|
||||
const buildUserItemFromDetail = (user) => ({
|
||||
id: String(user.userId),
|
||||
name: formatUserDisplayName(user),
|
||||
deptName: user.deptName || ""
|
||||
});
|
||||
const getUsersByIdsFromTree = (ids, tree) => {
|
||||
const userMap = /* @__PURE__ */ new Map();
|
||||
(tree || []).forEach((dept) => {
|
||||
(dept.users || []).forEach((user) => {
|
||||
userMap.set(String(user.userId), buildUserItem(user, dept));
|
||||
});
|
||||
});
|
||||
return ids.map((id) => userMap.get(String(id))).filter(Boolean);
|
||||
};
|
||||
const mergeUsersFromDetailPool = (ids, resolvedUsers) => {
|
||||
const userMap = new Map(resolvedUsers.map((user) => [user.id, user]));
|
||||
ids.forEach((id) => {
|
||||
const key = String(id);
|
||||
if (userMap.has(key))
|
||||
return;
|
||||
const found = detailPersonPool.value.find((user) => String(user.userId) === key);
|
||||
if (found) {
|
||||
userMap.set(key, buildUserItemFromDetail(found));
|
||||
}
|
||||
});
|
||||
return ids.map((id) => userMap.get(String(id))).filter(Boolean);
|
||||
};
|
||||
const applyRectifyTimeValue = (timeStr) => {
|
||||
const ts = parseDeadlineToTimestamp(timeStr);
|
||||
if (ts) {
|
||||
rectifyTimeValue.value = ts;
|
||||
selectedRectifyTime.value = formatDateValue(ts);
|
||||
} else if (timeStr) {
|
||||
selectedRectifyTime.value = String(timeStr).trim().replace("T", " ");
|
||||
}
|
||||
};
|
||||
const initRectifyTimeDefault = () => {
|
||||
rectifyTimeValue.value = Date.now();
|
||||
selectedRectifyTime.value = formatDateValue(rectifyTimeValue.value);
|
||||
};
|
||||
const onRectifyTimeConfirm = (e) => {
|
||||
rectifyTimeValue.value = e.value;
|
||||
selectedRectifyTime.value = formatDateValue(e.value);
|
||||
showRectifyTimePicker.value = false;
|
||||
};
|
||||
const managerDeptList = common_vendor.ref([]);
|
||||
const deptList = common_vendor.ref([]);
|
||||
const detailPersonPool = common_vendor.ref([]);
|
||||
const showManagerPopup = common_vendor.ref(false);
|
||||
const selectedManagerIds = common_vendor.ref([]);
|
||||
const selectedManagers = common_vendor.ref([]);
|
||||
const activeManagerDeptIndex = common_vendor.ref(0);
|
||||
const managerPickerSelectedIds = common_vendor.ref([]);
|
||||
const showUserPopup = common_vendor.ref(false);
|
||||
const selectedUserIds = common_vendor.ref([]);
|
||||
const selectedUsers = common_vendor.ref([]);
|
||||
const selectedUsersText = common_vendor.computed(() => {
|
||||
if (selectedUsers.value.length === 0)
|
||||
return "";
|
||||
if (selectedUsers.value.length <= 2) {
|
||||
return selectedUsers.value.map((u) => u.name).join("、");
|
||||
const activeDeptIndex = common_vendor.ref(0);
|
||||
const userPickerSelectedIds = common_vendor.ref([]);
|
||||
const formatUserDisplayName = (user) => {
|
||||
if (user.postName) {
|
||||
return `${user.nickName}_${user.postName}`;
|
||||
}
|
||||
return `${selectedUsers.value[0].name}等${selectedUsers.value.length}人`;
|
||||
return user.nickName || "";
|
||||
};
|
||||
const buildUserItem = (user, dept) => ({
|
||||
id: String(user.userId),
|
||||
name: formatUserDisplayName(user),
|
||||
deptName: dept.deptName
|
||||
});
|
||||
const onUserChange = (ids) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:211", "选中的ID:", ids);
|
||||
const buildSelectedPersonText = (users) => {
|
||||
if (users.length === 0)
|
||||
return "";
|
||||
if (users.length <= 2) {
|
||||
return users.map((u) => u.name).join("、");
|
||||
}
|
||||
return `${users[0].name}等${users.length}人`;
|
||||
};
|
||||
const selectedManagersText = common_vendor.computed(() => buildSelectedPersonText(selectedManagers.value));
|
||||
const selectedUsersText = common_vendor.computed(() => buildSelectedPersonText(selectedUsers.value));
|
||||
const currentManagerDeptUsers = common_vendor.computed(() => {
|
||||
const dept = managerDeptList.value[activeManagerDeptIndex.value];
|
||||
return (dept == null ? void 0 : dept.users) || [];
|
||||
});
|
||||
const managerPickerSelectedText = common_vendor.computed(() => {
|
||||
const users = getManagerUsersByIds(managerPickerSelectedIds.value);
|
||||
return buildSelectedPersonText(users);
|
||||
});
|
||||
const managerPickerSelectedSet = common_vendor.computed(() => {
|
||||
return new Set(managerPickerSelectedIds.value.map((id) => String(id)));
|
||||
});
|
||||
const currentDeptUsers = common_vendor.computed(() => {
|
||||
const dept = deptList.value[activeDeptIndex.value];
|
||||
return (dept == null ? void 0 : dept.users) || [];
|
||||
});
|
||||
const userPickerSelectedText = common_vendor.computed(() => {
|
||||
const users = getUsersByIds(userPickerSelectedIds.value);
|
||||
return buildSelectedPersonText(users);
|
||||
});
|
||||
const userPickerSelectedSet = common_vendor.computed(() => {
|
||||
return new Set(userPickerSelectedIds.value.map((id) => String(id)));
|
||||
});
|
||||
const getManagerUsersByIds = (ids) => {
|
||||
let users = getUsersByIdsFromTree(ids, managerDeptList.value);
|
||||
if (users.length < ids.length) {
|
||||
const userDeptUsers = getUsersByIdsFromTree(ids, deptList.value);
|
||||
const userMap = new Map(users.map((user) => [user.id, user]));
|
||||
userDeptUsers.forEach((user) => {
|
||||
if (!userMap.has(user.id))
|
||||
userMap.set(user.id, user);
|
||||
});
|
||||
users = ids.map((id) => userMap.get(String(id))).filter(Boolean);
|
||||
}
|
||||
return mergeUsersFromDetailPool(ids, users);
|
||||
};
|
||||
const getUsersByIds = (ids) => {
|
||||
let users = getUsersByIdsFromTree(ids, deptList.value);
|
||||
return mergeUsersFromDetailPool(ids, users);
|
||||
};
|
||||
const syncSelectedManagersFromIds = (ids) => {
|
||||
selectedManagers.value = getManagerUsersByIds(ids);
|
||||
};
|
||||
const syncSelectedUsersFromIds = (ids) => {
|
||||
selectedUsers.value = getUsersByIds(ids);
|
||||
};
|
||||
const getManagerDeptSelectedCount = (dept) => {
|
||||
var _a;
|
||||
if (!((_a = dept.users) == null ? void 0 : _a.length))
|
||||
return 0;
|
||||
const selectedSet = new Set(managerPickerSelectedIds.value.map(String));
|
||||
return dept.users.filter((user) => selectedSet.has(String(user.userId))).length;
|
||||
};
|
||||
const getDeptSelectedCount = (dept) => {
|
||||
var _a;
|
||||
if (!((_a = dept.users) == null ? void 0 : _a.length))
|
||||
return 0;
|
||||
const selectedSet = new Set(userPickerSelectedIds.value.map(String));
|
||||
return dept.users.filter((user) => selectedSet.has(String(user.userId))).length;
|
||||
};
|
||||
function onManagerCheckChange(userId, checked) {
|
||||
const id = String(userId);
|
||||
if (checked) {
|
||||
if (!managerPickerSelectedSet.value.has(id)) {
|
||||
managerPickerSelectedIds.value = [...managerPickerSelectedIds.value, id];
|
||||
}
|
||||
return;
|
||||
}
|
||||
managerPickerSelectedIds.value = managerPickerSelectedIds.value.filter((item) => String(item) !== id);
|
||||
}
|
||||
function onUserCheckChange(userId, checked) {
|
||||
const id = String(userId);
|
||||
if (checked) {
|
||||
if (!userPickerSelectedSet.value.has(id)) {
|
||||
userPickerSelectedIds.value = [...userPickerSelectedIds.value, id];
|
||||
}
|
||||
return;
|
||||
}
|
||||
userPickerSelectedIds.value = userPickerSelectedIds.value.filter((item) => String(item) !== id);
|
||||
}
|
||||
const openManagerPopup = () => {
|
||||
managerPickerSelectedIds.value = [...selectedManagerIds.value];
|
||||
const firstDeptWithUsers = managerDeptList.value.findIndex((dept) => {
|
||||
var _a;
|
||||
return ((_a = dept.users) == null ? void 0 : _a.length) > 0;
|
||||
});
|
||||
activeManagerDeptIndex.value = firstDeptWithUsers >= 0 ? firstDeptWithUsers : 0;
|
||||
showManagerPopup.value = true;
|
||||
};
|
||||
const cancelManagerSelect = () => {
|
||||
showManagerPopup.value = false;
|
||||
};
|
||||
const openUserPopup = () => {
|
||||
userPickerSelectedIds.value = [...selectedUserIds.value];
|
||||
const firstDeptWithUsers = deptList.value.findIndex((dept) => {
|
||||
var _a;
|
||||
return ((_a = dept.users) == null ? void 0 : _a.length) > 0;
|
||||
});
|
||||
activeDeptIndex.value = firstDeptWithUsers >= 0 ? firstDeptWithUsers : 0;
|
||||
showUserPopup.value = true;
|
||||
};
|
||||
const cancelUserSelect = () => {
|
||||
showUserPopup.value = false;
|
||||
};
|
||||
const confirmManagerSelect = () => {
|
||||
selectedManagerIds.value = managerPickerSelectedIds.value.map((id) => String(id));
|
||||
syncSelectedManagersFromIds(selectedManagerIds.value);
|
||||
showManagerPopup.value = false;
|
||||
};
|
||||
const confirmUserSelect = () => {
|
||||
selectedUsers.value = cateList.value.filter((item) => selectedUserIds.value.includes(item.id));
|
||||
selectedUserIds.value = userPickerSelectedIds.value.map((id) => String(id));
|
||||
syncSelectedUsersFromIds(selectedUserIds.value);
|
||||
showUserPopup.value = false;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:219", "选中的整改人员:", selectedUsers.value);
|
||||
};
|
||||
const fetchDeptUsers = async () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:224", "当前hazardId:", hazardId.value);
|
||||
const fetchManagerDeptUsers = async () => {
|
||||
try {
|
||||
const res = await request_api.getDepartmentPersonUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
managerDeptList.value = res.data;
|
||||
if (selectedManagerIds.value.length > 0) {
|
||||
syncSelectedManagersFromIds(selectedManagerIds.value);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:633", "获取安全管理人员列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchRectifyDeptUsers = async () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:639", "当前hazardId:", hazardId.value);
|
||||
try {
|
||||
const res = await request_api.getDeptUsersWithSubordinates({ hazardId: hazardId.value });
|
||||
if (res.code === 0 && res.data) {
|
||||
const userList = [];
|
||||
res.data.forEach((dept) => {
|
||||
if (dept.users && dept.users.length > 0) {
|
||||
dept.users.forEach((user) => {
|
||||
userList.push({
|
||||
id: String(user.userId),
|
||||
name: `${user.nickName}(${dept.deptName})`
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
cateList.value = userList;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:242", "整改人员列表:", cateList.value);
|
||||
deptList.value = res.data;
|
||||
if (selectedUserIds.value.length > 0) {
|
||||
syncSelectedUsersFromIds(selectedUserIds.value);
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:647", "整改责任人部门树:", deptList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:245", "获取部门人员失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:650", "获取整改责任人列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchPersonnelLists = async () => {
|
||||
await Promise.all([fetchManagerDeptUsers(), fetchRectifyDeptUsers()]);
|
||||
if (selectedManagerIds.value.length > 0) {
|
||||
syncSelectedManagersFromIds(selectedManagerIds.value);
|
||||
}
|
||||
};
|
||||
const fileList1 = common_vendor.ref([]);
|
||||
const deletePic = (event) => {
|
||||
fileList1.value.splice(event.index, 1);
|
||||
};
|
||||
const afterRead = async (event) => {
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = fileList1.value.length;
|
||||
lists.map((item) => {
|
||||
fileList1.value.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中"
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
let watermarkedUrl = lists[i].url;
|
||||
try {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
watermarkedUrl = await utils_watermark.addTimestampWatermark({
|
||||
tempFilePath: lists[i].url,
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:281", "加水印失败,将使用原图上传:", e);
|
||||
}
|
||||
const result = await uploadFilePromise(watermarkedUrl);
|
||||
let item = fileList1.value[fileListLen];
|
||||
const serverPath = typeof result === "string" ? result : (result == null ? void 0 : result.url) || (result == null ? void 0 : result.filePath) || (result == null ? void 0 : result.path) || "";
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: request_request.toImageUrl(serverPath),
|
||||
serverPath
|
||||
});
|
||||
fileListLen++;
|
||||
const rectifyUploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList1, {
|
||||
watermark: {
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance: rectifyUploadInstance
|
||||
}
|
||||
};
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:317", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
const executeSubmit = async () => {
|
||||
const attachments = fileList1.value.map((file) => {
|
||||
const path = request_request.toRelativeFilePath(file.serverPath || file.filePath || file.url || "");
|
||||
const fileName = path ? path.split("/").pop() : file.name || "";
|
||||
return {
|
||||
fileName: fileName || "",
|
||||
filePath: path || "",
|
||||
fileType: file.type || "image/png",
|
||||
fileSize: file.size || 0
|
||||
};
|
||||
});
|
||||
const attachments = fileList1.value.filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file));
|
||||
const params = {
|
||||
hazardId: hazardId.value,
|
||||
assignId: assignId.value,
|
||||
rectifyPlan: formData.rectifyPlan,
|
||||
rectificationMeasures: formData.rectificationMeasures,
|
||||
controlMeasures: formData.controlMeasures,
|
||||
rectifyResult: formData.rectifyResult,
|
||||
planCost: Number(formData.planCost) || 0,
|
||||
actualCost: Number(formData.actualCost) || 0,
|
||||
attachments,
|
||||
// 整改人员ID数组
|
||||
rectifyUserIds: selectedUserIds.value.map((id) => Number(id)),
|
||||
manageIds: selectedManagerIds.value.map((id) => Number(id)),
|
||||
memberIds: selectedUserIds.value.map((id) => Number(id)),
|
||||
rectifyTime: selectedRectifyTime.value || formatDateValue(rectifyTimeValue.value),
|
||||
signPath: signatureServerPath.value || ""
|
||||
// 电子签名路径
|
||||
};
|
||||
if (rectifyId.value) {
|
||||
params.rectifyId = rectifyId.value;
|
||||
@@ -226,7 +419,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:377", "提交整改失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:721", "提交整改失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none"
|
||||
@@ -237,17 +430,15 @@ const _sfc_main = {
|
||||
};
|
||||
const onSignatureConfirm = async (tempFilePath) => {
|
||||
try {
|
||||
const res = await uploadFilePromise(tempFilePath);
|
||||
const path = res && typeof res === "object" ? res.url || res.filePath || "" : res || "";
|
||||
signatureServerPath.value = request_request.toRelativeFilePath(path);
|
||||
signatureUrl.value = request_request.toImageUrl(signatureServerPath.value);
|
||||
const { url } = await utils_upload.uploadToCloud(tempFilePath);
|
||||
applySignatureFromServer(url);
|
||||
if (isSubmitting.value) {
|
||||
await executeSubmit();
|
||||
}
|
||||
} catch (err) {
|
||||
isSubmitting.value = false;
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:402", "签名上传失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:743", "签名上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -259,6 +450,20 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.rectificationMeasures) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入整改措施",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.controlMeasures) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入管控措施",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.rectifyResult) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入整改完成情况",
|
||||
@@ -266,9 +471,23 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!selectedRectifyTime.value) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请选择实际整改时间",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (selectedManagers.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请选择安全管理人员",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (selectedUsers.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请选择整改人员",
|
||||
title: "请选择整改责任人",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
@@ -305,47 +524,45 @@ const _sfc_main = {
|
||||
if (res.code === 0 && res.data) {
|
||||
const data = res.data;
|
||||
formData.rectifyPlan = data.rectifyPlan || "";
|
||||
formData.rectificationMeasures = data.rectificationMeasures || "";
|
||||
formData.controlMeasures = data.controlMeasures || "";
|
||||
formData.rectifyResult = data.rectifyResult || "";
|
||||
formData.planCost = data.planCost ? String(data.planCost) : "";
|
||||
formData.actualCost = data.actualCost ? String(data.actualCost) : "";
|
||||
if (data.signPath) {
|
||||
signatureServerPath.value = request_request.toRelativeFilePath(data.signPath);
|
||||
signatureUrl.value = request_request.toImageUrl(signatureServerPath.value);
|
||||
showCanvas.value = false;
|
||||
if (data.deadline) {
|
||||
applyDeadlineFromOptions(data.deadline);
|
||||
}
|
||||
if (data.rectifyTime) {
|
||||
applyRectifyTimeValue(data.rectifyTime);
|
||||
}
|
||||
const signPath = resolveSignPathFromData(data);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:926", "整改详情签名路径:", signPath);
|
||||
applySignatureFromServer(signPath);
|
||||
hazardId.value = data.hazardId || "";
|
||||
assignId.value = data.assignId || "";
|
||||
await fetchDeptUsers();
|
||||
if (data.attachments && data.attachments.length > 0) {
|
||||
fileList1.value = data.attachments.map((att) => {
|
||||
const serverPath = request_request.toRelativeFilePath(att.filePath);
|
||||
return {
|
||||
url: request_request.toImageUrl(serverPath),
|
||||
status: "success",
|
||||
message: "",
|
||||
name: att.fileName,
|
||||
type: att.fileType,
|
||||
serverPath
|
||||
};
|
||||
});
|
||||
detailPersonPool.value = [
|
||||
...Array.isArray(data.managers) ? data.managers : [],
|
||||
...Array.isArray(data.members) ? data.members : []
|
||||
];
|
||||
const managerIdArr = resolveManagerIdsFromDetail(data);
|
||||
const memberIdArr = parseIdList(data.memberIds);
|
||||
if (managerIdArr.length > 0) {
|
||||
selectedManagerIds.value = managerIdArr;
|
||||
}
|
||||
if (data.memberIds) {
|
||||
const memberIdArr = data.memberIds.split(",").map((id) => String(id.trim()));
|
||||
if (memberIdArr.length > 0) {
|
||||
selectedUserIds.value = memberIdArr;
|
||||
setTimeout(() => {
|
||||
selectedUsers.value = cateList.value.filter((item) => memberIdArr.includes(item.id));
|
||||
}, 500);
|
||||
} else if (data.rectifierId) {
|
||||
selectedUserIds.value = [String(data.rectifierId)];
|
||||
setTimeout(() => {
|
||||
selectedUsers.value = cateList.value.filter((item) => item.id === String(data.rectifierId));
|
||||
}, 500);
|
||||
}
|
||||
await fetchPersonnelLists();
|
||||
if (data.attachments && data.attachments.length > 0) {
|
||||
fileList1.value = data.attachments.map((att) => utils_upload.mapServerFileToUploadItem(att));
|
||||
}
|
||||
common_vendor.index.setNavigationBarTitle({ title: "编辑整改信息" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:600", "获取整改详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:960", "获取整改详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -376,7 +593,7 @@ 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:637", "AI生成整改方案失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:997", "AI生成整改方案失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI生成失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiGenerating.value = false;
|
||||
@@ -391,7 +608,7 @@ const _sfc_main = {
|
||||
if (isRestoring.value)
|
||||
return;
|
||||
const key = getDraftKey();
|
||||
const hasContent = formData.rectifyPlan || formData.rectifyResult || formData.planCost || formData.actualCost || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
|
||||
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;
|
||||
@@ -400,6 +617,8 @@ const _sfc_main = {
|
||||
const data = {
|
||||
formData: {
|
||||
rectifyPlan: formData.rectifyPlan,
|
||||
rectificationMeasures: formData.rectificationMeasures,
|
||||
controlMeasures: formData.controlMeasures,
|
||||
rectifyResult: formData.rectifyResult,
|
||||
planCost: formData.planCost,
|
||||
actualCost: formData.actualCost
|
||||
@@ -420,6 +639,8 @@ const _sfc_main = {
|
||||
showRestoreBanner.value = false;
|
||||
isRestoring.value = true;
|
||||
formData.rectifyPlan = "";
|
||||
formData.rectificationMeasures = "";
|
||||
formData.controlMeasures = "";
|
||||
formData.rectifyResult = "";
|
||||
formData.planCost = "";
|
||||
formData.actualCost = "";
|
||||
@@ -444,19 +665,23 @@ const _sfc_main = {
|
||||
if (cached) {
|
||||
try {
|
||||
const data = JSON.parse(cached);
|
||||
const hasContent = data.formData.rectifyPlan || data.formData.rectifyResult || data.formData.planCost || data.formData.actualCost || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
|
||||
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 || [];
|
||||
signatureServerPath.value = data.signatureServerPath || "";
|
||||
signatureUrl.value = data.signatureUrl || "";
|
||||
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
|
||||
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) {
|
||||
@@ -475,7 +700,7 @@ const _sfc_main = {
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:772", "解析草稿失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1145", "解析草稿失败:", e);
|
||||
isRestoring.value = false;
|
||||
}
|
||||
}
|
||||
@@ -483,6 +708,8 @@ const _sfc_main = {
|
||||
common_vendor.watch(
|
||||
() => [
|
||||
formData.rectifyPlan,
|
||||
formData.rectificationMeasures,
|
||||
formData.controlMeasures,
|
||||
formData.rectifyResult,
|
||||
formData.planCost,
|
||||
formData.actualCost,
|
||||
@@ -502,7 +729,7 @@ const _sfc_main = {
|
||||
const sysInfo = common_vendor.index.getSystemInfoSync();
|
||||
signatureWidth.value = sysInfo.windowWidth - 40;
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:803", "获取系统信息失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1178", "获取系统信息失败:", e);
|
||||
}
|
||||
if (options.hazardId) {
|
||||
hazardId.value = options.hazardId;
|
||||
@@ -511,13 +738,17 @@ const _sfc_main = {
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
if (!options.rectifyId)
|
||||
fetchDeptUsers();
|
||||
fetchPersonnelLists();
|
||||
if (options.rectifyId) {
|
||||
rectifyId.value = options.rectifyId;
|
||||
isEdit.value = options.isEdit === "1";
|
||||
fetchRectifyDetail();
|
||||
} else {
|
||||
restoreDraft();
|
||||
initRectifyTimeDefault();
|
||||
}
|
||||
if (options.deadline) {
|
||||
applyDeadlineFromOptions(options.deadline);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
@@ -539,93 +770,184 @@ const _sfc_main = {
|
||||
autoHeight: true,
|
||||
modelValue: formData.rectifyPlan
|
||||
}),
|
||||
j: common_vendor.o(($event) => formData.rectifyResult = $event),
|
||||
j: common_vendor.o(($event) => formData.rectificationMeasures = $event),
|
||||
k: common_vendor.p({
|
||||
placeholder: "请输入整改措施",
|
||||
modelValue: formData.rectificationMeasures
|
||||
}),
|
||||
l: common_vendor.o(($event) => formData.controlMeasures = $event),
|
||||
m: common_vendor.p({
|
||||
placeholder: "请输入管控措施",
|
||||
modelValue: formData.controlMeasures
|
||||
}),
|
||||
n: common_vendor.o(($event) => formData.rectifyResult = $event),
|
||||
o: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.rectifyResult
|
||||
}),
|
||||
l: common_vendor.o(($event) => formData.planCost = $event),
|
||||
m: common_vendor.p({
|
||||
p: common_vendor.o(($event) => formData.planCost = $event),
|
||||
q: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
type: "number",
|
||||
modelValue: formData.planCost
|
||||
}),
|
||||
n: common_vendor.o(($event) => formData.actualCost = $event),
|
||||
o: common_vendor.p({
|
||||
r: common_vendor.o(($event) => formData.actualCost = $event),
|
||||
s: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
type: "number",
|
||||
modelValue: formData.actualCost
|
||||
}),
|
||||
p: common_vendor.o(($event) => value1.value = $event),
|
||||
q: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
t: common_vendor.t(selectedDeadlineDate.value || "暂无"),
|
||||
v: !selectedDeadlineDate.value ? 1 : "",
|
||||
w: common_vendor.t(selectedRectifyTime.value || "请选择实际整改时间"),
|
||||
x: !selectedRectifyTime.value ? 1 : "",
|
||||
y: common_vendor.o(($event) => showRectifyTimePicker.value = true),
|
||||
z: common_vendor.o(onRectifyTimeConfirm),
|
||||
A: common_vendor.o(($event) => showRectifyTimePicker.value = false),
|
||||
B: common_vendor.o(($event) => showRectifyTimePicker.value = false),
|
||||
C: common_vendor.o(($event) => rectifyTimeValue.value = $event),
|
||||
D: common_vendor.p({
|
||||
show: showRectifyTimePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: rectifyTimeValue.value
|
||||
}),
|
||||
r: common_vendor.t(selectedUsers.value.length > 0 ? selectedUsersText.value : "请选择整改人员(可多选)"),
|
||||
s: selectedUsers.value.length === 0 ? 1 : "",
|
||||
t: common_vendor.o(($event) => showUserPopup.value = true),
|
||||
v: common_vendor.o(($event) => showUserPopup.value = false),
|
||||
w: common_vendor.f(cateList.value, (item, k0, i0) => {
|
||||
E: common_vendor.t(selectedManagers.value.length > 0 ? selectedManagersText.value : "请选择安全管理人员(可多选)"),
|
||||
F: selectedManagers.value.length === 0 ? 1 : "",
|
||||
G: common_vendor.o(openManagerPopup),
|
||||
H: common_vendor.t(selectedUsers.value.length > 0 ? selectedUsersText.value : "请选择整改责任人(可多选)"),
|
||||
I: selectedUsers.value.length === 0 ? 1 : "",
|
||||
J: common_vendor.o(openUserPopup),
|
||||
K: common_vendor.o(cancelManagerSelect),
|
||||
L: managerPickerSelectedIds.value.length > 0
|
||||
}, managerPickerSelectedIds.value.length > 0 ? {
|
||||
M: common_vendor.t(managerPickerSelectedIds.value.length),
|
||||
N: common_vendor.t(managerPickerSelectedText.value)
|
||||
} : {}, {
|
||||
O: common_vendor.f(managerDeptList.value, (dept, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(dept.deptName),
|
||||
b: getManagerDeptSelectedCount(dept) > 0
|
||||
}, getManagerDeptSelectedCount(dept) > 0 ? {
|
||||
c: common_vendor.t(getManagerDeptSelectedCount(dept))
|
||||
} : {}, {
|
||||
d: "manager-dept-" + dept.deptId,
|
||||
e: common_vendor.n({
|
||||
active: activeManagerDeptIndex.value === index
|
||||
}),
|
||||
f: common_vendor.o(($event) => activeManagerDeptIndex.value = index, "manager-dept-" + dept.deptId)
|
||||
});
|
||||
}),
|
||||
P: currentManagerDeptUsers.value.length === 0
|
||||
}, currentManagerDeptUsers.value.length === 0 ? {} : {
|
||||
Q: common_vendor.f(currentManagerDeptUsers.value, (user, k0, i0) => {
|
||||
return {
|
||||
a: "f18ba0ce-7-" + i0 + ",f18ba0ce-6",
|
||||
b: common_vendor.p({
|
||||
label: item.name,
|
||||
name: item.id,
|
||||
a: common_vendor.o((checked) => onManagerCheckChange(user.userId, checked), "manager-user-" + user.userId),
|
||||
b: "f18ba0ce-8-" + i0 + ",f18ba0ce-7",
|
||||
c: common_vendor.p({
|
||||
usedAlone: true,
|
||||
checked: managerPickerSelectedSet.value.has(String(user.userId)),
|
||||
label: formatUserDisplayName(user),
|
||||
activeColor: "#2667E9",
|
||||
shape: "square"
|
||||
}),
|
||||
c: item.id
|
||||
d: "manager-user-" + user.userId
|
||||
};
|
||||
})
|
||||
}, {
|
||||
R: "manager-dept-users-" + activeManagerDeptIndex.value,
|
||||
S: common_vendor.o(cancelManagerSelect),
|
||||
T: common_vendor.o(confirmManagerSelect),
|
||||
U: common_vendor.o(cancelManagerSelect),
|
||||
V: common_vendor.p({
|
||||
show: showManagerPopup.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
x: common_vendor.o(onUserChange),
|
||||
y: common_vendor.o(($event) => selectedUserIds.value = $event),
|
||||
z: common_vendor.p({
|
||||
placement: "column",
|
||||
modelValue: selectedUserIds.value
|
||||
W: common_vendor.o(cancelUserSelect),
|
||||
X: userPickerSelectedIds.value.length > 0
|
||||
}, userPickerSelectedIds.value.length > 0 ? {
|
||||
Y: common_vendor.t(userPickerSelectedIds.value.length),
|
||||
Z: common_vendor.t(userPickerSelectedText.value)
|
||||
} : {}, {
|
||||
aa: common_vendor.f(deptList.value, (dept, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(dept.deptName),
|
||||
b: getDeptSelectedCount(dept) > 0
|
||||
}, getDeptSelectedCount(dept) > 0 ? {
|
||||
c: common_vendor.t(getDeptSelectedCount(dept))
|
||||
} : {}, {
|
||||
d: dept.deptId,
|
||||
e: common_vendor.n({
|
||||
active: activeDeptIndex.value === index
|
||||
}),
|
||||
f: common_vendor.o(($event) => activeDeptIndex.value = index, dept.deptId)
|
||||
});
|
||||
}),
|
||||
A: common_vendor.o(($event) => showUserPopup.value = false),
|
||||
B: common_vendor.o(confirmUserSelect),
|
||||
C: common_vendor.o(($event) => showUserPopup.value = false),
|
||||
D: common_vendor.p({
|
||||
ab: currentDeptUsers.value.length === 0
|
||||
}, currentDeptUsers.value.length === 0 ? {} : {
|
||||
ac: common_vendor.f(currentDeptUsers.value, (user, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.o((checked) => onUserCheckChange(user.userId, checked), "user-" + user.userId),
|
||||
b: "f18ba0ce-10-" + i0 + ",f18ba0ce-9",
|
||||
c: common_vendor.p({
|
||||
usedAlone: true,
|
||||
checked: userPickerSelectedSet.value.has(String(user.userId)),
|
||||
label: formatUserDisplayName(user),
|
||||
activeColor: "#2667E9",
|
||||
shape: "square"
|
||||
}),
|
||||
d: "user-" + user.userId
|
||||
};
|
||||
})
|
||||
}, {
|
||||
ad: "dept-users-" + activeDeptIndex.value,
|
||||
ae: common_vendor.o(cancelUserSelect),
|
||||
af: common_vendor.o(confirmUserSelect),
|
||||
ag: common_vendor.o(cancelUserSelect),
|
||||
ah: common_vendor.p({
|
||||
show: showUserPopup.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
E: common_vendor.o(afterRead),
|
||||
F: common_vendor.o(deletePic),
|
||||
G: common_vendor.p({
|
||||
ai: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
aj: common_vendor.o(common_vendor.unref(deletePic)),
|
||||
ak: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
imageMode: "aspectFill",
|
||||
maxCount: 10
|
||||
}),
|
||||
H: canvasWidth.value,
|
||||
I: canvasHeight.value,
|
||||
J: canvasWidth.value + "px",
|
||||
K: canvasHeight.value + "px",
|
||||
L: showCanvas.value
|
||||
}, showCanvas.value ? {
|
||||
M: common_vendor.o(clearSignature)
|
||||
} : {
|
||||
N: common_vendor.o(reSign)
|
||||
}, {
|
||||
O: !showCanvas.value
|
||||
}, !showCanvas.value ? {
|
||||
P: signatureUrl.value
|
||||
al: !showUserPopup.value && !showManagerPopup.value && !showRectifyTimePicker.value
|
||||
}, !showUserPopup.value && !showManagerPopup.value && !showRectifyTimePicker.value ? {
|
||||
am: canvasWidth.value,
|
||||
an: canvasHeight.value,
|
||||
ao: canvasWidth.value + "px",
|
||||
ap: canvasHeight.value + "px"
|
||||
} : {}, {
|
||||
Q: showCanvas.value && !showUserPopup.value
|
||||
}, showCanvas.value && !showUserPopup.value ? {
|
||||
R: common_vendor.sr(signatureRef, "f18ba0ce-9", {
|
||||
aq: showCanvas.value
|
||||
}, showCanvas.value ? {
|
||||
ar: common_vendor.o(clearSignature)
|
||||
} : {
|
||||
as: common_vendor.o(reSign)
|
||||
}, {
|
||||
at: !showCanvas.value
|
||||
}, !showCanvas.value ? common_vendor.e({
|
||||
av: signatureUrl.value
|
||||
}, signatureUrl.value ? {
|
||||
aw: signatureUrl.value,
|
||||
ax: common_vendor.o(onSignatureImageError)
|
||||
} : {}) : {}, {
|
||||
ay: showCanvas.value && !showUserPopup.value && !showManagerPopup.value && !showRectifyTimePicker.value
|
||||
}, showCanvas.value && !showUserPopup.value && !showManagerPopup.value && !showRectifyTimePicker.value ? {
|
||||
az: common_vendor.sr(signatureRef, "f18ba0ce-12", {
|
||||
"k": "signatureRef"
|
||||
}),
|
||||
S: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
|
||||
T: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
U: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
V: common_vendor.o(($event) => isSignatureEmpty.value = true),
|
||||
W: common_vendor.p({
|
||||
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({
|
||||
width: signatureWidth.value,
|
||||
height: 160,
|
||||
backgroundColor: "#f8f8f8",
|
||||
@@ -634,9 +956,9 @@ const _sfc_main = {
|
||||
enableHistory: false
|
||||
})
|
||||
} : {}, {
|
||||
X: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
|
||||
Y: common_vendor.o(handleSubmit),
|
||||
Z: common_vendor.gei(_ctx, "")
|
||||
aF: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
|
||||
aG: common_vendor.o(handleSubmit),
|
||||
aH: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"up-checkbox": "../../uni_modules/uview-plus/components/u-checkbox/u-checkbox",
|
||||
"up-checkbox-group": "../../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
||||
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -78,6 +78,15 @@
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.readonly-field.data-v-f18ba0ce {
|
||||
background: #f5f7fa;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -117,6 +126,86 @@
|
||||
max-height: 600rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.user-popup.cascader-user-popup .selected-summary.data-v-f18ba0ce {
|
||||
padding: 16rpx 30rpx;
|
||||
background: #f5f7fa;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.user-popup.cascader-user-popup .selected-summary .summary-label.data-v-f18ba0ce {
|
||||
color: #909399;
|
||||
}
|
||||
.user-popup.cascader-user-popup .selected-summary .summary-text.data-v-f18ba0ce {
|
||||
color: #333;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-body.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
height: 600rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-col.data-v-f18ba0ce {
|
||||
height: 600rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.user-popup.cascader-user-popup .dept-col.data-v-f18ba0ce {
|
||||
width: 38%;
|
||||
background: #f7f8fa;
|
||||
border-right: 1rpx solid #eee;
|
||||
}
|
||||
.user-popup.cascader-user-popup .user-col.data-v-f18ba0ce {
|
||||
width: 62%;
|
||||
padding: 10rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 28rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #eef0f3;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item.active.data-v-f18ba0ce {
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item.active.data-v-f18ba0ce::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 6rpx;
|
||||
background: #2667E9;
|
||||
}
|
||||
.user-popup.cascader-user-popup .cascader-item-text.data-v-f18ba0ce {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.user-popup.cascader-user-popup .dept-badge.data-v-f18ba0ce {
|
||||
min-width: 32rpx;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
padding: 0 8rpx;
|
||||
margin-left: 8rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.user-popup.cascader-user-popup .empty-tip.data-v-f18ba0ce {
|
||||
padding: 80rpx 20rpx;
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.user-popup .user-item.data-v-f18ba0ce {
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
@@ -25,55 +25,49 @@ const _sfc_main = {
|
||||
description: "",
|
||||
address: "",
|
||||
areaName: "",
|
||||
// 隐患区域名称
|
||||
createdAt: "",
|
||||
areaColor: "",
|
||||
tagName: "",
|
||||
legalBasis: "",
|
||||
regulationName: "",
|
||||
attachments: []
|
||||
});
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const getFullPath = (filePath) => {
|
||||
return request_request.toImageUrl(filePath);
|
||||
};
|
||||
const legalBasisText = common_vendor.computed(() => detailData.legalBasis || detailData.regulationName || "");
|
||||
const getFullPath = (filePath) => request_request.toImageUrl(filePath);
|
||||
const previewHazardImage = (index) => {
|
||||
if (!detailData.attachments || detailData.attachments.length === 0)
|
||||
return;
|
||||
const urls = detailData.attachments.map((item) => getFullPath(item.filePath));
|
||||
common_vendor.index.previewImage({
|
||||
current: index,
|
||||
urls
|
||||
urls: detailData.attachments.map((item) => getFullPath(item.filePath))
|
||||
});
|
||||
};
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId, assignId });
|
||||
const params = { hazardId };
|
||||
if (assignId)
|
||||
params.assignId = assignId;
|
||||
const res = await request_api.getHiddenDangerDetail(params);
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/view.vue:120", "隐患详情数据:", res.data);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/view.vue:121", "隐患附件:", res.data.attachments);
|
||||
if (res.data.assigns && res.data.assigns.length > 0) {
|
||||
const assign = res.data.assigns[0];
|
||||
if (assign.rectify && assign.rectify.attachments) {
|
||||
rectifyAttachments.value = assign.rectify.attachments;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/view.vue:128", "整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:135", "获取隐患详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:138", "获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId && options.assignId) {
|
||||
if (options.hazardId) {
|
||||
fetchDetail(options.hazardId, options.assignId);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: detailData.attachments && detailData.attachments.length > 0
|
||||
a: common_vendor.t(detailData.source || "暂无"),
|
||||
b: detailData.attachments && detailData.attachments.length > 0
|
||||
}, detailData.attachments && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
c: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: getFullPath(img.filePath),
|
||||
@@ -81,28 +75,41 @@ const _sfc_main = {
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.o(($event) => detailData.title = $event),
|
||||
d: common_vendor.p({
|
||||
disabled: "true",
|
||||
d: common_vendor.o(($event) => detailData.title = $event),
|
||||
e: common_vendor.p({
|
||||
disabled: true,
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
placeholder: "暂无",
|
||||
modelValue: detailData.title
|
||||
}),
|
||||
e: common_vendor.n(detailData.level === 1 ? "bg-blue light" : "bg-gray"),
|
||||
f: common_vendor.n(detailData.level === 2 ? "bg-blue light" : "bg-gray"),
|
||||
g: common_vendor.n(detailData.level === 3 ? "bg-blue light" : "bg-gray"),
|
||||
h: detailData.address,
|
||||
i: common_vendor.o(($event) => detailData.address = $event.detail.value),
|
||||
j: common_vendor.t(detailData.areaName || "暂无"),
|
||||
k: common_vendor.o(($event) => detailData.description = $event),
|
||||
l: common_vendor.p({
|
||||
h: common_vendor.o(($event) => detailData.address = $event),
|
||||
i: common_vendor.p({
|
||||
disabled: true,
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
placeholder: "暂无地址",
|
||||
modelValue: detailData.address
|
||||
}),
|
||||
j: common_vendor.t(legalBasisText.value || "暂无"),
|
||||
k: !legalBasisText.value ? 1 : "",
|
||||
l: detailData.areaColor
|
||||
}, detailData.areaColor ? {
|
||||
m: detailData.areaColor
|
||||
} : {}, {
|
||||
n: common_vendor.t(detailData.areaName || "暂无"),
|
||||
o: !detailData.areaName ? 1 : "",
|
||||
p: common_vendor.o(($event) => detailData.description = $event),
|
||||
q: common_vendor.p({
|
||||
placeholder: "暂无描述",
|
||||
disabled: true,
|
||||
autoHeight: true,
|
||||
modelValue: detailData.description
|
||||
}),
|
||||
m: common_vendor.t(detailData.source || "暂无"),
|
||||
n: common_vendor.t(detailData.createdAt || "暂无"),
|
||||
o: common_vendor.gei(_ctx, "")
|
||||
r: common_vendor.t(detailData.tagName || "暂无"),
|
||||
s: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{o}}"><view class="padding bg-white radius data-v-4d631e68"><view class="flex 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="{{a}}" class="margin-top data-v-4d631e68"><view class="flex data-v-4d631e68" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{b}}" 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 data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患标题</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{d}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"/><view class="margin-bottom text-gray text-sm margin-top-xs data-v-4d631e68">请用简洁的语言概括隐患要点</view><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="flex col-3 data-v-4d631e68" style="gap:10rpx"><view class="{{['data-v-4d631e68', e]}}" style="padding:16rpx 40rpx">轻微隐患</view><view class="{{['data-v-4d631e68', f]}}" style="padding:16rpx 40rpx">一般隐患</view><view class="{{['data-v-4d631e68', g]}}" style="padding:16rpx 40rpx">重大隐患</view></view><view class="text-gray text-sm margin-top-xs margin-bottom data-v-4d631e68">请用隐患可能造成的危害程度选择等级</view><view class="flex data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患位置</view><view class="text-red data-v-4d631e68">*</view></view><view class="address-box margin-top-sm margin-bottom-sm data-v-4d631e68"><input class="address-input data-v-4d631e68" placeholder="暂无地址" disabled value="{{h}}" bindinput="{{i}}"/><button class="address-btn bg-blue data-v-4d631e68">选择地址</button></view><view class="text-gray text-sm data-v-4d631e68">如:办公楼3层东侧消防通道,生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view><view class="text-gray margin-top margin-bottom data-v-4d631e68">隐患区域</view><view class="bg-gray padding radius data-v-4d631e68">{{j}}</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="{{l}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-1" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-textarea><view class="text-gray text-sm margin-top-xs margin-bottom data-v-4d631e68">请详细说明隐患现状、潜在风险及影响范围</view><view class="text-gray margin-bottom data-v-4d631e68">隐患来源</view><view class="bg-gray padding radius data-v-4d631e68">{{m}}</view><view class="text-gray margin-top margin-bottom data-v-4d631e68">创建时间</view><view class="bg-gray padding radius data-v-4d631e68">{{n}}</view></view></view>
|
||||
<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>
|
||||
@@ -28,26 +28,38 @@
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.address-box.data-v-4d631e68 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-input.data-v-4d631e68 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 12rpx;
|
||||
padding: 0 24rpx;
|
||||
.read-only-box.data-v-4d631e68 {
|
||||
background: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.address-btn.data-v-4d631e68 {
|
||||
flex-shrink: 0;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 32rpx;
|
||||
border-radius: 12rpx;
|
||||
.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: #fff;
|
||||
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;
|
||||
}
|
||||
@@ -217,9 +217,11 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
const goRectification = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
let url = `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`;
|
||||
if (item.deadline) {
|
||||
url += `&deadline=${encodeURIComponent(item.deadline)}`;
|
||||
}
|
||||
common_vendor.index.navigateTo({ url });
|
||||
};
|
||||
const goAcceptance = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
const request_three_one_api_info = require("../../request/three_one_api/info.js");
|
||||
const defaultAvatar = "https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg";
|
||||
const _sfc_main = {
|
||||
@@ -10,7 +11,7 @@ const _sfc_main = {
|
||||
const avatarPreview = common_vendor.ref("");
|
||||
const userInfo = common_vendor.reactive({
|
||||
avatar: "",
|
||||
// 保存相对路径,用于提交
|
||||
// 七牛完整 URL,用于提交
|
||||
nickName: "",
|
||||
phonenumber: "",
|
||||
email: "",
|
||||
@@ -39,7 +40,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/personalcenter/edit.vue:111", "获取个人信息失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/personalcenter/edit.vue:112", "获取个人信息失败:", err);
|
||||
}
|
||||
};
|
||||
const chooseAvatar = () => {
|
||||
@@ -54,37 +55,19 @@ const _sfc_main = {
|
||||
}
|
||||
});
|
||||
};
|
||||
const uploadAvatar = (filePath) => {
|
||||
common_vendor.index.showLoading({ title: "上传中..." });
|
||||
common_vendor.index.uploadFile({
|
||||
url: request_request.baseUrl + "/frontend/attachment/upload",
|
||||
filePath,
|
||||
name: "file",
|
||||
header: {
|
||||
"Authorization": request_request.getToken()
|
||||
},
|
||||
success: (uploadRes) => {
|
||||
common_vendor.index.hideLoading();
|
||||
try {
|
||||
const data = JSON.parse(uploadRes.data);
|
||||
if (data.code === 0 && data.data) {
|
||||
userInfo.avatar = data.data.url || data.data;
|
||||
common_vendor.index.showToast({ title: "上传成功", icon: "success" });
|
||||
} else {
|
||||
avatarPreview.value = "";
|
||||
common_vendor.index.showToast({ title: data.msg || "上传失败", icon: "none" });
|
||||
}
|
||||
} catch (e) {
|
||||
avatarPreview.value = "";
|
||||
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.hideLoading();
|
||||
avatarPreview.value = "";
|
||||
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
||||
}
|
||||
});
|
||||
const uploadAvatar = async (filePath) => {
|
||||
try {
|
||||
const { url } = await utils_upload.uploadSingleWithLoading(filePath);
|
||||
userInfo.avatar = url;
|
||||
avatarPreview.value = url;
|
||||
common_vendor.index.showToast({ title: "上传成功", icon: "success" });
|
||||
} catch (e) {
|
||||
avatarPreview.value = "";
|
||||
common_vendor.index.showToast({
|
||||
title: (e == null ? void 0 : e.msg) || (e == null ? void 0 : e.message) || "上传失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const handleSave = async () => {
|
||||
if (!userInfo.nickName) {
|
||||
@@ -99,7 +82,6 @@ const _sfc_main = {
|
||||
email: userInfo.email,
|
||||
sex: userInfo.sex,
|
||||
avatar: userInfo.avatar
|
||||
// 提交相对路径
|
||||
};
|
||||
const res = await request_three_one_api_info.updateProfile(params);
|
||||
if (res.code === 0) {
|
||||
@@ -111,7 +93,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: res.msg || "保存失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/personalcenter/edit.vue:195", "保存失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/personalcenter/edit.vue:176", "保存失败:", err);
|
||||
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
|
||||
} finally {
|
||||
saving.value = false;
|
||||
|
||||
16
unpackage/dist/dev/mp-weixin/request/api.js
vendored
16
unpackage/dist/dev/mp-weixin/request/api.js
vendored
@@ -40,6 +40,14 @@ function assignHiddenDanger(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
function getQiniuUploadToken(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/attachment/qiniu/token",
|
||||
method: "GET",
|
||||
data: params,
|
||||
loadingText: false
|
||||
});
|
||||
}
|
||||
function getMyHiddenDangerList(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/hazard/my/list",
|
||||
@@ -141,6 +149,12 @@ function getMyWriteOffList(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
function getWriteOffApplyDetail(applyId) {
|
||||
return request_request.requestAPI({
|
||||
url: `/admin/hazard/writeoff/getWriteOffApplyDetail/${applyId}`,
|
||||
method: "GET"
|
||||
});
|
||||
}
|
||||
function acceptanceRectification(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/hazard/verify",
|
||||
@@ -321,8 +335,10 @@ exports.getMemberList = getMemberList;
|
||||
exports.getMyHiddenDangerList = getMyHiddenDangerList;
|
||||
exports.getMyWriteOffList = getMyWriteOffList;
|
||||
exports.getParentDepts = getParentDepts;
|
||||
exports.getQiniuUploadToken = getQiniuUploadToken;
|
||||
exports.getRectifyDetail = getRectifyDetail;
|
||||
exports.getRegulationList = getRegulationList;
|
||||
exports.getWriteOffApplyDetail = getWriteOffApplyDetail;
|
||||
exports.getindustry = getindustry;
|
||||
exports.lockOrUnlockMember = lockOrUnlockMember;
|
||||
exports.login = login;
|
||||
|
||||
23
unpackage/dist/dev/mp-weixin/request/request.js
vendored
23
unpackage/dist/dev/mp-weixin/request/request.js
vendored
@@ -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:85", "HTTP错误:", res.statusCode);
|
||||
common_vendor.index.__f__("error", "at request/request.js:86", "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:110", "接口错误:", res.data);
|
||||
common_vendor.index.__f__("error", "at request/request.js:111", "接口错误:", 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:121", "网络请求失败:", err);
|
||||
common_vendor.index.__f__("error", "at request/request.js:122", "网络请求失败:", err);
|
||||
common_vendor.index.hideLoading();
|
||||
if (err.errMsg && err.errMsg.includes("request:fail")) {
|
||||
showToast("网络连接失败,请检查网络设置");
|
||||
@@ -112,23 +112,6 @@ const toImageUrl = (filePath) => {
|
||||
const normalized = p.startsWith("/") ? p : `/${p}`;
|
||||
return imageBaseUrl + normalized;
|
||||
};
|
||||
const toRelativeFilePath = (filePath) => {
|
||||
if (!filePath)
|
||||
return "";
|
||||
let p = String(filePath);
|
||||
if (p.startsWith("http://") || p.startsWith("https://")) {
|
||||
p = p.replace(/^https?:\/\/[^/]+/, "");
|
||||
}
|
||||
p = p.replace(/^\/prod-api(?=\/|$)/, "");
|
||||
if (!p.startsWith("/")) {
|
||||
p = `/${p}`;
|
||||
}
|
||||
return p;
|
||||
};
|
||||
exports.baseUrl = baseUrl;
|
||||
exports.getToken = getToken;
|
||||
exports.imageBaseUrl = imageBaseUrl;
|
||||
exports.requestAPI = requestAPI;
|
||||
exports.toImageUrl = toImageUrl;
|
||||
exports.toRelativeFilePath = toRelativeFilePath;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/request/request.js.map
|
||||
|
||||
@@ -1,84 +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: {
|
||||
// 标识符
|
||||
name: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.name
|
||||
},
|
||||
// 绑定的值
|
||||
modelValue: {
|
||||
type: Array,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.value
|
||||
},
|
||||
// 形状,circle-圆形,square-方形
|
||||
shape: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.shape
|
||||
},
|
||||
// 是否禁用全部checkbox
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.disabled
|
||||
},
|
||||
// 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
|
||||
activeColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.activeColor
|
||||
},
|
||||
// 未选中的颜色
|
||||
inactiveColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.inactiveColor
|
||||
},
|
||||
// 整个组件的尺寸,默认px
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.size
|
||||
},
|
||||
// 布局方式,row-横向,column-纵向
|
||||
placement: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.placement
|
||||
},
|
||||
// label的字体大小,px单位
|
||||
labelSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.labelSize
|
||||
},
|
||||
// label的字体颜色
|
||||
labelColor: {
|
||||
type: [String],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.labelColor
|
||||
},
|
||||
// 是否禁止点击文本操作
|
||||
labelDisabled: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.labelDisabled
|
||||
},
|
||||
// 图标颜色
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.iconColor
|
||||
},
|
||||
// 图标的大小,单位px
|
||||
iconSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.iconSize
|
||||
},
|
||||
// 勾选图标的对齐方式,left-左边,right-右边
|
||||
iconPlacement: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.iconPlacement
|
||||
},
|
||||
// 竖向配列时,是否显示下划线
|
||||
borderBottom: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.checkboxGroup.borderBottom
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-checkbox-group/props.js.map
|
||||
@@ -1,73 +0,0 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uCheckboxGroup_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 common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-checkbox-group",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uCheckboxGroup_props.props],
|
||||
computed: {
|
||||
// 这里computed的变量,都是子组件u-checkbox需要用到的,由于头条小程序的兼容性差异,子组件无法实时监听父组件参数的变化
|
||||
// 所以需要手动通知子组件,这里返回一个parentData变量,供watch监听,在其中去通知每一个子组件重新从父组件(u-checkbox-group)
|
||||
// 拉取父组件新的变化后的参数
|
||||
parentData() {
|
||||
return [
|
||||
this.modelValue,
|
||||
this.disabled,
|
||||
this.inactiveColor,
|
||||
this.activeColor,
|
||||
this.size,
|
||||
this.labelDisabled,
|
||||
this.shape,
|
||||
this.iconSize,
|
||||
this.borderBottom,
|
||||
this.placement
|
||||
];
|
||||
},
|
||||
bemClass() {
|
||||
return this.bem("checkbox-group", ["placement"]);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
|
||||
parentData: {
|
||||
handler() {
|
||||
if (this.children.length) {
|
||||
this.children.map((child) => {
|
||||
typeof child.init === "function" && child.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.children = [];
|
||||
},
|
||||
emits: ["update:modelValue", "change"],
|
||||
methods: {
|
||||
// 将其他的checkbox设置为未选中的状态
|
||||
unCheckedOther(childInstance) {
|
||||
const values = [];
|
||||
this.children.map((child) => {
|
||||
if (child.isChecked) {
|
||||
values.push(child.name);
|
||||
}
|
||||
});
|
||||
this.$emit("update:modelValue", values);
|
||||
this.$emit("change", values);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.n($options.bemClass),
|
||||
b: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ff0492f0"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js.map
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{['u-checkbox-group', 'data-v-ff0492f0', a, virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{b}}"><slot></slot></view>
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-checkbox-group--row.data-v-ff0492f0 {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.u-checkbox-group--column.data-v-ff0492f0 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
234
unpackage/dist/dev/mp-weixin/utils/upload.js
vendored
Normal file
234
unpackage/dist/dev/mp-weixin/utils/upload.js
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
const request_request = require("../request/request.js");
|
||||
const request_api = require("../request/api.js");
|
||||
const utils_watermark = require("./watermark.js");
|
||||
const DEFAULT_QINIU_UPLOAD_URL = "https://upload.qiniup.com";
|
||||
function getFileSuffix(filePath) {
|
||||
var _a;
|
||||
if (!filePath)
|
||||
return "";
|
||||
const clean = String(filePath).split("?")[0];
|
||||
const ext = ((_a = clean.split(".").pop()) == null ? void 0 : _a.toLowerCase()) || "";
|
||||
if (!ext || ext.length > 8 || clean.endsWith(ext) === false) {
|
||||
return "jpg";
|
||||
}
|
||||
return ext;
|
||||
}
|
||||
function getFileMd5(filePath) {
|
||||
return new Promise((resolve) => {
|
||||
common_vendor.index.getFileInfo({
|
||||
filePath,
|
||||
digestAlgorithm: "md5",
|
||||
success: (res) => resolve((res.digest || "").toLowerCase()),
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("warn", "at utils/upload.js:32", "getFileMd5 fail, use empty:", err);
|
||||
resolve("");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
async function fetchQiniuUploadCredential(filePath) {
|
||||
const suffix = getFileSuffix(filePath);
|
||||
const fileMd5 = await getFileMd5(filePath);
|
||||
const res = await request_api.getQiniuUploadToken({ fileMd5, suffix });
|
||||
return normalizeQiniuCredential(res.data);
|
||||
}
|
||||
function normalizeQiniuCredential(raw) {
|
||||
if (!raw) {
|
||||
throw new Error("七牛凭证为空");
|
||||
}
|
||||
const token = raw.token || raw.uploadToken || raw.uptoken;
|
||||
const key = raw.key || raw.fileKey || raw.objectKey;
|
||||
const uploadUrl = (raw.uploadUrl || raw.uploadHost || raw.host || DEFAULT_QINIU_UPLOAD_URL).replace(/\/$/, "");
|
||||
const presetUrl = String(raw.url || raw.fileUrl || raw.fullUrl || "").trim();
|
||||
let cdnOrigin = (raw.domain || raw.cdnDomain || "").replace(/\/$/, "");
|
||||
if (!cdnOrigin && presetUrl) {
|
||||
const m = presetUrl.match(/^(https?:\/\/[^/]+)/i);
|
||||
if (m)
|
||||
cdnOrigin = m[1];
|
||||
}
|
||||
if (cdnOrigin && !cdnOrigin.startsWith("http")) {
|
||||
cdnOrigin = `https://${cdnOrigin}`;
|
||||
}
|
||||
if (!token || !key) {
|
||||
throw new Error("七牛凭证缺少 token 或 key");
|
||||
}
|
||||
return { token, key, uploadUrl, cdnOrigin, presetUrl };
|
||||
}
|
||||
function resolveUploadedFileUrl(credential, uploadResData) {
|
||||
if (credential.presetUrl) {
|
||||
return credential.presetUrl;
|
||||
}
|
||||
let objectKey = credential.key;
|
||||
if (uploadResData) {
|
||||
try {
|
||||
const body = typeof uploadResData === "string" ? JSON.parse(uploadResData) : uploadResData;
|
||||
if (body == null ? void 0 : body.key) {
|
||||
objectKey = body.key;
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
if (credential.cdnOrigin && objectKey) {
|
||||
return `${credential.cdnOrigin}/${String(objectKey).replace(/^\//, "")}`;
|
||||
}
|
||||
return buildQiniuFileUrl(credential.cdnOrigin, objectKey);
|
||||
}
|
||||
function buildQiniuFileUrl(domain, key) {
|
||||
if (!domain || !key)
|
||||
return "";
|
||||
const k = String(key).replace(/^\//, "");
|
||||
const d = String(domain).replace(/\/$/, "");
|
||||
if (d.startsWith("http://") || d.startsWith("https://")) {
|
||||
return `${d}/${k}`;
|
||||
}
|
||||
return `https://${d}/${k}`;
|
||||
}
|
||||
async function uploadToCloud(filePath, options = {}) {
|
||||
let localPath = filePath;
|
||||
if (options.beforeUpload) {
|
||||
localPath = await options.beforeUpload(filePath);
|
||||
}
|
||||
const credential = await fetchQiniuUploadCredential(localPath);
|
||||
const { token, key, uploadUrl } = credential;
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: uploadUrl,
|
||||
filePath: localPath,
|
||||
name: "file",
|
||||
formData: {
|
||||
token,
|
||||
key
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.statusCode && res.statusCode >= 400) {
|
||||
reject(new Error(`七牛上传失败(${res.statusCode})`));
|
||||
return;
|
||||
}
|
||||
const fullUrl = resolveUploadedFileUrl(credential, res.data);
|
||||
if (!fullUrl) {
|
||||
reject(new Error("无法解析上传后的文件地址,请检查后端 url 或 CDN 配置"));
|
||||
return;
|
||||
}
|
||||
let respKey = key;
|
||||
try {
|
||||
const body = typeof res.data === "string" ? JSON.parse(res.data) : res.data;
|
||||
if (body == null ? void 0 : body.key)
|
||||
respKey = body.key;
|
||||
} catch (e) {
|
||||
}
|
||||
resolve({
|
||||
url: fullUrl,
|
||||
key: respKey,
|
||||
filePath: fullUrl,
|
||||
serverPath: fullUrl
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at utils/upload.js:167", "七牛上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function toSubmitFileUrl(filePath) {
|
||||
if (!filePath)
|
||||
return "";
|
||||
const p = String(filePath);
|
||||
if (p.startsWith("http://") || p.startsWith("https://")) {
|
||||
return p;
|
||||
}
|
||||
return request_request.toImageUrl(p);
|
||||
}
|
||||
function mapServerFileToUploadItem(att) {
|
||||
const filePath = toSubmitFileUrl(att.filePath || att.url || "");
|
||||
return {
|
||||
url: filePath,
|
||||
serverPath: filePath,
|
||||
status: "success",
|
||||
message: "",
|
||||
name: att.fileName || att.name || "",
|
||||
type: att.fileType || "image/jpeg",
|
||||
size: att.fileSize || 0
|
||||
};
|
||||
}
|
||||
function buildAttachmentItem(file, defaults = {}) {
|
||||
var _a;
|
||||
const filePath = toSubmitFileUrl(
|
||||
file.serverPath || file.filePath || file.url || ""
|
||||
);
|
||||
const fileName = file.name || (filePath ? (_a = filePath.split("/").pop()) == null ? void 0 : _a.split("?")[0] : "") || "";
|
||||
return {
|
||||
fileName: fileName || defaults.fileName || "",
|
||||
filePath,
|
||||
fileType: file.type || defaults.fileType || "image/jpeg",
|
||||
fileSize: file.size || defaults.fileSize || 0
|
||||
};
|
||||
}
|
||||
function createUploadListHandlers(fileListRef, options = {}) {
|
||||
const deletePic = (event) => {
|
||||
fileListRef.value.splice(event.index, 1);
|
||||
};
|
||||
const afterRead = async (event) => {
|
||||
const lists = [].concat(event.file);
|
||||
let fileListLen = fileListRef.value.length;
|
||||
lists.forEach((item) => {
|
||||
fileListRef.value.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中"
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const listIndex = fileListLen;
|
||||
try {
|
||||
const beforeUpload = options.watermark ? (tempFilePath) => utils_watermark.addTimestampWatermark({
|
||||
tempFilePath,
|
||||
...options.watermark
|
||||
}) : void 0;
|
||||
const result = await uploadToCloud(lists[i].url, { beforeUpload });
|
||||
const item = fileListRef.value[listIndex];
|
||||
fileListRef.value.splice(listIndex, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result.url,
|
||||
serverPath: result.url
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at utils/upload.js:263", "上传失败:", e);
|
||||
const item = fileListRef.value[listIndex];
|
||||
fileListRef.value.splice(listIndex, 1, {
|
||||
...item,
|
||||
status: "failed",
|
||||
message: (e == null ? void 0 : e.msg) || (e == null ? void 0 : e.message) || "上传失败"
|
||||
});
|
||||
common_vendor.index.showToast({
|
||||
title: (e == null ? void 0 : e.msg) || (e == null ? void 0 : e.message) || "上传失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
return { afterRead, deletePic };
|
||||
}
|
||||
function uploadSingleWithLoading(filePath, options = {}) {
|
||||
const loadingTitle = options.loadingTitle || "上传中...";
|
||||
common_vendor.index.showLoading({ title: loadingTitle, mask: true });
|
||||
return uploadToCloud(filePath, options).then((result) => {
|
||||
common_vendor.index.hideLoading();
|
||||
return result;
|
||||
}).catch((err) => {
|
||||
common_vendor.index.hideLoading();
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
exports.buildAttachmentItem = buildAttachmentItem;
|
||||
exports.createUploadListHandlers = createUploadListHandlers;
|
||||
exports.mapServerFileToUploadItem = mapServerFileToUploadItem;
|
||||
exports.toSubmitFileUrl = toSubmitFileUrl;
|
||||
exports.uploadSingleWithLoading = uploadSingleWithLoading;
|
||||
exports.uploadToCloud = uploadToCloud;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/upload.js.map
|
||||
Reference in New Issue
Block a user