优化后,再次提交
This commit is contained in:
385
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.js
vendored
Normal file
385
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.js
vendored
Normal file
@@ -0,0 +1,385 @@
|
||||
"use strict";
|
||||
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");
|
||||
if (!Array) {
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_u_datetime_picker2 = common_vendor.resolveComponent("u-datetime-picker");
|
||||
const _easycom_u_modal2 = common_vendor.resolveComponent("u-modal");
|
||||
(_easycom_u_popup2 + _easycom_u_datetime_picker2 + _easycom_u_modal2)();
|
||||
}
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
const _easycom_u_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
const _easycom_u_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_popup + _easycom_u_datetime_picker + _easycom_u_modal)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Idphotomanagement",
|
||||
setup(__props) {
|
||||
const licenseList = common_vendor.ref([]);
|
||||
const deptList = common_vendor.ref([]);
|
||||
const selectedDept = common_vendor.ref(null);
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const showDeptPopup = common_vendor.ref(false);
|
||||
const showDeleteModal = common_vendor.ref(false);
|
||||
const isEdit = common_vendor.ref(false);
|
||||
const currentEditId = common_vendor.ref(null);
|
||||
const currentDeleteItem = common_vendor.ref(null);
|
||||
const submitting = common_vendor.ref(false);
|
||||
const datePickerType = common_vendor.ref("start");
|
||||
const datePickerValue = common_vendor.ref(Date.now());
|
||||
const formData = common_vendor.reactive({
|
||||
enterpriseId: "",
|
||||
enterpriseName: "",
|
||||
type: "",
|
||||
code: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
legalPerson: "",
|
||||
photo: "",
|
||||
photoPreview: ""
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
loadLicenseList();
|
||||
loadDeptList();
|
||||
});
|
||||
const getImageUrl = (path) => {
|
||||
if (!path)
|
||||
return "";
|
||||
return request_request.toImageUrl(path);
|
||||
};
|
||||
const previewImage = (path) => {
|
||||
common_vendor.index.previewImage({
|
||||
urls: [getImageUrl(path)]
|
||||
});
|
||||
};
|
||||
const loadLicenseList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_license.getLicenseList();
|
||||
if (res.code === 0) {
|
||||
licenseList.value = res.data.records || [];
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:249", "获取证照列表失败:", err);
|
||||
}
|
||||
};
|
||||
const loadDeptList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_license.getLicenseEnterpriseSelect();
|
||||
if (res.code === 0) {
|
||||
deptList.value = res.data || [];
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:261", "获取部门列表失败:", err);
|
||||
}
|
||||
};
|
||||
const openAddPopup = () => {
|
||||
resetForm();
|
||||
isEdit.value = false;
|
||||
currentEditId.value = null;
|
||||
showAddPopup.value = true;
|
||||
};
|
||||
const handleEdit = async (item) => {
|
||||
try {
|
||||
const res = await request_three_one_api_license.getLicenseDetail({ id: item.id });
|
||||
if (res.code === 0) {
|
||||
const detail = res.data;
|
||||
isEdit.value = true;
|
||||
currentEditId.value = item.id;
|
||||
formData.enterpriseId = detail.enterpriseId || "";
|
||||
formData.type = detail.type || "";
|
||||
formData.code = detail.code || "";
|
||||
formData.startDate = detail.startDate || "";
|
||||
formData.endDate = detail.endDate || "";
|
||||
formData.legalPerson = detail.legalPerson || "";
|
||||
formData.photo = detail.photo || "";
|
||||
formData.photoPreview = detail.photo ? getImageUrl(detail.photo) : "";
|
||||
const dept = deptList.value.find((d) => d.id === detail.enterpriseId);
|
||||
formData.enterpriseName = dept ? dept.name : "";
|
||||
selectedDept.value = dept || null;
|
||||
showAddPopup.value = true;
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:301", "获取证照详情失败:", err);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const handleDelete = (item) => {
|
||||
currentDeleteItem.value = item;
|
||||
showDeleteModal.value = true;
|
||||
};
|
||||
const confirmDelete = async () => {
|
||||
if (!currentDeleteItem.value)
|
||||
return;
|
||||
try {
|
||||
const res = await request_three_one_api_license.deleteLicense({ id: currentDeleteItem.value.id });
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "删除成功", icon: "success" });
|
||||
loadLicenseList();
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:323", "删除失败:", err);
|
||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
||||
} finally {
|
||||
showDeleteModal.value = false;
|
||||
currentDeleteItem.value = null;
|
||||
}
|
||||
};
|
||||
const closePopup = () => {
|
||||
showAddPopup.value = false;
|
||||
resetForm();
|
||||
};
|
||||
const resetForm = () => {
|
||||
formData.enterpriseId = "";
|
||||
formData.enterpriseName = "";
|
||||
formData.type = "";
|
||||
formData.code = "";
|
||||
formData.startDate = "";
|
||||
formData.endDate = "";
|
||||
formData.legalPerson = "";
|
||||
formData.photo = "";
|
||||
formData.photoPreview = "";
|
||||
selectedDept.value = null;
|
||||
isEdit.value = false;
|
||||
currentEditId.value = null;
|
||||
};
|
||||
const confirmDept = () => {
|
||||
if (selectedDept.value) {
|
||||
formData.enterpriseId = selectedDept.value.id;
|
||||
formData.enterpriseName = selectedDept.value.name;
|
||||
}
|
||||
showDeptPopup.value = false;
|
||||
};
|
||||
const openDatePicker = (type) => {
|
||||
datePickerType.value = type;
|
||||
let currentDate = "";
|
||||
if (type === "start" && formData.startDate) {
|
||||
currentDate = formData.startDate;
|
||||
} else if (type === "end" && formData.endDate) {
|
||||
currentDate = formData.endDate;
|
||||
}
|
||||
if (currentDate) {
|
||||
datePickerValue.value = new Date(currentDate).getTime();
|
||||
} else {
|
||||
datePickerValue.value = Date.now();
|
||||
}
|
||||
showDatePicker.value = true;
|
||||
};
|
||||
const onDateCancel = () => {
|
||||
showDatePicker.value = false;
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
const timestamp = datePickerValue.value;
|
||||
if (!timestamp || isNaN(timestamp)) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:396", "无效的日期值:", 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);
|
||||
showDatePicker.value = false;
|
||||
return;
|
||||
}
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const dateStr = `${year}-${month}-${day}`;
|
||||
if (datePickerType.value === "start") {
|
||||
formData.startDate = dateStr;
|
||||
} else {
|
||||
formData.endDate = dateStr;
|
||||
}
|
||||
showDatePicker.value = false;
|
||||
};
|
||||
const chooseImage = () => {
|
||||
common_vendor.index.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
sourceType: ["album", "camera"],
|
||||
success: (res) => {
|
||||
const tempFilePath = res.tempFilePaths[0];
|
||||
formData.photoPreview = tempFilePath;
|
||||
uploadImage(tempFilePath);
|
||||
}
|
||||
});
|
||||
};
|
||||
const uploadImage = (filePath) => {
|
||||
common_vendor.index.showLoading({ title: "上传中..." });
|
||||
common_vendor.index.uploadFile({
|
||||
url: 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 removeImage = () => {
|
||||
formData.photo = "";
|
||||
formData.photoPreview = "";
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.enterpriseId) {
|
||||
common_vendor.index.showToast({ title: "请选择部门", icon: "none" });
|
||||
return;
|
||||
}
|
||||
submitting.value = true;
|
||||
try {
|
||||
const submitData = {
|
||||
enterpriseId: formData.enterpriseId,
|
||||
type: formData.type,
|
||||
code: formData.code,
|
||||
startDate: formData.startDate,
|
||||
endDate: formData.endDate,
|
||||
legalPerson: formData.legalPerson,
|
||||
photo: formData.photo
|
||||
};
|
||||
let res;
|
||||
if (isEdit.value) {
|
||||
submitData.id = currentEditId.value;
|
||||
res = await request_three_one_api_license.updateLicense(submitData);
|
||||
} else {
|
||||
res = await request_three_one_api_license.addLicense(submitData);
|
||||
}
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: isEdit.value ? "修改成功" : "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
closePopup();
|
||||
loadLicenseList();
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/Idphotomanagement/Idphotomanagement.vue:521", "提交失败:", err);
|
||||
common_vendor.index.showToast({ title: "操作失败", icon: "none" });
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: licenseList.value.length > 0
|
||||
}, licenseList.value.length > 0 ? {
|
||||
b: common_vendor.f(licenseList.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.type || "未知类型"),
|
||||
b: common_vendor.o(($event) => handleEdit(item), item.id),
|
||||
c: common_vendor.o(($event) => handleDelete(item), item.id),
|
||||
d: common_vendor.t(item.code || "-"),
|
||||
e: common_vendor.t(item.startDate || "-"),
|
||||
f: common_vendor.t(item.endDate || "-"),
|
||||
g: common_vendor.t(item.legalPerson || "-"),
|
||||
h: item.photo
|
||||
}, item.photo ? {
|
||||
i: getImageUrl(item.photo),
|
||||
j: common_vendor.o(($event) => previewImage(item.photo), item.id)
|
||||
} : {}, {
|
||||
k: item.id
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.o(openAddPopup),
|
||||
d: common_vendor.t(isEdit.value ? "编辑证照" : "新增证照"),
|
||||
e: common_vendor.o(closePopup),
|
||||
f: common_vendor.t(formData.enterpriseName || "请选择部门"),
|
||||
g: common_vendor.n(formData.enterpriseName ? "" : "text-gray"),
|
||||
h: common_vendor.o(($event) => showDeptPopup.value = true),
|
||||
i: formData.type,
|
||||
j: common_vendor.o(($event) => formData.type = $event.detail.value),
|
||||
k: formData.code,
|
||||
l: common_vendor.o(($event) => formData.code = $event.detail.value),
|
||||
m: common_vendor.t(formData.startDate || "请选择开始日期"),
|
||||
n: common_vendor.n(formData.startDate ? "" : "text-gray"),
|
||||
o: common_vendor.o(($event) => openDatePicker("start")),
|
||||
p: common_vendor.t(formData.endDate || "请选择结束日期"),
|
||||
q: common_vendor.n(formData.endDate ? "" : "text-gray"),
|
||||
r: common_vendor.o(($event) => openDatePicker("end")),
|
||||
s: formData.legalPerson,
|
||||
t: common_vendor.o(($event) => formData.legalPerson = $event.detail.value),
|
||||
v: !formData.photoPreview
|
||||
}, !formData.photoPreview ? {} : {
|
||||
w: formData.photoPreview,
|
||||
x: common_vendor.o(removeImage)
|
||||
}, {
|
||||
y: common_vendor.o(chooseImage),
|
||||
z: common_vendor.o(closePopup),
|
||||
A: common_vendor.o(handleSubmit),
|
||||
B: submitting.value,
|
||||
C: common_vendor.o(closePopup),
|
||||
D: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
E: common_vendor.o(onDateConfirm),
|
||||
F: common_vendor.o(onDateCancel),
|
||||
G: common_vendor.o(onDateCancel),
|
||||
H: common_vendor.o(($event) => datePickerValue.value = $event),
|
||||
I: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "date",
|
||||
modelValue: datePickerValue.value
|
||||
}),
|
||||
J: common_vendor.o(($event) => showDeptPopup.value = false),
|
||||
K: deptList.value.length > 0
|
||||
}, deptList.value.length > 0 ? {
|
||||
L: common_vendor.f(deptList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: selectedDept.value && selectedDept.value.id === item.id
|
||||
}, selectedDept.value && selectedDept.value.id === item.id ? {} : {}, {
|
||||
b: selectedDept.value && selectedDept.value.id === item.id ? 1 : "",
|
||||
c: common_vendor.t(item.name),
|
||||
d: item.id,
|
||||
e: common_vendor.o(($event) => selectedDept.value = item, item.id)
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
M: common_vendor.o(confirmDept),
|
||||
N: common_vendor.o(($event) => showDeptPopup.value = false),
|
||||
O: common_vendor.p({
|
||||
show: showDeptPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
P: common_vendor.o(confirmDelete),
|
||||
Q: common_vendor.o(($event) => showDeleteModal.value = false),
|
||||
R: common_vendor.p({
|
||||
show: showDeleteModal.value,
|
||||
title: "确认删除",
|
||||
content: "确定要删除这条证照记录吗?",
|
||||
showCancelButton: true
|
||||
}),
|
||||
S: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1ad9c724"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Idphotomanagement/Idphotomanagement.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "证件照管理",
|
||||
"usingComponents": {
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"u-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"u-modal": "../../uni_modules/uview-plus/components/u-modal/u-modal"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
269
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.wxss
vendored
Normal file
269
unpackage/dist/dev/mp-weixin/pages/Idphotomanagement/Idphotomanagement.wxss
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-1ad9c724 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
.license-list.data-v-1ad9c724 {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.license-item.data-v-1ad9c724 {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.license-header.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.license-type.data-v-1ad9c724 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.license-actions.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.action-btn.data-v-1ad9c724 {
|
||||
font-size: 28rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
}
|
||||
.license-detail.data-v-1ad9c724 {
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.detail-row.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.detail-row .label.data-v-1ad9c724 {
|
||||
color: #999;
|
||||
width: 160rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.detail-row .value.data-v-1ad9c724 {
|
||||
color: #333;
|
||||
flex: 1;
|
||||
}
|
||||
.license-photo.data-v-1ad9c724 {
|
||||
width: 200rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.license-photo image.data-v-1ad9c724 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.empty-state.data-v-1ad9c724 {
|
||||
padding: 200rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
.add-btn.data-v-1ad9c724 {
|
||||
position: fixed;
|
||||
bottom: 40rpx;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.popup-content.data-v-1ad9c724 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.popup-header.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.popup-title.data-v-1ad9c724 {
|
||||
font-size: 34rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-close.data-v-1ad9c724 {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-1ad9c724 {
|
||||
max-height: 700rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.form-item.data-v-1ad9c724 {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.form-label.data-v-1ad9c724 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.form-input.data-v-1ad9c724 {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
padding: 0 24rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-select.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.upload-box.data-v-1ad9c724 {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border: 2rpx dashed #ccc;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
.upload-add.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.upload-icon.data-v-1ad9c724 {
|
||||
font-size: 60rpx;
|
||||
color: #999;
|
||||
}
|
||||
.upload-text.data-v-1ad9c724 {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.upload-preview.data-v-1ad9c724 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.upload-img.data-v-1ad9c724 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.upload-delete.data-v-1ad9c724 {
|
||||
position: absolute;
|
||||
top: -16rpx;
|
||||
right: -16rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: #ff4d4f;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.popup-footer.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 30rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.btn-cancel.data-v-1ad9c724 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 40rpx;
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.btn-confirm.data-v-1ad9c724 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.dept-popup.data-v-1ad9c724 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.dept-list.data-v-1ad9c724 {
|
||||
max-height: 400rpx;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.dept-item.data-v-1ad9c724 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.dept-checkbox.data-v-1ad9c724 {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border: 2rpx solid #ccc;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.dept-checkbox-active.data-v-1ad9c724 {
|
||||
background: #2667E9;
|
||||
border-color: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
.dept-name.data-v-1ad9c724 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.btn-dept-confirm.data-v-1ad9c724 {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
11
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.js
vendored
Normal file
11
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {};
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {
|
||||
a: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "检查清单",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{a}}"><view class="text-bold text-black">检查清单预览</view><view class="flex margin-bottom"><view class="text-gray">计划名称:</view><view>和谐矿业每日巡检</view></view><view class="flex margin-bottom"><view class="text-gray">检查时间:</view><view>2025-11-19 10:18:40</view></view><view class="flex margin-bottom"><view class="text-gray">检查人员:</view><view>18174379303</view></view><image></image><view class="flex margin-bottom"><view>被检查单位:</view><view></view></view><view class="flex margin-bottom"><view>检查人员:</view><view></view></view><view class="flex margin-bottom"><view>上次检查情况:</view><view></view></view><view class="flex margin-bottom"><view>本次检查情况:</view><view></view></view><view class="flex margin-bottom"><view>检查日期:</view><view>2025-11-19 10:18:40</view></view><view class="flex justify-between"><view class="flex text-center align-center"><button class="bg-blue">缩小</button><view>50%</view><button class="bg-blue">放大</button></view><button class="lg cu-btn">重置</button></view></view>
|
||||
0
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.wxss
vendored
Normal file
0
unpackage/dist/dev/mp-weixin/pages/Inspectionchecklist/Inspectionchecklist.wxss
vendored
Normal file
21
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.js
vendored
Normal file
21
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
__name: "Inspectionlog",
|
||||
setup(__props) {
|
||||
const Checklist = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/Inspectionchecklist/Inspectionchecklist"
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => Checklist()),
|
||||
b: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2f72507f"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionlog/Inspectionlog.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "检查记录",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-2f72507f', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{b}}"><view class="padding bg-white radius list data-v-2f72507f"><view class="text-bold margin-bottom text-black data-v-2f72507f">和谐矿业每日巡检</view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">检查时间:</view><view class="data-v-2f72507f">2025-11-19 10:18:40</view></view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">检查人员:</view><view class="data-v-2f72507f">18174379303</view></view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">隐患数量:</view><view class="data-v-2f72507f">1</view></view><view class="flex margin-bottom data-v-2f72507f"><view class="text-gray data-v-2f72507f">备注:</view><view class="data-v-2f72507f">可以</view></view><view class="flex justify-between data-v-2f72507f"><view class="data-v-2f72507f"></view><button class="bg-blue round cu-btn lg data-v-2f72507f" bindtap="{{a}}">预览清单</button></view></view></view>
|
||||
37
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.wxss
vendored
Normal file
37
unpackage/dist/dev/mp-weixin/pages/Inspectionlog/Inspectionlog.wxss
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-2f72507f {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.list.data-v-2f72507f {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
||||
border-left: 5px solid #2667E9;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
557
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.js
vendored
Normal file
557
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.js
vendored
Normal file
@@ -0,0 +1,557 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.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_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)();
|
||||
}
|
||||
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_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)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspectionresult",
|
||||
setup(__props) {
|
||||
const oneTableId = common_vendor.ref("");
|
||||
const checkData = common_vendor.ref(null);
|
||||
const radiolist1 = common_vendor.reactive([
|
||||
{
|
||||
name: "正常",
|
||||
value: 1,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "异常",
|
||||
value: 2,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "不涉及",
|
||||
value: 3,
|
||||
disabled: false
|
||||
}
|
||||
]);
|
||||
const radiovalue1 = common_vendor.ref("");
|
||||
const groupChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:240", "groupChange", n);
|
||||
if (n !== "异常") {
|
||||
clearHazard();
|
||||
}
|
||||
};
|
||||
const radioChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:248", "radioChange", n);
|
||||
};
|
||||
const value1 = common_vendor.ref("");
|
||||
const showHazardPopup = common_vendor.ref(false);
|
||||
const hazardFormData = common_vendor.reactive({
|
||||
title: "",
|
||||
level: 0,
|
||||
source: 0,
|
||||
description: "",
|
||||
tagIndex: 0
|
||||
});
|
||||
const hazardAddress = common_vendor.ref("");
|
||||
const hazardLng = common_vendor.ref(0);
|
||||
const hazardLat = common_vendor.ref(0);
|
||||
const showAreaPicker = common_vendor.ref(false);
|
||||
const areaList = common_vendor.ref([]);
|
||||
const selectedAreaId = common_vendor.ref("");
|
||||
const selectedAreaName = common_vendor.ref("");
|
||||
const tempAreaId = common_vendor.ref("");
|
||||
const fetchAreaList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaList();
|
||||
if (res.code === 0 && res.data && res.data.records) {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:288", "获取区域列表失败:", error);
|
||||
}
|
||||
};
|
||||
const confirmAreaSelect = () => {
|
||||
if (tempAreaId.value) {
|
||||
selectedAreaId.value = tempAreaId.value;
|
||||
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
|
||||
selectedAreaName.value = selected ? selected.name : "";
|
||||
}
|
||||
showAreaPicker.value = false;
|
||||
};
|
||||
const hazardFileList = common_vendor.ref([]);
|
||||
const levelChooseRef = common_vendor.ref(null);
|
||||
const aiAnalyzing = common_vendor.ref(false);
|
||||
const hasHazardData = common_vendor.computed(() => {
|
||||
return hazardFormData.title && hazardFileList.value.length > 0;
|
||||
});
|
||||
const progressPercent = common_vendor.computed(() => {
|
||||
if (!checkData.value)
|
||||
return 0;
|
||||
const current = checkData.value.currentIndex || 1;
|
||||
const total = checkData.value.totalCount || 1;
|
||||
return Math.round(current / total * 100);
|
||||
});
|
||||
const levelOptions = common_vendor.ref([
|
||||
{ id: 1, title: "轻微隐患" },
|
||||
{ id: 2, title: "一般隐患" },
|
||||
{ id: 3, title: "重大隐患" }
|
||||
]);
|
||||
const sourceOptions = common_vendor.ref([
|
||||
{ id: 1, title: "随手拍" },
|
||||
{ id: 2, title: "企业自查" },
|
||||
{ id: 3, title: "行业互查" },
|
||||
{ id: 4, title: "专家诊查" }
|
||||
]);
|
||||
const tagOptions = common_vendor.ref([]);
|
||||
const fetchTagOptions = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerLabelList();
|
||||
if (res.code === 0) {
|
||||
tagOptions.value = res.data.map((item) => ({
|
||||
id: item.id,
|
||||
title: item.name
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:353", "获取标签列表失败:", error);
|
||||
}
|
||||
};
|
||||
const openHazardPopup = () => {
|
||||
showHazardPopup.value = true;
|
||||
};
|
||||
const editHazard = () => {
|
||||
showHazardPopup.value = true;
|
||||
};
|
||||
const clearHazard = () => {
|
||||
hazardFormData.title = "";
|
||||
hazardFormData.level = 0;
|
||||
hazardFormData.source = 0;
|
||||
hazardFormData.description = "";
|
||||
hazardFormData.tagIndex = 0;
|
||||
hazardAddress.value = "";
|
||||
hazardLng.value = 0;
|
||||
hazardLat.value = 0;
|
||||
hazardFileList.value = [];
|
||||
selectedAreaId.value = "";
|
||||
selectedAreaName.value = "";
|
||||
};
|
||||
const confirmHazard = () => {
|
||||
if (hazardFileList.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请上传隐患图片/视频", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!hazardFormData.title) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!hazardAddress.value) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患位置", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!hazardFormData.description) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患描述", icon: "none" });
|
||||
return;
|
||||
}
|
||||
showHazardPopup.value = false;
|
||||
common_vendor.index.showToast({ title: "隐患信息已暂存", icon: "success" });
|
||||
};
|
||||
const chooseLocation = () => {
|
||||
showHazardPopup.value = false;
|
||||
setTimeout(() => {
|
||||
common_vendor.index.chooseLocation({
|
||||
success: (res) => {
|
||||
hazardAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
||||
hazardLng.value = res.longitude;
|
||||
hazardLat.value = res.latitude;
|
||||
showHazardPopup.value = true;
|
||||
},
|
||||
fail: (err) => {
|
||||
showHazardPopup.value = true;
|
||||
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({ title: "选择位置失败", icon: "none" });
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
const 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++) {
|
||||
const result = await uploadFilePromise(lists[i].url);
|
||||
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.baseUrl.replace("/prod-api", "") + serverPath,
|
||||
serverPath
|
||||
});
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
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:479", "上传失败:", 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)$/);
|
||||
});
|
||||
if (imageFiles.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const fullImageUrl = imageFiles[0].url;
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:500", "开始调用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:507", "AI分析结果:", aiData);
|
||||
if (aiData.title)
|
||||
hazardFormData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
hazardFormData.description = aiData.description;
|
||||
if (aiData.level) {
|
||||
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 1, "一般隐患": 1, "重大": 2, "重大隐患": 2 };
|
||||
const levelIndex = levelMap[aiData.level];
|
||||
if (levelIndex !== void 0) {
|
||||
hazardFormData.level = levelIndex;
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (levelChooseRef.value && levelChooseRef.value.$data) {
|
||||
levelChooseRef.value.$data.currentIndex = levelIndex;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
common_vendor.index.showToast({ title: "AI分析完成,已自动填充", icon: "success", duration: 2e3 });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:530", "AI分析接口调用失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI分析失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiAnalyzing.value = false;
|
||||
}
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
var _a, _b, _c, _d;
|
||||
if (!radiovalue1.value) {
|
||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const selectedItem = radiolist1.find((item) => item.name === radiovalue1.value);
|
||||
const resultValue = selectedItem ? selectedItem.value : null;
|
||||
if (!resultValue) {
|
||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (radiovalue1.value === "异常" && !hasHazardData.value) {
|
||||
common_vendor.index.showToast({ title: "请填写隐患信息", icon: "none" });
|
||||
return;
|
||||
}
|
||||
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 || "";
|
||||
}
|
||||
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 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,
|
||||
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) || "",
|
||||
tagId,
|
||||
attachments
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:604", "隐患参数:", 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:613", "新增隐患成功");
|
||||
}
|
||||
const submitParams = {
|
||||
taskId: (_d = checkData.value) == null ? void 0 : _d.taskId,
|
||||
result: resultValue,
|
||||
remark: value1.value
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:622", "提交参数:", submitParams);
|
||||
const res = await request_api.submitCheckResult(submitParams);
|
||||
common_vendor.index.hideLoading();
|
||||
if (res.code === 0) {
|
||||
if (res.data && res.data.allFinished === true) {
|
||||
common_vendor.index.showToast({ title: "全部检查已完成", icon: "success" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else if (res.data && res.data.nextTask) {
|
||||
common_vendor.index.showToast({ title: "提交成功,进入下一题", icon: "success" });
|
||||
resetFormState();
|
||||
checkData.value = res.data.nextTask;
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: "提交成功", icon: "success" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:656", "提交失败:", error);
|
||||
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const resetFormState = () => {
|
||||
radiovalue1.value = "";
|
||||
value1.value = "";
|
||||
clearHazard();
|
||||
};
|
||||
const getCheckData = async () => {
|
||||
try {
|
||||
const res = await request_api.enterCheckPlan(oneTableId.value);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:675", "检查项数据:", res);
|
||||
if (res.code === 0) {
|
||||
checkData.value = res.data;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:680", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:686", "接收到的参数:", options);
|
||||
if (options.id) {
|
||||
oneTableId.value = options.id;
|
||||
getCheckData();
|
||||
}
|
||||
fetchTagOptions();
|
||||
fetchAreaList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
var _a, _b, _c, _d;
|
||||
return common_vendor.e({
|
||||
a: checkData.value
|
||||
}, checkData.value ? {
|
||||
b: common_vendor.t(checkData.value.currentIndex || 1),
|
||||
c: common_vendor.t(checkData.value.totalCount || 1),
|
||||
d: progressPercent.value + "%"
|
||||
} : {}, {
|
||||
e: common_vendor.t(((_a = checkData.value) == null ? void 0 : _a.name) || "加载中..."),
|
||||
f: ((_b = checkData.value) == null ? void 0 : _b.point) || "",
|
||||
g: common_vendor.f(radiolist1, (item, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: common_vendor.o(radioChange, index),
|
||||
c: "643afff0-1-" + i0 + ",643afff0-0",
|
||||
d: common_vendor.p({
|
||||
customStyle: {
|
||||
marginBottom: "8px"
|
||||
},
|
||||
label: item.name,
|
||||
name: item.name
|
||||
})
|
||||
};
|
||||
}),
|
||||
h: common_vendor.o(groupChange),
|
||||
i: common_vendor.o(($event) => radiovalue1.value = $event),
|
||||
j: common_vendor.p({
|
||||
placement: "row",
|
||||
modelValue: radiovalue1.value
|
||||
}),
|
||||
k: radiovalue1.value === "异常"
|
||||
}, radiovalue1.value === "异常" ? common_vendor.e({
|
||||
l: !hasHazardData.value
|
||||
}, !hasHazardData.value ? {
|
||||
m: common_vendor.o(openHazardPopup)
|
||||
} : common_vendor.e({
|
||||
n: common_vendor.t(hazardFormData.title),
|
||||
o: common_vendor.t((_c = levelOptions.value[hazardFormData.level]) == null ? void 0 : _c.title),
|
||||
p: hazardFormData.level === 0 ? 1 : "",
|
||||
q: hazardFormData.level === 1 ? 1 : "",
|
||||
r: hazardFormData.level === 2 ? 1 : "",
|
||||
s: common_vendor.t(((_d = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _d.title) || "-"),
|
||||
t: common_vendor.t(hazardAddress.value || "-"),
|
||||
v: common_vendor.t(hazardFormData.description || "-"),
|
||||
w: hazardFileList.value.length > 0
|
||||
}, hazardFileList.value.length > 0 ? {
|
||||
x: common_vendor.t(hazardFileList.value.length)
|
||||
} : {}, {
|
||||
y: common_vendor.o(editHazard),
|
||||
z: common_vendor.o(clearHazard)
|
||||
})) : {}, {
|
||||
A: common_vendor.o(($event) => value1.value = $event),
|
||||
B: common_vendor.p({
|
||||
placeholder: "请输入备注信息",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
C: common_vendor.o(handleSubmit),
|
||||
D: common_vendor.o(($event) => showHazardPopup.value = false),
|
||||
E: common_vendor.o(afterRead),
|
||||
F: common_vendor.o(deletePic),
|
||||
G: common_vendor.p({
|
||||
fileList: hazardFileList.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
H: !aiAnalyzing.value
|
||||
}, !aiAnalyzing.value ? {} : {}, {
|
||||
I: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
|
||||
J: aiAnalyzing.value,
|
||||
K: aiAnalyzing.value,
|
||||
L: common_vendor.o(handleAiAnalyze),
|
||||
M: common_vendor.o(($event) => hazardFormData.title = $event),
|
||||
N: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: hazardFormData.title
|
||||
}),
|
||||
O: common_vendor.sr(levelChooseRef, "643afff0-6,643afff0-3", {
|
||||
"k": "levelChooseRef"
|
||||
}),
|
||||
P: common_vendor.o(($event) => hazardFormData.level = $event),
|
||||
Q: common_vendor.p({
|
||||
options: levelOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: hazardFormData.level
|
||||
}),
|
||||
R: common_vendor.o(($event) => hazardFormData.source = $event),
|
||||
S: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: hazardFormData.source
|
||||
}),
|
||||
T: common_vendor.o(($event) => hazardAddress.value = $event),
|
||||
U: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
border: "surround",
|
||||
modelValue: hazardAddress.value
|
||||
}),
|
||||
V: common_vendor.o(chooseLocation),
|
||||
W: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
|
||||
X: !selectedAreaName.value ? 1 : "",
|
||||
Y: common_vendor.o(($event) => showAreaPicker.value = true),
|
||||
Z: common_vendor.o(($event) => hazardFormData.description = $event),
|
||||
aa: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: hazardFormData.description
|
||||
}),
|
||||
ab: common_vendor.o(($event) => hazardFormData.tagIndex = $event),
|
||||
ac: common_vendor.p({
|
||||
options: tagOptions.value,
|
||||
modelValue: hazardFormData.tagIndex
|
||||
}),
|
||||
ad: common_vendor.o(($event) => showHazardPopup.value = false),
|
||||
ae: common_vendor.o(confirmHazard),
|
||||
af: common_vendor.o(($event) => showHazardPopup.value = false),
|
||||
ag: common_vendor.p({
|
||||
show: showHazardPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
ah: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
ai: common_vendor.o(confirmAreaSelect),
|
||||
aj: common_vendor.f(areaList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.color,
|
||||
b: common_vendor.t(item.name),
|
||||
c: tempAreaId.value === item.id
|
||||
}, tempAreaId.value === item.id ? {} : {}, {
|
||||
d: item.id,
|
||||
e: tempAreaId.value === item.id ? 1 : "",
|
||||
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
ak: areaList.value.length === 0
|
||||
}, areaList.value.length === 0 ? {} : {}, {
|
||||
al: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
am: common_vendor.p({
|
||||
show: showAreaPicker.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
an: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-643afff0"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionresult/Inspectionresult.js.map
|
||||
12
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.json
vendored
Normal file
12
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"navigationBarTitleText": "检查结果",
|
||||
"usingComponents": {
|
||||
"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-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"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
330
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxss
vendored
Normal file
330
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/Inspectionresult.wxss
vendored
Normal file
@@ -0,0 +1,330 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-643afff0 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.progress-bar.data-v-643afff0 {
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.progress-text.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.progress-text .current-index.data-v-643afff0 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #2667E9;
|
||||
}
|
||||
.progress-text .total-count.data-v-643afff0 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.progress-line.data-v-643afff0 {
|
||||
height: 12rpx;
|
||||
background: #E5E5E5;
|
||||
border-radius: 6rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.progress-inner.data-v-643afff0 {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #2667E9, #5B9BFF);
|
||||
border-radius: 6rpx;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
.hazard-section.data-v-643afff0 {
|
||||
border-top: 1rpx solid #eee;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.hazard-tip.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 20rpx;
|
||||
background: #FFF7E6;
|
||||
border: 1rpx solid #FFE7BA;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.hazard-tip .text-orange.data-v-643afff0 {
|
||||
color: #FA8C16;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.hazard-btn.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 88rpx;
|
||||
border: 2rpx dashed #2667E9;
|
||||
border-radius: 12rpx;
|
||||
background: #F5F9FF;
|
||||
}
|
||||
.hazard-btn .text-blue.data-v-643afff0 {
|
||||
color: #2667E9;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.hazard-card.data-v-643afff0 {
|
||||
background: #F5F9FF;
|
||||
border: 1rpx solid #D6E4FF;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.hazard-card .card-header.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #E8E8E8;
|
||||
background: #fff;
|
||||
}
|
||||
.hazard-card .card-body.data-v-643afff0 {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.hazard-card .card-body .info-row.data-v-643afff0 {
|
||||
display: flex;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.hazard-card .card-body .info-row.data-v-643afff0:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.hazard-card .card-body .info-row .text-gray.data-v-643afff0 {
|
||||
flex-shrink: 0;
|
||||
color: #999;
|
||||
}
|
||||
.hazard-card .card-body .info-row .description-text.data-v-643afff0 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.hazard-card .card-footer.data-v-643afff0 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #E8E8E8;
|
||||
background: #fff;
|
||||
}
|
||||
.hazard-card .card-footer button.data-v-643afff0 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 0;
|
||||
}
|
||||
.hazard-card .card-footer button.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.hazard-card .card-footer .btn-edit.data-v-643afff0 {
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
border-right: 1rpx solid #E8E8E8;
|
||||
}
|
||||
.hazard-card .card-footer .btn-clear.data-v-643afff0 {
|
||||
background: #fff;
|
||||
color: #F56C6C;
|
||||
}
|
||||
.level-tag.data-v-643afff0 {
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.level-minor.data-v-643afff0 {
|
||||
background: #F6FFED;
|
||||
border: 2rpx solid #B7EB8F;
|
||||
color: #52C41A;
|
||||
}
|
||||
.level-normal.data-v-643afff0 {
|
||||
background: #FFF7E6;
|
||||
border: 2rpx solid #FFD591;
|
||||
color: #FA8C16;
|
||||
}
|
||||
.level-major.data-v-643afff0 {
|
||||
background: #FFF1F0;
|
||||
border: 2rpx solid #FFA39E;
|
||||
color: #F5222D;
|
||||
}
|
||||
.popup-content.data-v-643afff0 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-643afff0 {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-643afff0 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-643afff0 {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-643afff0 {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-643afff0 {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.popup-footer.data-v-643afff0 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-643afff0 {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-643afff0 {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-643afff0 {
|
||||
color: #fff;
|
||||
}
|
||||
.address-box.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-box .address-input-wrapper.data-v-643afff0 {
|
||||
flex: 1;
|
||||
}
|
||||
.address-box .btn-address.data-v-643afff0 {
|
||||
flex-shrink: 0;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.address-box .btn-address.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.select-trigger.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.select-trigger .select-value.data-v-643afff0 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger .select-value.placeholder.data-v-643afff0 {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
.picker-popup.data-v-643afff0 {
|
||||
background: #fff;
|
||||
}
|
||||
.picker-popup .picker-header.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.picker-popup .picker-header .picker-cancel.data-v-643afff0 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.picker-popup .picker-header .picker-title.data-v-643afff0 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-header .picker-confirm.data-v-643afff0 {
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.picker-popup .picker-body.data-v-643afff0 {
|
||||
max-height: 600rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-643afff0:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.picker-popup .picker-item.picker-item-active.data-v-643afff0 {
|
||||
color: #2667E9;
|
||||
}
|
||||
.area-color-dot.data-v-643afff0 {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
186
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.js
vendored
Normal file
186
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.js
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
(_easycom_up_datetime_picker2 + _easycom_up_input2)();
|
||||
}
|
||||
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";
|
||||
if (!Math) {
|
||||
(_easycom_up_datetime_picker + _easycom_up_input)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspectionwarning",
|
||||
setup(__props) {
|
||||
const searchForm = common_vendor.reactive({
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
deptName: ""
|
||||
});
|
||||
const showStartDatePicker = common_vendor.ref(false);
|
||||
const showEndDatePicker = common_vendor.ref(false);
|
||||
const startDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
|
||||
const endDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
|
||||
const statistics = common_vendor.reactive({
|
||||
total: 0,
|
||||
overdue: 0,
|
||||
completed: 0,
|
||||
pending: 0
|
||||
});
|
||||
const dataList = common_vendor.ref([]);
|
||||
const pageNum = common_vendor.ref(1);
|
||||
const pageSize = common_vendor.ref(20);
|
||||
const formatDate = (timestamp) => {
|
||||
const date = new Date(timestamp);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
const onStartDateConfirm = (e) => {
|
||||
const dateStr = formatDate(e.value);
|
||||
searchForm.startDate = `${dateStr} 00:00:00`;
|
||||
showStartDatePicker.value = false;
|
||||
};
|
||||
const onEndDateConfirm = (e) => {
|
||||
const dateStr = formatDate(e.value);
|
||||
searchForm.endDate = `${dateStr} 23:59:59`;
|
||||
showEndDatePicker.value = false;
|
||||
};
|
||||
const getStatusClass = (overdueDays) => {
|
||||
if (!overdueDays || overdueDays === "按期") {
|
||||
return "status-normal";
|
||||
}
|
||||
const days = parseInt(overdueDays);
|
||||
if (days >= 7) {
|
||||
return "status-serious";
|
||||
} else if (days >= 1) {
|
||||
return "status-overdue";
|
||||
}
|
||||
return "status-normal";
|
||||
};
|
||||
const getStatusText = (overdueDays, statusName) => {
|
||||
if (!overdueDays || overdueDays === "按期") {
|
||||
return statusName === "已完成" ? "按期已完成" : "期限内待检";
|
||||
}
|
||||
const days = parseInt(overdueDays);
|
||||
if (days >= 7) {
|
||||
return "严重逾期";
|
||||
} else if (days >= 1) {
|
||||
return statusName === "已完成" ? "逾期已完成" : "逾期未检";
|
||||
}
|
||||
return "期限内待检";
|
||||
};
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const params = {
|
||||
pageNum: pageNum.value,
|
||||
pageSize: pageSize.value
|
||||
};
|
||||
if (searchForm.startDate) {
|
||||
params.startDate = searchForm.startDate;
|
||||
}
|
||||
if (searchForm.endDate) {
|
||||
params.endDate = searchForm.endDate;
|
||||
}
|
||||
if (searchForm.deptName && searchForm.deptName.trim()) {
|
||||
params.deptName = searchForm.deptName.trim();
|
||||
}
|
||||
const res = await request_api.getInspectionWarningList(params);
|
||||
if (res.code === 0) {
|
||||
if (res.data.statistics) {
|
||||
statistics.total = res.data.statistics.total || 0;
|
||||
statistics.overdue = res.data.statistics.overdue || 0;
|
||||
statistics.completed = res.data.statistics.completed || 0;
|
||||
statistics.pending = res.data.statistics.pending || 0;
|
||||
}
|
||||
if (res.data.page && res.data.page.records) {
|
||||
dataList.value = res.data.page.records;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionwarning/Inspectionwarning.vue:255", "获取预警列表失败:", error);
|
||||
}
|
||||
};
|
||||
const handleSearch = () => {
|
||||
pageNum.value = 1;
|
||||
fetchData();
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
fetchData();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(_ctx.warningList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: _ctx.activeIndex === index ? 1 : "",
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => _ctx.switchTab(index), index)
|
||||
};
|
||||
}),
|
||||
b: common_assets._imports_0$1,
|
||||
c: common_vendor.t(searchForm.startDate || "请选择"),
|
||||
d: common_vendor.n(searchForm.startDate ? "date-value" : "date-placeholder"),
|
||||
e: common_vendor.o(($event) => showStartDatePicker.value = true),
|
||||
f: common_vendor.o(onStartDateConfirm),
|
||||
g: common_vendor.o(($event) => showStartDatePicker.value = false),
|
||||
h: common_vendor.o(($event) => showStartDatePicker.value = false),
|
||||
i: common_vendor.o(($event) => startDateValue.value = $event),
|
||||
j: common_vendor.p({
|
||||
show: showStartDatePicker.value,
|
||||
mode: "date",
|
||||
modelValue: startDateValue.value
|
||||
}),
|
||||
k: common_vendor.t(searchForm.endDate || "请选择"),
|
||||
l: common_vendor.n(searchForm.endDate ? "date-value" : "date-placeholder"),
|
||||
m: common_vendor.o(($event) => showEndDatePicker.value = true),
|
||||
n: common_vendor.o(onEndDateConfirm),
|
||||
o: common_vendor.o(($event) => showEndDatePicker.value = false),
|
||||
p: common_vendor.o(($event) => showEndDatePicker.value = false),
|
||||
q: common_vendor.o(($event) => endDateValue.value = $event),
|
||||
r: common_vendor.p({
|
||||
show: showEndDatePicker.value,
|
||||
mode: "date",
|
||||
modelValue: endDateValue.value
|
||||
}),
|
||||
s: common_vendor.o(($event) => searchForm.deptName = $event),
|
||||
t: common_vendor.p({
|
||||
placeholder: "请输入公司名称",
|
||||
border: "surround",
|
||||
modelValue: searchForm.deptName
|
||||
}),
|
||||
v: common_vendor.o(handleSearch),
|
||||
w: common_assets._imports_1,
|
||||
x: common_vendor.t(statistics.total),
|
||||
y: common_vendor.t(statistics.overdue),
|
||||
z: common_vendor.t(statistics.completed),
|
||||
A: common_vendor.t(statistics.pending),
|
||||
B: common_vendor.f(dataList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(getStatusText(item.overdueDays, item.statusName)),
|
||||
b: common_vendor.n(getStatusClass(item.overdueDays)),
|
||||
c: common_vendor.t(index + 1),
|
||||
d: common_vendor.t(item.deptName || "-"),
|
||||
e: common_vendor.t(item.planName || "-"),
|
||||
f: common_vendor.t(item.cycleName || "-"),
|
||||
g: common_vendor.t(item.taskDate || "-"),
|
||||
h: common_vendor.t(item.finishTime || "未完成"),
|
||||
i: common_vendor.t(item.executorName || "-"),
|
||||
j: common_vendor.t(item.overdueDays || "-"),
|
||||
k: item.id
|
||||
};
|
||||
}),
|
||||
C: dataList.value.length === 0
|
||||
}, dataList.value.length === 0 ? {} : {}, {
|
||||
D: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-00b99536"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionwarning/Inspectionwarning.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "日常安全检查预警",
|
||||
"usingComponents": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
184
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.wxss
vendored
Normal file
184
unpackage/dist/dev/mp-weixin/pages/Inspectionwarning/Inspectionwarning.wxss
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-00b99536 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.section-header.data-v-00b99536 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.section-header .section-icon.data-v-00b99536 {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.search-card .date-row.data-v-00b99536 {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.search-card .date-row .date-item.data-v-00b99536 {
|
||||
flex: 1;
|
||||
}
|
||||
.search-card .date-label.data-v-00b99536 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.search-card .date-picker.data-v-00b99536 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 72rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #f8f8f8;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #eee;
|
||||
}
|
||||
.search-card .date-picker .date-value.data-v-00b99536 {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.search-card .date-picker .date-placeholder.data-v-00b99536 {
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.search-card .search-btn.data-v-00b99536 {
|
||||
margin-top: 30rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #2667E9 100%);
|
||||
color: #fff;
|
||||
border-radius: 40rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.stat-grid.data-v-00b99536 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.stat-grid .stat-item.data-v-00b99536 {
|
||||
flex: 1;
|
||||
height: 124rpx;
|
||||
border-radius: 12rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.stat-grid .stat-item .stat-num.data-v-00b99536 {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.stat-grid .stat-item .stat-label.data-v-00b99536 {
|
||||
font-size: 24rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.stat-grid .stat-total.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #628EFB 0%, #4A7CF7 100%);
|
||||
}
|
||||
.stat-grid .stat-overdue.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #32DCC7 0%, #20C5B0 100%);
|
||||
}
|
||||
.stat-grid .stat-completed.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #32D1E9 0%, #20B8D0 100%);
|
||||
}
|
||||
.stat-grid .stat-pending.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #A190F5 0%, #8B78E8 100%);
|
||||
}
|
||||
.list-title-bar.data-v-00b99536 {
|
||||
width: 8rpx;
|
||||
height: 32rpx;
|
||||
background: #2667E9;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.list-card.data-v-00b99536 {
|
||||
position: relative;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 10rpx rgba(0, 0, 0, 0.08);
|
||||
border-left: 8rpx solid #2667E9;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.list-card .card-header.data-v-00b99536 {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.list-card .card-row.data-v-00b99536 {
|
||||
display: flex;
|
||||
margin-top: 16rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.list-card .card-row .row-label.data-v-00b99536 {
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.list-card .card-row .row-value.data-v-00b99536 {
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
}
|
||||
.status-tag.data-v-00b99536 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 160rpx;
|
||||
height: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform: rotate(0deg);
|
||||
border-radius: 0 16rpx 0 16rpx;
|
||||
}
|
||||
.status-tag .status-text.data-v-00b99536 {
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
}
|
||||
.status-serious.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #FF6B6B 0%, #EE5A5A 100%);
|
||||
}
|
||||
.status-overdue.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #FFA726 0%, #FF9800 100%);
|
||||
}
|
||||
.status-normal.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
|
||||
}
|
||||
.status-completed.data-v-00b99536 {
|
||||
background: linear-gradient(135deg, #42A5F5 0%, #2196F3 100%);
|
||||
}
|
||||
.empty-tip.data-v-00b99536 {
|
||||
text-align: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
140
unpackage/dist/dev/mp-weixin/pages/area/management.js
vendored
Normal file
140
unpackage/dist/dev/mp-weixin/pages/area/management.js
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_three_one_api_area = require("../../request/three_one_api/area.js");
|
||||
if (!Math) {
|
||||
AreaFormPopup();
|
||||
}
|
||||
const AreaFormPopup = () => "../../components/AreaFormPopup.js";
|
||||
const _sfc_main = {
|
||||
__name: "management",
|
||||
setup(__props) {
|
||||
const areaList = common_vendor.ref([]);
|
||||
const showPopup = common_vendor.ref(false);
|
||||
const isEdit = common_vendor.ref(false);
|
||||
const currentEditId = common_vendor.ref(null);
|
||||
const submitting = common_vendor.ref(false);
|
||||
const editData = common_vendor.ref({});
|
||||
common_vendor.onMounted(() => {
|
||||
loadAreaList();
|
||||
});
|
||||
const loadAreaList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaList();
|
||||
if (res.code === 0) {
|
||||
areaList.value = res.data.records || [];
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/area/management.vue:79", "获取区域列表失败:", err);
|
||||
}
|
||||
};
|
||||
const openAddPopup = () => {
|
||||
isEdit.value = false;
|
||||
currentEditId.value = null;
|
||||
editData.value = {};
|
||||
showPopup.value = true;
|
||||
};
|
||||
const openEditPopup = async (item) => {
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaDetail({ id: item.id });
|
||||
if (res.code === 0) {
|
||||
isEdit.value = true;
|
||||
currentEditId.value = item.id;
|
||||
editData.value = {
|
||||
name: res.data.name || "",
|
||||
color: res.data.color || "#FF5733"
|
||||
};
|
||||
showPopup.value = true;
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/area/management.vue:105", "获取区域详情失败:", err);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const handlePopupClose = () => {
|
||||
isEdit.value = false;
|
||||
currentEditId.value = null;
|
||||
editData.value = {};
|
||||
};
|
||||
const handleSubmit = async (formData) => {
|
||||
submitting.value = true;
|
||||
try {
|
||||
const submitData = {
|
||||
name: formData.name,
|
||||
color: formData.color
|
||||
};
|
||||
let res;
|
||||
if (isEdit.value) {
|
||||
submitData.id = currentEditId.value;
|
||||
res = await request_three_one_api_area.updateArea(submitData);
|
||||
} else {
|
||||
res = await request_three_one_api_area.addArea(submitData);
|
||||
}
|
||||
if (res.code === 0) {
|
||||
showPopup.value = false;
|
||||
common_vendor.index.showToast({
|
||||
title: isEdit.value ? "修改成功" : "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
loadAreaList();
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/area/management.vue:144", "提交失败:", err);
|
||||
common_vendor.index.showToast({ title: "操作失败", icon: "none" });
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
};
|
||||
const handleDelete = (item) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "确认删除",
|
||||
content: "确定要删除该区域吗?",
|
||||
confirmColor: "#e54d42",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
const result = await request_three_one_api_area.deleteArea({ id: item.id });
|
||||
if (result.code === 0) {
|
||||
common_vendor.index.showToast({ title: "删除成功", icon: "success" });
|
||||
loadAreaList();
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/area/management.vue:166", "删除失败:", err);
|
||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: areaList.value.length > 0
|
||||
}, areaList.value.length > 0 ? {
|
||||
b: common_vendor.f(areaList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name || "区域名称"),
|
||||
b: item.color,
|
||||
c: common_vendor.t(item.color),
|
||||
d: common_vendor.o(($event) => openEditPopup(item), item.id),
|
||||
e: common_vendor.o(($event) => handleDelete(item), item.id),
|
||||
f: item.id
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.o(openAddPopup),
|
||||
d: common_vendor.o(handleSubmit),
|
||||
e: common_vendor.o(handlePopupClose),
|
||||
f: common_vendor.o(($event) => showPopup.value = $event),
|
||||
g: common_vendor.p({
|
||||
isEdit: isEdit.value,
|
||||
editData: editData.value,
|
||||
loading: submitting.value,
|
||||
visible: showPopup.value
|
||||
}),
|
||||
h: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-847f15e8"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/area/management.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/pages/area/management.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pages/area/management.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "区域管理",
|
||||
"usingComponents": {
|
||||
"area-form-popup": "../../components/AreaFormPopup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/area/management.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/area/management.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-847f15e8', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{h}}"><view wx:if="{{a}}" class="area-list data-v-847f15e8"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" class="padding bg-white radius margin-bottom data-v-847f15e8"><view class="flex justify-between data-v-847f15e8"><view class="data-v-847f15e8"><view class="text-bold text-black data-v-847f15e8">{{item.a}}</view><view class="margin-top flex align-center data-v-847f15e8"><text class="data-v-847f15e8">颜色:</text><view class="color-dot data-v-847f15e8" style="{{'background-color:' + item.b}}"></view><text class="margin-left-xs data-v-847f15e8">{{item.c}}</text></view></view><view class="data-v-847f15e8"><button class="bg-blue cu-btn data-v-847f15e8" bindtap="{{item.d}}">编辑</button><button class="bg-red cu-btn margin-left data-v-847f15e8" bindtap="{{item.e}}">删除</button></view></view></view></view><view wx:else class="empty-state data-v-847f15e8"><text class="text-gray data-v-847f15e8">暂无区域数据</text></view><button class="add-btn cuIcon-add bg-blue round data-v-847f15e8" bindtap="{{c}}">新增公司区域</button><area-form-popup wx:if="{{g}}" class="data-v-847f15e8" virtualHostClass="data-v-847f15e8" bindsubmit="{{d}}" bindclose="{{e}}" u-i="847f15e8-0" bind:__l="__l" bindupdateVisible="{{f}}" u-p="{{g}}"/></view>
|
||||
55
unpackage/dist/dev/mp-weixin/pages/area/management.wxss
vendored
Normal file
55
unpackage/dist/dev/mp-weixin/pages/area/management.wxss
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-847f15e8 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
.area-list.data-v-847f15e8 {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.empty-state.data-v-847f15e8 {
|
||||
padding: 200rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
.add-btn.data-v-847f15e8 {
|
||||
position: fixed;
|
||||
bottom: 40rpx;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.color-dot.data-v-847f15e8 {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 6rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
44
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.js
vendored
Normal file
44
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const _sfc_main = {
|
||||
__name: "checklist",
|
||||
setup(__props) {
|
||||
const list = common_vendor.ref([]);
|
||||
const fetchList = async () => {
|
||||
try {
|
||||
const res = await request_api.getCheckTableList({ pageNum: 1, pageSize: 100 });
|
||||
if (res.code === 0) {
|
||||
list.value = res.data.records || [];
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/checklist/checklist.vue:36", "获取检查表列表失败:", error);
|
||||
}
|
||||
};
|
||||
const goToAdd = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/editchecklist/editchecklist"
|
||||
});
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
fetchList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(list.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: item.id
|
||||
};
|
||||
}),
|
||||
b: list.value.length === 0
|
||||
}, list.value.length === 0 ? {} : {}, {
|
||||
c: common_vendor.o(goToAdd),
|
||||
d: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4d00090a"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/checklist/checklist.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "检查表",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-4d00090a', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{d}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="b" class="checklist-card data-v-4d00090a"><view class="card-name data-v-4d00090a">{{item.a}}</view></view><view wx:if="{{b}}" class="empty-tip data-v-4d00090a"><text class="data-v-4d00090a">暂无检查表</text></view><button class="add-btn data-v-4d00090a" bindtap="{{c}}"><text class="cuIcon-add data-v-4d00090a"></text><text class="data-v-4d00090a">新增检查表</text></button></view>
|
||||
68
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.wxss
vendored
Normal file
68
unpackage/dist/dev/mp-weixin/pages/checklist/checklist.wxss
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-4d00090a {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
.checklist-card.data-v-4d00090a {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.checklist-card .card-name.data-v-4d00090a {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
.empty-tip.data-v-4d00090a {
|
||||
text-align: center;
|
||||
padding: 100rpx 0;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.add-btn.data-v-4d00090a {
|
||||
position: fixed;
|
||||
bottom: 40rpx;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
height: 90rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #2668EA 100%);
|
||||
border-radius: 45rpx;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
.add-btn .cuIcon-add.data-v-4d00090a {
|
||||
margin-right: 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
339
unpackage/dist/dev/mp-weixin/pages/closeout/application.js
vendored
Normal file
339
unpackage/dist/dev/mp-weixin/pages/closeout/application.js
vendored
Normal file
@@ -0,0 +1,339 @@
|
||||
"use strict";
|
||||
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)();
|
||||
}
|
||||
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)();
|
||||
}
|
||||
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: "",
|
||||
// 整改时限
|
||||
responsibleDeptId: "",
|
||||
// 隐患治理责任单位ID
|
||||
responsiblePerson: "",
|
||||
// 主要负责人
|
||||
mainTreatmentContent: "",
|
||||
// 主要治理内容
|
||||
treatmentResult: "",
|
||||
// 隐患治理完成内容
|
||||
selfVerifyContent: ""
|
||||
// 责任单位自行验收情况
|
||||
});
|
||||
const fetchWriteOffList = async () => {
|
||||
try {
|
||||
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:148", "销号申请列表:", res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:151", "获取销号申请列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchAcceptanceList = async () => {
|
||||
try {
|
||||
const res = await request_api.getAcceptanceList();
|
||||
if (res.code === 0 && res.data) {
|
||||
const list = res.data.records || res.data || [];
|
||||
acceptanceHazardList.value = list;
|
||||
if (list.length > 0) {
|
||||
hazardColumns.value = [list.map((item) => item.title || item.hazardTitle || `隐患${item.hazardId}`)];
|
||||
} else {
|
||||
hazardColumns.value = [["暂无可申请销号的隐患"]];
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:168", "可申请销号的隐患列表:", list);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:171", "获取可申请销号隐患列表失败:", 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:199", "部门人员列表:", users);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:202", "获取部门人员列表失败:", error);
|
||||
}
|
||||
};
|
||||
const onDeptConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:208", "选择的人员:", 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 onHazardConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:231", "选择的隐患:", 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;
|
||||
}
|
||||
}
|
||||
showHazardPicker.value = false;
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:245", "选择的日期时间:", 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 = "";
|
||||
formData.mainTreatmentContent = "";
|
||||
formData.treatmentResult = "";
|
||||
formData.selfVerifyContent = "";
|
||||
};
|
||||
const handleAiGenerate = async () => {
|
||||
if (!selectedHazardId.value) {
|
||||
common_vendor.index.showToast({ title: "请先选择隐患", icon: "none" });
|
||||
return;
|
||||
}
|
||||
aiGenerating.value = true;
|
||||
try {
|
||||
const hazardRes = await request_api.getHiddenDangerDetail({ hazardId: selectedHazardId.value });
|
||||
if (hazardRes.code !== 0 || !hazardRes.data) {
|
||||
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const assigns = hazardRes.data.assigns;
|
||||
if (!assigns || assigns.length === 0 || !assigns[0].rectify) {
|
||||
common_vendor.index.showToast({ title: "该隐患暂无整改记录", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const rectifyId = assigns[0].rectify.rectifyId;
|
||||
const rectifyRes = await request_api.getRectifyDetail({ rectifyId });
|
||||
if (rectifyRes.code !== 0 || !rectifyRes.data) {
|
||||
common_vendor.index.showToast({ title: "获取整改详情失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const rectifyPlan = rectifyRes.data.rectifyPlan;
|
||||
if (!rectifyPlan) {
|
||||
common_vendor.index.showToast({ title: "整改方案内容为空", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const aiRes = await request_api.generateWriteoffContent({ rectifyContent: rectifyPlan });
|
||||
if (aiRes.code === 0 && aiRes.data) {
|
||||
formData.mainTreatmentContent = aiRes.data.mainContent || "";
|
||||
formData.treatmentResult = aiRes.data.completionContent || "";
|
||||
formData.selfVerifyContent = aiRes.data.selfInspection || "";
|
||||
common_vendor.index.showToast({ title: "AI生成成功", icon: "success" });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:319", "AI生成销号方案失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI生成失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiGenerating.value = false;
|
||||
}
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
if (!selectedHazardId.value) {
|
||||
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
hazardId: Number(selectedHazardId.value),
|
||||
// 隐患ID(必需)
|
||||
rectifyDeadline: formData.rectifyDeadline || "",
|
||||
// 整改时限
|
||||
responsibleDeptId: Number(formData.responsibleDeptId) || 0,
|
||||
// 隐患治理责任单位ID
|
||||
responsiblePerson: formData.responsiblePerson || "",
|
||||
// 主要负责人
|
||||
mainTreatmentContent: formData.mainTreatmentContent || "",
|
||||
// 主要治理内容
|
||||
treatmentResult: formData.treatmentResult || "",
|
||||
// 隐患治理完成内容
|
||||
selfVerifyContent: formData.selfVerifyContent || ""
|
||||
// 责任单位自行验收情况
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/closeout/application.vue:344", "提交数据:", params);
|
||||
try {
|
||||
const res = await request_api.applyDelete(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "申请成功", icon: "success" });
|
||||
showAddPopup.value = false;
|
||||
resetForm();
|
||||
fetchWriteOffList();
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/application.vue:358", "申请失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const editor = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/closeout/editor"
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
fetchWriteOffList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(hazardList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.hazardTitle),
|
||||
b: common_vendor.t(item.statusName),
|
||||
c: common_vendor.t(item.hazardCreatedAt),
|
||||
d: common_vendor.t(item.responsibleDeptName),
|
||||
e: common_vendor.t(item.responsiblePerson),
|
||||
f: common_vendor.t(item.createdAt),
|
||||
g: common_vendor.o(($event) => editor(), index),
|
||||
h: index
|
||||
};
|
||||
}),
|
||||
b: common_vendor.o(openAddPopup),
|
||||
c: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
|
||||
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
|
||||
f: common_vendor.o(($event) => showHazardPicker.value = true),
|
||||
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
|
||||
}),
|
||||
k: common_vendor.t(formData.rectifyDeadline || "请选择整改时限"),
|
||||
l: common_vendor.n(formData.rectifyDeadline ? "" : "text-gray"),
|
||||
m: common_vendor.o(($event) => showDatePicker.value = true),
|
||||
n: common_vendor.o(onDateConfirm),
|
||||
o: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
p: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
q: common_vendor.o(($event) => dateValue.value = $event),
|
||||
r: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: dateValue.value
|
||||
}),
|
||||
s: common_vendor.t(selectedDeptName.value || "请选择隐患治理责任单位"),
|
||||
t: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
|
||||
v: common_vendor.o(($event) => showDeptPicker.value = true),
|
||||
w: common_vendor.o(onDeptConfirm),
|
||||
x: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
y: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
z: common_vendor.p({
|
||||
show: showDeptPicker.value,
|
||||
columns: deptColumns.value
|
||||
}),
|
||||
A: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
B: common_vendor.p({
|
||||
placeholder: "请输入主要负责人",
|
||||
modelValue: formData.responsiblePerson
|
||||
}),
|
||||
C: !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({
|
||||
placeholder: "请输入主要治理内容",
|
||||
modelValue: formData.mainTreatmentContent
|
||||
}),
|
||||
J: common_vendor.o(($event) => formData.treatmentResult = $event),
|
||||
K: common_vendor.p({
|
||||
placeholder: "请输入隐患治理完成情况",
|
||||
modelValue: formData.treatmentResult
|
||||
}),
|
||||
L: common_vendor.o(($event) => formData.selfVerifyContent = $event),
|
||||
M: 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({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
R: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4b6250eb"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/application.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/pages/closeout/application.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/closeout/application.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-4b6250eb', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{R}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="padding bg-white radius margin-bottom data-v-4b6250eb"><view class="flex justify-between margin-bottom data-v-4b6250eb"><view class="text-bold text-black data-v-4b6250eb">{{item.a}}</view><view class="data-v-4b6250eb">{{item.b}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">隐患日期:</view><view class="text-black data-v-4b6250eb">{{item.c}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">责任单位:</view><view class="text-black data-v-4b6250eb">{{item.d}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">判定人员:</view><view class="text-black data-v-4b6250eb">{{item.e}}</view></view><view class="flex margin-bottom data-v-4b6250eb"><view class="text-gray data-v-4b6250eb">创建时间:</view><view class="text-black data-v-4b6250eb">{{item.f}}</view></view><view class="flex justify-between data-v-4b6250eb"><view class="data-v-4b6250eb"></view><view class="data-v-4b6250eb"><button class="bg-blue round cu-btn lg data-v-4b6250eb" bindtap="{{item.g}}">查看详情</button></view></view></view><button class="cuIcon-add bg-blue round margin-top data-v-4b6250eb" bindtap="{{b}}">新增</button><u-popup wx:if="{{Q}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-s="{{['d']}}" bindclose="{{P}}" u-i="4b6250eb-0" bind:__l="__l" u-p="{{Q}}"><view class="popup-content data-v-4b6250eb"><view class="popup-header data-v-4b6250eb"><view class="popup-title text-bold data-v-4b6250eb">新增销号申请</view><view class="popup-close data-v-4b6250eb" bindtap="{{c}}">×</view></view><scroll-view class="popup-body data-v-4b6250eb" scroll-y style="{{'height:' + '60vh'}}"><view class="flex margin-bottom data-v-4b6250eb"><view class="data-v-4b6250eb">隐患</view><view class="text-red data-v-4b6250eb">*</view></view><view class="picker-input data-v-4b6250eb" bindtap="{{f}}"><text class="{{['data-v-4b6250eb', e]}}">{{d}}</text></view><up-picker wx:if="{{j}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{g}}" bindcancel="{{h}}" bindclose="{{i}}" u-i="4b6250eb-1,4b6250eb-0" bind:__l="__l" u-p="{{j}}"></up-picker><view class="flex margin-bottom margin-top data-v-4b6250eb"><view class="data-v-4b6250eb">整改时限</view></view><view class="picker-input data-v-4b6250eb" bindtap="{{m}}"><text class="{{['data-v-4b6250eb', l]}}">{{k}}</text></view><up-datetime-picker wx:if="{{r}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{n}}" bindcancel="{{o}}" bindclose="{{p}}" u-i="4b6250eb-2,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"></up-datetime-picker><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位</view><view class="picker-input data-v-4b6250eb" bindtap="{{v}}"><text class="{{['data-v-4b6250eb', t]}}">{{s}}</text></view><up-picker wx:if="{{z}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" bindconfirm="{{w}}" bindcancel="{{x}}" bindclose="{{y}}" u-i="4b6250eb-3,4b6250eb-0" bind:__l="__l" u-p="{{z}}"></up-picker><view class="margin-bottom margin-top data-v-4b6250eb">主要负责人</view><up-input wx:if="{{B}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-4,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{A}}" u-p="{{B}}"></up-input><view class="ai-btn-wrapper margin-top margin-bottom data-v-4b6250eb"><button class="ai-analyze-btn data-v-4b6250eb" loading="{{E}}" disabled="{{F}}" bindtap="{{G}}"><text wx:if="{{C}}" class="cuIcon-magic ai-btn-icon data-v-4b6250eb"></text> {{D}}</button></view><view class="margin-bottom margin-top data-v-4b6250eb">主要治理内容</view><up-textarea wx:if="{{I}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-5,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{H}}" u-p="{{I}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理完成内容</view><up-textarea wx:if="{{K}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-6,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{J}}" u-p="{{K}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{M}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-7,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{L}}" u-p="{{M}}"></up-textarea></scroll-view><view class="popup-footer data-v-4b6250eb"><button class="btn-cancel data-v-4b6250eb" bindtap="{{N}}">取消</button><button class="btn-confirm bg-blue data-v-4b6250eb" bindtap="{{O}}">确定</button></view></view></u-popup></view>
|
||||
112
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxss
vendored
Normal file
112
unpackage/dist/dev/mp-weixin/pages/closeout/application.wxss
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-4b6250eb {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.popup-content.data-v-4b6250eb {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-4b6250eb {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-4b6250eb {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-4b6250eb {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-4b6250eb {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.popup-footer.data-v-4b6250eb {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-4b6250eb {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-4b6250eb::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-4b6250eb {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-4b6250eb {
|
||||
color: #fff;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-4b6250eb {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-4b6250eb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-4b6250eb::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-4b6250eb {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-4b6250eb {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.picker-input.data-v-4b6250eb {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1rpx solid #eee;
|
||||
}
|
||||
.picker-input text.data-v-4b6250eb {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
137
unpackage/dist/dev/mp-weixin/pages/closeout/editor.js
vendored
Normal file
137
unpackage/dist/dev/mp-weixin/pages/closeout/editor.js
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
_easycom_up_input2();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
if (!Math) {
|
||||
_easycom_up_input();
|
||||
}
|
||||
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 formData = common_vendor.reactive({
|
||||
id: "",
|
||||
hazardId: "",
|
||||
hazardTitle: "",
|
||||
// 隐患标题
|
||||
hazardCreatedAt: "",
|
||||
// 隐患日期
|
||||
responsibleDeptName: "",
|
||||
// 隐患治理责任单位
|
||||
responsiblePerson: "",
|
||||
// 主要负责人
|
||||
createdAt: "",
|
||||
// 创建时间
|
||||
statusName: ""
|
||||
// 状态
|
||||
});
|
||||
const fetchDetail = async (id) => {
|
||||
common_vendor.index.__f__("log", "at pages/closeout/editor.vue:56", "=== fetchDetail 被调用 ===, id:", id);
|
||||
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", "状态为已审核,不可编辑");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/closeout/editor.vue:93", "获取详情失败:", error);
|
||||
}
|
||||
};
|
||||
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);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => formData.hazardTitle = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardTitle
|
||||
}),
|
||||
c: common_vendor.o(($event) => formData.hazardCreatedAt = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.hazardCreatedAt
|
||||
}),
|
||||
e: common_vendor.o(($event) => formData.responsibleDeptName = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsibleDeptName
|
||||
}),
|
||||
g: common_vendor.o(($event) => formData.responsiblePerson = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入",
|
||||
disabled: !canEdit.value,
|
||||
modelValue: formData.responsiblePerson
|
||||
}),
|
||||
i: common_vendor.o(($event) => formData.createdAt = $event),
|
||||
j: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.createdAt
|
||||
}),
|
||||
k: common_vendor.o(($event) => formData.statusName = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "",
|
||||
disabled: true,
|
||||
modelValue: formData.statusName
|
||||
}),
|
||||
m: common_vendor.o(handleCancel),
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bbd4165b"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/closeout/editor.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/pages/closeout/editor.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pages/closeout/editor.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "销号详情",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxml
vendored
Normal file
@@ -0,0 +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>
|
||||
30
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxss
vendored
Normal file
30
unpackage/dist/dev/mp-weixin/pages/closeout/editor.wxss
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-bbd4165b {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
530
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.js
vendored
Normal file
530
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.js
vendored
Normal file
@@ -0,0 +1,530 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
|
||||
const _easycom_u_datetime_picker2 = common_vendor.resolveComponent("u-datetime-picker");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_upload2 + _easycom_up_modal2 + _easycom_u_datetime_picker2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
const _easycom_up_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
|
||||
const _easycom_u_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_upload + _easycom_up_modal + _easycom_u_datetime_picker + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "corporateInformation",
|
||||
setup(__props) {
|
||||
const enterpriseInfo = common_vendor.ref({});
|
||||
const hasEnterpriseInfo = common_vendor.computed(() => {
|
||||
return enterpriseInfo.value && enterpriseInfo.value.name;
|
||||
});
|
||||
const showPopup = common_vendor.ref(false);
|
||||
const isEdit = common_vendor.ref(false);
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const establishDateValue = common_vendor.ref(Date.now());
|
||||
const enterpriseTypeList = common_vendor.ref([]);
|
||||
const industryList = common_vendor.ref([]);
|
||||
const showEnterpriseTypePopup = common_vendor.ref(false);
|
||||
const showIndustryPopup = common_vendor.ref(false);
|
||||
const tempEnterpriseTypeId = common_vendor.ref("");
|
||||
const tempIndustryId = common_vendor.ref("");
|
||||
const selectedEnterpriseTypeName = common_vendor.ref("");
|
||||
const selectedIndustryName = common_vendor.ref("");
|
||||
const formData = common_vendor.reactive({
|
||||
deptId: "",
|
||||
enterpriseTypeId: "",
|
||||
industryId: "",
|
||||
name: "",
|
||||
creditCode: "",
|
||||
registeredCapital: "",
|
||||
establishDate: "",
|
||||
employeeCount: "",
|
||||
mainBusiness: "",
|
||||
mainProducts: "",
|
||||
annualOutput: "",
|
||||
province: "",
|
||||
city: "",
|
||||
address: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
legalPerson: "",
|
||||
legalPersonPhone: "",
|
||||
safetyManager: "",
|
||||
safetyManagerPhone: "",
|
||||
certificates: ""
|
||||
});
|
||||
const certificateFiles = common_vendor.ref([]);
|
||||
const getDeptId = () => {
|
||||
try {
|
||||
const userInfoStr = common_vendor.index.getStorageSync("userInfo");
|
||||
if (userInfoStr) {
|
||||
const userInfo = JSON.parse(userInfoStr);
|
||||
return userInfo.deptId || "";
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:365", "获取用户信息失败:", error);
|
||||
}
|
||||
return "";
|
||||
};
|
||||
const fetchEnterpriseInfo = async () => {
|
||||
try {
|
||||
const res = await request_api.getEnterpriseinfo();
|
||||
if (res.code === 0 && res.data) {
|
||||
enterpriseInfo.value = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/corporateInformation/corporateInformation.vue:376", "企业信息:", res.data);
|
||||
} else {
|
||||
enterpriseInfo.value = {};
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:381", "获取企业信息失败:", error);
|
||||
enterpriseInfo.value = {};
|
||||
}
|
||||
};
|
||||
const fetchEnterpriseTypes = async () => {
|
||||
try {
|
||||
const res = await request_api.getEnterprisetype();
|
||||
if (res.code === 0 && res.data) {
|
||||
enterpriseTypeList.value = res.data.map((item) => ({
|
||||
id: String(item.id),
|
||||
name: item.name
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:397", "获取企业类型失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchIndustryTypes = async () => {
|
||||
try {
|
||||
const res = await request_api.getindustry({});
|
||||
if (res.code === 0 && res.data) {
|
||||
industryList.value = res.data.map((item) => ({
|
||||
id: String(item.id),
|
||||
name: item.name
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:412", "获取行业类型失败:", error);
|
||||
}
|
||||
};
|
||||
const openEnterpriseTypePopup = () => {
|
||||
tempEnterpriseTypeId.value = formData.enterpriseTypeId;
|
||||
showEnterpriseTypePopup.value = true;
|
||||
};
|
||||
const confirmEnterpriseType = () => {
|
||||
if (tempEnterpriseTypeId.value) {
|
||||
formData.enterpriseTypeId = tempEnterpriseTypeId.value;
|
||||
const selected = enterpriseTypeList.value.find((item) => item.id === tempEnterpriseTypeId.value);
|
||||
selectedEnterpriseTypeName.value = selected ? selected.name : "";
|
||||
}
|
||||
showEnterpriseTypePopup.value = false;
|
||||
};
|
||||
const openIndustryPopup = () => {
|
||||
tempIndustryId.value = formData.industryId;
|
||||
showIndustryPopup.value = true;
|
||||
};
|
||||
const confirmIndustry = () => {
|
||||
if (tempIndustryId.value) {
|
||||
formData.industryId = tempIndustryId.value;
|
||||
const selected = industryList.value.find((item) => item.id === tempIndustryId.value);
|
||||
selectedIndustryName.value = selected ? selected.name : "";
|
||||
}
|
||||
showIndustryPopup.value = false;
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
const date = new Date(e.value);
|
||||
formData.establishDate = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
||||
showDatePicker.value = false;
|
||||
};
|
||||
const resetForm = () => {
|
||||
formData.deptId = getDeptId();
|
||||
formData.enterpriseTypeId = "";
|
||||
formData.industryId = "";
|
||||
formData.name = "";
|
||||
formData.creditCode = "";
|
||||
formData.registeredCapital = "";
|
||||
formData.establishDate = "";
|
||||
formData.employeeCount = "";
|
||||
formData.mainBusiness = "";
|
||||
formData.mainProducts = "";
|
||||
formData.annualOutput = "";
|
||||
formData.province = "";
|
||||
formData.city = "";
|
||||
formData.address = "";
|
||||
formData.phone = "";
|
||||
formData.email = "";
|
||||
formData.legalPerson = "";
|
||||
formData.legalPersonPhone = "";
|
||||
formData.safetyManager = "";
|
||||
formData.safetyManagerPhone = "";
|
||||
formData.certificates = "";
|
||||
certificateFiles.value = [];
|
||||
selectedEnterpriseTypeName.value = "";
|
||||
selectedIndustryName.value = "";
|
||||
};
|
||||
const openAddPopup = () => {
|
||||
isEdit.value = false;
|
||||
resetForm();
|
||||
showPopup.value = true;
|
||||
};
|
||||
const openEditPopup = () => {
|
||||
isEdit.value = true;
|
||||
formData.deptId = enterpriseInfo.value.deptId || getDeptId();
|
||||
formData.enterpriseTypeId = String(enterpriseInfo.value.enterpriseTypeId || "");
|
||||
formData.industryId = String(enterpriseInfo.value.industryId || "");
|
||||
formData.name = enterpriseInfo.value.name || "";
|
||||
formData.creditCode = enterpriseInfo.value.creditCode || "";
|
||||
formData.registeredCapital = enterpriseInfo.value.registeredCapital || "";
|
||||
formData.establishDate = enterpriseInfo.value.establishDate || "";
|
||||
formData.employeeCount = enterpriseInfo.value.employeeCount || "";
|
||||
formData.mainBusiness = enterpriseInfo.value.mainBusiness || "";
|
||||
formData.mainProducts = enterpriseInfo.value.mainProducts || "";
|
||||
formData.annualOutput = enterpriseInfo.value.annualOutput || "";
|
||||
formData.province = enterpriseInfo.value.province || "";
|
||||
formData.city = enterpriseInfo.value.city || "";
|
||||
formData.address = enterpriseInfo.value.address || "";
|
||||
formData.phone = enterpriseInfo.value.phone || "";
|
||||
formData.email = enterpriseInfo.value.email || "";
|
||||
formData.legalPerson = enterpriseInfo.value.legalPerson || "";
|
||||
formData.legalPersonPhone = enterpriseInfo.value.legalPersonPhone || "";
|
||||
formData.safetyManager = enterpriseInfo.value.safetyManager || "";
|
||||
formData.safetyManagerPhone = enterpriseInfo.value.safetyManagerPhone || "";
|
||||
selectedEnterpriseTypeName.value = enterpriseInfo.value.enterpriseTypeName || "";
|
||||
selectedIndustryName.value = enterpriseInfo.value.industryName || "";
|
||||
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"
|
||||
}));
|
||||
} catch (e) {
|
||||
certificateFiles.value = [];
|
||||
}
|
||||
} else {
|
||||
certificateFiles.value = [];
|
||||
}
|
||||
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 handleSubmit = async () => {
|
||||
if (!formData.name) {
|
||||
common_vendor.index.showToast({ title: "请输入企业名称", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.enterpriseTypeId) {
|
||||
common_vendor.index.showToast({ title: "请选择企业类型", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.industryId) {
|
||||
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 params = {
|
||||
deptId: Number(formData.deptId) || Number(getDeptId()),
|
||||
enterpriseTypeId: Number(formData.enterpriseTypeId),
|
||||
industryId: Number(formData.industryId),
|
||||
name: formData.name,
|
||||
creditCode: formData.creditCode || "",
|
||||
registeredCapital: Number(formData.registeredCapital) || 0,
|
||||
establishDate: formData.establishDate || "",
|
||||
employeeCount: Number(formData.employeeCount) || 0,
|
||||
mainBusiness: formData.mainBusiness || "",
|
||||
mainProducts: formData.mainProducts || "",
|
||||
annualOutput: Number(formData.annualOutput) || 0,
|
||||
province: formData.province || "",
|
||||
city: formData.city || "",
|
||||
address: formData.address || "",
|
||||
phone: formData.phone || "",
|
||||
email: formData.email || "",
|
||||
legalPerson: formData.legalPerson || "",
|
||||
legalPersonPhone: formData.legalPersonPhone || "",
|
||||
safetyManager: formData.safetyManager || "",
|
||||
safetyManagerPhone: formData.safetyManagerPhone || "",
|
||||
certificates: JSON.stringify(certificates)
|
||||
};
|
||||
if (isEdit.value && enterpriseInfo.value.id) {
|
||||
params.id = enterpriseInfo.value.id;
|
||||
}
|
||||
try {
|
||||
let res;
|
||||
if (isEdit.value) {
|
||||
res = await request_api.updateEnterprise(params);
|
||||
} else {
|
||||
res = await request_api.addEnterprise(params);
|
||||
}
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: isEdit.value ? "修改成功" : "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
showPopup.value = false;
|
||||
fetchEnterpriseInfo();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "操作失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/corporateInformation/corporateInformation.vue:667", "提交失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
fetchEnterpriseInfo();
|
||||
fetchEnterpriseTypes();
|
||||
fetchIndustryTypes();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: hasEnterpriseInfo.value
|
||||
}, hasEnterpriseInfo.value ? common_vendor.e({
|
||||
b: common_vendor.t(enterpriseInfo.value.name),
|
||||
c: common_vendor.o(openEditPopup),
|
||||
d: enterpriseInfo.value.enterpriseTypeName
|
||||
}, enterpriseInfo.value.enterpriseTypeName ? {
|
||||
e: common_vendor.t(enterpriseInfo.value.enterpriseTypeName)
|
||||
} : {}, {
|
||||
f: enterpriseInfo.value.industryName
|
||||
}, enterpriseInfo.value.industryName ? {
|
||||
g: common_vendor.t(enterpriseInfo.value.industryName)
|
||||
} : {}, {
|
||||
h: enterpriseInfo.value.creditCode
|
||||
}, enterpriseInfo.value.creditCode ? {
|
||||
i: common_vendor.t(enterpriseInfo.value.creditCode)
|
||||
} : {}, {
|
||||
j: enterpriseInfo.value.registeredCapital
|
||||
}, enterpriseInfo.value.registeredCapital ? {
|
||||
k: common_vendor.t(enterpriseInfo.value.registeredCapital)
|
||||
} : {}, {
|
||||
l: enterpriseInfo.value.establishDate
|
||||
}, enterpriseInfo.value.establishDate ? {
|
||||
m: common_vendor.t(enterpriseInfo.value.establishDate)
|
||||
} : {}, {
|
||||
n: enterpriseInfo.value.employeeCount
|
||||
}, enterpriseInfo.value.employeeCount ? {
|
||||
o: common_vendor.t(enterpriseInfo.value.employeeCount)
|
||||
} : {}, {
|
||||
p: enterpriseInfo.value.mainBusiness
|
||||
}, enterpriseInfo.value.mainBusiness ? {
|
||||
q: common_vendor.t(enterpriseInfo.value.mainBusiness)
|
||||
} : {}, {
|
||||
r: enterpriseInfo.value.mainProducts
|
||||
}, enterpriseInfo.value.mainProducts ? {
|
||||
s: common_vendor.t(enterpriseInfo.value.mainProducts)
|
||||
} : {}, {
|
||||
t: enterpriseInfo.value.annualOutput
|
||||
}, enterpriseInfo.value.annualOutput ? {
|
||||
v: common_vendor.t(enterpriseInfo.value.annualOutput)
|
||||
} : {}, {
|
||||
w: enterpriseInfo.value.province || enterpriseInfo.value.city
|
||||
}, enterpriseInfo.value.province || enterpriseInfo.value.city ? {
|
||||
x: common_vendor.t(enterpriseInfo.value.province),
|
||||
y: common_vendor.t(enterpriseInfo.value.city)
|
||||
} : {}, {
|
||||
z: enterpriseInfo.value.address
|
||||
}, enterpriseInfo.value.address ? {
|
||||
A: common_vendor.t(enterpriseInfo.value.address)
|
||||
} : {}, {
|
||||
B: enterpriseInfo.value.phone
|
||||
}, enterpriseInfo.value.phone ? {
|
||||
C: common_vendor.t(enterpriseInfo.value.phone)
|
||||
} : {}, {
|
||||
D: enterpriseInfo.value.email
|
||||
}, enterpriseInfo.value.email ? {
|
||||
E: common_vendor.t(enterpriseInfo.value.email)
|
||||
} : {}, {
|
||||
F: enterpriseInfo.value.legalPerson
|
||||
}, enterpriseInfo.value.legalPerson ? {
|
||||
G: common_vendor.t(enterpriseInfo.value.legalPerson)
|
||||
} : {}, {
|
||||
H: enterpriseInfo.value.legalPersonPhone
|
||||
}, enterpriseInfo.value.legalPersonPhone ? {
|
||||
I: common_vendor.t(enterpriseInfo.value.legalPersonPhone)
|
||||
} : {}, {
|
||||
J: enterpriseInfo.value.safetyManager
|
||||
}, enterpriseInfo.value.safetyManager ? {
|
||||
K: common_vendor.t(enterpriseInfo.value.safetyManager)
|
||||
} : {}, {
|
||||
L: enterpriseInfo.value.safetyManagerPhone
|
||||
}, enterpriseInfo.value.safetyManagerPhone ? {
|
||||
M: common_vendor.t(enterpriseInfo.value.safetyManagerPhone)
|
||||
} : {}) : {
|
||||
N: common_vendor.o(openAddPopup)
|
||||
}, {
|
||||
O: formData.name,
|
||||
P: common_vendor.o(($event) => formData.name = $event.detail.value),
|
||||
Q: common_vendor.t(selectedEnterpriseTypeName.value || "请选择企业类型"),
|
||||
R: !selectedEnterpriseTypeName.value ? 1 : "",
|
||||
S: common_vendor.o(openEnterpriseTypePopup),
|
||||
T: common_vendor.t(selectedIndustryName.value || "请选择行业类型"),
|
||||
U: !selectedIndustryName.value ? 1 : "",
|
||||
V: common_vendor.o(openIndustryPopup),
|
||||
W: formData.creditCode,
|
||||
X: common_vendor.o(($event) => formData.creditCode = $event.detail.value),
|
||||
Y: formData.registeredCapital,
|
||||
Z: common_vendor.o(($event) => formData.registeredCapital = $event.detail.value),
|
||||
aa: common_vendor.t(formData.establishDate || "请选择成立时间"),
|
||||
ab: !formData.establishDate ? 1 : "",
|
||||
ac: common_vendor.o(($event) => showDatePicker.value = true),
|
||||
ad: formData.employeeCount,
|
||||
ae: common_vendor.o(($event) => formData.employeeCount = $event.detail.value),
|
||||
af: formData.mainBusiness,
|
||||
ag: common_vendor.o(($event) => formData.mainBusiness = $event.detail.value),
|
||||
ah: formData.mainProducts,
|
||||
ai: common_vendor.o(($event) => formData.mainProducts = $event.detail.value),
|
||||
aj: formData.annualOutput,
|
||||
ak: common_vendor.o(($event) => formData.annualOutput = $event.detail.value),
|
||||
al: formData.province,
|
||||
am: common_vendor.o(($event) => formData.province = $event.detail.value),
|
||||
an: formData.city,
|
||||
ao: common_vendor.o(($event) => formData.city = $event.detail.value),
|
||||
ap: formData.address,
|
||||
aq: common_vendor.o(($event) => formData.address = $event.detail.value),
|
||||
ar: formData.phone,
|
||||
as: common_vendor.o(($event) => formData.phone = $event.detail.value),
|
||||
at: formData.email,
|
||||
av: common_vendor.o(($event) => formData.email = $event.detail.value),
|
||||
aw: formData.legalPerson,
|
||||
ax: common_vendor.o(($event) => formData.legalPerson = $event.detail.value),
|
||||
ay: formData.legalPersonPhone,
|
||||
az: common_vendor.o(($event) => formData.legalPersonPhone = $event.detail.value),
|
||||
aA: formData.safetyManager,
|
||||
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),
|
||||
aG: common_vendor.p({
|
||||
fileList: certificateFiles.value,
|
||||
name: "certificate",
|
||||
multiple: true,
|
||||
maxCount: 10,
|
||||
accept: "all"
|
||||
}),
|
||||
aH: common_vendor.o(handleSubmit),
|
||||
aI: common_vendor.o(($event) => showPopup.value = false),
|
||||
aJ: common_vendor.o(($event) => showPopup.value = false),
|
||||
aK: common_vendor.p({
|
||||
show: showPopup.value,
|
||||
title: isEdit.value ? "编辑企业信息" : "新增企业信息",
|
||||
showConfirmButton: true,
|
||||
showCancelButton: true,
|
||||
confirmText: "确定",
|
||||
cancelText: "取消",
|
||||
closeOnClickOverlay: false
|
||||
}),
|
||||
aL: common_vendor.o(onDateConfirm),
|
||||
aM: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
aN: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
aO: common_vendor.o(($event) => establishDateValue.value = $event),
|
||||
aP: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "date",
|
||||
modelValue: establishDateValue.value
|
||||
}),
|
||||
aQ: common_vendor.o(($event) => showEnterpriseTypePopup.value = false),
|
||||
aR: common_vendor.o(confirmEnterpriseType),
|
||||
aS: common_vendor.f(enterpriseTypeList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.name),
|
||||
b: tempEnterpriseTypeId.value === item.id
|
||||
}, tempEnterpriseTypeId.value === item.id ? {} : {}, {
|
||||
c: item.id,
|
||||
d: tempEnterpriseTypeId.value === item.id ? 1 : "",
|
||||
e: common_vendor.o(($event) => tempEnterpriseTypeId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
aT: common_vendor.o(($event) => showEnterpriseTypePopup.value = false),
|
||||
aU: common_vendor.p({
|
||||
show: showEnterpriseTypePopup.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
aV: common_vendor.o(($event) => showIndustryPopup.value = false),
|
||||
aW: common_vendor.o(confirmIndustry),
|
||||
aX: common_vendor.f(industryList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.name),
|
||||
b: tempIndustryId.value === item.id
|
||||
}, tempIndustryId.value === item.id ? {} : {}, {
|
||||
c: item.id,
|
||||
d: tempIndustryId.value === item.id ? 1 : "",
|
||||
e: common_vendor.o(($event) => tempIndustryId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
aY: common_vendor.o(($event) => showIndustryPopup.value = false),
|
||||
aZ: common_vendor.p({
|
||||
show: showIndustryPopup.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
ba: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0d880083"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/corporateInformation/corporateInformation.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "企业信息",
|
||||
"usingComponents": {
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
||||
"up-modal": "../../uni_modules/uview-plus/components/u-modal/u-modal",
|
||||
"u-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
142
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.wxss
vendored
Normal file
142
unpackage/dist/dev/mp-weixin/pages/corporateInformation/corporateInformation.wxss
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-0d880083 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.list.data-v-0d880083 {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
||||
border-left: 5px solid #2667E9;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.info-item.data-v-0d880083 {
|
||||
display: flex;
|
||||
margin-top: 16rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.info-item .text-gray.data-v-0d880083 {
|
||||
flex-shrink: 0;
|
||||
color: #999;
|
||||
}
|
||||
.empty-box.data-v-0d880083 {
|
||||
padding: 100rpx 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.modal-scroll-body.data-v-0d880083 {
|
||||
height: 60vh;
|
||||
padding: 20rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-input.data-v-0d880083 {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 24rpx;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
}
|
||||
.form-textarea.data-v-0d880083 {
|
||||
width: 100%;
|
||||
min-height: 160rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
}
|
||||
.form-label.data-v-0d880083 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.form-label .text-red.data-v-0d880083 {
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
.select-trigger.data-v-0d880083 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.select-trigger .select-value.data-v-0d880083 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger .select-value.placeholder.data-v-0d880083 {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
.picker-popup.data-v-0d880083 {
|
||||
background: #fff;
|
||||
}
|
||||
.picker-popup .picker-header.data-v-0d880083 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.picker-popup .picker-header .picker-cancel.data-v-0d880083 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.picker-popup .picker-header .picker-title.data-v-0d880083 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-header .picker-confirm.data-v-0d880083 {
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.picker-popup .picker-body.data-v-0d880083 {
|
||||
max-height: 600rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-0d880083 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-0d880083:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.picker-popup .picker-item.active.data-v-0d880083 {
|
||||
color: #2667E9;
|
||||
}
|
||||
818
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.js
vendored
Normal file
818
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.js
vendored
Normal file
@@ -0,0 +1,818 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_input2 + _easycom_up_picker2 + _easycom_up_textarea2 + _easycom_up_datetime_picker2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_picker + _easycom_up_textarea + _easycom_up_datetime_picker + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "editchecklist",
|
||||
setup(__props) {
|
||||
const formData = common_vendor.reactive({
|
||||
name: "",
|
||||
deptId: "",
|
||||
deptName: "",
|
||||
remark: "",
|
||||
type: "",
|
||||
// 检查表类型:1-日常检查,2-专项检查,3-设备检查
|
||||
typeName: "",
|
||||
modeId: "",
|
||||
modeName: "",
|
||||
selectDeptId: "",
|
||||
selectDeptName: "",
|
||||
executorIds: [],
|
||||
// 执行人员ID数组
|
||||
executorNames: "",
|
||||
// 执行人员名称(显示用)
|
||||
cycleId: "",
|
||||
cycleName: "",
|
||||
startDate: "",
|
||||
endDate: ""
|
||||
});
|
||||
const workdaySwitch = common_vendor.ref(false);
|
||||
const onSwitchChange = (e) => {
|
||||
workdaySwitch.value = e.detail.value;
|
||||
};
|
||||
const startDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
|
||||
const endDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
|
||||
const showDeptPicker = common_vendor.ref(false);
|
||||
const showTypePicker = common_vendor.ref(false);
|
||||
const showModePicker = common_vendor.ref(false);
|
||||
common_vendor.ref(false);
|
||||
const showCyclePicker = common_vendor.ref(false);
|
||||
const showStartDatePicker = common_vendor.ref(false);
|
||||
const showEndDatePicker = common_vendor.ref(false);
|
||||
common_vendor.ref([["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云大数据科技有限公司", "湘西网络有限公司"]]);
|
||||
const typeColumns = common_vendor.ref([["日常检查", "专项检查", "设备检查"]]);
|
||||
const modeColumns = common_vendor.ref([["全员", "指定人员"]]);
|
||||
const cycleColumns = common_vendor.ref([["每天一次", "每周一次", "每月一次", "每季度一次"]]);
|
||||
const showExecutorPopup = common_vendor.ref(false);
|
||||
const executorList = common_vendor.ref([]);
|
||||
const selectedExecutorIds = common_vendor.ref([]);
|
||||
const deptTree = common_vendor.ref([]);
|
||||
const deptCascaderColumns = common_vendor.ref([]);
|
||||
const deptCascaderIndexs = common_vendor.ref([0]);
|
||||
const selectedDeptPath = common_vendor.ref([]);
|
||||
const onDeptConfirm = (e) => {
|
||||
const lastSelected = selectedDeptPath.value[selectedDeptPath.value.length - 1];
|
||||
if (lastSelected) {
|
||||
formData.deptId = lastSelected.deptId;
|
||||
formData.deptName = selectedDeptPath.value.map((d) => d.deptName).join(" / ");
|
||||
}
|
||||
showDeptPicker.value = false;
|
||||
};
|
||||
const typeMap = {
|
||||
"日常检查": 1,
|
||||
"专项检查": 2,
|
||||
"设备检查": 3
|
||||
};
|
||||
const onTypeConfirm = (e) => {
|
||||
if (e.value && e.value.length > 0) {
|
||||
formData.typeName = e.value[0];
|
||||
formData.type = typeMap[e.value[0]];
|
||||
}
|
||||
showTypePicker.value = false;
|
||||
};
|
||||
const onModeConfirm = (e) => {
|
||||
if (e.value && e.value.length > 0) {
|
||||
formData.modeName = e.value[0];
|
||||
if (e.value[0] === "全员") {
|
||||
formData.executorIds = [];
|
||||
formData.executorNames = "";
|
||||
selectedExecutorIds.value = [];
|
||||
}
|
||||
}
|
||||
showModePicker.value = false;
|
||||
};
|
||||
const fetchDeptUsers = async () => {
|
||||
try {
|
||||
const res = await request_api.getDeptUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
executorList.value = res.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:496", "获取部门用户失败:", error);
|
||||
}
|
||||
};
|
||||
const toggleExecutorSelect = (item) => {
|
||||
const index = selectedExecutorIds.value.indexOf(item.userId);
|
||||
if (index > -1) {
|
||||
selectedExecutorIds.value.splice(index, 1);
|
||||
} else {
|
||||
selectedExecutorIds.value.push(item.userId);
|
||||
}
|
||||
};
|
||||
const confirmExecutorSelect = () => {
|
||||
formData.executorIds = [...selectedExecutorIds.value];
|
||||
const selectedUsers = executorList.value.filter((u) => selectedExecutorIds.value.includes(u.userId));
|
||||
formData.executorNames = selectedUsers.map((u) => u.nickName).join("、");
|
||||
showExecutorPopup.value = false;
|
||||
};
|
||||
const openExecutorPopup = () => {
|
||||
selectedExecutorIds.value = [...formData.executorIds];
|
||||
showExecutorPopup.value = true;
|
||||
};
|
||||
const fetchParentDepts = async () => {
|
||||
try {
|
||||
const res = await request_api.getParentDepts();
|
||||
if (res.code === 0 && res.data) {
|
||||
deptTree.value = res.data;
|
||||
initDeptCascader(res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:534", "获取部门树失败:", error);
|
||||
}
|
||||
};
|
||||
const initDeptCascader = (data) => {
|
||||
if (!data)
|
||||
return;
|
||||
const firstColumn = buildDeptColumn(data);
|
||||
deptCascaderColumns.value = [firstColumn];
|
||||
deptCascaderIndexs.value = [0];
|
||||
selectedDeptPath.value = [data];
|
||||
if (data.children && data.children.length > 0) {
|
||||
const secondColumn = data.children.map((item) => ({ text: item.deptName, ...item }));
|
||||
deptCascaderColumns.value.push(secondColumn);
|
||||
deptCascaderIndexs.value.push(0);
|
||||
selectedDeptPath.value.push(data.children[0]);
|
||||
if (data.children[0].children && data.children[0].children.length > 0) {
|
||||
const thirdColumn = data.children[0].children.map((item) => ({ text: item.deptName, ...item }));
|
||||
deptCascaderColumns.value.push(thirdColumn);
|
||||
deptCascaderIndexs.value.push(0);
|
||||
selectedDeptPath.value.push(data.children[0].children[0]);
|
||||
}
|
||||
}
|
||||
};
|
||||
const buildDeptColumn = (data) => {
|
||||
return [{ text: data.deptName, ...data }];
|
||||
};
|
||||
const onDeptCascaderChange = (e) => {
|
||||
const { columnIndex, index, value } = e;
|
||||
deptCascaderIndexs.value[columnIndex] = index;
|
||||
selectedDeptPath.value[columnIndex] = value;
|
||||
deptCascaderColumns.value = deptCascaderColumns.value.slice(0, columnIndex + 1);
|
||||
deptCascaderIndexs.value = deptCascaderIndexs.value.slice(0, columnIndex + 1);
|
||||
selectedDeptPath.value = selectedDeptPath.value.slice(0, columnIndex + 1);
|
||||
if (value.children && value.children.length > 0) {
|
||||
const nextColumn = value.children.map((item) => ({ text: item.deptName, ...item }));
|
||||
deptCascaderColumns.value.push(nextColumn);
|
||||
deptCascaderIndexs.value.push(0);
|
||||
selectedDeptPath.value.push(value.children[0]);
|
||||
if (value.children[0].children && value.children[0].children.length > 0) {
|
||||
const thirdColumn = value.children[0].children.map((item) => ({ text: item.deptName, ...item }));
|
||||
deptCascaderColumns.value.push(thirdColumn);
|
||||
deptCascaderIndexs.value.push(0);
|
||||
selectedDeptPath.value.push(value.children[0].children[0]);
|
||||
}
|
||||
}
|
||||
};
|
||||
const onCycleConfirm = (e) => {
|
||||
if (e.value && e.value.length > 0) {
|
||||
formData.cycleName = e.value[0];
|
||||
}
|
||||
showCyclePicker.value = false;
|
||||
};
|
||||
const formatDateTime = (timestamp) => {
|
||||
const date = new Date(timestamp);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
};
|
||||
const onStartDateConfirm = (e) => {
|
||||
formData.startDate = formatDateTime(e.value);
|
||||
showStartDatePicker.value = false;
|
||||
};
|
||||
const onEndDateConfirm = (e) => {
|
||||
formData.endDate = formatDateTime(e.value);
|
||||
showEndDatePicker.value = false;
|
||||
};
|
||||
const manualCheckItems = common_vendor.ref([]);
|
||||
const checkItems = common_vendor.ref([]);
|
||||
const checkItemCount = common_vendor.computed(() => {
|
||||
const libraryCount = checkItems.value.reduce((sum, item) => sum + item.count, 0);
|
||||
return manualCheckItems.value.length + libraryCount;
|
||||
});
|
||||
const deleteManualCheckItem = (item, index) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该检查项吗?",
|
||||
confirmColor: "#F56C6C",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
if (item.id) {
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "删除中..." });
|
||||
const result = await request_api.deleteCheckPoint({ id: item.id });
|
||||
common_vendor.index.hideLoading();
|
||||
if (result.code === 0) {
|
||||
manualCheckItems.value.splice(index, 1);
|
||||
common_vendor.index.showToast({ title: "删除成功", icon: "success" });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: result.msg || "删除失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:669", "删除检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
||||
}
|
||||
} else {
|
||||
manualCheckItems.value.splice(index, 1);
|
||||
common_vendor.index.showToast({ title: "删除成功", icon: "success" });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const deleteCheckItem = (index) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该检查项吗?",
|
||||
confirmColor: "#F56C6C",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
checkItems.value.splice(index, 1);
|
||||
common_vendor.index.showToast({ title: "删除成功", icon: "success" });
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const checkForm = common_vendor.reactive({
|
||||
name: "",
|
||||
// 检查名称
|
||||
point: "",
|
||||
// 检查内容
|
||||
regulationId: null,
|
||||
// 参考法规ID
|
||||
regulationName: ""
|
||||
// 参考法规名称(显示用)
|
||||
});
|
||||
const showLawPopup = common_vendor.ref(false);
|
||||
const lawKeyword = common_vendor.ref("");
|
||||
const selectedLawId = common_vendor.ref(null);
|
||||
const selectedLawName = common_vendor.ref("");
|
||||
const lawList = common_vendor.ref([]);
|
||||
const lawLoading = common_vendor.ref(false);
|
||||
const lawPageNum = common_vendor.ref(1);
|
||||
const lawPageSize = common_vendor.ref(10);
|
||||
const hasMoreLaw = common_vendor.ref(true);
|
||||
const openLawPopup = () => {
|
||||
showLawPopup.value = true;
|
||||
if (lawList.value.length === 0) {
|
||||
fetchRegulationList();
|
||||
}
|
||||
};
|
||||
const fetchRegulationList = async (isLoadMore = false) => {
|
||||
if (lawLoading.value)
|
||||
return;
|
||||
lawLoading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: lawPageNum.value,
|
||||
pageSize: lawPageSize.value,
|
||||
status: 1
|
||||
// 启用状态
|
||||
};
|
||||
if (lawKeyword.value && lawKeyword.value.trim()) {
|
||||
params.keyword = lawKeyword.value.trim();
|
||||
}
|
||||
const res = await request_api.getRegulationList(params);
|
||||
if (res.code === 0) {
|
||||
const records = res.data.records || res.data || [];
|
||||
if (isLoadMore) {
|
||||
lawList.value = [...lawList.value, ...records];
|
||||
} else {
|
||||
lawList.value = records;
|
||||
}
|
||||
const total = res.data.total || 0;
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:756", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
};
|
||||
const searchRegulation = () => {
|
||||
lawPageNum.value = 1;
|
||||
lawList.value = [];
|
||||
hasMoreLaw.value = true;
|
||||
fetchRegulationList();
|
||||
};
|
||||
const loadMoreLaw = () => {
|
||||
if (!hasMoreLaw.value || lawLoading.value)
|
||||
return;
|
||||
lawPageNum.value++;
|
||||
fetchRegulationList(true);
|
||||
};
|
||||
const selectLaw = (item) => {
|
||||
selectedLawId.value = item.id;
|
||||
selectedLawName.value = item.depict || item.keyword || "";
|
||||
};
|
||||
const confirmLaw = () => {
|
||||
if (selectedLawId.value) {
|
||||
checkForm.regulationId = selectedLawId.value;
|
||||
checkForm.regulationName = selectedLawName.value;
|
||||
}
|
||||
showLawPopup.value = false;
|
||||
};
|
||||
const handleAddCheck = async () => {
|
||||
var _a;
|
||||
if (!checkForm.name) {
|
||||
common_vendor.index.showToast({ title: "请输入检查名称", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!checkForm.point) {
|
||||
common_vendor.index.showToast({ title: "请输入检查内容", icon: "none" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "添加中..." });
|
||||
const params = {
|
||||
name: checkForm.name,
|
||||
point: checkForm.point,
|
||||
regulationId: checkForm.regulationId || void 0
|
||||
};
|
||||
const res = await request_api.addCheckPoint(params);
|
||||
if (res.code === 0) {
|
||||
const checkPointId = ((_a = res.data) == null ? void 0 : _a.id) || res.data;
|
||||
if (checkPointId) {
|
||||
const detailRes = await request_api.detailcheckPoint(checkPointId);
|
||||
if (detailRes.code === 0 && detailRes.data) {
|
||||
manualCheckItems.value.push({
|
||||
id: detailRes.data.id,
|
||||
name: detailRes.data.name,
|
||||
point: detailRes.data.point,
|
||||
regulationId: detailRes.data.regulationId,
|
||||
regulationName: detailRes.data.regulationName || checkForm.regulationName
|
||||
});
|
||||
}
|
||||
} else {
|
||||
manualCheckItems.value.push({
|
||||
name: checkForm.name,
|
||||
point: checkForm.point,
|
||||
regulationId: checkForm.regulationId,
|
||||
regulationName: checkForm.regulationName
|
||||
});
|
||||
}
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
|
||||
showAddPopup.value = false;
|
||||
checkForm.name = "";
|
||||
checkForm.point = "";
|
||||
checkForm.regulationId = null;
|
||||
checkForm.regulationName = "";
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({ title: res.msg || "添加失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:856", "添加检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const showLibraryPopup = common_vendor.ref(false);
|
||||
const libraryKeyword = common_vendor.ref("");
|
||||
const selectedLibraries = common_vendor.ref([]);
|
||||
const libraryList = common_vendor.ref([]);
|
||||
const libraryLoading = common_vendor.ref(false);
|
||||
const libraryPageNum = common_vendor.ref(1);
|
||||
const libraryPageSize = common_vendor.ref(10);
|
||||
const hasMoreLibrary = common_vendor.ref(true);
|
||||
const openLibraryPopup = () => {
|
||||
showLibraryPopup.value = true;
|
||||
libraryKeyword.value = "";
|
||||
libraryPageNum.value = 1;
|
||||
libraryList.value = [];
|
||||
hasMoreLibrary.value = true;
|
||||
selectedLibraries.value = [];
|
||||
fetchLibraryList();
|
||||
};
|
||||
const closeLibraryPopup = () => {
|
||||
showLibraryPopup.value = false;
|
||||
selectedLibraries.value = [];
|
||||
};
|
||||
const fetchLibraryList = async (isLoadMore = false) => {
|
||||
if (libraryLoading.value)
|
||||
return;
|
||||
libraryLoading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: libraryPageNum.value,
|
||||
pageSize: libraryPageSize.value
|
||||
};
|
||||
if (libraryKeyword.value && libraryKeyword.value.trim()) {
|
||||
params.name = libraryKeyword.value.trim();
|
||||
}
|
||||
const res = await request_api.getCheckItemList(params);
|
||||
if (res.code === 0) {
|
||||
const records = res.data.records || [];
|
||||
if (isLoadMore) {
|
||||
libraryList.value = [...libraryList.value, ...records];
|
||||
} else {
|
||||
libraryList.value = records;
|
||||
}
|
||||
const total = res.data.total || 0;
|
||||
hasMoreLibrary.value = libraryList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:916", "获取检查库列表失败:", error);
|
||||
} finally {
|
||||
libraryLoading.value = false;
|
||||
}
|
||||
};
|
||||
const searchLibrary = () => {
|
||||
libraryPageNum.value = 1;
|
||||
libraryList.value = [];
|
||||
hasMoreLibrary.value = true;
|
||||
fetchLibraryList();
|
||||
};
|
||||
const loadMoreLibrary = () => {
|
||||
if (!hasMoreLibrary.value || libraryLoading.value)
|
||||
return;
|
||||
libraryPageNum.value++;
|
||||
fetchLibraryList(true);
|
||||
};
|
||||
const toggleLibrarySelect = (item) => {
|
||||
const index = selectedLibraries.value.indexOf(item.id);
|
||||
if (index > -1) {
|
||||
selectedLibraries.value.splice(index, 1);
|
||||
} else {
|
||||
selectedLibraries.value.push(item.id);
|
||||
}
|
||||
};
|
||||
const addSelectedLibrary = async () => {
|
||||
if (selectedLibraries.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请选择检查库", icon: "none" });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showLoading({ title: "加载中..." });
|
||||
try {
|
||||
for (const id of selectedLibraries.value) {
|
||||
const res = await request_api.getCheckItemListDetail({ itemId: 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
|
||||
// 保存详情数据,以便后续使用
|
||||
});
|
||||
}
|
||||
}
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
|
||||
showLibraryPopup.value = false;
|
||||
selectedLibraries.value = [];
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:981", "获取检查库详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const handleSave = async () => {
|
||||
if (!formData.name) {
|
||||
common_vendor.index.showToast({ title: "请输入检查表名称", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.deptId) {
|
||||
common_vendor.index.showToast({ title: "请选择分派单位", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.type) {
|
||||
common_vendor.index.showToast({ title: "请选择检查表类型", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.modeName) {
|
||||
common_vendor.index.showToast({ title: "请选择运行模式", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (formData.modeName === "指定人员" && formData.executorIds.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.cycleName) {
|
||||
common_vendor.index.showToast({ title: "请选择周期", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!formData.startDate || !formData.endDate) {
|
||||
common_vendor.index.showToast({ title: "请选择计划时间", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const items = [];
|
||||
manualCheckItems.value.forEach((item) => {
|
||||
if (item.id) {
|
||||
items.push(item.id);
|
||||
}
|
||||
});
|
||||
checkItems.value.forEach((lib) => {
|
||||
if (lib.details && lib.details.length > 0) {
|
||||
lib.details.forEach((detail) => {
|
||||
if (detail.pointId) {
|
||||
items.push(detail.pointId);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (items.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请添加检查项", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const runModeMap = {
|
||||
"指定人员": 1,
|
||||
"全员": 2
|
||||
};
|
||||
const cycleMap = {
|
||||
"每天一次": 1,
|
||||
"每周一次": 2,
|
||||
"每月一次": 3,
|
||||
"每季度一次": 4
|
||||
};
|
||||
const itemIds = [];
|
||||
checkItems.value.forEach((lib) => {
|
||||
if (lib.itemId) {
|
||||
itemIds.push(lib.itemId);
|
||||
}
|
||||
});
|
||||
const params = {
|
||||
name: formData.name,
|
||||
deptId: formData.deptId,
|
||||
description: formData.remark || "",
|
||||
type: formData.type,
|
||||
// 检查表类型:1-日常检查,2-专项检查,3-设备检查
|
||||
runMode: runModeMap[formData.modeName] || 2,
|
||||
checkPointIds: items,
|
||||
itemIds,
|
||||
// 从检查库选择的库id数组
|
||||
cycle: cycleMap[formData.cycleName] || 1,
|
||||
isWeekend: workdaySwitch.value ? 1 : 2,
|
||||
planStartTime: formData.startDate,
|
||||
planEndTime: formData.endDate
|
||||
};
|
||||
if (formData.modeName === "指定人员" && formData.executorIds.length > 0) {
|
||||
params.executorId = formData.executorIds[0];
|
||||
}
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "保存中..." });
|
||||
const res = await request_api.addCheckTable(params);
|
||||
common_vendor.index.hideLoading();
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "保存成功", icon: "success" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "保存失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1101", "保存失败:", error);
|
||||
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
fetchDeptUsers();
|
||||
fetchParentDepts();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o(($event) => formData.name = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "请输入检查表名称",
|
||||
border: "surround",
|
||||
modelValue: formData.name
|
||||
}),
|
||||
c: common_vendor.t(formData.deptName || "请选择分派单位"),
|
||||
d: common_vendor.n(formData.deptName ? "picker-value" : "picker-placeholder"),
|
||||
e: common_vendor.o(($event) => showDeptPicker.value = true),
|
||||
f: common_vendor.o(onDeptConfirm),
|
||||
g: common_vendor.o(onDeptCascaderChange),
|
||||
h: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
i: common_vendor.o(($event) => showDeptPicker.value = false),
|
||||
j: common_vendor.p({
|
||||
show: showDeptPicker.value,
|
||||
columns: deptCascaderColumns.value,
|
||||
defaultIndex: deptCascaderIndexs.value
|
||||
}),
|
||||
k: common_vendor.o(($event) => formData.remark = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "请输入补充说明",
|
||||
modelValue: formData.remark
|
||||
}),
|
||||
m: common_vendor.t(formData.typeName || "请选择检查表类型"),
|
||||
n: common_vendor.n(formData.typeName ? "picker-value" : "picker-placeholder"),
|
||||
o: common_vendor.o(($event) => showTypePicker.value = true),
|
||||
p: common_vendor.o(onTypeConfirm),
|
||||
q: common_vendor.o(($event) => showTypePicker.value = false),
|
||||
r: common_vendor.o(($event) => showTypePicker.value = false),
|
||||
s: common_vendor.p({
|
||||
show: showTypePicker.value,
|
||||
columns: typeColumns.value
|
||||
}),
|
||||
t: common_vendor.t(formData.modeName || "请选择运行模式"),
|
||||
v: common_vendor.n(formData.modeName ? "picker-value" : "picker-placeholder"),
|
||||
w: common_vendor.o(($event) => showModePicker.value = true),
|
||||
x: common_vendor.o(onModeConfirm),
|
||||
y: common_vendor.o(($event) => showModePicker.value = false),
|
||||
z: common_vendor.o(($event) => showModePicker.value = false),
|
||||
A: common_vendor.p({
|
||||
show: showModePicker.value,
|
||||
columns: modeColumns.value
|
||||
}),
|
||||
B: formData.modeName === "指定人员"
|
||||
}, formData.modeName === "指定人员" ? {
|
||||
C: common_vendor.t(formData.executorNames || "请选择执行人员"),
|
||||
D: common_vendor.n(formData.executorNames ? "picker-value" : "picker-placeholder"),
|
||||
E: common_vendor.o(openExecutorPopup)
|
||||
} : {}, {
|
||||
F: common_vendor.t(formData.cycleName || "请选择周期"),
|
||||
G: common_vendor.n(formData.cycleName ? "picker-value" : "picker-placeholder"),
|
||||
H: common_vendor.o(($event) => showCyclePicker.value = true),
|
||||
I: common_vendor.o(onCycleConfirm),
|
||||
J: common_vendor.o(($event) => showCyclePicker.value = false),
|
||||
K: common_vendor.o(($event) => showCyclePicker.value = false),
|
||||
L: common_vendor.p({
|
||||
show: showCyclePicker.value,
|
||||
columns: cycleColumns.value
|
||||
}),
|
||||
M: workdaySwitch.value,
|
||||
N: common_vendor.o(onSwitchChange),
|
||||
O: common_vendor.t(formData.startDate || "请选择开始时间"),
|
||||
P: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"),
|
||||
Q: common_vendor.o(($event) => showStartDatePicker.value = true),
|
||||
R: common_vendor.o(onStartDateConfirm),
|
||||
S: common_vendor.o(($event) => showStartDatePicker.value = false),
|
||||
T: common_vendor.o(($event) => showStartDatePicker.value = false),
|
||||
U: common_vendor.o(($event) => startDateValue.value = $event),
|
||||
V: common_vendor.p({
|
||||
show: showStartDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: startDateValue.value
|
||||
}),
|
||||
W: common_vendor.t(formData.endDate || "请选择结束时间"),
|
||||
X: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"),
|
||||
Y: common_vendor.o(($event) => showEndDatePicker.value = true),
|
||||
Z: common_vendor.o(onEndDateConfirm),
|
||||
aa: common_vendor.o(($event) => showEndDatePicker.value = false),
|
||||
ab: common_vendor.o(($event) => showEndDatePicker.value = false),
|
||||
ac: common_vendor.o(($event) => endDateValue.value = $event),
|
||||
ad: common_vendor.p({
|
||||
show: showEndDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: endDateValue.value
|
||||
}),
|
||||
ae: common_vendor.t(checkItemCount.value),
|
||||
af: checkItemCount.value === 0
|
||||
}, checkItemCount.value === 0 ? {} : {}, {
|
||||
ag: common_vendor.f(manualCheckItems.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(index + 1),
|
||||
b: common_vendor.t(item.name),
|
||||
c: common_vendor.t(item.point),
|
||||
d: common_vendor.t(item.regulationName || "-"),
|
||||
e: common_vendor.o(($event) => deleteManualCheckItem(item, index), "manual-" + index),
|
||||
f: "manual-" + index
|
||||
};
|
||||
}),
|
||||
ah: common_vendor.f(checkItems.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
|
||||
};
|
||||
}),
|
||||
ai: common_vendor.o(($event) => showAddPopup.value = true),
|
||||
aj: common_vendor.o(openLibraryPopup),
|
||||
ak: common_vendor.o(handleSave),
|
||||
al: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
am: common_vendor.o(($event) => checkForm.name = $event),
|
||||
an: common_vendor.p({
|
||||
placeholder: "请输入检查名称",
|
||||
border: "surround",
|
||||
modelValue: checkForm.name
|
||||
}),
|
||||
ao: common_vendor.o(($event) => checkForm.point = $event),
|
||||
ap: common_vendor.p({
|
||||
placeholder: "请输入检查内容",
|
||||
height: 150,
|
||||
modelValue: checkForm.point
|
||||
}),
|
||||
aq: common_vendor.t(checkForm.regulationName || "选择法规"),
|
||||
ar: common_vendor.n(checkForm.regulationName ? "" : "text-gray"),
|
||||
as: common_vendor.o(openLawPopup),
|
||||
at: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
av: common_vendor.o(handleAddCheck),
|
||||
aw: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
ax: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
ay: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
az: common_vendor.o(searchRegulation),
|
||||
aA: lawKeyword.value,
|
||||
aB: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
|
||||
aC: common_vendor.o(searchRegulation),
|
||||
aD: lawLoading.value && lawList.value.length === 0
|
||||
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
|
||||
aF: common_vendor.f(lawList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.depict),
|
||||
b: common_vendor.t(item.legalBasis),
|
||||
c: selectedLawId.value === item.id ? 1 : "",
|
||||
d: item.id,
|
||||
e: common_vendor.o(($event) => selectLaw(item), item.id)
|
||||
};
|
||||
}),
|
||||
aG: lawLoading.value
|
||||
}, lawLoading.value ? {} : {}), {
|
||||
aE: !lawLoading.value && lawList.value.length === 0,
|
||||
aH: common_vendor.o(loadMoreLaw),
|
||||
aI: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
aJ: common_vendor.o(confirmLaw),
|
||||
aK: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
aL: common_vendor.p({
|
||||
show: showLawPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
aM: common_vendor.o(closeLibraryPopup),
|
||||
aN: common_vendor.o(searchLibrary),
|
||||
aO: libraryKeyword.value,
|
||||
aP: common_vendor.o(($event) => libraryKeyword.value = $event.detail.value),
|
||||
aQ: common_vendor.o(searchLibrary),
|
||||
aR: libraryLoading.value && libraryList.value.length === 0
|
||||
}, libraryLoading.value && libraryList.value.length === 0 ? {} : !libraryLoading.value && libraryList.value.length === 0 ? {} : common_vendor.e({
|
||||
aT: common_vendor.f(libraryList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: selectedLibraries.value.includes(item.id)
|
||||
}, selectedLibraries.value.includes(item.id) ? {} : {}, {
|
||||
b: selectedLibraries.value.includes(item.id) ? 1 : "",
|
||||
c: common_vendor.t(item.name),
|
||||
d: common_vendor.t(item.pointCount),
|
||||
e: item.id,
|
||||
f: common_vendor.o(($event) => toggleLibrarySelect(item), item.id)
|
||||
});
|
||||
}),
|
||||
aU: libraryLoading.value
|
||||
}, libraryLoading.value ? {} : {}), {
|
||||
aS: !libraryLoading.value && libraryList.value.length === 0,
|
||||
aV: common_vendor.o(loadMoreLibrary),
|
||||
aW: common_vendor.o(addSelectedLibrary),
|
||||
aX: common_vendor.o(closeLibraryPopup),
|
||||
aY: common_vendor.p({
|
||||
show: showLibraryPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
aZ: common_vendor.o(($event) => showExecutorPopup.value = false),
|
||||
ba: executorList.value.length === 0
|
||||
}, executorList.value.length === 0 ? {} : {
|
||||
bb: common_vendor.f(executorList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: selectedExecutorIds.value.includes(item.userId)
|
||||
}, selectedExecutorIds.value.includes(item.userId) ? {} : {}, {
|
||||
b: selectedExecutorIds.value.includes(item.userId) ? 1 : "",
|
||||
c: common_vendor.t(item.nickName),
|
||||
d: item.userId,
|
||||
e: common_vendor.o(($event) => toggleExecutorSelect(item), item.userId)
|
||||
});
|
||||
})
|
||||
}, {
|
||||
bc: common_vendor.o(($event) => showExecutorPopup.value = false),
|
||||
bd: common_vendor.o(confirmExecutorSelect),
|
||||
be: common_vendor.o(($event) => showExecutorPopup.value = false),
|
||||
bf: common_vendor.p({
|
||||
show: showExecutorPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
bg: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-98282eb3"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/editchecklist/editchecklist.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "编辑检查表",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
452
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.wxss
vendored
Normal file
452
unpackage/dist/dev/mp-weixin/pages/editchecklist/editchecklist.wxss
vendored
Normal file
@@ -0,0 +1,452 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-98282eb3 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding: 24rpx;
|
||||
padding-bottom: 140rpx;
|
||||
}
|
||||
.form-card.data-v-98282eb3 {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
.form-item.data-v-98282eb3 {
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
.form-item.data-v-98282eb3:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form-label.data-v-98282eb3 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.form-label .required.data-v-98282eb3 {
|
||||
color: #F56C6C;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
.label-blue.data-v-98282eb3 {
|
||||
color: #2667E9;
|
||||
}
|
||||
.picker-input.data-v-98282eb3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 88rpx;
|
||||
background: #fff;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 8rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.picker-input .picker-value.data-v-98282eb3 {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.picker-input .picker-placeholder.data-v-98282eb3 {
|
||||
color: #C0C4CC;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.picker-input .picker-arrow.data-v-98282eb3 {
|
||||
color: #C0C4CC;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.switch-row.data-v-98282eb3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 30rpx;
|
||||
}
|
||||
.empty-check-tip.data-v-98282eb3 {
|
||||
text-align: center;
|
||||
padding: 60rpx 0;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.check-card.data-v-98282eb3 {
|
||||
background: #F8FAFF;
|
||||
border-left: 6rpx solid #2667E9;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx;
|
||||
padding-bottom: 80rpx;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
.check-card .check-info .info-row.data-v-98282eb3 {
|
||||
display: flex;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.check-card .check-info .info-row.data-v-98282eb3:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.check-card .check-info .info-row .info-label.data-v-98282eb3 {
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.check-card .check-info .info-row .info-label-bold.data-v-98282eb3 {
|
||||
font-weight: bold;
|
||||
}
|
||||
.check-card .check-info .info-row .info-value.data-v-98282eb3 {
|
||||
color: #333;
|
||||
flex: 1;
|
||||
}
|
||||
.check-card .check-action.data-v-98282eb3 {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
}
|
||||
.check-card .check-action .btn-delete.data-v-98282eb3 {
|
||||
width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
background: #F56C6C;
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
border-radius: 8rpx;
|
||||
padding: 0;
|
||||
}
|
||||
.check-card .check-action .btn-delete.data-v-98282eb3::after {
|
||||
border: none;
|
||||
}
|
||||
.manual-card.data-v-98282eb3 {
|
||||
padding-top: 50rpx;
|
||||
}
|
||||
.manual-card .card-tag.data-v-98282eb3 {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 0 0 12rpx 0;
|
||||
}
|
||||
.add-btns.data-v-98282eb3 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 24rpx;
|
||||
}
|
||||
.add-btns .btn-add.data-v-98282eb3 {
|
||||
flex: 1;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
background: #fff;
|
||||
border: 2rpx solid #2667E9;
|
||||
border-radius: 8rpx;
|
||||
color: #2667E9;
|
||||
font-size: 28rpx;
|
||||
padding: 0;
|
||||
}
|
||||
.add-btns .btn-add.data-v-98282eb3::after {
|
||||
border: none;
|
||||
}
|
||||
.footer-btn.data-v-98282eb3 {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 40rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.footer-btn .btn-save.data-v-98282eb3 {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
border-radius: 44rpx;
|
||||
}
|
||||
.footer-btn .btn-save.data-v-98282eb3::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-content.data-v-98282eb3 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-98282eb3 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-title.data-v-98282eb3 {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
.popup-close.data-v-98282eb3 {
|
||||
font-size: 48rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-98282eb3 {
|
||||
padding: 30rpx;
|
||||
max-height: 700rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.popup-form-item.data-v-98282eb3 {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.popup-form-label.data-v-98282eb3 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.popup-form-label .required.data-v-98282eb3 {
|
||||
color: #F56C6C;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
.popup-select.data-v-98282eb3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 80rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 8rpx;
|
||||
padding: 0 24rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.regulation-select.data-v-98282eb3 {
|
||||
align-items: flex-start;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.regulation-select .regulation-text.data-v-98282eb3 {
|
||||
flex: 1;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
.regulation-select .select-icon.data-v-98282eb3 {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.popup-footer.data-v-98282eb3 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-98282eb3 {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-98282eb3::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-98282eb3 {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-98282eb3 {
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
.law-popup.data-v-98282eb3 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
max-height: 80vh;
|
||||
}
|
||||
.search-box.data-v-98282eb3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 40rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
margin: 20rpx 30rpx;
|
||||
}
|
||||
.search-box .search-icon.data-v-98282eb3 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.search-box .search-input.data-v-98282eb3 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
background: transparent;
|
||||
}
|
||||
.search-box .search-btn.data-v-98282eb3 {
|
||||
color: #2667E9;
|
||||
font-size: 26rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.loading-tip.data-v-98282eb3, .empty-tip.data-v-98282eb3 {
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.law-list.data-v-98282eb3 {
|
||||
max-height: 400rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.law-item.data-v-98282eb3 {
|
||||
padding: 24rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.law-item .law-title.data-v-98282eb3 {
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.law-item .law-basis.data-v-98282eb3 {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.law-item-active.data-v-98282eb3 {
|
||||
border-color: #2667E9;
|
||||
background: #F0F6FF;
|
||||
}
|
||||
.load-more.data-v-98282eb3 {
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
margin: 0 30rpx;
|
||||
border: 2rpx solid #2667E9;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
.library-popup.data-v-98282eb3 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
max-height: 80vh;
|
||||
}
|
||||
.library-list.data-v-98282eb3 {
|
||||
max-height: 400rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.library-item.data-v-98282eb3 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 24rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.library-checkbox.data-v-98282eb3 {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border: 2rpx solid #ccc;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
margin-top: 4rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.library-checkbox-active.data-v-98282eb3 {
|
||||
background: #2667E9;
|
||||
border-color: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
.library-info.data-v-98282eb3 {
|
||||
flex: 1;
|
||||
}
|
||||
.library-name.data-v-98282eb3 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.library-count.data-v-98282eb3 {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.btn-add-library.data-v-98282eb3 {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
background: #2667E9;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
margin: 20rpx 30rpx;
|
||||
}
|
||||
.btn-add-library.data-v-98282eb3::after {
|
||||
border: none;
|
||||
}
|
||||
.executor-popup.data-v-98282eb3 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
max-height: 80vh;
|
||||
}
|
||||
.executor-list.data-v-98282eb3 {
|
||||
max-height: 500rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.executor-item.data-v-98282eb3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.executor-checkbox.data-v-98282eb3 {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border: 2rpx solid #ccc;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.executor-checkbox-active.data-v-98282eb3 {
|
||||
background: #2667E9;
|
||||
border-color: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
.executor-info.data-v-98282eb3 {
|
||||
flex: 1;
|
||||
}
|
||||
.executor-name.data-v-98282eb3 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
209
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.js
vendored
Normal file
209
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.js
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
|
||||
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_input2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_upload2 + _easycom_up_textarea2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
||||
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_upload + _easycom_up_textarea)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "editcompanInformation",
|
||||
setup(__props) {
|
||||
const radiolist1 = common_vendor.reactive([
|
||||
{
|
||||
name: "矿山开采",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "化工生产",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "冶金工业",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "建筑施工",
|
||||
disabled: false
|
||||
}
|
||||
]);
|
||||
const radiovalue1 = common_vendor.ref("矿山开采");
|
||||
const groupChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:86", "groupChange", n);
|
||||
};
|
||||
const radioChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/editcompanInformation/editcompanInformation.vue:90", "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);
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(_ctx.change),
|
||||
b: common_vendor.o(($event) => _ctx.value = $event),
|
||||
c: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
d: common_vendor.o(_ctx.change),
|
||||
e: common_vendor.o(($event) => _ctx.value = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
g: common_vendor.o(_ctx.change),
|
||||
h: common_vendor.o(($event) => _ctx.value = $event),
|
||||
i: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
j: common_vendor.o(_ctx.change),
|
||||
k: common_vendor.o(($event) => _ctx.value = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
m: common_vendor.o(_ctx.change),
|
||||
n: common_vendor.o(($event) => _ctx.value = $event),
|
||||
o: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
p: common_vendor.o(_ctx.change),
|
||||
q: common_vendor.o(($event) => _ctx.value = $event),
|
||||
r: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
s: common_vendor.f(radiolist1, (item, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: common_vendor.o(radioChange, index),
|
||||
c: "2e9c764f-7-" + i0 + ",2e9c764f-6",
|
||||
d: common_vendor.p({
|
||||
customStyle: {
|
||||
marginBottom: "8px"
|
||||
},
|
||||
label: item.name,
|
||||
name: item.name
|
||||
})
|
||||
};
|
||||
}),
|
||||
t: common_vendor.o(groupChange),
|
||||
v: common_vendor.o(($event) => radiovalue1.value = $event),
|
||||
w: common_vendor.p({
|
||||
placement: "row",
|
||||
shape: "square",
|
||||
modelValue: radiovalue1.value
|
||||
}),
|
||||
x: common_vendor.o(_ctx.change),
|
||||
y: common_vendor.o(($event) => _ctx.value = $event),
|
||||
z: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
A: common_vendor.o(_ctx.change),
|
||||
B: common_vendor.o(($event) => _ctx.value = $event),
|
||||
C: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
D: common_vendor.o(_ctx.change),
|
||||
E: common_vendor.o(($event) => _ctx.value = $event),
|
||||
F: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
G: common_vendor.o(_ctx.change),
|
||||
H: common_vendor.o(($event) => _ctx.value = $event),
|
||||
I: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
J: common_vendor.o(_ctx.change),
|
||||
K: common_vendor.o(($event) => _ctx.value = $event),
|
||||
L: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
M: common_vendor.o(_ctx.change),
|
||||
N: common_vendor.o(($event) => _ctx.value = $event),
|
||||
O: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
P: common_vendor.o(_ctx.change),
|
||||
Q: common_vendor.o(($event) => _ctx.value = $event),
|
||||
R: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
S: common_vendor.o(_ctx.change),
|
||||
T: common_vendor.o(($event) => _ctx.value = $event),
|
||||
U: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
V: common_vendor.o(_ctx.change),
|
||||
W: common_vendor.o(($event) => _ctx.value = $event),
|
||||
X: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
Y: common_vendor.o(_ctx.change),
|
||||
Z: common_vendor.o(($event) => _ctx.value = $event),
|
||||
aa: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: _ctx.value
|
||||
}),
|
||||
ab: common_vendor.o(afterRead),
|
||||
ac: common_vendor.o(deletePic),
|
||||
ad: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
ae: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
af: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
}),
|
||||
ag: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2e9c764f"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/editcompanInformation/editcompanInformation.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "编辑企业信息",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
||||
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
30
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.wxss
vendored
Normal file
30
unpackage/dist/dev/mp-weixin/pages/editcompanInformation/editcompanInformation.wxss
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-2e9c764f {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
128
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.js
vendored
Normal file
128
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.js
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
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_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_input + _easycom_up_datetime_picker + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "equipmentregistration",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const fileList = common_vendor.ref([]);
|
||||
const toAdd = () => {
|
||||
showAddPopup.value = true;
|
||||
};
|
||||
const chooseFile = () => {
|
||||
common_vendor.index.chooseMessageFile({
|
||||
count: 10,
|
||||
type: "all",
|
||||
success: (res) => {
|
||||
const files = res.tempFiles.map((file) => ({
|
||||
name: file.name,
|
||||
path: file.path,
|
||||
size: file.size
|
||||
}));
|
||||
fileList.value = [...fileList.value, ...files];
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.chooseImage({
|
||||
count: 9,
|
||||
success: (res) => {
|
||||
const files = res.tempFilePaths.map((path, index) => ({
|
||||
name: `文件${fileList.value.length + index + 1}`,
|
||||
path,
|
||||
size: 0
|
||||
}));
|
||||
fileList.value = [...fileList.value, ...files];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const removeFile = (index) => {
|
||||
fileList.value.splice(index, 1);
|
||||
};
|
||||
const handleAdd = () => {
|
||||
showAddPopup.value = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
};
|
||||
const show = common_vendor.ref(false);
|
||||
const value1 = common_vendor.ref(Date.now());
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o(toAdd),
|
||||
b: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
c: common_vendor.p({
|
||||
placeholder: "请输入型号"
|
||||
}),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入名称"
|
||||
}),
|
||||
e: common_vendor.p({
|
||||
placeholder: "请输入参数"
|
||||
}),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入数量"
|
||||
}),
|
||||
g: common_vendor.o(($event) => value1.value = $event),
|
||||
h: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
i: common_vendor.o(($event) => value1.value = $event),
|
||||
j: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
k: common_vendor.p({
|
||||
placeholder: "请输入区域"
|
||||
}),
|
||||
l: common_vendor.o(chooseFile),
|
||||
m: fileList.value.length > 0
|
||||
}, fileList.value.length > 0 ? {
|
||||
n: common_vendor.f(fileList.value, (file, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(file.name),
|
||||
b: common_vendor.o(($event) => removeFile(index), index),
|
||||
c: index
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
o: common_vendor.o(($event) => value1.value = $event),
|
||||
p: common_vendor.p({
|
||||
placeholder: "请输入备注",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
q: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
r: common_vendor.o(handleAdd),
|
||||
s: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
t: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
v: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1714bad4"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/equipmentregistration/equipmentregistration.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "设备登记",
|
||||
"usingComponents": {
|
||||
"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-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'data-v-1714bad4', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{v}}"><view class="padding data-v-1714bad4"><view class="text-gray text-center margin-top-xl margin-bottom-xl data-v-1714bad4">暂无设备</view><button class="cuIcon-add round bg-blue data-v-1714bad4" bindtap="{{a}}">新增</button></view><u-popup wx:if="{{t}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-s="{{['d']}}" bindclose="{{s}}" u-i="1714bad4-0" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-1714bad4"><view class="popup-header data-v-1714bad4"><view class="popup-title text-bold data-v-1714bad4">新增设备</view><view class="popup-close data-v-1714bad4" bindtap="{{b}}">×</view></view><scroll-view class="popup-body data-v-1714bad4" scroll-y style="{{'height:' + '60vh'}}"><view class="flex data-v-1714bad4"><view class="margin-bottom data-v-1714bad4">型号</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{c}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-1,1714bad4-0" bind:__l="__l" u-p="{{c}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">名称</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{d}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-2,1714bad4-0" bind:__l="__l" u-p="{{d}}"></up-input><view class="margin-bottom margin-top data-v-1714bad4">参数</view><up-input wx:if="{{e}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-3,1714bad4-0" bind:__l="__l" u-p="{{e}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">数量(单位:台)</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{f}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-4,1714bad4-0" bind:__l="__l" u-p="{{f}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">购买时间</view><view class="text-red data-v-1714bad4">*</view></view><up-datetime-picker wx:if="{{h}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-5,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">设备预警时间</view><view class="text-red data-v-1714bad4">*</view></view><up-datetime-picker wx:if="{{j}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-6,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">区域</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{k}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-7,1714bad4-0" bind:__l="__l" u-p="{{k}}"></up-input><view class="margin-top-sm margin-bottom-sm margin-bottom margin-top data-v-1714bad4">上传资料</view><view class="upload-area data-v-1714bad4" bindtap="{{l}}"><view class="upload-icon data-v-1714bad4"><text class="cuIcon-upload data-v-1714bad4" style="font-size:60rpx;color:#999"></text></view><view class="upload-text data-v-1714bad4">点击选择文件</view><view class="upload-tip data-v-1714bad4">支持Word、Excel、PDF、图片等格式</view><button class="cu-but bg-blue data-v-1714bad4">选择文件</button></view><view wx:if="{{m}}" class="file-list data-v-1714bad4"><view wx:for="{{n}}" wx:for-item="file" wx:key="c" class="file-item data-v-1714bad4"><text class="file-name data-v-1714bad4">{{file.a}}</text><text class="file-delete text-red data-v-1714bad4" catchtap="{{file.b}}">×</text></view></view><view class="margin-top-sm margin-bottom margin-top data-v-1714bad4">备注</view><up-textarea wx:if="{{p}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-8,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{o}}" u-p="{{p}}"></up-textarea></scroll-view><view class="popup-footer data-v-1714bad4"><button class="btn-cancel data-v-1714bad4" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-1714bad4" bindtap="{{r}}">确定</button></view></view></u-popup></view>
|
||||
130
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxss
vendored
Normal file
130
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxss
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.popup-content.data-v-1714bad4 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-1714bad4 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-title.data-v-1714bad4 {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.popup-close.data-v-1714bad4 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
}
|
||||
.popup-body.data-v-1714bad4 {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.popup-footer.data-v-1714bad4 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-1714bad4 {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-1714bad4::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-1714bad4 {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-1714bad4 {
|
||||
color: #fff;
|
||||
}
|
||||
.upload-area.data-v-1714bad4 {
|
||||
background: #F8F8F;
|
||||
border: 2rpx dashed #C5D4F5;
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.upload-icon.data-v-1714bad4 {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.upload-text.data-v-1714bad4 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.upload-tip.data-v-1714bad4 {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.upload-btn.data-v-1714bad4 {
|
||||
padding: 16rpx 48rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
.file-list.data-v-1714bad4 {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.file-item.data-v-1714bad4 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16rpx 20rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.file-name.data-v-1714bad4 {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-delete.data-v-1714bad4 {
|
||||
font-size: 36rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
595
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.js
vendored
Normal file
595
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.js
vendored
Normal file
@@ -0,0 +1,595 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_three_one_api_area = require("../../request/three_one_api/area.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
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)();
|
||||
}
|
||||
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)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspection",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const levelChooseRef = common_vendor.ref(null);
|
||||
const userRole = common_vendor.ref("");
|
||||
const canAcceptance = common_vendor.computed(() => {
|
||||
return userRole.value === "admin" || userRole.value === "manage";
|
||||
});
|
||||
const getUserRole = () => {
|
||||
try {
|
||||
const userInfoStr = common_vendor.index.getStorageSync("userInfo");
|
||||
if (userInfoStr) {
|
||||
const userInfo = JSON.parse(userInfoStr);
|
||||
userRole.value = userInfo.role || "";
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:211", "当前用户角色:", userRole.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:214", "获取用户信息失败:", error);
|
||||
}
|
||||
};
|
||||
getUserRole();
|
||||
const taskId = common_vendor.ref("");
|
||||
const checkPointId = common_vendor.ref("");
|
||||
const fetchTaskInfo = async (oneTableId) => {
|
||||
try {
|
||||
const startRes = await request_api.enterCheckPlan(oneTableId);
|
||||
if (startRes.code === 0 && startRes.data) {
|
||||
const tid = startRes.data.taskId;
|
||||
const detailRes = await request_api.getCheckTaskDetail(tid);
|
||||
if (detailRes.code === 0 && detailRes.data) {
|
||||
taskId.value = detailRes.data.taskId;
|
||||
checkPointId.value = detailRes.data.checkPointId;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:239", "获取任务信息失败:", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.id) {
|
||||
fetchTaskInfo(options.id);
|
||||
}
|
||||
});
|
||||
const formData = common_vendor.reactive({
|
||||
title: "",
|
||||
// 隐患标题
|
||||
level: 0,
|
||||
// 隐患等级索引
|
||||
description: "",
|
||||
// 隐患描述
|
||||
tagIndex: 0,
|
||||
// 隐患标签索引
|
||||
source: ""
|
||||
// 隐患来源
|
||||
});
|
||||
common_vendor.ref(0);
|
||||
const lng = common_vendor.ref(0);
|
||||
const lat = common_vendor.ref(0);
|
||||
const selectedAddress = common_vendor.ref("");
|
||||
const showAreaPicker = common_vendor.ref(false);
|
||||
const areaList = common_vendor.ref([]);
|
||||
const selectedAreaId = common_vendor.ref("");
|
||||
const selectedAreaName = common_vendor.ref("");
|
||||
const tempAreaId = common_vendor.ref("");
|
||||
const fetchAreaList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaList();
|
||||
if (res.code === 0 && res.data && res.data.records) {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:283", "获取区域列表失败:", error);
|
||||
}
|
||||
};
|
||||
fetchAreaList();
|
||||
const confirmAreaSelect = () => {
|
||||
if (tempAreaId.value) {
|
||||
selectedAreaId.value = tempAreaId.value;
|
||||
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
|
||||
selectedAreaName.value = selected ? selected.name : "";
|
||||
}
|
||||
showAreaPicker.value = false;
|
||||
};
|
||||
const chooseLocation = () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:299", "chooseLocation called");
|
||||
showAddPopup.value = false;
|
||||
setTimeout(() => {
|
||||
common_vendor.index.getLocation({
|
||||
type: "gcj02",
|
||||
// 使用国测局坐标系(腾讯地图使用)
|
||||
success: (locationRes) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:308", "获取当前位置成功:", locationRes);
|
||||
common_vendor.index.chooseLocation({
|
||||
latitude: locationRes.latitude,
|
||||
longitude: locationRes.longitude,
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:314", "选择位置成功:", res);
|
||||
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
||||
lng.value = res.longitude;
|
||||
lat.value = res.latitude;
|
||||
showAddPopup.value = true;
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:323", "选择位置失败:", err);
|
||||
showAddPopup.value = true;
|
||||
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({
|
||||
title: "选择位置失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:337", "获取当前位置失败:", err);
|
||||
common_vendor.index.chooseLocation({
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:341", "选择位置成功:", res);
|
||||
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
||||
lng.value = res.longitude;
|
||||
lat.value = res.latitude;
|
||||
showAddPopup.value = true;
|
||||
},
|
||||
fail: (chooseErr) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:348", "选择位置失败:", chooseErr);
|
||||
showAddPopup.value = true;
|
||||
if (chooseErr.errMsg && chooseErr.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({
|
||||
title: "选择位置失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
var _a;
|
||||
if (!formData.title) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入隐患标题",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (fileList1.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请上传隐患图片/视频",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const attachments = fileList1.value.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 selectedTag = tagOptions.value[formData.tagIndex];
|
||||
const tagId = selectedTag ? selectedTag.id : null;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:395", "innnn", sourceOptions);
|
||||
const params = {
|
||||
title: formData.title,
|
||||
//标题
|
||||
level: formData.level + 1,
|
||||
// 1.轻微隐患 2.一般隐患 3.重大隐患
|
||||
lng: lng.value || 0,
|
||||
//经度
|
||||
lat: lat.value || 0,
|
||||
//纬度
|
||||
address: selectedAddress.value || "",
|
||||
//详细地址
|
||||
areaId: selectedAreaId.value || null,
|
||||
//隐患区域ID
|
||||
description: formData.description || "",
|
||||
//隐患描述
|
||||
tagId,
|
||||
//隐患标签ID
|
||||
taskId: taskId.value,
|
||||
//关联任务ID
|
||||
checkPointId: checkPointId.value,
|
||||
//关联检查点ID
|
||||
source: ((_a = sourceOptions.value[formData.source]) == null ? void 0 : _a.title) || "",
|
||||
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
||||
attachments
|
||||
//附件列表(图片/视频)
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:413", "提交的参数:", params);
|
||||
try {
|
||||
const res = await request_api.addHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
showAddPopup.value = false;
|
||||
formData.title = "";
|
||||
formData.level = 0;
|
||||
formData.description = "";
|
||||
formData.tagIndex = 0;
|
||||
selectedAddress.value = "";
|
||||
selectedAreaId.value = "";
|
||||
selectedAreaName.value = "";
|
||||
fileList1.value = [];
|
||||
fetchHiddenDangerList();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "新增失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:441", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const hiddenDangerList = common_vendor.ref([]);
|
||||
const fetchHiddenDangerList = async () => {
|
||||
try {
|
||||
const res = await request_api.getMyHiddenDangerList();
|
||||
if (res.code === 0) {
|
||||
hiddenDangerList.value = res.data.records;
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "获取隐患列表失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:462", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
fetchHiddenDangerList();
|
||||
});
|
||||
const details = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
const Rectification = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
const editRectification = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/rectification?rectifyId=${item.rectifyId}&isEdit=1`
|
||||
});
|
||||
};
|
||||
const acceptance = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
|
||||
});
|
||||
};
|
||||
const assignHazard = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
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++) {
|
||||
const result = await uploadFilePromise(lists[i].url);
|
||||
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.baseUrl.replace("/prod-api", "") + serverPath,
|
||||
serverPath
|
||||
});
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
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:558", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const aiAnalyzing = common_vendor.ref(false);
|
||||
const handleAiAnalyze = async () => {
|
||||
const imageFiles = fileList1.value.filter((f) => {
|
||||
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
|
||||
});
|
||||
if (imageFiles.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const fullImageUrl = imageFiles[0].url;
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:580", "开始调用AI分析接口,图片地址:", fullImageUrl);
|
||||
const analyzeRes = await request_api.analyzeHazardImage({
|
||||
// imageUrl: 'https://yx.zhihuixiangxi.com:58880/1.png' ,
|
||||
imageUrl: fullImageUrl
|
||||
});
|
||||
if (analyzeRes.code === 0 && analyzeRes.data) {
|
||||
const aiData = analyzeRes.data;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:588", "AI分析结果:", aiData);
|
||||
if (aiData.title)
|
||||
formData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
formData.description = aiData.description;
|
||||
if (aiData.level) {
|
||||
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 1, "一般隐患": 1, "重大": 2, "重大隐患": 2 };
|
||||
const levelIndex = levelMap[aiData.level];
|
||||
if (levelIndex !== void 0) {
|
||||
formData.level = levelIndex;
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (levelChooseRef.value && levelChooseRef.value.$data) {
|
||||
levelChooseRef.value.$data.currentIndex = levelIndex;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
common_vendor.index.showToast({ title: "AI分析完成,已自动填充", icon: "success", duration: 2e3 });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:611", "AI分析接口调用失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI分析失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiAnalyzing.value = false;
|
||||
}
|
||||
};
|
||||
const tagOptions = common_vendor.ref([]);
|
||||
const fetchTagOptions = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerLabelList();
|
||||
if (res.code === 0) {
|
||||
tagOptions.value = res.data.map((item) => ({
|
||||
id: item.id,
|
||||
title: item.name
|
||||
}));
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "获取标签列表失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:634", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
fetchTagOptions();
|
||||
const levelOptions = common_vendor.ref([
|
||||
{
|
||||
id: 1,
|
||||
title: "轻微隐患"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "一般隐患"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "重大隐患"
|
||||
}
|
||||
]);
|
||||
const sourceOptions = common_vendor.ref([
|
||||
{
|
||||
id: 1,
|
||||
title: "随手拍"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "企业自查"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "行业互查"
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "专家诊查"
|
||||
}
|
||||
]);
|
||||
common_vendor.watch(() => formData.source, (newVal) => {
|
||||
const selected = sourceOptions.value[newVal];
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:680", "隐患来源选择结果:", {
|
||||
索引: newVal,
|
||||
选中项: selected,
|
||||
id: selected == null ? void 0 : selected.id,
|
||||
title: selected == null ? void 0 : selected.title
|
||||
});
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f(hiddenDangerList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.statusName),
|
||||
c: common_vendor.t(item.levelName),
|
||||
d: item.levelName === "轻微隐患" ? 1 : "",
|
||||
e: item.levelName === "一般隐患" ? 1 : "",
|
||||
f: item.levelName === "重大隐患" ? 1 : "",
|
||||
g: common_vendor.t(item.address),
|
||||
h: common_vendor.t(item.createdAt),
|
||||
i: common_vendor.o(($event) => details(item), item.hazardId),
|
||||
j: item.statusName === "待整改" && item.canEdit
|
||||
}, item.statusName === "待整改" && item.canEdit ? {
|
||||
k: common_vendor.o(($event) => assignHazard(item), item.hazardId)
|
||||
} : {}, {
|
||||
l: item.statusName === "待整改" && item.canEdit
|
||||
}, item.statusName === "待整改" && item.canEdit ? {
|
||||
m: common_vendor.o(($event) => Rectification(item), item.hazardId)
|
||||
} : {}, {
|
||||
n: item.statusName === "待验收" && item.canEdit
|
||||
}, item.statusName === "待验收" && item.canEdit ? {
|
||||
o: common_vendor.o(($event) => editRectification(item), item.hazardId)
|
||||
} : {}, {
|
||||
p: item.statusName === "待验收" && canAcceptance.value
|
||||
}, item.statusName === "待验收" && canAcceptance.value ? {
|
||||
q: common_vendor.o(($event) => acceptance(item), item.hazardId)
|
||||
} : {}, {
|
||||
r: item.statusName === "待交办"
|
||||
}, item.statusName === "待交办" ? {
|
||||
s: common_vendor.o(($event) => assignHazard(item), item.hazardId)
|
||||
} : {}, {
|
||||
t: item.hazardId
|
||||
});
|
||||
}),
|
||||
b: common_vendor.o(($event) => showAddPopup.value = true),
|
||||
c: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
d: common_vendor.o(afterRead),
|
||||
e: common_vendor.o(deletePic),
|
||||
f: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
g: !aiAnalyzing.value
|
||||
}, !aiAnalyzing.value ? {} : {}, {
|
||||
h: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
|
||||
i: aiAnalyzing.value,
|
||||
j: aiAnalyzing.value,
|
||||
k: common_vendor.o(handleAiAnalyze),
|
||||
l: common_vendor.o(($event) => formData.title = $event),
|
||||
m: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: formData.title
|
||||
}),
|
||||
n: common_vendor.sr(levelChooseRef, "b44c631d-3,b44c631d-0", {
|
||||
"k": "levelChooseRef"
|
||||
}),
|
||||
o: common_vendor.o(($event) => formData.level = $event),
|
||||
p: common_vendor.p({
|
||||
options: levelOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: formData.level
|
||||
}),
|
||||
q: common_vendor.o(($event) => formData.source = $event),
|
||||
r: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: formData.source
|
||||
}),
|
||||
s: common_vendor.o(($event) => selectedAddress.value = $event),
|
||||
t: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
border: "surround",
|
||||
modelValue: selectedAddress.value
|
||||
}),
|
||||
v: common_vendor.o(chooseLocation),
|
||||
w: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
|
||||
x: !selectedAreaName.value ? 1 : "",
|
||||
y: common_vendor.o(($event) => showAreaPicker.value = true),
|
||||
z: common_vendor.o(($event) => formData.description = $event),
|
||||
A: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.description
|
||||
}),
|
||||
B: common_vendor.o(($event) => formData.tagIndex = $event),
|
||||
C: common_vendor.p({
|
||||
options: tagOptions.value,
|
||||
modelValue: formData.tagIndex
|
||||
}),
|
||||
D: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
E: common_vendor.o(handleAdd),
|
||||
F: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
G: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
H: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
I: common_vendor.o(confirmAreaSelect),
|
||||
J: common_vendor.f(areaList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.color,
|
||||
b: common_vendor.t(item.name),
|
||||
c: tempAreaId.value === item.id
|
||||
}, tempAreaId.value === item.id ? {} : {}, {
|
||||
d: item.id,
|
||||
e: tempAreaId.value === item.id ? 1 : "",
|
||||
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
K: areaList.value.length === 0
|
||||
}, areaList.value.length === 0 ? {} : {}, {
|
||||
L: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
M: common_vendor.p({
|
||||
show: showAreaPicker.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
N: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b44c631d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/Inspection.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "隐患排查",
|
||||
"usingComponents": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
304
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.wxss
vendored
Normal file
304
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.wxss
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-b44c631d {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding-bottom: 120rpx;
|
||||
}
|
||||
.fixed-add-btn.data-v-b44c631d {
|
||||
position: fixed;
|
||||
bottom: 40rpx;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #2668EA 100%);
|
||||
border-radius: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 8rpx 24rpx rgba(38, 104, 234, 0.4);
|
||||
z-index: 100;
|
||||
}
|
||||
.fixed-add-btn .cuIcon-add.data-v-b44c631d {
|
||||
margin-right: 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.list-list.data-v-b44c631d {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
||||
border-left: 5px solid #2667E9;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.level-tag.data-v-b44c631d {
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.level-minor.data-v-b44c631d {
|
||||
background: #F6FFED;
|
||||
border: 2rpx solid #B7EB8F;
|
||||
color: #52C41A;
|
||||
}
|
||||
.level-normal.data-v-b44c631d {
|
||||
background: #FFF7E6;
|
||||
border: 2rpx solid #FFD591;
|
||||
color: #FA8C16;
|
||||
}
|
||||
.level-major.data-v-b44c631d {
|
||||
background: #FFF1F0;
|
||||
border: 2rpx solid #FFA39E;
|
||||
color: #F5222D;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-b44c631d {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-b44c631d {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.popup-content.data-v-b44c631d {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-b44c631d {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-b44c631d {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-b44c631d {
|
||||
padding: 30rpx;
|
||||
max-height: 900rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.popup-footer.data-v-b44c631d {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-b44c631d {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-b44c631d {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-b44c631d {
|
||||
color: #fff;
|
||||
}
|
||||
.address-box.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-box .address-input-wrapper.data-v-b44c631d {
|
||||
flex: 1;
|
||||
}
|
||||
.address-box .btn-address.data-v-b44c631d {
|
||||
flex-shrink: 0;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.address-box .btn-address.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.select-trigger.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.select-trigger .select-value.data-v-b44c631d {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger .select-value.placeholder.data-v-b44c631d {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
.picker-popup.data-v-b44c631d {
|
||||
background: #fff;
|
||||
}
|
||||
.picker-popup .picker-header.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.picker-popup .picker-header .picker-cancel.data-v-b44c631d {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.picker-popup .picker-header .picker-title.data-v-b44c631d {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-header .picker-confirm.data-v-b44c631d {
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.picker-popup .picker-body.data-v-b44c631d {
|
||||
max-height: 600rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-b44c631d:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.picker-popup .picker-item.picker-item-active.data-v-b44c631d {
|
||||
color: #2667E9;
|
||||
}
|
||||
.area-color-dot.data-v-b44c631d {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.address-popup.data-v-b44c631d {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.address-popup-body.data-v-b44c631d {
|
||||
padding: 30rpx;
|
||||
max-height: 500rpx;
|
||||
}
|
||||
.address-popup-body .search-box.data-v-b44c631d {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.address-popup-body .search-box .search-input.data-v-b44c631d {
|
||||
width: 100%;
|
||||
background: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.address-popup-body .address-list.data-v-b44c631d {
|
||||
max-height: 350rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.address-popup-body .address-item.data-v-b44c631d {
|
||||
padding: 24rpx 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
.address-popup-body .address-item.data-v-b44c631d:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.address-popup-body .address-item.address-item-active.data-v-b44c631d {
|
||||
background: #EBF2FC;
|
||||
color: #2667E9;
|
||||
}
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 全局样式覆盖 up-tag 文字居中 */
|
||||
.u-tag {
|
||||
justify-content: center !important;
|
||||
}
|
||||
233
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.js
vendored
Normal file
233
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.js
vendored
Normal file
@@ -0,0 +1,233 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
(_easycom_up_textarea2 + _easycom_up_upload2)();
|
||||
}
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_textarea + _easycom_up_upload)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "acceptance",
|
||||
setup(__props) {
|
||||
const rectifyId = common_vendor.ref("");
|
||||
const hazardId = common_vendor.ref("");
|
||||
const assignId = common_vendor.ref("");
|
||||
const rectifyData = common_vendor.reactive({
|
||||
rectifyPlan: "",
|
||||
rectifyResult: ""
|
||||
});
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const formData = common_vendor.reactive({
|
||||
result: 1,
|
||||
// 验收结果 1.通过 2.不通过
|
||||
verifyRemark: ""
|
||||
// 验收备注
|
||||
});
|
||||
const fileList1 = common_vendor.ref([]);
|
||||
const getFullPath = (filePath) => {
|
||||
if (!filePath)
|
||||
return "";
|
||||
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
|
||||
return request_request.toImageUrl(filePath);
|
||||
}
|
||||
return request_request.toImageUrl(filePath);
|
||||
};
|
||||
const previewImage = (index) => {
|
||||
const urls = rectifyAttachments.value.map((item) => getFullPath(item.filePath));
|
||||
common_vendor.index.previewImage({
|
||||
current: index,
|
||||
urls
|
||||
});
|
||||
};
|
||||
const fetchDetail = async () => {
|
||||
if (!hazardId.value || !assignId.value)
|
||||
return;
|
||||
try {
|
||||
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:108", "整改记录:", rectifyData);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:109", "整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:116", "获取隐患详情失败:", 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:131", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
||||
fetchDetail();
|
||||
});
|
||||
const handleCancel = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
if (!rectifyId.value) {
|
||||
common_vendor.index.showToast({
|
||||
title: "缺少整改ID",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
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 || "";
|
||||
}
|
||||
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 params = {
|
||||
rectifyId: Number(rectifyId.value),
|
||||
result: formData.result,
|
||||
verifyRemark: formData.verifyRemark || "",
|
||||
attachments
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:176", "提交验收参数:", params);
|
||||
try {
|
||||
const res = await request_api.acceptanceRectification(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "验收成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "验收失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:195", "验收失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
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++) {
|
||||
const result = await uploadFilePromise(lists[i].url);
|
||||
let item = fileList1.value[fileListLen];
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result
|
||||
});
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
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:250", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(rectifyData.rectifyPlan || "暂无"),
|
||||
b: common_vendor.t(rectifyData.rectifyResult || "暂无"),
|
||||
c: rectifyAttachments.value.length > 0
|
||||
}, rectifyAttachments.value.length > 0 ? {
|
||||
d: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: getFullPath(img.filePath),
|
||||
c: common_vendor.o(($event) => previewImage(idx), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
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({
|
||||
placeholder: "请输入验收备注",
|
||||
modelValue: formData.verifyRemark
|
||||
}),
|
||||
k: common_vendor.o(afterRead),
|
||||
l: common_vendor.o(deletePic),
|
||||
m: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
n: common_vendor.o(handleCancel),
|
||||
o: common_vendor.o(handleSubmit),
|
||||
p: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-39f9b795"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/acceptance.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "隐患验收",
|
||||
"usingComponents": {
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-39f9b795', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{p}}"><view class="padding bg-white radius data-v-39f9b795"><view class="text-gray margin-bottom data-v-39f9b795">整改记录</view><view class="padding solid radius data-v-39f9b795"><view class="flex data-v-39f9b795"><view class="data-v-39f9b795">整改方案:</view><view class="data-v-39f9b795">{{a}}</view></view><view class="flex margin-top-sm data-v-39f9b795"><view class="data-v-39f9b795">完成情况:</view><view class="data-v-39f9b795">{{b}}</view></view><view class="margin-top-sm data-v-39f9b795"><view class="data-v-39f9b795">整改附件:</view><view wx:if="{{c}}" class="flex margin-top-xs data-v-39f9b795" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{d}}" wx:for-item="img" wx:key="a" class="data-v-39f9b795" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill" bindtap="{{img.c}}"></image></view><view wx:else class="text-gray text-sm margin-top-xs data-v-39f9b795">暂无附件</view></view></view><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收结果</view><view class="text-red data-v-39f9b795">*</view></view><view class="flex data-v-39f9b795" style="gap:20rpx"><button class="{{['data-v-39f9b795', 'result-btn', e]}}" bindtap="{{f}}">通过</button><button class="{{['data-v-39f9b795', 'result-btn', g]}}" bindtap="{{h}}">不通过</button></view><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收备注</view></view><up-textarea wx:if="{{j}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收图片/视频</view></view><up-upload wx:if="{{m}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" bindafterRead="{{k}}" binddelete="{{l}}" u-i="39f9b795-1" bind:__l="__l" u-p="{{m}}"></up-upload><view class="flex margin-top-xl data-v-39f9b795" style="gap:20rpx"><button class="round flex-sub data-v-39f9b795" bindtap="{{n}}">取消</button><button class="bg-blue round flex-sub data-v-39f9b795" bindtap="{{o}}">提交验收</button></view></view></view>
|
||||
46
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.wxss
vendored
Normal file
46
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.wxss
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-39f9b795 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.result-btn.data-v-39f9b795 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.result-btn.data-v-39f9b795::after {
|
||||
border: none;
|
||||
}
|
||||
.result-btn.active.data-v-39f9b795 {
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
151
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.js
vendored
Normal file
151
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.js
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
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");
|
||||
(_easycom_up_picker2 + _easycom_up_datetime_picker2)();
|
||||
}
|
||||
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";
|
||||
if (!Math) {
|
||||
(_easycom_up_picker + _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 selectedUser = common_vendor.ref("");
|
||||
const selectedUserId = common_vendor.ref("");
|
||||
const userColumns = common_vendor.ref([["暂无数据"]]);
|
||||
const userList = common_vendor.ref([]);
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const dateValue = common_vendor.ref(Date.now());
|
||||
const selectedDate = common_vendor.ref("");
|
||||
const fetchDeptUsers = 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({
|
||||
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:83", "整改人员列表:", users);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:86", "获取部门人员失败:", error);
|
||||
}
|
||||
};
|
||||
const onUserConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:92", "选择的人员:", 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:106", "选择的日期时间:", 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");
|
||||
selectedDate.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
showDatePicker.value = false;
|
||||
};
|
||||
const handleCancel = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
if (!selectedUserId.value) {
|
||||
common_vendor.index.showToast({ title: "请选择整改人员", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!selectedDate.value) {
|
||||
common_vendor.index.showToast({ title: "请选择整改期限", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
hazardId: Number(hazardId.value),
|
||||
// 隐患ID
|
||||
assigneeId: Number(selectedUserId.value),
|
||||
// 被指派人ID
|
||||
deadline: selectedDate.value,
|
||||
// 处理期限
|
||||
assignRemark: ""
|
||||
// 交办备注(可选)
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:142", "提交数据:", params);
|
||||
try {
|
||||
const res = await request_api.assignHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({ title: "交办成功", icon: "success" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:155", "交办失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId)
|
||||
hazardId.value = options.hazardId;
|
||||
if (options.assignId)
|
||||
assignId.value = options.assignId;
|
||||
fetchDeptUsers();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.t(selectedUser.value || "请选择整改人员"),
|
||||
b: common_vendor.n(selectedUser.value ? "" : "text-gray"),
|
||||
c: common_vendor.o(($event) => showUserPicker.value = true),
|
||||
d: common_vendor.o(onUserConfirm),
|
||||
e: common_vendor.o(($event) => showUserPicker.value = false),
|
||||
f: common_vendor.o(($event) => showUserPicker.value = false),
|
||||
g: common_vendor.p({
|
||||
show: showUserPicker.value,
|
||||
columns: userColumns.value
|
||||
}),
|
||||
h: common_vendor.t(selectedDate.value || "请选择整改期限"),
|
||||
i: common_vendor.n(selectedDate.value ? "" : "text-gray"),
|
||||
j: common_vendor.o(($event) => showDatePicker.value = true),
|
||||
k: common_vendor.o(onDateConfirm),
|
||||
l: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
m: common_vendor.o(($event) => showDatePicker.value = false),
|
||||
n: common_vendor.o(($event) => dateValue.value = $event),
|
||||
o: common_vendor.p({
|
||||
show: showDatePicker.value,
|
||||
mode: "datetime",
|
||||
modelValue: dateValue.value
|
||||
}),
|
||||
p: common_vendor.o(handleCancel),
|
||||
q: common_vendor.o(handleSubmit),
|
||||
r: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6209e844"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/assignment.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{r}}"><view class="padding radius bg-white data-v-6209e844"><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="{{c}}"><text class="{{['data-v-6209e844', b]}}">{{a}}</text></view><up-picker wx:if="{{g}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{d}}" bindcancel="{{e}}" bindclose="{{f}}" u-i="6209e844-0" bind:__l="__l" u-p="{{g}}"></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="{{j}}"><text class="{{['data-v-6209e844', i]}}">{{h}}</text></view><up-datetime-picker wx:if="{{o}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{k}}" bindcancel="{{l}}" bindclose="{{m}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"></up-datetime-picker><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{p}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{q}}">确认</button></view></view></view>
|
||||
63
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.wxss
vendored
Normal file
63
unpackage/dist/dev/mp-weixin/pages/hiddendanger/assignment.wxss
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-6209e844 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.picker-input.data-v-6209e844 {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1rpx solid #F6F6F6;
|
||||
}
|
||||
.picker-input text.data-v-6209e844 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.btn-group.data-v-6209e844 {
|
||||
display: flex;
|
||||
gap: 30rpx;
|
||||
}
|
||||
.btn-cancel.data-v-6209e844 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border: 2rpx solid #2667E9;
|
||||
border-radius: 40rpx;
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.btn-confirm.data-v-6209e844 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
390
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.js
vendored
Normal file
390
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.js
vendored
Normal file
@@ -0,0 +1,390 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_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");
|
||||
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_checkbox2 + _easycom_up_checkbox_group2 + _easycom_u_popup2 + _easycom_up_upload2)();
|
||||
}
|
||||
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";
|
||||
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)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "rectification",
|
||||
setup(__props) {
|
||||
const hazardId = common_vendor.ref("");
|
||||
const assignId = common_vendor.ref("");
|
||||
const rectifyId = common_vendor.ref("");
|
||||
const isEdit = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
rectifyPlan: "",
|
||||
// 整改方案
|
||||
rectifyResult: "",
|
||||
// 整改完成情况
|
||||
planCost: "",
|
||||
// 投资资金(计划)
|
||||
actualCost: ""
|
||||
// 投资资金(实际)
|
||||
});
|
||||
const show = common_vendor.ref(false);
|
||||
const value1 = common_vendor.ref(Date.now());
|
||||
common_vendor.ref("");
|
||||
const cateList = 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("、");
|
||||
}
|
||||
return `${selectedUsers.value[0].name}等${selectedUsers.value.length}人`;
|
||||
});
|
||||
const onUserChange = (ids) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:125", "选中的ID:", ids);
|
||||
};
|
||||
const confirmUserSelect = () => {
|
||||
selectedUsers.value = cateList.value.filter((item) => selectedUserIds.value.includes(item.id));
|
||||
showUserPopup.value = false;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:133", "选中的整改人员:", selectedUsers.value);
|
||||
};
|
||||
const fetchDeptUsers = async () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:138", "当前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:156", "整改人员列表:", cateList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:159", "获取部门人员失败:", error);
|
||||
}
|
||||
};
|
||||
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++) {
|
||||
const result = await uploadFilePromise(lists[i].url);
|
||||
let item = fileList1.value[fileListLen];
|
||||
fileList1.value.splice(fileListLen, 1, {
|
||||
...item,
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result
|
||||
});
|
||||
fileListLen++;
|
||||
}
|
||||
};
|
||||
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:214", "上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.rectifyPlan) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入整改方案",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!formData.rectifyResult) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入整改完成情况",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (selectedUsers.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请选择整改人员",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
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 || "";
|
||||
}
|
||||
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 params = {
|
||||
hazardId: hazardId.value,
|
||||
assignId: assignId.value,
|
||||
rectifyPlan: formData.rectifyPlan,
|
||||
rectifyResult: formData.rectifyResult,
|
||||
planCost: Number(formData.planCost) || 0,
|
||||
actualCost: Number(formData.actualCost) || 0,
|
||||
attachments,
|
||||
// 整改人员ID数组
|
||||
rectifyUserIds: selectedUserIds.value.map((id) => Number(id))
|
||||
};
|
||||
if (rectifyId.value) {
|
||||
params.rectifyId = rectifyId.value;
|
||||
}
|
||||
try {
|
||||
const res = await request_api.submitRectification(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: isEdit.value ? "保存成功" : "提交成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || (isEdit.value ? "保存失败" : "提交失败"),
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:296", "提交整改失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const fetchRectifyDetail = async () => {
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "加载中..." });
|
||||
const res = await request_api.getRectifyDetail({ rectifyId: rectifyId.value });
|
||||
common_vendor.index.hideLoading();
|
||||
if (res.code === 0 && res.data) {
|
||||
const data = res.data;
|
||||
formData.rectifyPlan = data.rectifyPlan || "";
|
||||
formData.rectifyResult = data.rectifyResult || "";
|
||||
formData.planCost = data.planCost ? String(data.planCost) : "";
|
||||
formData.actualCost = data.actualCost ? String(data.actualCost) : "";
|
||||
hazardId.value = data.hazardId || "";
|
||||
assignId.value = data.assignId || "";
|
||||
if (data.attachments && data.attachments.length > 0) {
|
||||
fileList1.value = data.attachments.map((att) => ({
|
||||
url: att.filePath.startsWith("http") ? att.filePath : request_request.baseUrl.replace("/api", "") + att.filePath,
|
||||
status: "success",
|
||||
message: "",
|
||||
name: att.fileName,
|
||||
type: att.fileType,
|
||||
filePath: att.filePath
|
||||
// 保存原始路径用于提交
|
||||
}));
|
||||
}
|
||||
if (data.memberIds) {
|
||||
const memberIdArr = data.memberIds.split(",").map((id) => String(id.trim()));
|
||||
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);
|
||||
}
|
||||
common_vendor.index.setNavigationBarTitle({ title: "编辑整改信息" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:356", "获取整改详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const aiGenerating = common_vendor.ref(false);
|
||||
const handleAiGenerate = async () => {
|
||||
if (!hazardId.value) {
|
||||
common_vendor.index.showToast({ title: "缺少隐患信息", icon: "none" });
|
||||
return;
|
||||
}
|
||||
aiGenerating.value = true;
|
||||
try {
|
||||
const detailRes = await request_api.getHiddenDangerDetail({
|
||||
hazardId: hazardId.value,
|
||||
assignId: assignId.value
|
||||
});
|
||||
if (detailRes.code !== 0 || !detailRes.data) {
|
||||
common_vendor.index.showToast({ title: "获取隐患详情失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const { title, description } = detailRes.data;
|
||||
const aiRes = await request_api.generateRectifyPlan({ title, description });
|
||||
if (aiRes.code === 0 && aiRes.data) {
|
||||
if (aiRes.data.rawResponse) {
|
||||
formData.rectifyPlan = aiRes.data.rawResponse;
|
||||
}
|
||||
common_vendor.index.showToast({ title: "AI生成完成", icon: "success", duration: 2e3 });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:393", "AI生成整改方案失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI生成失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiGenerating.value = false;
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId) {
|
||||
hazardId.value = options.hazardId;
|
||||
}
|
||||
if (options.assignId) {
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
fetchDeptUsers();
|
||||
if (options.rectifyId) {
|
||||
rectifyId.value = options.rectifyId;
|
||||
isEdit.value = options.isEdit === "1";
|
||||
fetchRectifyDetail();
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !aiGenerating.value
|
||||
}, !aiGenerating.value ? {} : {}, {
|
||||
b: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI生成整改方案"),
|
||||
c: aiGenerating.value,
|
||||
d: aiGenerating.value,
|
||||
e: common_vendor.o(handleAiGenerate),
|
||||
f: common_vendor.o(($event) => formData.rectifyPlan = $event),
|
||||
g: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
maxlength: -1,
|
||||
autoHeight: true,
|
||||
modelValue: formData.rectifyPlan
|
||||
}),
|
||||
h: common_vendor.o(($event) => formData.rectifyResult = $event),
|
||||
i: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.rectifyResult
|
||||
}),
|
||||
j: common_vendor.o(($event) => formData.planCost = $event),
|
||||
k: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
type: "number",
|
||||
modelValue: formData.planCost
|
||||
}),
|
||||
l: common_vendor.o(($event) => formData.actualCost = $event),
|
||||
m: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
type: "number",
|
||||
modelValue: formData.actualCost
|
||||
}),
|
||||
n: common_vendor.o(($event) => value1.value = $event),
|
||||
o: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
p: common_vendor.t(selectedUsers.value.length > 0 ? selectedUsersText.value : "请选择整改人员(可多选)"),
|
||||
q: selectedUsers.value.length === 0 ? 1 : "",
|
||||
r: common_vendor.o(($event) => showUserPopup.value = true),
|
||||
s: common_vendor.o(($event) => showUserPopup.value = false),
|
||||
t: common_vendor.f(cateList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: "f18ba0ce-7-" + i0 + ",f18ba0ce-6",
|
||||
b: common_vendor.p({
|
||||
label: item.name,
|
||||
name: item.id,
|
||||
activeColor: "#2667E9",
|
||||
shape: "square"
|
||||
}),
|
||||
c: item.id
|
||||
};
|
||||
}),
|
||||
v: common_vendor.o(onUserChange),
|
||||
w: common_vendor.o(($event) => selectedUserIds.value = $event),
|
||||
x: common_vendor.p({
|
||||
placement: "column",
|
||||
modelValue: selectedUserIds.value
|
||||
}),
|
||||
y: common_vendor.o(($event) => showUserPopup.value = false),
|
||||
z: common_vendor.o(confirmUserSelect),
|
||||
A: common_vendor.o(($event) => showUserPopup.value = false),
|
||||
B: common_vendor.p({
|
||||
show: showUserPopup.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
C: common_vendor.o(afterRead),
|
||||
D: common_vendor.o(deletePic),
|
||||
E: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
F: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
|
||||
G: common_vendor.o(handleSubmit),
|
||||
H: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f18ba0ce"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/rectification.js.map
|
||||
12
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.json
vendored
Normal file
12
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"navigationBarTitleText": "隐患整改",
|
||||
"usingComponents": {
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-f18ba0ce', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{H}}"><view class="padding bg-white radius data-v-f18ba0ce"><view class="form-header margin-bottom data-v-f18ba0ce"><view class="form-label data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改方案</view><view class="text-red data-v-f18ba0ce">*</view></view><button class="ai-rectify-btn data-v-f18ba0ce" loading="{{c}}" disabled="{{d}}" bindtap="{{e}}"><text wx:if="{{a}}" class="cuIcon-magic ai-btn-icon data-v-f18ba0ce"></text> {{b}}</button></view><up-textarea wx:if="{{g}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-textarea><view class="form-label margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改完成情况</view><view class="text-red data-v-f18ba0ce">*</view></view><up-textarea wx:if="{{i}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-1" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-textarea><view class="form-label margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">投资资金(计划)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{k}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-2" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-input><view class="form-label margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">投资资金(实际)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{m}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-3" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-input><view class="form-label margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">限定整改时间</view><view class="text-red data-v-f18ba0ce">*</view></view><up-datetime-picker wx:if="{{o}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-4" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"></up-datetime-picker><view class="form-label margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改人员</view><view class="text-red data-v-f18ba0ce">*</view></view><view class="select-trigger data-v-f18ba0ce" bindtap="{{r}}"><view class="{{['select-content', 'data-v-f18ba0ce', q && 'text-gray']}}">{{p}}</view><text class="cuIcon-unfold data-v-f18ba0ce"></text></view><u-popup wx:if="{{B}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-s="{{['d']}}" bindclose="{{A}}" u-i="f18ba0ce-5" bind:__l="__l" u-p="{{B}}"><view class="user-popup data-v-f18ba0ce"><view class="popup-header data-v-f18ba0ce"><view class="popup-title text-bold data-v-f18ba0ce">选择整改人员</view><view class="popup-close data-v-f18ba0ce" bindtap="{{s}}">×</view></view><view class="popup-body data-v-f18ba0ce"><up-checkbox-group wx:if="{{x}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-s="{{['d']}}" bindchange="{{v}}" u-i="f18ba0ce-6,f18ba0ce-5" bind:__l="__l" bindupdateModelValue="{{w}}" u-p="{{x}}"><view wx:for="{{t}}" wx:for-item="item" wx:key="c" class="user-item data-v-f18ba0ce"><up-checkbox wx:if="{{item.b}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></up-checkbox></view></up-checkbox-group></view><view class="popup-footer data-v-f18ba0ce"><button class="btn-cancel data-v-f18ba0ce" bindtap="{{y}}">取消</button><button class="btn-confirm bg-blue data-v-f18ba0ce" bindtap="{{z}}">确定</button></view></view></u-popup><view class="form-label margin-bottom margin-top data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改图片/视频</view><view class="text-red data-v-f18ba0ce">*</view></view><up-upload wx:if="{{E}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindafterRead="{{C}}" binddelete="{{D}}" u-i="f18ba0ce-8" bind:__l="__l" u-p="{{E}}"></up-upload><button class="bg-blue round margin-top-xl data-v-f18ba0ce" bindtap="{{G}}">{{F}}</button></view></view>
|
||||
147
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.wxss
vendored
Normal file
147
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.wxss
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-f18ba0ce {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.ai-rectify-btn.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 60rpx;
|
||||
padding: 0 24rpx;
|
||||
margin: 0;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 30rpx;
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.ai-rectify-btn.data-v-f18ba0ce::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-rectify-btn .ai-btn-icon.data-v-f18ba0ce {
|
||||
margin-right: 6rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.ai-rectify-btn[disabled].data-v-f18ba0ce {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.form-header.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
.form-label.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.form-label .text-red.data-v-f18ba0ce {
|
||||
margin-left: 4rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
.date-input.data-v-f18ba0ce {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: 1rpx solid #F6F6F6;
|
||||
}
|
||||
.date-input text.data-v-f18ba0ce {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger.data-v-f18ba0ce {
|
||||
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-f18ba0ce {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.user-popup.data-v-f18ba0ce {
|
||||
background: #fff;
|
||||
}
|
||||
.user-popup .popup-header.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.user-popup .popup-header .popup-title.data-v-f18ba0ce {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.user-popup .popup-header .popup-close.data-v-f18ba0ce {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.user-popup .popup-body.data-v-f18ba0ce {
|
||||
padding: 20rpx 30rpx;
|
||||
max-height: 600rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.user-popup .user-item.data-v-f18ba0ce {
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
.user-popup .user-item.data-v-f18ba0ce:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.user-popup .popup-footer.data-v-f18ba0ce {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.user-popup .popup-footer button.data-v-f18ba0ce {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.user-popup .popup-footer button.data-v-f18ba0ce::after {
|
||||
border: none;
|
||||
}
|
||||
.user-popup .popup-footer .btn-cancel.data-v-f18ba0ce {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.user-popup .popup-footer .btn-confirm.data-v-f18ba0ce {
|
||||
color: #fff;
|
||||
}
|
||||
112
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.js
vendored
Normal file
112
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.js
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_input2 + _easycom_up_textarea2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_textarea)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "view",
|
||||
setup(__props) {
|
||||
const detailData = common_vendor.reactive({
|
||||
hazardId: "",
|
||||
assignId: "",
|
||||
title: "",
|
||||
level: 0,
|
||||
levelName: "",
|
||||
source: "",
|
||||
description: "",
|
||||
address: "",
|
||||
areaName: "",
|
||||
// 隐患区域名称
|
||||
createdAt: "",
|
||||
attachments: []
|
||||
});
|
||||
const rectifyAttachments = common_vendor.ref([]);
|
||||
const getFullPath = (filePath) => {
|
||||
return 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
|
||||
});
|
||||
};
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId, assignId });
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
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.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId && options.assignId) {
|
||||
fetchDetail(options.hazardId, options.assignId);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: detailData.attachments && detailData.attachments.length > 0
|
||||
}, detailData.attachments && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: getFullPath(img.filePath),
|
||||
c: common_vendor.o(($event) => previewHazardImage(idx), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.o(($event) => detailData.title = $event),
|
||||
d: common_vendor.p({
|
||||
disabled: "true",
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
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({
|
||||
placeholder: "暂无描述",
|
||||
disabled: true,
|
||||
modelValue: detailData.description
|
||||
}),
|
||||
m: common_vendor.t(detailData.source || "暂无"),
|
||||
n: common_vendor.t(detailData.createdAt || "暂无"),
|
||||
o: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4d631e68"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/view.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "查看隐患",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.wxml
vendored
Normal file
@@ -0,0 +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>
|
||||
53
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.wxss
vendored
Normal file
53
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.wxss
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-4d631e68 {
|
||||
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;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.address-btn.data-v-4d631e68 {
|
||||
flex-shrink: 0;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 32rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
315
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
315
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
@@ -0,0 +1,315 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_three_one_api_info = require("../../request/three_one_api/info.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
|
||||
_easycom_u_navbar2();
|
||||
}
|
||||
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
|
||||
if (!Math) {
|
||||
_easycom_u_navbar();
|
||||
}
|
||||
const defaultAvatar = "https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg";
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const loading = common_vendor.ref(true);
|
||||
const userInfo = common_vendor.reactive({
|
||||
userId: "",
|
||||
username: "",
|
||||
nickName: "",
|
||||
deptId: "",
|
||||
deptName: "",
|
||||
role: "",
|
||||
avatar: "",
|
||||
phone: ""
|
||||
});
|
||||
const canAcceptance = common_vendor.computed(() => {
|
||||
return userInfo.role === "admin" || userInfo.role === "manage";
|
||||
});
|
||||
const getImageUrl = (path) => {
|
||||
if (!path)
|
||||
return "";
|
||||
return request_request.toImageUrl(path);
|
||||
};
|
||||
const getUserInfo = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_info.getProfileDetail();
|
||||
if (res.code === 0 && res.data) {
|
||||
userInfo.userId = res.data.userId || "";
|
||||
userInfo.username = res.data.userName || "";
|
||||
userInfo.nickName = res.data.nickName || "";
|
||||
userInfo.deptId = res.data.deptId || "";
|
||||
userInfo.deptName = res.data.deptName || "";
|
||||
userInfo.avatar = res.data.avatar || "";
|
||||
userInfo.phone = res.data.phonenumber || res.data.phone || "";
|
||||
if (res.data.roles && res.data.roles.length > 0) {
|
||||
userInfo.role = res.data.roles[0].roleKey || "";
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:229", "获取用户信息失败:", e);
|
||||
try {
|
||||
const storedUserInfo = common_vendor.index.getStorageSync("userInfo");
|
||||
if (storedUserInfo) {
|
||||
const info = JSON.parse(storedUserInfo);
|
||||
userInfo.userId = info.userId || "";
|
||||
userInfo.username = info.username || "";
|
||||
userInfo.nickName = info.nickName || "";
|
||||
userInfo.deptId = info.deptId || "";
|
||||
userInfo.deptName = info.deptName || "";
|
||||
userInfo.role = info.role || "";
|
||||
userInfo.avatar = info.avatar || "";
|
||||
userInfo.phone = info.phone || "";
|
||||
}
|
||||
} catch (storageError) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:245", "从本地存储获取用户信息失败:", storageError);
|
||||
}
|
||||
}
|
||||
};
|
||||
const infoList = common_vendor.ref([
|
||||
{
|
||||
name: "成员管理",
|
||||
src: "/static/home_icon/chengyuangaunli.png"
|
||||
},
|
||||
{
|
||||
name: "信息填报",
|
||||
src: "/static/home_icon/xinxitianbao.png"
|
||||
},
|
||||
{
|
||||
name: "区域设置",
|
||||
src: "/static/home_icon/quyushezhi.png"
|
||||
},
|
||||
{
|
||||
name: "检查清单",
|
||||
src: "/static/home_icon/jiachaqingdan.png"
|
||||
},
|
||||
{
|
||||
name: "检查记录",
|
||||
src: "/static/home_icon/jianchajilu.png"
|
||||
},
|
||||
{
|
||||
name: "证件管理",
|
||||
src: "/static/home_icon/zhengjianguanli.png"
|
||||
},
|
||||
{
|
||||
name: "隐患排查",
|
||||
src: "/static/home_icon/yinhuanpaicha.png"
|
||||
},
|
||||
{
|
||||
name: "隐患销号",
|
||||
src: "/static/home_icon/yinhuanxiaohao.png"
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// name: '设备登记',
|
||||
// src: '/static/home_icon/shebeidengji.png'
|
||||
// }
|
||||
]);
|
||||
const ViewDetails = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/plandetail/plandetail?id=${item.id}`
|
||||
});
|
||||
};
|
||||
const goDetails = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
|
||||
});
|
||||
};
|
||||
const handleMenuClick = (item) => {
|
||||
const menuRoutes = {
|
||||
"成员管理": "/pages/membermanagemen/membermanagemen",
|
||||
"信息填报": "/pages/corporateInformation/corporateInformation",
|
||||
"区域设置": "/pages/area/management",
|
||||
"检查清单": "/pages/checklist/checklist",
|
||||
"检查记录": "/pages/Inspectionlog/Inspectionlog",
|
||||
"证件管理": "/pages/Idphotomanagement/Idphotomanagement",
|
||||
"隐患排查": "/pages/hiddendanger/Inspection",
|
||||
"隐患销号": "/pages/closeout/application",
|
||||
"设备登记": "/pages/equipmentregistration/equipmentregistration"
|
||||
};
|
||||
const url = menuRoutes[item.name];
|
||||
if (url) {
|
||||
common_vendor.index.navigateTo({ url });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: "功能开发中", icon: "none" });
|
||||
}
|
||||
};
|
||||
const checkPlanParams = common_vendor.ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: ""
|
||||
});
|
||||
const checkPlanData = common_vendor.ref([]);
|
||||
const getCheckPlanLists = async () => {
|
||||
try {
|
||||
const res = await request_api.getCheckPlanList(checkPlanParams.value);
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:331", res);
|
||||
if (res.code === 0) {
|
||||
checkPlanData.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:336", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const formatDate = (dateStr) => {
|
||||
if (!dateStr)
|
||||
return "";
|
||||
return dateStr.split(" ")[0];
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
getUserInfo();
|
||||
getCheckPlanLists();
|
||||
getHiddenDangerLists();
|
||||
});
|
||||
const hiddenDangerParams = common_vendor.ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: ""
|
||||
});
|
||||
const hiddenDangerData = common_vendor.ref([]);
|
||||
const dangerTabs = common_vendor.ref(["全部状态", "待验收", "待整改", "待交办", "验收通过"]);
|
||||
const activeDangerTab = common_vendor.ref(0);
|
||||
const switchDangerTab = (index) => {
|
||||
activeDangerTab.value = index;
|
||||
};
|
||||
const filteredDangerData = common_vendor.computed(() => {
|
||||
if (activeDangerTab.value === 0) {
|
||||
return hiddenDangerData.value;
|
||||
}
|
||||
const status = dangerTabs.value[activeDangerTab.value];
|
||||
return hiddenDangerData.value.filter((item) => item.statusName === status);
|
||||
});
|
||||
const getHiddenDangerLists = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerList(hiddenDangerParams.value);
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:388", res);
|
||||
if (res.code === 0) {
|
||||
hiddenDangerData.value = res.data.records;
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:391", hiddenDangerData.value, 1111);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:394", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad(() => {
|
||||
getHiddenDangerLists();
|
||||
});
|
||||
const viewHazardDetail = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
const goRectification = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
const goAcceptance = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/acceptance?hazardId=${item.hazardId}&assignId=${item.assignId}&rectifyId=${item.rectifyId}`
|
||||
});
|
||||
};
|
||||
const assignHazard = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_assets._imports_0,
|
||||
b: common_vendor.p({
|
||||
title: "三查一曝光",
|
||||
placeholder: false,
|
||||
fixed: false,
|
||||
safeAreaInsetTop: true,
|
||||
bgColor: "transparent",
|
||||
titleColor: "#fff",
|
||||
border: false,
|
||||
leftIcon: ""
|
||||
}),
|
||||
c: getImageUrl(userInfo.avatar) || defaultAvatar,
|
||||
d: common_vendor.t(userInfo.deptName || "未知部门"),
|
||||
e: common_vendor.t(userInfo.phone || "未绑定"),
|
||||
f: common_vendor.f(infoList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: item.src,
|
||||
b: common_vendor.t(item.name),
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => handleMenuClick(item), index)
|
||||
};
|
||||
}),
|
||||
g: checkPlanData.value.length === 0
|
||||
}, checkPlanData.value.length === 0 ? {} : {}, {
|
||||
h: common_vendor.f(checkPlanData.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.name),
|
||||
b: common_vendor.t(item.runModeName),
|
||||
c: common_vendor.t(item.cycle),
|
||||
d: common_vendor.t(formatDate(item.planStartTime)),
|
||||
e: common_vendor.t(formatDate(item.planEndTime)),
|
||||
f: item.progress + "%",
|
||||
g: common_vendor.t(item.progress),
|
||||
h: common_vendor.t(item.totalCount),
|
||||
i: common_vendor.t(item.totalCount - item.finishedCount),
|
||||
j: common_vendor.t(item.finishedCount),
|
||||
k: common_vendor.o(($event) => ViewDetails(item), item.id),
|
||||
l: item.finishedCount < item.totalCount
|
||||
}, item.finishedCount < item.totalCount ? {
|
||||
m: common_vendor.o(($event) => goDetails(item), item.id)
|
||||
} : {}, {
|
||||
n: item.id
|
||||
});
|
||||
}),
|
||||
i: common_vendor.f(dangerTabs.value, (tab, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(tab),
|
||||
b: activeDangerTab.value === index ? 1 : "",
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => switchDangerTab(index), index)
|
||||
};
|
||||
}),
|
||||
j: filteredDangerData.value.length === 0
|
||||
}, filteredDangerData.value.length === 0 ? {} : {}, {
|
||||
k: common_vendor.f(filteredDangerData.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.levelName),
|
||||
c: item.levelName === "轻微隐患" ? 1 : "",
|
||||
d: item.levelName === "一般隐患" ? 1 : "",
|
||||
e: item.levelName === "重大隐患" ? 1 : "",
|
||||
f: common_vendor.t(item.address),
|
||||
g: common_vendor.t(item.source),
|
||||
h: common_vendor.t(item.statusName),
|
||||
i: common_vendor.t(item.createdAt),
|
||||
j: common_vendor.o(($event) => viewHazardDetail(item), item.hazardId),
|
||||
k: item.statusName === "待整改" && item.canEdit
|
||||
}, item.statusName === "待整改" && item.canEdit ? {
|
||||
l: common_vendor.o(($event) => goRectification(item), item.hazardId)
|
||||
} : {}, {
|
||||
m: item.statusName === "待验收" && canAcceptance.value
|
||||
}, item.statusName === "待验收" && canAcceptance.value ? {
|
||||
n: common_vendor.o(($event) => goAcceptance(item), item.hazardId)
|
||||
} : {}, {
|
||||
o: item.statusName === "待交办"
|
||||
}, item.statusName === "待交办" ? {
|
||||
p: common_vendor.o(($event) => assignHazard(item), item.hazardId)
|
||||
} : {}, {
|
||||
q: item.hazardId
|
||||
});
|
||||
}),
|
||||
l: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "三查一曝光",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white",
|
||||
"usingComponents": {
|
||||
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
291
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal file
291
unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.header-wrapper.data-v-1cf27b2a {
|
||||
position: relative;
|
||||
padding-bottom: 40rpx;
|
||||
overflow: hidden;
|
||||
background-color: #2472EA;
|
||||
}
|
||||
.header-bg-image.data-v-1cf27b2a {
|
||||
position: absolute;
|
||||
top: 2rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
opacity: 1.6;
|
||||
}
|
||||
.user-card.data-v-1cf27b2a {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 42rpx 30rpx 54rpx 30rpx;
|
||||
}
|
||||
.user-card .user-avatar.data-v-1cf27b2a {
|
||||
flex-shrink: 0;
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
.user-card .user-info.data-v-1cf27b2a {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
overflow: hidden;
|
||||
max-width: 576rpx;
|
||||
}
|
||||
.user-card .user-info .user-dept.data-v-1cf27b2a {
|
||||
font-size: 34rpx;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-card .user-info .user-phone.data-v-1cf27b2a {
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.user-card .switch-btn.data-v-1cf27b2a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 16rpx 24rpx;
|
||||
border-radius: 30rpx;
|
||||
color: #285CE9;
|
||||
font-size: 26rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.user-card .switch-btn text.data-v-1cf27b2a {
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.page-content.data-v-1cf27b2a {
|
||||
background: #F4F7FB;
|
||||
border-radius: 40rpx 40rpx 0rpx 0rpx;
|
||||
margin-top: -40rpx;
|
||||
padding: 30rpx;
|
||||
padding-bottom: 50rpx;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
min-height: calc(100vh - 400rpx);
|
||||
}
|
||||
.menu-card.data-v-1cf27b2a {
|
||||
background: #fff;
|
||||
border-radius: 40rpx 40rpx 0 0rpx;
|
||||
padding: 44rpx 30rpx 30rpx 30rpx;
|
||||
margin-left: -40rpx;
|
||||
margin-right: -40rpx;
|
||||
margin-top: -30rpx;
|
||||
}
|
||||
.menu-grid.data-v-1cf27b2a {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.menu-item.data-v-1cf27b2a {
|
||||
width: 20%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 38rpx;
|
||||
}
|
||||
.menu-item .menu-icon.data-v-1cf27b2a {
|
||||
width: 72rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.menu-item .menu-text.data-v-1cf27b2a {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
margin-top: 14rpx;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.avatar-image.data-v-1cf27b2a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.list-list.data-v-1cf27b2a {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.08);
|
||||
border-left: 5px solid #2667E9;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plan-card.data-v-1cf27b2a {
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.plan-header.data-v-1cf27b2a {
|
||||
background: linear-gradient(135deg, #4A90E2 0%, #2667E9 100%);
|
||||
padding: 24rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.plan-header .plan-header-icon.data-v-1cf27b2a {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.plan-header .plan-header-title.data-v-1cf27b2a {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.plan-body.data-v-1cf27b2a {
|
||||
padding: 24rpx 30rpx 10rpx 30rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.plan-stats.data-v-1cf27b2a {
|
||||
display: flex;
|
||||
background: #F5F7FA;
|
||||
border-radius: 12rpx;
|
||||
border: 1rpx solid #E8ECF0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.plan-stats .plan-stat-item.data-v-1cf27b2a {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
border-right: 1rpx solid #E8ECF0;
|
||||
}
|
||||
.plan-stats .plan-stat-item.data-v-1cf27b2a:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
.plan-stats .plan-stat-num.data-v-1cf27b2a {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.plan-stats .plan-stat-label.data-v-1cf27b2a {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.border-tite.data-v-1cf27b2a {
|
||||
width: 10rpx;
|
||||
height: 32rpx;
|
||||
background: #2667E9;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.cu-progress.data-v-1cf27b2a {
|
||||
width: 300rpx;
|
||||
height: 20rpx;
|
||||
background: #ebeef5;
|
||||
border-radius: 100rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cu-progress view.data-v-1cf27b2a {
|
||||
height: 100%;
|
||||
border-radius: 100rpx;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
.bg-green.data-v-1cf27b2a {
|
||||
background: #2667E9;
|
||||
}
|
||||
.border-border.data-v-1cf27b2a {
|
||||
padding: 10rpx;
|
||||
background: #EEF3FF;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #AAC5FC;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.level-tag.data-v-1cf27b2a {
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.level-minor.data-v-1cf27b2a {
|
||||
background: #F6FFED;
|
||||
border: 2rpx solid #B7EB8F;
|
||||
color: #52C41A;
|
||||
}
|
||||
.level-normal.data-v-1cf27b2a {
|
||||
background: #FFF7E6;
|
||||
border: 2rpx solid #FFD591;
|
||||
color: #FA8C16;
|
||||
}
|
||||
.level-major.data-v-1cf27b2a {
|
||||
background: #FFF1F0;
|
||||
border: 2rpx solid #FFA39E;
|
||||
color: #F5222D;
|
||||
}
|
||||
.danger-tab-scroll.data-v-1cf27b2a {
|
||||
white-space: nowrap;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.danger-tab-list.data-v-1cf27b2a {
|
||||
display: inline-flex;
|
||||
gap: 42rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.danger-tab-item.data-v-1cf27b2a {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding-bottom: 12rpx;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.danger-tab-active.data-v-1cf27b2a {
|
||||
font-weight: bold;
|
||||
color: #2667E9 !important;
|
||||
}
|
||||
.danger-tab-active.data-v-1cf27b2a::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 40rpx;
|
||||
height: 6rpx;
|
||||
background: #2667E9;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.danger-card.data-v-1cf27b2a {
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx #F1F5FE;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
border: 2rpx solid #EAECEF;
|
||||
}
|
||||
.danger-info-row.data-v-1cf27b2a {
|
||||
font-size: 28rpx;
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
}
|
||||
.danger-info-row .text-gray.data-v-1cf27b2a {
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
27
unpackage/dist/dev/mp-weixin/pages/login/agreement.js
vendored
Normal file
27
unpackage/dist/dev/mp-weixin/pages/login/agreement.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
__name: "agreement",
|
||||
setup(__props) {
|
||||
const articleUrl = common_vendor.ref("");
|
||||
const webviewStyles = common_vendor.ref({
|
||||
progress: {
|
||||
color: "#3D83F6"
|
||||
// 使用蓝色主题色
|
||||
}
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
articleUrl.value = "http://www.baidu.com/";
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: webviewStyles.value,
|
||||
b: articleUrl.value,
|
||||
c: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b4896b2f"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/agreement.js.map
|
||||
5
unpackage/dist/dev/mp-weixin/pages/login/agreement.json
vendored
Normal file
5
unpackage/dist/dev/mp-weixin/pages/login/agreement.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "用户协议",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/agreement.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/login/agreement.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-b4896b2f', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{c}}"><web-view class="data-v-b4896b2f" webview-styles="{{a}}" src="{{b}}"></web-view></view>
|
||||
26
unpackage/dist/dev/mp-weixin/pages/login/agreement.wxss
vendored
Normal file
26
unpackage/dist/dev/mp-weixin/pages/login/agreement.wxss
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
154
unpackage/dist/dev/mp-weixin/pages/login/enterprise.js
vendored
Normal file
154
unpackage/dist/dev/mp-weixin/pages/login/enterprise.js
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_form_item2 = common_vendor.resolveComponent("up-form-item");
|
||||
const _easycom_up_form2 = common_vendor.resolveComponent("up-form");
|
||||
const _component_lsl_protocol_popup = common_vendor.resolveComponent("lsl-protocol-popup");
|
||||
(_easycom_up_input2 + _easycom_up_form_item2 + _easycom_up_form2 + _component_lsl_protocol_popup)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_form_item = () => "../../uni_modules/uview-plus/components/u-form-item/u-form-item.js";
|
||||
const _easycom_up_form = () => "../../uni_modules/uview-plus/components/u-form/u-form.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_form_item + _easycom_up_form)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "enterprise",
|
||||
setup(__props) {
|
||||
const state = common_vendor.reactive({
|
||||
showSex: false,
|
||||
isAgreed: false,
|
||||
// 用户是否同意协议
|
||||
showProtocolPopup: false,
|
||||
// 是否显示协议弹窗
|
||||
model1: {
|
||||
userInfo: {
|
||||
name: "uview-plus UI",
|
||||
sex: ""
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"userInfo.name": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请填写姓名",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
}
|
||||
});
|
||||
const toggleAgreement = () => {
|
||||
state.isAgreed = !state.isAgreed;
|
||||
};
|
||||
const showProtocol = (type) => {
|
||||
if (type === "user") {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/login/agreement"
|
||||
});
|
||||
} else if (type === "privacy") {
|
||||
state.showProtocolPopup = true;
|
||||
}
|
||||
};
|
||||
const handleRegister = () => {
|
||||
if (!state.isAgreed) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请先阅读并同意用户协议和隐私政策",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/login/enterprise.vue:105", "开始注册流程");
|
||||
};
|
||||
const handleAgreeProtocol = () => {
|
||||
state.isAgreed = true;
|
||||
state.showProtocolPopup = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "已同意协议条款",
|
||||
icon: "success",
|
||||
duration: 1500
|
||||
});
|
||||
};
|
||||
const closeProtocolPopup = () => {
|
||||
state.showProtocolPopup = false;
|
||||
};
|
||||
const other = [
|
||||
[
|
||||
{
|
||||
tit: "《服务协议》",
|
||||
type: "page",
|
||||
// doc自行下载打开文档 page跳转页面
|
||||
content: "/pages/login/agreement"
|
||||
// 文档地址/页面跳转地址
|
||||
},
|
||||
{
|
||||
tit: "《隐私政策》",
|
||||
type: "page",
|
||||
// doc自行下载打开文档 page跳转页面
|
||||
content: "/pages/login/privacy"
|
||||
// 文档地址/页面跳转地址
|
||||
}
|
||||
]
|
||||
];
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请填写营业执照上的企业名称",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
b: common_vendor.sr("item1", "280ea37d-1,280ea37d-0"),
|
||||
c: common_vendor.p({
|
||||
required: true,
|
||||
label: "企业名称",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
d: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入管理员姓名",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
e: common_vendor.sr("item1", "280ea37d-3,280ea37d-0"),
|
||||
f: common_vendor.p({
|
||||
required: true,
|
||||
label: "管理员姓名",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "120"
|
||||
}),
|
||||
g: common_vendor.sr("form1", "280ea37d-0"),
|
||||
h: common_vendor.p({
|
||||
labelPosition: "left",
|
||||
model: state.model1,
|
||||
rules: state.rules
|
||||
}),
|
||||
i: common_vendor.n(state.isAgreed ? "bg-blue" : "bg-gray"),
|
||||
j: !state.isAgreed,
|
||||
k: common_vendor.o(handleRegister),
|
||||
l: state.isAgreed
|
||||
}, state.isAgreed ? {} : {}, {
|
||||
m: state.isAgreed ? 1 : "",
|
||||
n: common_vendor.o(($event) => showProtocol("user")),
|
||||
o: common_vendor.o(($event) => showProtocol("privacy")),
|
||||
p: common_vendor.o(toggleAgreement),
|
||||
q: common_vendor.o(handleAgreeProtocol),
|
||||
r: common_vendor.o(closeProtocolPopup),
|
||||
s: common_vendor.p({
|
||||
title: "用户协议和隐私政策",
|
||||
predesc: "为了更好地保护您的个人信息和合法权益,在使用我们的服务前,请您务必仔细阅读并充分理解以下协议条款。",
|
||||
subdesc: '请您详细阅读各条款内容,特别是免除或限制责任的条款。如您同意以下协议条款,请点击"同意并继续"开始使用我们的服务。',
|
||||
color: "#007AFF",
|
||||
onNeed: state.showProtocolPopup,
|
||||
other,
|
||||
open_type: "getPhoneNumber|agreePrivacyAuthorization"
|
||||
}),
|
||||
t: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-280ea37d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/enterprise.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/pages/login/enterprise.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/pages/login/enterprise.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册新企业",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-form-item": "../../uni_modules/uview-plus/components/u-form-item/u-form-item",
|
||||
"up-form": "../../uni_modules/uview-plus/components/u-form/u-form"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/enterprise.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/login/enterprise.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-280ea37d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{t}}"><view class="padding solid radius margin data-v-280ea37d"><up-form wx:if="{{h}}" class="r data-v-280ea37d" virtualHostClass="r data-v-280ea37d" u-s="{{['d']}}" u-r="form1" u-i="280ea37d-0" bind:__l="__l" u-p="{{h}}"><up-form-item wx:if="{{c}}" class="r data-v-280ea37d" virtualHostClass="r data-v-280ea37d" u-s="{{['d']}}" u-r="item1" u-i="280ea37d-1,280ea37d-0" bind:__l="__l" u-p="{{c}}"><up-input wx:if="{{a}}" class="data-v-280ea37d" virtualHostClass="data-v-280ea37d" u-i="280ea37d-2,280ea37d-1" bind:__l="__l" u-p="{{a}}"></up-input></up-form-item><up-form-item wx:if="{{f}}" class="r data-v-280ea37d" virtualHostClass="r data-v-280ea37d" u-s="{{['d']}}" u-r="item1" u-i="280ea37d-3,280ea37d-0" bind:__l="__l" u-p="{{f}}"><up-input wx:if="{{d}}" class="data-v-280ea37d" virtualHostClass="data-v-280ea37d" u-i="280ea37d-4,280ea37d-3" bind:__l="__l" u-p="{{d}}"></up-input></up-form-item></up-form><view class="margin-top-xl data-v-280ea37d"><button class="{{['round', 'data-v-280ea37d', i]}}" disabled="{{j}}" bindtap="{{k}}"> 申请注册 </button></view><view class="protocol-agreement data-v-280ea37d"><view class="protocol-checkbox data-v-280ea37d" bindtap="{{p}}"><view class="{{['checkbox', 'data-v-280ea37d', m && 'checked']}}"><text wx:if="{{l}}" class="checkmark data-v-280ea37d">✓</text></view><text class="protocol-text data-v-280ea37d"> 我已阅读并接受 <text class="protocol-link data-v-280ea37d" catchtap="{{n}}">《服务协议》</text> 和 <text class="protocol-link data-v-280ea37d" catchtap="{{o}}">《隐私政策》</text></text></view></view><view class="container data-v-280ea37d"><lsl-protocol-popup wx:if="{{s}}" class="data-v-280ea37d" virtualHostClass="data-v-280ea37d" bindagree="{{q}}" bindclose="{{r}}" u-i="280ea37d-5" bind:__l="__l" u-p="{{s}}"></lsl-protocol-popup></view></view></view>
|
||||
59
unpackage/dist/dev/mp-weixin/pages/login/enterprise.wxss
vendored
Normal file
59
unpackage/dist/dev/mp-weixin/pages/login/enterprise.wxss
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
/* 协议同意区域 */
|
||||
.protocol-agreement.data-v-280ea37d {
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.protocol-checkbox.data-v-280ea37d {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 15rpx;
|
||||
}
|
||||
.checkbox.data-v-280ea37d {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border: 2rpx solid #ddd;
|
||||
border-radius: 6rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.3s ease;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
.checkbox.checked.data-v-280ea37d {
|
||||
background-color: #007AFF;
|
||||
border-color: #007AFF;
|
||||
}
|
||||
.checkmark.data-v-280ea37d {
|
||||
color: white;
|
||||
font-size: 20rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.protocol-text.data-v-280ea37d {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
flex: 1;
|
||||
}
|
||||
.protocol-link.data-v-280ea37d {
|
||||
color: #007AFF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 注册按钮样式 */
|
||||
.bg-gray.data-v-280ea37d {
|
||||
background-color: #ccc !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
.bg-blue.data-v-280ea37d {
|
||||
background-color: #007AFF !important;
|
||||
color: white !important;
|
||||
}
|
||||
button[disabled].data-v-280ea37d {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
button.data-v-280ea37d:not([disabled]):active {
|
||||
transform: scale(0.98);
|
||||
transition: transform 0.1s ease;
|
||||
}
|
||||
170
unpackage/dist/dev/mp-weixin/pages/login/forget.js
vendored
Normal file
170
unpackage/dist/dev/mp-weixin/pages/login/forget.js
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
if (!Array) {
|
||||
const _component_cu_custom = common_vendor.resolveComponent("cu-custom");
|
||||
_component_cu_custom();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "forget",
|
||||
setup(__props) {
|
||||
const phone = common_vendor.ref("");
|
||||
const password = common_vendor.ref("");
|
||||
const code = common_vendor.ref("");
|
||||
const second = common_vendor.ref(0);
|
||||
const showPassword = common_vendor.ref(false);
|
||||
let timer = null;
|
||||
const codeText = common_vendor.computed(() => {
|
||||
if (second.value === 0) {
|
||||
return "获取验证码";
|
||||
} else {
|
||||
const secondStr = second.value < 10 ? `0${second.value}` : second.value;
|
||||
return `重新获取${secondStr}`;
|
||||
}
|
||||
});
|
||||
const togglePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
};
|
||||
const getCode = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "手机号不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (second.value > 0) {
|
||||
return;
|
||||
}
|
||||
second.value = 60;
|
||||
startCountdown();
|
||||
common_vendor.index.request({
|
||||
url: "http://example.com/api/code",
|
||||
data: {
|
||||
phone: phone.value,
|
||||
type: "forget"
|
||||
},
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "获取验证码失败",
|
||||
icon: "none"
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "验证码已发送"
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
second.value = 0;
|
||||
clearCountdown();
|
||||
}
|
||||
});
|
||||
};
|
||||
const startCountdown = () => {
|
||||
clearCountdown();
|
||||
timer = setInterval(() => {
|
||||
second.value--;
|
||||
if (second.value === 0) {
|
||||
clearCountdown();
|
||||
}
|
||||
}, 1e3);
|
||||
};
|
||||
const clearCountdown = () => {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
};
|
||||
const handleReset = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "手机号不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (password.value.length < 6) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "密码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (code.value.length !== 4) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "验证码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.request({
|
||||
url: "http://example.com/api/forget",
|
||||
data: {
|
||||
phone: phone.value,
|
||||
password: password.value,
|
||||
code: code.value
|
||||
},
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "修改密码失败",
|
||||
icon: "none"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "修改密码成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onUnmounted(() => {
|
||||
clearCountdown();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
isBack: true
|
||||
}),
|
||||
b: common_assets._imports_0$5,
|
||||
c: phone.value,
|
||||
d: common_vendor.o(($event) => phone.value = $event.detail.value),
|
||||
e: common_assets._imports_1$3,
|
||||
f: !showPassword.value,
|
||||
g: password.value,
|
||||
h: common_vendor.o(($event) => password.value = $event.detail.value),
|
||||
i: showPassword.value ? 1 : "",
|
||||
j: common_vendor.o(togglePassword),
|
||||
k: common_vendor.t(codeText.value),
|
||||
l: second.value > 0 ? 1 : "",
|
||||
m: common_vendor.o(getCode),
|
||||
n: common_vendor.o(handleReset),
|
||||
o: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79044ba6"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/forget.js.map
|
||||
5
unpackage/dist/dev/mp-weixin/pages/login/forget.json
vendored
Normal file
5
unpackage/dist/dev/mp-weixin/pages/login/forget.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "忘记密码",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/forget.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/login/forget.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-79044ba6', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{o}}"><cu-custom wx:if="{{a}}" class="data-v-79044ba6" virtualHostClass="data-v-79044ba6" u-s="{{['d']}}" u-i="79044ba6-0" bind:__l="__l" u-p="{{a}}"><view class="data-v-79044ba6" slot="backText">返回</view><view class="data-v-79044ba6" slot="content">忘记密码</view></cu-custom><view class="list data-v-79044ba6"><view class="tishi data-v-79044ba6">若您忘记了密码,可在此重新设置新密码。</view><view class="list-call data-v-79044ba6"><image class="img data-v-79044ba6" src="{{b}}"></image><input class="sl-input data-v-79044ba6" type="number" maxlength="11" placeholder="请输入手机号" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-79044ba6"><image class="img data-v-79044ba6" src="{{e}}"></image><input class="sl-input data-v-79044ba6" type="text" maxlength="32" placeholder="请输入新密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><text class="{{['eye-icon', 'data-v-79044ba6', i && 'eye-active']}}" bindtap="{{j}}"></text></view><view class="list-call data-v-79044ba6"><view class="{{['yzm', 'data-v-79044ba6', l && 'yzms']}}" bindtap="{{m}}">{{k}}</view></view></view><view class="padding-lr data-v-79044ba6"><view class="button-login data-v-79044ba6" hover-class="button-hover" bindtap="{{n}}"><text class="data-v-79044ba6">修改密码</text></view></view></view>
|
||||
116
unpackage/dist/dev/mp-weixin/pages/login/forget.wxss
vendored
Normal file
116
unpackage/dist/dev/mp-weixin/pages/login/forget.wxss
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page.data-v-79044ba6 {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.content.data-v-79044ba6 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.tishi.data-v-79044ba6 {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
.list.data-v-79044ba6 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.list .list-call.data-v-79044ba6 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list .list-call .img.data-v-79044ba6 {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.list .list-call .sl-input.data-v-79044ba6 {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-79044ba6 {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-79044ba6::before {
|
||||
content: "\e69c";
|
||||
/* 闭眼图标的unicode */
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-79044ba6 {
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-79044ba6::before {
|
||||
content: "\e69d";
|
||||
/* 睁眼图标的unicode */
|
||||
}
|
||||
.list .list-call .yzm.data-v-79044ba6 {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .yzm.yzms.data-v-79044ba6 {
|
||||
color: #999999;
|
||||
}
|
||||
.padding-lr.data-v-79044ba6 {
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.button-login.data-v-79044ba6 {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
}
|
||||
.button-hover.data-v-79044ba6 {
|
||||
opacity: 0.8;
|
||||
}
|
||||
96
unpackage/dist/dev/mp-weixin/pages/login/login.js
vendored
Normal file
96
unpackage/dist/dev/mp-weixin/pages/login/login.js
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const _sfc_main = {
|
||||
__name: "login",
|
||||
setup(__props) {
|
||||
const username = common_vendor.ref("");
|
||||
const password = common_vendor.ref("");
|
||||
const showPassword = common_vendor.ref(true);
|
||||
const changePassword = () => {
|
||||
showPassword.value = !showPassword.value;
|
||||
};
|
||||
const handleLogin = async () => {
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:72", "点击登录按钮");
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:73", "用户名:", username.value);
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:74", "密码:", password.value);
|
||||
if (!username.value) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "请输入用户名"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!password.value) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "请输入密码"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:95", "开始调用登录接口...");
|
||||
const res = await request_api.login({
|
||||
username: username.value,
|
||||
password: password.value
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:102", "登录接口返回:", res);
|
||||
if (res.code === 0) {
|
||||
if (res.data.token) {
|
||||
common_vendor.index.setStorageSync("token", res.data.token);
|
||||
}
|
||||
const userInfo = {
|
||||
userId: res.data.userId,
|
||||
username: res.data.username,
|
||||
nickName: res.data.nickName,
|
||||
deptId: res.data.deptId,
|
||||
deptName: res.data.deptName,
|
||||
role: res.data.role,
|
||||
isDept: res.data.isDept
|
||||
};
|
||||
common_vendor.index.setStorageSync("userInfo", JSON.stringify(userInfo));
|
||||
common_vendor.index.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "登录失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/login/login.vue:138", "登录失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_assets._imports_0$4,
|
||||
b: common_assets._imports_0$5,
|
||||
c: username.value,
|
||||
d: common_vendor.o(($event) => username.value = $event.detail.value),
|
||||
e: common_assets._imports_1$3,
|
||||
f: showPassword.value,
|
||||
g: password.value,
|
||||
h: common_vendor.o(($event) => password.value = $event.detail.value),
|
||||
i: showPassword.value ? "/static/index/cl.png" : "/static/index/op.png",
|
||||
j: common_vendor.o(changePassword),
|
||||
k: common_vendor.o(handleLogin),
|
||||
l: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e4e4508d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/login.js.map
|
||||
5
unpackage/dist/dev/mp-weixin/pages/login/login.json
vendored
Normal file
5
unpackage/dist/dev/mp-weixin/pages/login/login.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "登录页面",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/login.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/login/login.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{l}}"><view class="header data-v-e4e4508d"><image src="{{a}}" class="bg-image data-v-e4e4508d"></image><view class="padding login data-v-e4e4508d"><view class="text-xl text-black text-bold data-v-e4e4508d">账号登录</view><view class="padding-top data-v-e4e4508d">欢迎登录三查一曝光平台</view></view></view><view class="list data-v-e4e4508d"><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{b}}"></image><input class="sl-input data-v-e4e4508d" type="text" placeholder="请输入用户名" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{e}}"></image><input class="sl-input data-v-e4e4508d" type="text" maxlength="32" placeholder="请输入密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><image class="eye-img data-v-e4e4508d" src="{{i}}" bindtap="{{j}}"></image></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button></view></view>
|
||||
182
unpackage/dist/dev/mp-weixin/pages/login/login.wxss
vendored
Normal file
182
unpackage/dist/dev/mp-weixin/pages/login/login.wxss
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page.data-v-e4e4508d {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.content.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.header.data-v-e4e4508d {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.header .bg-image.data-v-e4e4508d {
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.login.data-v-e4e4508d {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.list.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
background-color: #FFFFFF;
|
||||
margin-top: -2rpx;
|
||||
/* 消除可能的间隙 */
|
||||
}
|
||||
.list .list-call.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list .list-call .img.data-v-e4e4508d {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.list .list-call .sl-input.data-v-e4e4508d {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.list .list-call .eye-img.data-v-e4e4508d {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.agreement.data-v-e4e4508d {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
color: #3D83F6;
|
||||
text-align: center;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.agreement .link.data-v-e4e4508d {
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
}
|
||||
.agreement .link.data-v-e4e4508d:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.padding-lr.data-v-e4e4508d {
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.button-login.data-v-e4e4508d {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
border: none;
|
||||
}
|
||||
.button-login.data-v-e4e4508d::after {
|
||||
border: none;
|
||||
}
|
||||
.button-report.data-v-e4e4508d {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #FF7878 0%, #F2505B 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.margin-top.data-v-e4e4508d {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.button-hover.data-v-e4e4508d {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.text-blue.data-v-e4e4508d {
|
||||
color: #3D83F6;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.icon-image.data-v-e4e4508d {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.text-xl.data-v-e4e4508d {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.text-black.data-v-e4e4508d {
|
||||
color: #000000;
|
||||
}
|
||||
.text-bold.data-v-e4e4508d {
|
||||
font-weight: bold;
|
||||
}
|
||||
.padding.data-v-e4e4508d {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.padding-top.data-v-e4e4508d {
|
||||
padding-top: 15rpx;
|
||||
}
|
||||
.protocol-box.data-v-e4e4508d {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.protocol-box .protocol-link.data-v-e4e4508d {
|
||||
font-size: 28rpx;
|
||||
color: #3D83F6;
|
||||
text-decoration: underline;
|
||||
}
|
||||
203
unpackage/dist/dev/mp-weixin/pages/login/reg.js
vendored
Normal file
203
unpackage/dist/dev/mp-weixin/pages/login/reg.js
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _component_cu_custom = common_vendor.resolveComponent("cu-custom");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_form_item2 = common_vendor.resolveComponent("up-form-item");
|
||||
const _easycom_up_form2 = common_vendor.resolveComponent("up-form");
|
||||
(_component_cu_custom + _easycom_up_input2 + _easycom_up_form_item2 + _easycom_up_form2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_form_item = () => "../../uni_modules/uview-plus/components/u-form-item/u-form-item.js";
|
||||
const _easycom_up_form = () => "../../uni_modules/uview-plus/components/u-form/u-form.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_form_item + _easycom_up_form)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "reg",
|
||||
setup(__props) {
|
||||
const phone = common_vendor.ref("");
|
||||
const password = common_vendor.ref("");
|
||||
const code = common_vendor.ref("");
|
||||
const invitation = common_vendor.ref("");
|
||||
const second = common_vendor.ref(0);
|
||||
common_vendor.ref(false);
|
||||
const state = common_vendor.reactive({
|
||||
showSex: false,
|
||||
model1: {
|
||||
userInfo: {
|
||||
name: "uview-plus UI",
|
||||
sex: ""
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"userInfo.name": {
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请填写姓名",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
}
|
||||
});
|
||||
common_vendor.computed(() => {
|
||||
if (second.value === 0) {
|
||||
return "获取验证码";
|
||||
} else {
|
||||
const secondStr = second.value < 10 ? `0${second.value}` : second.value;
|
||||
return `重新获取${secondStr}`;
|
||||
}
|
||||
});
|
||||
const handleRegister = () => {
|
||||
if (phone.value.length !== 11) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "手机号不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (password.value.length < 6) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "密码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (code.value.length !== 4) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "验证码不正确"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.request({
|
||||
url: "http://example.com/api/register",
|
||||
data: {
|
||||
phone: phone.value,
|
||||
password: password.value,
|
||||
code: code.value,
|
||||
invitation: invitation.value
|
||||
},
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code != 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "注册失败",
|
||||
icon: "none"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.msg || "注册成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "网络请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onUnmounted(() => {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
isBack: true
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入企业名称",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
c: common_vendor.sr("item1", "561d431d-2,561d431d-1"),
|
||||
d: common_vendor.p({
|
||||
label: "加入企业",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
e: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
f: common_vendor.sr("item1", "561d431d-4,561d431d-1"),
|
||||
g: common_vendor.p({
|
||||
required: true,
|
||||
label: "真实姓名",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
h: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "选择",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
i: common_vendor.sr("item1", "561d431d-6,561d431d-1"),
|
||||
j: common_vendor.p({
|
||||
required: true,
|
||||
label: "选择分组/部门",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "120"
|
||||
}),
|
||||
k: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入手机号码",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
l: common_vendor.sr("item1", "561d431d-8,561d431d-1"),
|
||||
m: common_vendor.p({
|
||||
required: true,
|
||||
label: "手机号码",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
n: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入密码",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
o: common_vendor.sr("item1", "561d431d-10,561d431d-1"),
|
||||
p: common_vendor.p({
|
||||
required: true,
|
||||
label: "密码",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
q: common_vendor.p({
|
||||
border: "none",
|
||||
placeholder: "请输入密码",
|
||||
inputAlign: "right"
|
||||
}),
|
||||
r: common_vendor.sr("item1", "561d431d-12,561d431d-1"),
|
||||
s: common_vendor.p({
|
||||
required: true,
|
||||
label: "确认密码",
|
||||
prop: "userInfo.name",
|
||||
borderBottom: true,
|
||||
["label-width"]: "90"
|
||||
}),
|
||||
t: common_vendor.sr("form1", "561d431d-1"),
|
||||
v: common_vendor.p({
|
||||
labelPosition: "left",
|
||||
model: state.model1,
|
||||
rules: state.rules
|
||||
}),
|
||||
w: common_vendor.o(handleRegister),
|
||||
x: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-561d431d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/reg.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/pages/login/reg.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/pages/login/reg.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册账号",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-form-item": "../../uni_modules/uview-plus/components/u-form-item/u-form-item",
|
||||
"up-form": "../../uni_modules/uview-plus/components/u-form/u-form"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/reg.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/login/reg.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['content', 'data-v-561d431d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{x}}"><view class="header data-v-561d431d"><cu-custom wx:if="{{a}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-s="{{['d']}}" u-i="561d431d-0" bind:__l="__l" u-p="{{a}}"><view class="data-v-561d431d" slot="backText">返回</view><view class="data-v-561d431d" slot="content">注册新成员账号</view></cu-custom></view><view class="padding solid radius margin data-v-561d431d"><up-form wx:if="{{v}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="form1" u-i="561d431d-1" bind:__l="__l" u-p="{{v}}"><up-form-item wx:if="{{d}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-2,561d431d-1" bind:__l="__l" u-p="{{d}}"><up-input wx:if="{{b}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-3,561d431d-2" bind:__l="__l" u-p="{{b}}"></up-input></up-form-item><up-form-item wx:if="{{g}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-4,561d431d-1" bind:__l="__l" u-p="{{g}}"><up-input wx:if="{{e}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-5,561d431d-4" bind:__l="__l" u-p="{{e}}"></up-input></up-form-item><up-form-item wx:if="{{j}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-6,561d431d-1" bind:__l="__l" u-p="{{j}}"><up-input wx:if="{{h}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-7,561d431d-6" bind:__l="__l" u-p="{{h}}"></up-input></up-form-item><up-form-item wx:if="{{m}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-8,561d431d-1" bind:__l="__l" u-p="{{m}}"><up-input wx:if="{{k}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-9,561d431d-8" bind:__l="__l" u-p="{{k}}"></up-input></up-form-item><up-form-item wx:if="{{p}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-10,561d431d-1" bind:__l="__l" u-p="{{p}}"><up-input wx:if="{{n}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-11,561d431d-10" bind:__l="__l" u-p="{{n}}"></up-input></up-form-item><up-form-item wx:if="{{s}}" class="r data-v-561d431d" virtualHostClass="r data-v-561d431d" u-s="{{['d']}}" u-r="item1" u-i="561d431d-12,561d431d-1" bind:__l="__l" u-p="{{s}}"><up-input wx:if="{{q}}" class="data-v-561d431d" virtualHostClass="data-v-561d431d" u-i="561d431d-13,561d431d-12" bind:__l="__l" u-p="{{q}}"></up-input></up-form-item></up-form><view class=" data-v-561d431d"><view class="button-login data-v-561d431d" hover-class="button-hover" bindtap="{{w}}"><text class="data-v-561d431d">申请加入</text></view></view></view></view>
|
||||
128
unpackage/dist/dev/mp-weixin/pages/login/reg.wxss
vendored
Normal file
128
unpackage/dist/dev/mp-weixin/pages/login/reg.wxss
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
page.data-v-561d431d {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.content.data-v-561d431d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.header.data-v-561d431d {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.header image.data-v-561d431d {
|
||||
width: 100%;
|
||||
}
|
||||
.list.data-v-561d431d {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 50rpx;
|
||||
padding-left: 70rpx;
|
||||
padding-right: 70rpx;
|
||||
}
|
||||
.list .list-call.data-v-561d431d {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
color: #333333;
|
||||
background: #F5F7FB;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F5F7FB;
|
||||
margin-top: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list .list-call .img.data-v-561d431d {
|
||||
width: 30rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.list .list-call .sl-input.data-v-561d431d {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-561d431d {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
}
|
||||
.list .list-call .eye-icon.data-v-561d431d::before {
|
||||
content: "\e69c";
|
||||
/* 闭眼图标的unicode */
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-561d431d {
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .eye-icon.eye-active.data-v-561d431d::before {
|
||||
content: "\e69d";
|
||||
/* 睁眼图标的unicode */
|
||||
}
|
||||
.list .list-call .yzm.data-v-561d431d {
|
||||
width: 200rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #3D83F6;
|
||||
}
|
||||
.list .list-call .yzm.yzms.data-v-561d431d {
|
||||
color: #999999;
|
||||
}
|
||||
.code-icon.data-v-561d431d::before {
|
||||
content: "\e682";
|
||||
/* 验证码图标的unicode */
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.invite-icon.data-v-561d431d::before {
|
||||
content: "\e683";
|
||||
/* 邀请码图标的unicode */
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.button-login.data-v-561d431d {
|
||||
color: #FFFFFF;
|
||||
font-size: 34rpx;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: linear-gradient(90deg, #3E95F1 0%, #4269F5 100%);
|
||||
border-radius: 50rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 130rpx;
|
||||
}
|
||||
.button-hover.data-v-561d431d {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.data-v-561d431d .up-input__input {
|
||||
color: #3D83F6;
|
||||
}
|
||||
21
unpackage/dist/dev/mp-weixin/pages/login/success.js
vendored
Normal file
21
unpackage/dist/dev/mp-weixin/pages/login/success.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const success = true;
|
||||
const _sfc_main = {
|
||||
__name: "success",
|
||||
setup(__props) {
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: success
|
||||
}, {
|
||||
b: common_assets._imports_0$6
|
||||
}, {
|
||||
d: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b27d95ff"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/success.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/pages/login/success.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/pages/login/success.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "注册成功",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/login/success.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/login/success.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-b27d95ff', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{d}}"><view wx:if="{{a}}" class="text-center data-v-b27d95ff"><image class="data-v-b27d95ff" src="{{b}}" style="width:160rpx;height:160rpx;margin-top:140rpx"></image><view class="text-bold margin-bottom-xl margin-top-xl data-v-b27d95ff">注册成功</view><view class="text-gray data-v-b27d95ff">等待管理员确认后,才能进行账号登录</view><button class="bg-blue round lg but data-v-b27d95ff">返回首页</button></view><view wx:else class="text-center data-v-b27d95ff"><image class="data-v-b27d95ff" src="{{c}}" style="width:160rpx;height:160rpx;margin-top:140rpx"></image><view class="text-bold margin-bottom-xl margin-top-xl data-v-b27d95ff">注册异常</view><view class="text-gray data-v-b27d95ff">员工已注册,如账号异常请联系管理员</view><button class="bg-blue round lg but data-v-b27d95ff">返回首页</button></view></view>
|
||||
6
unpackage/dist/dev/mp-weixin/pages/login/success.wxss
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/pages/login/success.wxss
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
.but.data-v-b27d95ff {
|
||||
width: 248rpx;
|
||||
height: 88rpx;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user