first commit
This commit is contained in:
338
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.js
vendored
Normal file
338
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.js
vendored
Normal file
@@ -0,0 +1,338 @@
|
||||
"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_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_choose2 = common_vendor.resolveComponent("up-choose");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_upload2 + _easycom_up_input2 + _easycom_up_choose2 + _easycom_u_popup2 + _easycom_up_textarea2)();
|
||||
}
|
||||
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";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_upload + _easycom_up_input + _easycom_up_choose + _easycom_u_popup + _easycom_up_textarea)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "Inspection",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
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) {
|
||||
console.error("获取任务信息失败:", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.id) {
|
||||
fetchTaskInfo(options.id);
|
||||
}
|
||||
});
|
||||
const formData = common_vendor.reactive({
|
||||
title: "",
|
||||
// 隐患标题
|
||||
level: 0,
|
||||
// 隐患等级索引
|
||||
description: "",
|
||||
// 隐患描述
|
||||
tagIndex: 0
|
||||
// 隐患标签索引
|
||||
});
|
||||
const lng = common_vendor.ref(0);
|
||||
const lat = common_vendor.ref(0);
|
||||
const showAddressPopup = common_vendor.ref(false);
|
||||
const addressKeyword = common_vendor.ref("");
|
||||
const selectedAddress = common_vendor.ref("");
|
||||
const tempSelectedAddress = common_vendor.ref("");
|
||||
const addressList = common_vendor.ref([
|
||||
"湖南省湘西土家族苗族自治州吉首市人民北路105号",
|
||||
"湖南省湘西土家族苗族自治州吉首市人民南路100号",
|
||||
"湖南省湘西土家族苗族自治州吉首市团结广场",
|
||||
"湖南省湘西土家族苗族自治州吉首市火车站"
|
||||
]);
|
||||
const filteredAddressList = common_vendor.computed(() => {
|
||||
if (!addressKeyword.value)
|
||||
return addressList.value;
|
||||
return addressList.value.filter((item) => item.includes(addressKeyword.value));
|
||||
});
|
||||
const confirmAddress = () => {
|
||||
if (tempSelectedAddress.value) {
|
||||
selectedAddress.value = tempSelectedAddress.value;
|
||||
}
|
||||
showAddressPopup.value = false;
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
if (!formData.title) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (fileList1.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请上传隐患图片/视频", icon: "none" });
|
||||
return;
|
||||
}
|
||||
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 selectedTag = tagOptions.value[formData.tagIndex];
|
||||
const tagId = selectedTag ? selectedTag.id : null;
|
||||
const params = {
|
||||
title: formData.title,
|
||||
//标题
|
||||
level: formData.level + 1,
|
||||
// 1.轻微隐患 2.一般隐患 3.重大隐患
|
||||
lng: lng.value || 0,
|
||||
//经度
|
||||
lat: lat.value || 0,
|
||||
//纬度
|
||||
address: selectedAddress.value || "",
|
||||
//详细地址
|
||||
description: formData.description || "",
|
||||
//隐患描述
|
||||
tagId,
|
||||
//隐患标签ID
|
||||
taskId: taskId.value,
|
||||
//关联任务ID
|
||||
checkPointId: checkPointId.value,
|
||||
//关联检查点ID
|
||||
source: "cillum labore veniam"
|
||||
//隐患来源
|
||||
};
|
||||
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 = "";
|
||||
fileList1.value = [];
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "新增失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(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;
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取隐患列表失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
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 acceptance = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/hiddendanger/acceptance"
|
||||
});
|
||||
};
|
||||
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.AUTH_TOKEN
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error("上传失败:", err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
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) {
|
||||
console.error(error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
fetchTagOptions();
|
||||
const levelOptions = common_vendor.ref([
|
||||
{ id: 1, title: "轻微隐患" },
|
||||
{ id: 2, title: "一般隐患" },
|
||||
{ id: 3, title: "重大隐患" }
|
||||
]);
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(hiddenDangerList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.statusName),
|
||||
c: common_vendor.t(item.levelName),
|
||||
d: common_vendor.t(item.address),
|
||||
e: common_vendor.t(item.createdAt),
|
||||
f: common_vendor.o(($event) => details(item), item.hazardId),
|
||||
g: common_vendor.o(($event) => Rectification(item), item.hazardId),
|
||||
h: common_vendor.o(($event) => acceptance(), item.hazardId),
|
||||
i: 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: common_vendor.o(($event) => formData.title = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: formData.title
|
||||
}),
|
||||
i: common_vendor.o(($event) => formData.level = $event),
|
||||
j: common_vendor.p({
|
||||
options: levelOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: formData.level
|
||||
}),
|
||||
k: common_vendor.t(selectedAddress.value || "请选择地址"),
|
||||
l: common_vendor.n(selectedAddress.value ? "" : "text-gray"),
|
||||
m: common_vendor.o(($event) => showAddressPopup.value = true),
|
||||
n: common_vendor.o(($event) => showAddressPopup.value = true),
|
||||
o: common_vendor.o(($event) => showAddressPopup.value = false),
|
||||
p: addressKeyword.value,
|
||||
q: common_vendor.o(($event) => addressKeyword.value = $event.detail.value),
|
||||
r: common_vendor.f(filteredAddressList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index,
|
||||
c: common_vendor.o(($event) => tempSelectedAddress.value = item, index),
|
||||
d: tempSelectedAddress.value === item ? 1 : ""
|
||||
};
|
||||
}),
|
||||
s: common_vendor.o(($event) => showAddressPopup.value = false),
|
||||
t: common_vendor.o(confirmAddress),
|
||||
v: common_vendor.o(($event) => showAddressPopup.value = false),
|
||||
w: common_vendor.p({
|
||||
show: showAddressPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
}),
|
||||
x: common_vendor.o(($event) => formData.description = $event),
|
||||
y: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.description
|
||||
}),
|
||||
z: common_vendor.o(($event) => formData.tagIndex = $event),
|
||||
A: common_vendor.p({
|
||||
options: tagOptions.value,
|
||||
modelValue: formData.tagIndex
|
||||
}),
|
||||
B: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
C: common_vendor.o(handleAdd),
|
||||
D: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
E: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b44c631d"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
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",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
}
|
||||
}
|
||||
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
181
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.wxss
vendored
Normal file
181
unpackage/dist/dev/mp-weixin/pages/hiddendanger/Inspection.wxss
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* 这里是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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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.data-v-b44c631d {
|
||||
flex: 1;
|
||||
background: #fff;
|
||||
border: 1rpx solid #F6F6F6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
85
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.js
vendored
Normal file
85
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.js
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.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 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 = (url) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: "http://192.168.2.21:7001/upload",
|
||||
// 仅为示例,非真实的接口地址
|
||||
filePath: url,
|
||||
name: "file",
|
||||
formData: {
|
||||
user: "test"
|
||||
},
|
||||
success: (res) => {
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data);
|
||||
}, 1e3);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
}),
|
||||
c: common_vendor.o(($event) => _ctx.value1 = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: _ctx.value1
|
||||
}),
|
||||
e: common_vendor.o(afterRead),
|
||||
f: common_vendor.o(deletePic),
|
||||
g: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-39f9b795"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
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}}"><view class="padding bg-white radius data-v-39f9b795"><view class="text-gray margin-bottom data-v-39f9b795">整改记录</view><up-textarea wx:if="{{b}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-textarea><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><up-textarea wx:if="{{d}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-textarea><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><up-upload wx:if="{{g}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" bindafterRead="{{e}}" binddelete="{{f}}" u-i="39f9b795-2" bind:__l="__l" u-p="{{g}}"></up-upload><button class="bg-blue round margin-top-xl data-v-39f9b795"> 提交验收</button></view></view>
|
||||
30
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.wxss
vendored
Normal file
30
unpackage/dist/dev/mp-weixin/pages/hiddendanger/acceptance.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-39f9b795 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
238
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.js
vendored
Normal file
238
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.js
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
"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_calendar2 = common_vendor.resolveComponent("up-calendar");
|
||||
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");
|
||||
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_calendar2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _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_calendar = () => "../../uni_modules/uview-plus/components/u-calendar/u-calendar.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";
|
||||
if (!Math) {
|
||||
(_easycom_up_textarea + _easycom_up_input + _easycom_up_calendar + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_upload)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "rectification",
|
||||
setup(__props) {
|
||||
const hazardId = common_vendor.ref("");
|
||||
const assignId = common_vendor.ref("");
|
||||
const formData = common_vendor.reactive({
|
||||
rectifyPlan: "",
|
||||
// 整改方案
|
||||
rectifyResult: "",
|
||||
// 整改完成情况
|
||||
planCost: "",
|
||||
// 投资资金(计划)
|
||||
actualCost: ""
|
||||
// 投资资金(实际)
|
||||
});
|
||||
const show = common_vendor.ref(false);
|
||||
const mode = common_vendor.ref("single");
|
||||
const selectedDate = common_vendor.ref("");
|
||||
const radiovalue1 = common_vendor.ref("");
|
||||
const radiolist1 = common_vendor.reactive([
|
||||
{
|
||||
name: "孙致远",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "符友成",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "向彪",
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "向纪荣",
|
||||
disabled: false
|
||||
}
|
||||
]);
|
||||
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 confirmDate = (e) => {
|
||||
selectedDate.value = e[0];
|
||||
show.value = false;
|
||||
};
|
||||
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.AUTH_TOKEN
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
if (data.code === 0) {
|
||||
resolve(data.data);
|
||||
} else {
|
||||
reject(data.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error("上传失败:", 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;
|
||||
}
|
||||
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
|
||||
};
|
||||
try {
|
||||
const res = await request_api.submitRectification(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) {
|
||||
console.error("提交整改失败:", 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;
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => formData.rectifyPlan = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.rectifyPlan
|
||||
}),
|
||||
c: common_vendor.o(($event) => formData.rectifyResult = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.rectifyResult
|
||||
}),
|
||||
e: common_vendor.o(($event) => formData.planCost = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
type: "number",
|
||||
modelValue: formData.planCost
|
||||
}),
|
||||
g: common_vendor.o(($event) => formData.actualCost = $event),
|
||||
h: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
type: "number",
|
||||
modelValue: formData.actualCost
|
||||
}),
|
||||
i: common_vendor.t(selectedDate.value || "请选择日期"),
|
||||
j: common_vendor.n(selectedDate.value ? "" : "text-gray"),
|
||||
k: common_vendor.o(($event) => show.value = true),
|
||||
l: common_vendor.o(confirmDate),
|
||||
m: common_vendor.o(($event) => show.value = false),
|
||||
n: common_vendor.p({
|
||||
show: show.value,
|
||||
mode: mode.value
|
||||
}),
|
||||
o: common_vendor.f(radiolist1, (item, index, i0) => {
|
||||
return {
|
||||
a: index,
|
||||
b: common_vendor.o(_ctx.radioChange, index),
|
||||
c: "f18ba0ce-6-" + i0 + ",f18ba0ce-5",
|
||||
d: common_vendor.p({
|
||||
shape: "square",
|
||||
customStyle: {
|
||||
marginBottom: "8px"
|
||||
},
|
||||
label: item.name,
|
||||
name: item.name
|
||||
})
|
||||
};
|
||||
}),
|
||||
p: common_vendor.o(_ctx.groupChange),
|
||||
q: common_vendor.o(($event) => radiovalue1.value = $event),
|
||||
r: common_vendor.p({
|
||||
placement: "column",
|
||||
modelValue: radiovalue1.value
|
||||
}),
|
||||
s: common_vendor.o(afterRead),
|
||||
t: common_vendor.o(deletePic),
|
||||
v: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
maxCount: 10
|
||||
}),
|
||||
w: common_vendor.o(handleSubmit)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f18ba0ce"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
11
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.json
vendored
Normal file
11
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"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-calendar": "../../uni_modules/uview-plus/components/u-calendar/u-calendar",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
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}}"><view class="padding bg-white radius data-v-f18ba0ce"><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改方案</view><view class="text-red data-v-f18ba0ce">*</view></view><up-textarea wx:if="{{b}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"></up-textarea><view class="flex 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="{{d}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"></up-textarea><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">投资资金(计划)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{f}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-input><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">投资资金(实际)</view><view class="text-red data-v-f18ba0ce">*</view></view><up-input wx:if="{{h}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-input><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray margin-top data-v-f18ba0ce">限定整改时间</view><view class="text-red data-v-f18ba0ce">*</view></view><view class="date-input data-v-f18ba0ce" bindtap="{{k}}"><text class="{{['data-v-f18ba0ce', j]}}">{{i}}</text></view><up-calendar wx:if="{{n}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindconfirm="{{l}}" bindclose="{{m}}" u-i="f18ba0ce-4" bind:__l="__l" u-p="{{n}}"></up-calendar><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改人员</view><view class="text-red data-v-f18ba0ce">*</view></view><up-radio-group wx:if="{{r}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-s="{{['d']}}" bindchange="{{p}}" u-i="f18ba0ce-5" bind:__l="__l" bindupdateModelValue="{{q}}" u-p="{{r}}"><up-radio wx:for="{{o}}" wx:for-item="item" wx:key="a" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindchange="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"></up-radio></up-radio-group><view class="flex margin-bottom data-v-f18ba0ce"><view class="text-gray data-v-f18ba0ce">整改图片/视频</view><view class="text-red data-v-f18ba0ce">*</view></view><up-upload wx:if="{{v}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindafterRead="{{s}}" binddelete="{{t}}" u-i="f18ba0ce-7" bind:__l="__l" u-p="{{v}}"></up-upload><button class="bg-blue round margin-top-xl data-v-f18ba0ce" bindtap="{{w}}">提交整改</button></view></view>
|
||||
41
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.wxss
vendored
Normal file
41
unpackage/dist/dev/mp-weixin/pages/hiddendanger/rectification.wxss
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 这里是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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
83
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.js
vendored
Normal file
83
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.js
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
"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_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: "",
|
||||
createdAt: "",
|
||||
attachments: []
|
||||
});
|
||||
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);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取隐患详情失败:", 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 == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0
|
||||
}, (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: img.filePath
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
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.o(($event) => detailData.description = $event),
|
||||
k: common_vendor.p({
|
||||
placeholder: "暂无描述",
|
||||
disabled: true,
|
||||
modelValue: detailData.description
|
||||
}),
|
||||
l: common_vendor.t(detailData.source || "暂无"),
|
||||
m: common_vendor.t(detailData.createdAt || "暂无")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4d631e68"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
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}}"><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="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"></image></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="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患描述</view><view class="text-red data-v-4d631e68">*</view></view><up-textarea wx:if="{{k}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-1" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></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">{{l}}</view><view class="text-gray margin-top margin-bottom data-v-4d631e68">创建时间</view><view class="bg-gray padding radius data-v-4d631e68">{{m}}</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;
|
||||
}
|
||||
Reference in New Issue
Block a user