1.18整合

This commit is contained in:
2026-01-18 16:06:37 +08:00
parent 10c3fbb0d7
commit a11d3cc2f8
138 changed files with 7241 additions and 856 deletions

View File

@@ -4,6 +4,7 @@ const common_vendor = require("./common/vendor.js");
const uni_modules_uviewPlus_index = require("./uni_modules/uview-plus/index.js");
if (!Math) {
"./pages/index/index.js";
"./pages/map/map.js";
"./pages/plandetail/plandetail.js";
"./pages/Inspectionresult/Inspectionresult.js";
"./pages/membermanagemen/membermanagemen.js";
@@ -18,6 +19,7 @@ if (!Math) {
"./pages/hiddendanger/view.js";
"./pages/hiddendanger/rectification.js";
"./pages/hiddendanger/acceptance.js";
"./pages/hiddendanger/assignment.js";
"./pages/closeout/application.js";
"./pages/closeout/editor.js";
"./pages/equipmentregistration/equipmentregistration.js";
@@ -29,6 +31,12 @@ if (!Math) {
"./pages/personalcenter/settings.js";
"./pages/personalcenter/account.js";
"./pages/personalcenter/edit.js";
"./pages/login/login.js";
"./pages/login/reg.js";
"./pages/login/enterprise.js";
"./pages/login/success.js";
"./pages/login/forget.js";
"./pages/login/agreement.js";
}
const _sfc_main = {
onLaunch: function() {

View File

@@ -1,6 +1,7 @@
{
"pages": [
"pages/index/index",
"pages/map/map",
"pages/plandetail/plandetail",
"pages/Inspectionresult/Inspectionresult",
"pages/membermanagemen/membermanagemen",
@@ -15,6 +16,7 @@
"pages/hiddendanger/view",
"pages/hiddendanger/rectification",
"pages/hiddendanger/acceptance",
"pages/hiddendanger/assignment",
"pages/closeout/application",
"pages/closeout/editor",
"pages/equipmentregistration/equipmentregistration",
@@ -25,7 +27,13 @@
"pages/personalcenter/notification",
"pages/personalcenter/settings",
"pages/personalcenter/account",
"pages/personalcenter/edit"
"pages/personalcenter/edit",
"pages/login/login",
"pages/login/reg",
"pages/login/enterprise",
"pages/login/success",
"pages/login/forget",
"pages/login/agreement"
],
"window": {
"navigationBarTextStyle": "white",
@@ -33,5 +41,46 @@
"navigationBarBackgroundColor": "#007aff",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#007aff",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/tabBar/home.png",
"selectedIconPath": "static/tabBar/home.png"
},
{
"pagePath": "pages/map/map",
"text": "一张图",
"iconPath": "static/tabBar/map.png",
"selectedIconPath": "static/tabBar/map.png"
},
{
"pagePath": "pages/Inspectionwarning/Inspectionwarning",
"text": "预警",
"iconPath": "static/tabBar/warning.png",
"selectedIconPath": "static/tabBar/warning.png"
},
{
"pagePath": "pages/personalcenter/my",
"text": "我的",
"iconPath": "static/tabBar/my.png",
"selectedIconPath": "static/tabBar/my.png"
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于选择隐患位置"
}
},
"requiredPrivateInfos": [
"chooseLocation",
"getLocation"
],
"usingComponents": {}
}

View File

@@ -1,27 +1,29 @@
"use strict";
const _imports_0$2 = "/static/蒙版组 273.png";
const _imports_1$2 = "/static/tabbar/组 20264.png";
const _imports_2$1 = "/static/tabbar/组 20261.png";
const _imports_3$1 = "/static/tabbar/组 20262.png";
const _imports_4$1 = "/static/tabbar/组 20263.png";
const _imports_0$1 = "/static/my/Helpcenter.png";
const _imports_1$1 = "/static/my/CustomerService.png";
const _imports_0$5 = "/static/蒙版组 273.png";
const _imports_0$4 = "/static/my/Helpcenter.png";
const _imports_1$2 = "/static/my/CustomerService.png";
const _imports_2 = "/static/my/Account.png";
const _imports_3 = "/static/my/Notification.png";
const _imports_3$1 = "/static/my/Notification.png";
const _imports_4 = "/static/my/Delete.png";
const _imports_5 = "/static/my/Settings.png";
const _imports_0 = "/static/my/Customer service.png";
const _imports_1 = "/static/my/Phone.png";
exports._imports_0 = _imports_0$2;
exports._imports_0$1 = _imports_0$1;
exports._imports_0$2 = _imports_0;
const _imports_0$3 = "/static/my/Customer service.png";
const _imports_1$1 = "/static/my/Phone.png";
const _imports_0$2 = "/static/index/index_bg.png";
const _imports_0$1 = "/static/index/phone.png";
const _imports_1 = "/static/index/lock.png";
const _imports_3 = "/static/index/photos.png";
const _imports_0 = "/static/index/蒙版组 260.png";
exports._imports_0 = _imports_0$5;
exports._imports_0$1 = _imports_0$4;
exports._imports_0$2 = _imports_0$3;
exports._imports_0$3 = _imports_0$2;
exports._imports_0$4 = _imports_0$1;
exports._imports_0$5 = _imports_0;
exports._imports_1 = _imports_1$2;
exports._imports_1$1 = _imports_1$1;
exports._imports_1$2 = _imports_1;
exports._imports_2 = _imports_2$1;
exports._imports_2$1 = _imports_2;
exports._imports_2 = _imports_2;
exports._imports_3 = _imports_3$1;
exports._imports_3$1 = _imports_3;
exports._imports_4 = _imports_4$1;
exports._imports_4$1 = _imports_4;
exports._imports_4 = _imports_4;
exports._imports_5 = _imports_5;

View File

@@ -7775,6 +7775,7 @@ const createSubpackageApp = initCreateSubpackageApp();
const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
!isInSSRComponentSetup && injectHook(lifecycle, hook, target);
};
const onShow = /* @__PURE__ */ createHook(ON_SHOW);
const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
/*!
* vue-router v4.3.0
@@ -7812,6 +7813,9 @@ exports.n = n;
exports.nextTick$1 = nextTick$1;
exports.o = o;
exports.onLoad = onLoad;
exports.onMounted = onMounted;
exports.onShow = onShow;
exports.onUnmounted = onUnmounted;
exports.p = p;
exports.r = r;
exports.reactive = reactive;
@@ -7821,4 +7825,5 @@ exports.s = s;
exports.sr = sr;
exports.t = t;
exports.useRouter = useRouter;
exports.watch = watch;
exports.wx$1 = wx$1;

View File

@@ -1,76 +1,204 @@
"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_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_input2 + _easycom_up_datetime_picker2 + _easycom_up_textarea2 + _easycom_u_popup2)();
(_easycom_up_picker2 + _easycom_up_datetime_picker2 + _easycom_up_input2 + _easycom_up_textarea2 + _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_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_input + _easycom_up_datetime_picker + _easycom_up_textarea + _easycom_u_popup)();
(_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 handleAdd = () => {
showAddPopup.value = false;
common_vendor.index.showToast({
title: "新增成功",
icon: "success"
});
const showHazardPicker = common_vendor.ref(false);
const showDatePicker = common_vendor.ref(false);
const selectedHazard = common_vendor.ref("");
const selectedHazardId = common_vendor.ref("");
const hazardColumns = common_vendor.ref([["暂无数据"]]);
const hazardList = common_vendor.ref([]);
const dateValue = common_vendor.ref(Date.now());
const formData = common_vendor.reactive({
rectifyDeadline: "",
// 整改时限
responsibleDeptName: "",
// 隐患治理责任单位
responsiblePerson: "",
// 主要负责人
mainTreatmentContent: "",
// 主要治理内容
treatmentResult: "",
// 隐患治理完成内容
selfVerifyContent: ""
// 责任单位自行验收情况
});
const fetchHazardList = async () => {
try {
const res = await request_api.getMyWriteOffList();
if (res.code === 0 && res.data) {
const list = res.data;
hazardList.value = list;
if (list.length > 0) {
hazardColumns.value = [list.map((item) => item.hazardTitle || `隐患${item.hazardId}`)];
}
console.log("隐患列表:", list);
}
} catch (error) {
console.error("获取隐患列表失败:", error);
}
};
const onHazardConfirm = (e) => {
console.log("选择的隐患:", e);
if (e.value && e.value.length > 0) {
selectedHazard.value = e.value[0];
const index = e.indexs[0];
if (hazardList.value[index]) {
selectedHazardId.value = hazardList.value[index].hazardId;
}
}
showHazardPicker.value = false;
};
const onDateConfirm = (e) => {
console.log("选择的日期时间:", 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 = "";
formData.rectifyDeadline = "";
formData.responsibleDeptName = "";
formData.responsiblePerson = "";
formData.mainTreatmentContent = "";
formData.treatmentResult = "";
formData.selfVerifyContent = "";
};
const handleAdd = async () => {
if (!selectedHazardId.value) {
common_vendor.index.showToast({ title: "请选择隐患", icon: "none" });
return;
}
const params = {
hazardId: Number(selectedHazardId.value),
// 隐患ID必需
rectifyDeadline: formData.rectifyDeadline || "",
// 整改时限
responsiblePerson: formData.responsiblePerson || "",
// 主要负责人
mainTreatmentContent: formData.mainTreatmentContent || "",
// 主要治理内容
treatmentResult: formData.treatmentResult || "",
// 隐患治理完成内容
selfVerifyContent: formData.selfVerifyContent || ""
// 责任单位自行验收情况
};
console.log("提交数据:", params);
try {
const res = await request_api.applyDelete(params);
if (res.code === 0) {
common_vendor.index.showToast({ title: "申请成功", icon: "success" });
showAddPopup.value = false;
resetForm();
} else {
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
}
} catch (error) {
console.error("申请失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
const value1 = common_vendor.ref(Date.now());
const editor = () => {
common_vendor.index.navigateTo({
url: "/pages/closeout/editor"
});
};
common_vendor.onMounted(() => {
fetchHazardList();
});
return (_ctx, _cache) => {
return {
a: common_vendor.o(($event) => editor()),
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(($event) => showAddPopup.value = true),
c: common_vendor.o(($event) => showAddPopup.value = false),
d: common_vendor.p({
placeholder: "请选择隐患"
}),
e: common_vendor.o(($event) => value1.value = $event),
f: common_vendor.p({
hasInput: true,
show: _ctx.show,
mode: "date",
modelValue: value1.value
}),
g: common_vendor.p({
placeholder: "请输入隐患治理责任单位"
}),
h: common_vendor.p({
placeholder: "请输入主要负责人"
}),
i: common_vendor.o(($event) => _ctx.value = $event),
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({
placeholder: "请输入主要治理内容",
modelValue: _ctx.value
show: showHazardPicker.value,
columns: hazardColumns.value
}),
k: common_vendor.o(($event) => _ctx.value = $event),
l: common_vendor.p({
placeholder: "请输入隐患治理完成情况",
modelValue: _ctx.value
}),
m: common_vendor.o(($event) => _ctx.value = $event),
n: common_vendor.p({
placeholder: "请输入隐患治理责任单位自行验收的情况",
modelValue: _ctx.value
}),
o: common_vendor.o(($event) => showAddPopup.value = false),
p: common_vendor.o(handleAdd),
q: common_vendor.o(($event) => showAddPopup.value = false),
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.o(($event) => formData.responsibleDeptName = $event),
t: common_vendor.p({
placeholder: "请输入隐患治理责任单位",
modelValue: formData.responsibleDeptName
}),
v: common_vendor.o(($event) => formData.responsiblePerson = $event),
w: common_vendor.p({
placeholder: "请输入主要负责人",
modelValue: formData.responsiblePerson
}),
x: common_vendor.o(($event) => formData.mainTreatmentContent = $event),
y: common_vendor.p({
placeholder: "请输入主要治理内容",
modelValue: formData.mainTreatmentContent
}),
z: common_vendor.o(($event) => formData.treatmentResult = $event),
A: common_vendor.p({
placeholder: "请输入隐患治理完成情况",
modelValue: formData.treatmentResult
}),
B: common_vendor.o(($event) => formData.selfVerifyContent = $event),
C: common_vendor.p({
placeholder: "请输入隐患治理责任单位自行验收的情况",
modelValue: formData.selfVerifyContent
}),
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"

View File

@@ -1,8 +1,9 @@
{
"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-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"
}

View File

@@ -1 +1 @@
<view class="{{['padding', 'page', 'data-v-4b6250eb', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-4b6250eb"><view class="flex justify-between margin-bottom data-v-4b6250eb"><view class="text-bold text-black data-v-4b6250eb">发现火苗</view><view class="data-v-4b6250eb">已审核</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">2025-11-11</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">吉首网络有限公司</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">张起</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">2025-11-14 06:33:49</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="{{a}}">查看详情</button></view></view></view><button class="cuIcon-add bg-blue round margin-top data-v-4b6250eb" bindtap="{{b}}">新增</button><u-popup wx:if="{{r}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-s="{{['d']}}" bindclose="{{q}}" u-i="4b6250eb-0" bind:__l="__l" u-p="{{r}}"><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><view class="popup-body data-v-4b6250eb"><view class="flex margin-bottom data-v-4b6250eb"><view class="data-v-4b6250eb">隐患</view><view class="text-red data-v-4b6250eb">*</view></view><up-input wx:if="{{d}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-1,4b6250eb-0" bind:__l="__l" u-p="{{d}}"></up-input><view class="flex margin-bottom margin-top data-v-4b6250eb"><view class="data-v-4b6250eb">整改时限</view><view class="text-red data-v-4b6250eb">*</view></view><view class="data-v-4b6250eb"><up-datetime-picker wx:if="{{f}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-2,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-datetime-picker></view><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位</view><up-input wx:if="{{g}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-3,4b6250eb-0" bind:__l="__l" u-p="{{g}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要负责人</view><up-input wx:if="{{h}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-4,4b6250eb-0" bind:__l="__l" u-p="{{h}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要治理内容</view><up-textarea wx:if="{{j}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-5,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理完成内容</view><up-textarea wx:if="{{l}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-6,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{n}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-7,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{m}}" u-p="{{n}}"></up-textarea></view><view class="popup-footer data-v-4b6250eb"><button class="btn-cancel data-v-4b6250eb" bindtap="{{o}}">取消</button><button class="btn-confirm bg-blue data-v-4b6250eb" bindtap="{{p}}">确定</button></view></view></u-popup></view>
<view class="{{['padding', 'page', 'data-v-4b6250eb', virtualHostClass]}}" style="{{virtualHostStyle}}"><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="{{G}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-s="{{['d']}}" bindclose="{{F}}" u-i="4b6250eb-0" bind:__l="__l" u-p="{{G}}"><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><view class="popup-body data-v-4b6250eb"><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><up-input wx:if="{{t}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-3,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{s}}" u-p="{{t}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要负责人</view><up-input wx:if="{{w}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-4,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{v}}" u-p="{{w}}"></up-input><view class="margin-bottom margin-top data-v-4b6250eb">主要治理内容</view><up-textarea wx:if="{{y}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-5,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{x}}" u-p="{{y}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理完成内容</view><up-textarea wx:if="{{A}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-6,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{z}}" u-p="{{A}}"></up-textarea><view class="margin-bottom margin-top data-v-4b6250eb">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{C}}" class="data-v-4b6250eb" virtualHostClass="data-v-4b6250eb" u-i="4b6250eb-7,4b6250eb-0" bind:__l="__l" bindupdateModelValue="{{B}}" u-p="{{C}}"></up-textarea></view><view class="popup-footer data-v-4b6250eb"><button class="btn-cancel data-v-4b6250eb" bindtap="{{D}}">取消</button><button class="btn-confirm bg-blue data-v-4b6250eb" bindtap="{{E}}">确定</button></view></view></u-popup></view>

View File

@@ -75,4 +75,14 @@
}
.popup-footer .btn-confirm.data-v-4b6250eb {
color: #fff;
}
.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;
}

View File

@@ -1,46 +1,145 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {};
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)();
_easycom_up_input2();
}
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)();
_easycom_up_input();
}
function _sfc_render(_ctx, _cache) {
return {
a: common_vendor.p({
placeholder: "请输入内容"
}),
b: common_vendor.p({
placeholder: "请输入内容"
}),
c: common_vendor.p({
placeholder: "请输入内容"
}),
d: common_vendor.p({
placeholder: "请输入内容"
}),
e: common_vendor.o(($event) => _ctx.value1 = $event),
f: common_vendor.p({
placeholder: "请输入内容",
modelValue: _ctx.value1
}),
g: common_vendor.o(($event) => _ctx.value1 = $event),
h: common_vendor.p({
placeholder: "请输入内容",
modelValue: _ctx.value1
}),
i: common_vendor.o(($event) => _ctx.value1 = $event),
j: common_vendor.p({
placeholder: "请输入内容",
modelValue: _ctx.value1
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
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) => {
console.log("=== fetchDetail 被调用 ===, id:", id);
try {
const res = await request_api.getMyWriteOffList();
console.log("接口返回:", 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];
}
console.log("绑定数据:", 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;
console.log("状态为待审核,可以编辑");
} else {
canEdit.value = false;
console.log("状态为已审核,不可编辑");
}
}
} catch (error) {
console.error("获取详情失败:", error);
}
};
const handleCancel = () => {
common_vendor.index.navigateBack();
};
const handleSubmit = async () => {
console.log("保存数据:", formData);
common_vendor.index.showToast({ title: "保存成功", icon: "success" });
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
};
common_vendor.onLoad((options) => {
console.log("=== onLoad 触发 ===");
console.log("options:", options);
pageId.value = (options == null ? void 0 : options.id) || "";
fetchDetail(pageId.value);
});
common_vendor.onMounted(() => {
console.log("=== onMounted 触发 ===");
if (!pageId.value) {
const options = getPageOptions();
console.log("备用获取参数:", options);
pageId.value = (options == null ? void 0 : options.id) || "";
fetchDetail(pageId.value);
}
});
return (_ctx, _cache) => {
return common_vendor.e({
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: canEdit.value
}, canEdit.value ? {
o: common_vendor.o(handleSubmit)
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bbd4165b"]]);
wx.createPage(MiniProgramPage);

View File

@@ -1,7 +1,6 @@
{
"navigationBarTitleText": "编辑销号申请",
"usingComponents": {
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
}
}

View File

@@ -1 +1 @@
<view class="{{['padding', 'page', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius"><view class="flex margin-bottom"><view class="text-gray">隐患</view><view class="text-red">*</view></view><up-input wx:if="{{a}}" u-i="df29223c-0" bind:__l="__l" u-p="{{a}}"></up-input><view class="flex margin-bottom margin-top"><view class="text-gray">整改时限</view><view class="text-red">*</view></view><up-input wx:if="{{b}}" u-i="df29223c-1" bind:__l="__l" u-p="{{b}}"></up-input><view class="text-gray margin-bottom margin-top">隐患治理责任单位</view><up-input wx:if="{{c}}" u-i="df29223c-2" bind:__l="__l" u-p="{{c}}"></up-input><view class="text-gray margin-bottom margin-top">主要负责人</view><up-input wx:if="{{d}}" u-i="df29223c-3" bind:__l="__l" u-p="{{d}}"></up-input><view class="margin-bottom text-gray margin-top">主要治理内容</view><up-textarea wx:if="{{f}}" u-i="df29223c-4" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></up-textarea><view class="margin-bottom text-gray margin-top">隐患治理完成情况</view><up-textarea wx:if="{{h}}" u-i="df29223c-5" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-textarea><view class="margin-bottom text-gray margin-top">隐患治理责任单位自行验收的情况</view><up-textarea wx:if="{{j}}" u-i="df29223c-6" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="flex justify-center margin-top-xl"><button class="lg round cu-btn lg margin-right">取消</button><button class="bg-blue round cu-btn lg">确定</button></view></view></view>
<view class="{{['padding', 'page', 'data-v-bbd4165b', virtualHostClass]}}" style="{{virtualHostStyle}}"><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><button wx:if="{{n}}" class="bg-blue round cu-btn lg data-v-bbd4165b" bindtap="{{o}}">保存</button></view></view></view>

View File

@@ -1,6 +1,30 @@
.page {
min-height: 100vh;
background: #EBF2FC;
}
/**
* 这里是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;
}

View File

@@ -6,17 +6,17 @@ 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_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_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";
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_u_popup + _easycom_up_textarea)();
(_easycom_up_upload + _easycom_up_input + _easycom_up_choose + _easycom_up_textarea + _easycom_u_popup)();
}
const _sfc_main = {
__name: "Inspection",
@@ -51,39 +51,53 @@ const _sfc_main = {
// 隐患等级索引
description: "",
// 隐患描述
tagIndex: 0
tagIndex: 0,
// 隐患标签索引
source: ""
// 隐患来源
});
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 chooseLocation = () => {
console.log("chooseLocation called");
showAddPopup.value = false;
setTimeout(() => {
common_vendor.index.chooseLocation({
success: (res) => {
console.log("选择位置成功:", res);
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
lng.value = res.longitude;
lat.value = res.latitude;
showAddPopup.value = true;
},
fail: (err) => {
console.error("选择位置失败:", err);
showAddPopup.value = true;
if (err.errMsg && err.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" });
common_vendor.index.showToast({
title: "请输入隐患标题",
icon: "none"
});
return;
}
if (fileList1.value.length === 0) {
common_vendor.index.showToast({ title: "请上传隐患图片/视频", icon: "none" });
common_vendor.index.showToast({
title: "请上传隐患图片/视频",
icon: "none"
});
return;
}
fileList1.value.map((file) => {
@@ -103,6 +117,7 @@ const _sfc_main = {
});
const selectedTag = tagOptions.value[formData.tagIndex];
const tagId = selectedTag ? selectedTag.id : null;
console.log("innnn", sourceOptions);
const params = {
title: formData.title,
//标题
@@ -122,8 +137,8 @@ const _sfc_main = {
//关联任务ID
checkPointId: checkPointId.value,
//关联检查点ID
source: "cillum labore veniam"
//隐患来源
source: ((_a = sourceOptions.value[formData.source]) == null ? void 0 : _a.title) || ""
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
};
try {
const res = await request_api.addHiddenDanger(params);
@@ -139,12 +154,19 @@ const _sfc_main = {
formData.tagIndex = 0;
selectedAddress.value = "";
fileList1.value = [];
fetchHiddenDangerList();
} else {
common_vendor.index.showToast({ title: res.msg || "新增失败", icon: "none" });
common_vendor.index.showToast({
title: res.msg || "新增失败",
icon: "none"
});
}
} catch (error) {
console.error(error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
const hiddenDangerList = common_vendor.ref([]);
@@ -152,16 +174,24 @@ const _sfc_main = {
try {
const res = await request_api.getMyHiddenDangerList();
if (res.code === 0) {
hiddenDangerList.value = res.data;
hiddenDangerList.value = res.data.records;
} else {
common_vendor.index.showToast({ title: res.msg || "获取隐患列表失败", icon: "none" });
common_vendor.index.showToast({
title: res.msg || "获取隐患列表失败",
icon: "none"
});
}
} catch (error) {
console.error(error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
fetchHiddenDangerList();
common_vendor.onShow(() => {
fetchHiddenDangerList();
});
const details = (item) => {
common_vendor.index.navigateTo({
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
@@ -172,9 +202,14 @@ const _sfc_main = {
url: `/pages/hiddendanger/rectification?hazardId=${item.hazardId}&assignId=${item.assignId}`
});
};
const acceptance = () => {
const acceptance = (item) => {
common_vendor.index.navigateTo({
url: "/pages/hiddendanger/acceptance"
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([]);
@@ -210,7 +245,7 @@ const _sfc_main = {
filePath,
name: "file",
header: {
"Authorization": request_request.AUTH_TOKEN
"Authorization": request_request.getToken()
},
success: (res) => {
const data = JSON.parse(res.data);
@@ -237,33 +272,88 @@ const _sfc_main = {
title: item.name
}));
} else {
common_vendor.index.showToast({ title: res.msg || "获取标签列表失败", icon: "none" });
common_vendor.index.showToast({
title: res.msg || "获取标签列表失败",
icon: "none"
});
}
} catch (error) {
console.error(error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
fetchTagOptions();
const levelOptions = common_vendor.ref([
{ id: 1, title: "轻微隐患" },
{ id: 2, title: "一般隐患" },
{ id: 3, title: "重大隐患" }
{
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];
console.log("隐患来源选择结果:", {
索引: newVal,
选中项: selected,
id: selected == null ? void 0 : selected.id,
title: selected == null ? void 0 : selected.title
});
});
return (_ctx, _cache) => {
return {
a: common_vendor.f(hiddenDangerList.value, (item, k0, i0) => {
return {
return common_vendor.e({
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
};
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.statusName === "待验收"
}, item.statusName === "待整改" || item.statusName === "待验收" ? {
k: common_vendor.o(($event) => Rectification(item), item.hazardId)
} : {}, {
l: item.statusName === "待验收"
}, item.statusName === "待验收" ? {
m: common_vendor.o(($event) => acceptance(item), item.hazardId)
} : {}, {
n: item.statusName === "待交办"
}, item.statusName === "待交办" ? {
o: common_vendor.o(($event) => assignHazard(item), item.hazardId)
} : {}, {
p: item.hazardId
});
}),
b: common_vendor.o(($event) => showAddPopup.value = true),
c: common_vendor.o(($event) => showAddPopup.value = false),
@@ -289,43 +379,32 @@ const _sfc_main = {
["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 : ""
};
k: common_vendor.o(($event) => formData.source = $event),
l: common_vendor.p({
options: sourceOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: formData.source
}),
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({
m: common_vendor.t(selectedAddress.value || "请选择地址"),
n: common_vendor.n(selectedAddress.value ? "" : "text-gray"),
o: common_vendor.o(chooseLocation),
p: common_vendor.o(chooseLocation),
q: common_vendor.o(($event) => formData.description = $event),
r: common_vendor.p({
placeholder: "请输入内容",
modelValue: formData.description
}),
z: common_vendor.o(($event) => formData.tagIndex = $event),
A: common_vendor.p({
s: common_vendor.o(($event) => formData.tagIndex = $event),
t: 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({
v: common_vendor.o(($event) => showAddPopup.value = false),
w: common_vendor.o(handleAdd),
x: common_vendor.o(($event) => showAddPopup.value = false),
y: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20"

View File

@@ -4,7 +4,7 @@
"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"
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -35,6 +35,25 @@
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;
}
.popup-content.data-v-b44c631d {
width: 600rpx;
background: #fff;

View File

@@ -1,5 +1,7 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_request = require("../../request/request.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
@@ -13,7 +15,132 @@ if (!Math) {
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 filePath;
}
return request_request.baseUrl + 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;
}
console.log("整改记录:", rectifyData);
console.log("整改附件:", rectifyAttachments.value);
}
}
} 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.rectifyId) {
rectifyId.value = options.rectifyId;
}
if (options.hazardId) {
hazardId.value = options.hazardId;
}
if (options.assignId) {
assignId.value = options.assignId;
}
console.log("验收页面参数:", { 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
};
console.log("提交验收参数:", 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) {
console.error("验收失败:", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
const deletePic = (event) => {
fileList1.value.splice(event.index, 1);
};
@@ -39,45 +166,64 @@ const _sfc_main = {
fileListLen++;
}
};
const uploadFilePromise = (url) => {
const uploadFilePromise = (filePath) => {
return new Promise((resolve, reject) => {
common_vendor.index.uploadFile({
url: "http://192.168.2.21:7001/upload",
// 仅为示例,非真实的接口地址
filePath: url,
url: request_request.baseUrl + "/frontend/attachment/upload",
filePath,
name: "file",
formData: {
user: "test"
header: {
"Authorization": request_request.getToken()
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data);
}, 1e3);
const data = JSON.parse(res.data);
if (data.code === 0) {
resolve(data.data);
} else {
reject(data.msg || "上传失败");
}
},
fail: (err) => {
console.error("上传失败:", err);
reject(err);
}
});
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(($event) => _ctx.value1 = $event),
b: common_vendor.p({
placeholder: "请输入内容",
modelValue: _ctx.value1
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
}),
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({
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)
});
};
}
};

View File

@@ -1 +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>
<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><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>

View File

@@ -27,4 +27,20 @@
.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;
}

View File

@@ -0,0 +1,149 @@
"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)];
console.log("整改人员列表:", users);
}
} catch (error) {
console.error("获取部门人员失败:", error);
}
};
const onUserConfirm = (e) => {
console.log("选择的人员:", 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) => {
console.log("选择的日期时间:", 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: ""
// 交办备注(可选)
};
console.log("提交数据:", 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) {
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;
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)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6209e844"]]);
wx.createPage(MiniProgramPage);

View 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"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}"><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>

View 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;
}

View File

@@ -5,20 +5,18 @@ 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_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
const _easycom_up_select2 = common_vendor.resolveComponent("up-select");
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)();
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_select2 + _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_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
const _easycom_up_select = () => "../../uni_modules/uview-plus/components/u-select/u-select.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)();
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_select + _easycom_up_upload)();
}
const _sfc_main = {
__name: "rectification",
@@ -36,27 +34,34 @@ const _sfc_main = {
// 投资资金(实际)
});
const show = common_vendor.ref(false);
const mode = common_vendor.ref("single");
const value1 = common_vendor.ref(Date.now());
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
common_vendor.ref("");
const cateId = common_vendor.ref("");
const cateList = common_vendor.ref([]);
const fetchDeptUsers = async () => {
try {
const res = await request_api.getDepartmentPersonUsers();
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;
console.log("整改人员列表:", cateList.value);
}
} catch (error) {
console.error("获取部门人员失败:", error);
}
]);
};
fetchDeptUsers();
const fileList1 = common_vendor.ref([]);
const deletePic = (event) => {
fileList1.value.splice(event.index, 1);
@@ -83,10 +88,6 @@ const _sfc_main = {
fileListLen++;
}
};
const confirmDate = (e) => {
selectedDate.value = e[0];
show.value = false;
};
const uploadFilePromise = (filePath) => {
return new Promise((resolve, reject) => {
common_vendor.index.uploadFile({
@@ -94,7 +95,7 @@ const _sfc_main = {
filePath,
name: "file",
header: {
"Authorization": request_request.AUTH_TOKEN
"Authorization": request_request.getToken()
},
success: (res) => {
const data = JSON.parse(res.data);
@@ -113,11 +114,17 @@ const _sfc_main = {
};
const handleSubmit = async () => {
if (!formData.rectifyPlan) {
common_vendor.index.showToast({ title: "请输入整改方案", icon: "none" });
common_vendor.index.showToast({
title: "请输入整改方案",
icon: "none"
});
return;
}
if (!formData.rectifyResult) {
common_vendor.index.showToast({ title: "请输入整改完成情况", icon: "none" });
common_vendor.index.showToast({
title: "请输入整改完成情况",
icon: "none"
});
return;
}
const attachments = fileList1.value.map((file) => {
@@ -147,16 +154,25 @@ const _sfc_main = {
try {
const res = await request_api.submitRectification(params);
if (res.code === 0) {
common_vendor.index.showToast({ title: "提交成功", icon: "success" });
common_vendor.index.showToast({
title: "提交成功",
icon: "success"
});
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
} else {
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
common_vendor.index.showToast({
title: res.msg || "提交失败",
icon: "none"
});
}
} catch (error) {
console.error("提交整改失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
};
common_vendor.onLoad((options) => {
@@ -167,6 +183,10 @@ const _sfc_main = {
assignId.value = options.assignId;
}
});
const selectItem = (item) => {
console.log("选择的整改人员:", item);
cateId.value = item.id;
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(($event) => formData.rectifyPlan = $event),
@@ -194,42 +214,29 @@ const _sfc_main = {
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({
l: common_vendor.o(($event) => value1.value = $event),
m: common_vendor.p({
hasInput: true,
show: show.value,
mode: mode.value
mode: "date",
modelValue: value1.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
})
};
n: common_vendor.o(selectItem),
o: common_vendor.o(($event) => cateId.value = $event),
p: common_vendor.p({
label: "整改人员",
options: cateList.value,
current: cateId.value
}),
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({
q: common_vendor.o(afterRead),
r: common_vendor.o(deletePic),
s: common_vendor.p({
fileList: fileList1.value,
name: "1",
multiple: true,
maxCount: 10
}),
w: common_vendor.o(handleSubmit)
t: common_vendor.o(handleSubmit)
};
};
}

View File

@@ -3,9 +3,8 @@
"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-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
"up-select": "../../uni_modules/uview-plus/components/u-select/u-select",
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload"
}
}

View File

@@ -1 +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>
<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-datetime-picker wx:if="{{m}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" u-i="f18ba0ce-4" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-datetime-picker><view class="margin-bottom margin-top data-v-f18ba0ce"><up-select wx:if="{{p}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindselect="{{n}}" u-i="f18ba0ce-5" bind:__l="__l" bindupdateCurrent="{{o}}" u-p="{{p}}"></up-select></view><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="{{s}}" class="data-v-f18ba0ce" virtualHostClass="data-v-f18ba0ce" bindafterRead="{{q}}" binddelete="{{r}}" u-i="f18ba0ce-6" bind:__l="__l" u-p="{{s}}"></up-upload><button class="bg-blue round margin-top-xl data-v-f18ba0ce" bindtap="{{t}}">提交整改</button></view></view>

View File

@@ -1,6 +1,7 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_request = require("../../request/request.js");
if (!Array) {
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
@@ -26,11 +27,34 @@ const _sfc_main = {
createdAt: "",
attachments: []
});
const rectifyAttachments = common_vendor.ref([]);
const getFullPath = (filePath) => {
if (!filePath)
return "";
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
return filePath;
}
return request_request.baseUrl + filePath;
};
const previewRectifyImage = (index) => {
const urls = rectifyAttachments.value.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);
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;
console.log("整改附件:", rectifyAttachments.value);
}
}
} else {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
}
@@ -46,12 +70,13 @@ const _sfc_main = {
});
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) => {
a: rectifyAttachments.value.length > 0
}, rectifyAttachments.value.length > 0 ? {
b: common_vendor.f(rectifyAttachments.value, (img, idx, i0) => {
return {
a: idx,
b: img.filePath
b: getFullPath(img.filePath),
c: common_vendor.o(($event) => previewRectifyImage(idx), idx)
};
})
} : {}, {

View File

@@ -1 +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>
<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="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="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>

View File

@@ -6,6 +6,28 @@ const _sfc_main = {
__name: "index",
setup(__props) {
const loading = common_vendor.ref(true);
const userInfo = common_vendor.reactive({
userId: "",
username: "",
nickName: "",
deptId: "",
deptName: ""
});
const getUserInfo = () => {
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 || "";
}
} catch (e) {
console.error("获取用户信息失败:", e);
}
};
const infoList = common_vendor.ref([
{
name: "成员管理",
@@ -54,16 +76,6 @@ const _sfc_main = {
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
});
};
const Inspectionwarning = () => {
common_vendor.index.navigateTo({
url: "/pages/Inspectionwarning/Inspectionwarning"
});
};
const my = () => {
common_vendor.index.navigateTo({
url: "/pages/personalcenter/my"
});
};
const handleMenuClick = (item) => {
const menuRoutes = {
"成员管理": "/pages/membermanagemen/membermanagemen",
@@ -109,11 +121,37 @@ const _sfc_main = {
return dateStr.split(" ")[0];
};
common_vendor.onLoad(() => {
getUserInfo();
getCheckPlanLists();
});
const hiddenDangerParams = common_vendor.ref({
pageNum: 1,
pageSize: 10,
name: ""
});
const hiddenDangerData = common_vendor.ref([]);
const getHiddenDangerLists = async () => {
try {
const res = await request_api.getHiddenDangerList(hiddenDangerParams.value);
console.log(res);
if (res.code === 0) {
hiddenDangerData.value = res.data.records;
console.log(hiddenDangerData.value, 1111);
}
} catch (error) {
console.error(error);
} finally {
loading.value = false;
}
};
common_vendor.onLoad(() => {
getHiddenDangerLists();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(infoList.value, (item, index, i0) => {
a: common_vendor.t(userInfo.deptName || "未知部门"),
b: common_vendor.t(userInfo.nickName || userInfo.username || "未登录"),
c: common_vendor.f(infoList.value, (item, index, i0) => {
return {
a: item.src,
b: common_vendor.t(item.name),
@@ -121,9 +159,9 @@ const _sfc_main = {
d: common_vendor.o(($event) => handleMenuClick(item), index)
};
}),
b: checkPlanData.value.length === 0
d: checkPlanData.value.length === 0
}, checkPlanData.value.length === 0 ? {} : {}, {
c: common_vendor.f(checkPlanData.value, (item, index, i0) => {
e: common_vendor.f(checkPlanData.value, (item, index, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.t(item.runModeName),
@@ -140,13 +178,19 @@ const _sfc_main = {
m: item.id
};
}),
d: common_assets._imports_0,
e: common_assets._imports_1,
f: common_assets._imports_2,
g: common_assets._imports_3,
h: common_vendor.o(($event) => Inspectionwarning()),
i: common_assets._imports_4,
j: common_vendor.o(($event) => my())
f: common_assets._imports_0,
g: common_vendor.f(hiddenDangerData.value, (item, index, i0) => {
return {
a: common_vendor.t(item.title),
b: common_vendor.t(item.source),
c: common_vendor.t(item.address),
d: common_vendor.t(item.levelName),
e: common_vendor.t(item.statusName),
f: common_vendor.t(item.createdAt),
g: item.id,
h: common_vendor.o(($event) => _ctx.HazardList(), item.id)
};
})
});
};
}

File diff suppressed because one or more lines are too long

View File

@@ -24,6 +24,10 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.grid-list.data-v-1cf27b2a {
gap: 30rpx;
margin-top: 30rpx;
}
.list.data-v-1cf27b2a {
background: #F2F6FF;
box-shadow: 0rpx 4rpx 8rpx 2rpx #CADDFC;

View File

@@ -0,0 +1,25 @@
"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
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b4896b2f"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "用户协议",
"navigationStyle": "custom",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-b4896b2f', virtualHostClass]}}" style="{{virtualHostStyle}}"><web-view class="data-v-b4896b2f" webview-styles="{{a}}" src="{{b}}"></web-view></view>

View 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 */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */

View File

@@ -0,0 +1,152 @@
"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;
}
console.log("开始注册流程");
};
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"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-280ea37d"]]);
wx.createPage(MiniProgramPage);

View 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"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-280ea37d', virtualHostClass]}}" style="{{virtualHostStyle}}"><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>

View 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;
}

View File

@@ -0,0 +1,168 @@
"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$4,
c: phone.value,
d: common_vendor.o(($event) => phone.value = $event.detail.value),
e: common_assets._imports_1$2,
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)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-79044ba6"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "忘记密码",
"navigationStyle": "custom",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['content', 'data-v-79044ba6', virtualHostClass]}}" style="{{virtualHostStyle}}"><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>

View 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;
}

View File

@@ -0,0 +1,99 @@
"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 () => {
console.log("点击登录按钮");
console.log("用户名:", username.value);
console.log("密码:", 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 {
console.log("开始调用登录接口...");
const res = await request_api.login({
username: username.value,
password: password.value
});
console.log("登录接口返回:", 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
};
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) {
console.error("登录失败:", error);
common_vendor.index.showToast({
title: "网络请求失败",
icon: "none"
});
}
};
const goToReport = () => {
common_vendor.index.navigateTo({
url: "/subpackages/suishoupai/pages/index/index"
});
};
return (_ctx, _cache) => {
return {
a: common_assets._imports_0$3,
b: common_assets._imports_0$4,
c: username.value,
d: common_vendor.o(($event) => username.value = $event.detail.value),
e: common_assets._imports_1$2,
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_assets._imports_3$1,
m: common_vendor.o(goToReport)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e4e4508d"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "登录页面",
"navigationStyle": "custom",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}"><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 class="agreement data-v-e4e4508d"><navigator url="reg" open-type="navigate" class="link data-v-e4e4508d">注册成员账号</navigator><navigator url="forget" open-type="navigate" class="link data-v-e4e4508d">忘记密码?</navigator></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button><view class="button-report margin-top data-v-e4e4508d" hover-class="button-hover" bindtap="{{m}}"><image src="{{l}}" class="icon-image data-v-e4e4508d"></image><text class="data-v-e4e4508d">随手拍举报</text></view></view></view>

View 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;
}

View File

@@ -0,0 +1,201 @@
"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)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-561d431d"]]);
wx.createPage(MiniProgramPage);

View 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"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['content', 'data-v-561d431d', virtualHostClass]}}" style="{{virtualHostStyle}}"><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>

View 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;
}

View File

@@ -0,0 +1,18 @@
"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$5
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b27d95ff"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "注册成功",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['data-v-b27d95ff', virtualHostClass]}}" style="{{virtualHostStyle}}"><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>

View File

@@ -0,0 +1,6 @@
.but.data-v-b27d95ff {
width: 248rpx;
height: 88rpx;
margin-top: 100rpx;
}

View File

@@ -0,0 +1,8 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e06b858f"]]);
wx.createPage(MiniProgramPage);

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "一张图",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['content', 'data-v-e06b858f', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="text-center padding-top-xl data-v-e06b858f"><text class="text-xl text-gray data-v-e06b858f">一张图功能开发中...</text></view></view>

View 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 */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.content.data-v-e06b858f {
min-height: 100vh;
background: #EBF2FC;
}

View File

@@ -1,9 +1,11 @@
"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_u_popup2 = common_vendor.resolveComponent("u-popup");
(_easycom_up_picker2 + _easycom_u_popup2)();
const _component_TabBar = common_vendor.resolveComponent("TabBar");
(_easycom_up_picker2 + _easycom_u_popup2 + _component_TabBar)();
}
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
@@ -13,6 +15,10 @@ if (!Math) {
const _sfc_main = {
__name: "membermanagemen",
setup(__props) {
const list = common_vendor.ref([]);
request_api.getMemberList().then((res) => {
list.value = res.data;
});
const showPopup = common_vendor.ref(false);
const showDeptPicker = common_vendor.ref(false);
const formData = common_vendor.reactive({
@@ -22,34 +28,90 @@ const _sfc_main = {
password: "",
department: ""
});
const handleSubmit = () => {
const handleSubmit = async () => {
if (!formData.username) {
common_vendor.index.showToast({ title: "请输入用户名", icon: "none" });
common_vendor.index.showToast({
title: "请输入用户名",
icon: "none"
});
return;
}
if (!formData.password || formData.password.length < 6 || formData.password.length > 16) {
common_vendor.index.showToast({ title: "请输入6-16位密码", icon: "none" });
common_vendor.index.showToast({
title: "请输入6-16位密码",
icon: "none"
});
return;
}
if (!formData.department) {
common_vendor.index.showToast({ title: "请选择主部门", icon: "none" });
return;
const params = {
userName: formData.username,
nickName: formData.nickname || "",
phonenumber: formData.phone || "",
password: formData.password,
roleType: "common"
};
try {
const res = await request_api.addMember(params);
if (res.code === 0) {
common_vendor.index.showToast({
title: "添加成功",
icon: "success"
});
showPopup.value = false;
formData.username = "";
formData.nickname = "";
formData.phone = "";
formData.password = "";
formData.department = "";
} else {
common_vendor.index.showToast({
title: res.msg || "添加失败",
icon: "none"
});
}
} catch (error) {
console.error("添加成员失败:", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
console.log("提交数据:", formData);
common_vendor.index.showToast({ title: "添加成功", icon: "success" });
showPopup.value = false;
};
const Lock = () => {
const Lock = (item) => {
const isLocked = item.lockStatus === 1;
const actionText = isLocked ? "解锁" : "锁定";
const newLockStatus = isLocked ? 0 : 1;
common_vendor.index.showModal({
title: "提示",
content: "确定要锁定该成员吗?",
content: `确定要${actionText}该成员吗?`,
confirmColor: "#2667E9",
success: (res) => {
success: async (res) => {
if (res.confirm) {
console.log("用户点击确定");
common_vendor.index.showToast({ title: "锁定成功", icon: "success" });
} else if (res.cancel) {
console.log("用户点击取消");
try {
const result = await request_api.lockOrUnlockMember({
userId: item.userId,
lockStatus: newLockStatus
});
if (result.code === 0) {
common_vendor.index.showToast({
title: `${actionText}成功`,
icon: "success"
});
item.lockStatus = newLockStatus;
item.statusName = newLockStatus === 1 ? "已锁定" : "正常";
} else {
common_vendor.index.showToast({
title: result.msg || `${actionText}失败`,
icon: "none"
});
}
} catch (error) {
console.error(`${actionText}成员失败:`, error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
}
}
}
});
@@ -58,31 +120,58 @@ const _sfc_main = {
const columns = common_vendor.reactive([
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司"]
]);
const deptColumns = common_vendor.reactive([
["湘西自治州和谐网络科技有限公司", "湘西自治州和谐云科技有限公司", "研发部门", "深圳总公司", "若依科技"]
]);
const onDeptConfirm = (e) => {
console.log("选择的部门:", e);
if (e.value && e.value.length > 0) {
formData.department = e.value[0];
}
showDeptPicker.value = false;
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(($event) => show.value = true),
a: common_vendor.f(list.value, (item, index, i0) => {
return {
a: common_vendor.o(($event) => show.value = true, item.id),
b: "06d9f81b-0-" + i0,
c: common_vendor.t(item.nickName),
d: common_vendor.t(item.statusName),
e: common_vendor.t(item.phonenumber),
f: common_vendor.t(item.lockStatus === 1 ? "解锁" : "锁定"),
g: common_vendor.o(($event) => Lock(item), item.id),
h: item.id
};
}),
b: common_vendor.p({
show: show.value,
columns
}),
c: common_vendor.o(($event) => Lock()),
d: common_vendor.o(($event) => showPopup.value = true),
e: common_vendor.o(($event) => showPopup.value = false),
f: formData.username,
g: common_vendor.o(($event) => formData.username = $event.detail.value),
h: formData.nickname,
i: common_vendor.o(($event) => formData.nickname = $event.detail.value),
j: formData.phone,
k: common_vendor.o(($event) => formData.phone = $event.detail.value),
l: formData.password,
m: common_vendor.o(($event) => formData.password = $event.detail.value),
n: common_vendor.t(formData.department || "请选择主部门"),
o: common_vendor.n(formData.department ? "" : "text-gray"),
p: common_vendor.o(($event) => showDeptPicker.value = true),
q: common_vendor.o(($event) => showPopup.value = false),
r: common_vendor.o(handleSubmit),
s: common_vendor.o(($event) => showPopup.value = false),
t: common_vendor.p({
c: common_vendor.o(($event) => showPopup.value = true),
d: common_vendor.o(($event) => showPopup.value = false),
e: formData.username,
f: common_vendor.o(($event) => formData.username = $event.detail.value),
g: formData.nickname,
h: common_vendor.o(($event) => formData.nickname = $event.detail.value),
i: formData.phone,
j: common_vendor.o(($event) => formData.phone = $event.detail.value),
k: formData.password,
l: common_vendor.o(($event) => formData.password = $event.detail.value),
m: common_vendor.t(formData.department || "请选择主部门"),
n: common_vendor.n(formData.department ? "" : "text-gray"),
o: common_vendor.o(($event) => showDeptPicker.value = true),
p: common_vendor.o(onDeptConfirm),
q: common_vendor.o(($event) => showDeptPicker.value = false),
r: common_vendor.o(($event) => showDeptPicker.value = false),
s: common_vendor.p({
show: showDeptPicker.value,
columns: deptColumns
}),
t: common_vendor.o(($event) => showPopup.value = false),
v: common_vendor.o(handleSubmit),
w: common_vendor.o(($event) => showPopup.value = false),
x: common_vendor.p({
show: showPopup.value,
mode: "center",
round: "20"

View File

@@ -1 +1 @@
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding bg-white radius data-v-06d9f81b"><view class="flex justify-between align-center data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-tite data-v-06d9f81b"></view><view class="text-bold margin-left-xs data-v-06d9f81b" bindtap="{{a}}">湘西自治州和谐网络科技有限公司</view><up-picker wx:if="{{b}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-0" bind:__l="__l" u-p="{{b}}"></up-picker></view><view class="tag-outline data-v-06d9f81b">负责人</view></view><view class="flex margin-top data-v-06d9f81b"><view class="cu-avatar radius lg data-v-06d9f81b" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg)"></view><view class="margin-left data-v-06d9f81b"><view class="flex data-v-06d9f81b"><view class="data-v-06d9f81b">罗燚</view><view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs data-v-06d9f81b">正常</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">手机设置:</view><view class="data-v-06d9f81b">未设置</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">登录IP</view><view class="data-v-06d9f81b">45.135.228.172</view></view></view><button class="bg-blue btn-lock data-v-06d9f81b" bindtap="{{c}}">锁定</button></view></view><button class="lg cuIcon-add bg-blue round margin-top-xl data-v-06d9f81b" bindtap="{{d}}">添加成员</button><u-popup wx:if="{{t}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{s}}" u-i="06d9f81b-1" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{e}}">×</view></view><view class="popup-body data-v-06d9f81b"><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入用户名" value="{{f}}" bindinput="{{g}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><input class="form-input data-v-06d9f81b" placeholder="请输入昵称" value="{{h}}" bindinput="{{i}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><input class="form-input data-v-06d9f81b" placeholder="请输入手机号" type="number" value="{{j}}" bindinput="{{k}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入密码6-16位" password value="{{l}}" bindinput="{{m}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">主部门<text class="text-red data-v-06d9f81b">*</text></view><view class="form-input form-select data-v-06d9f81b" bindtap="{{p}}"><text class="{{['data-v-06d9f81b', o]}}">{{n}}</text></view></view></view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{r}}">确定</button></view></view></u-popup></view>
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="h" class="padding bg-white radius margin-bottom data-v-06d9f81b"><view class="flex justify-between align-center data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-tite data-v-06d9f81b"></view><view class="text-bold margin-left-xs data-v-06d9f81b" bindtap="{{item.a}}">湘西自治州和谐网络科技有限公司</view><up-picker wx:if="{{b}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="{{item.b}}" bind:__l="__l" u-p="{{b}}"></up-picker></view><view class="tag-outline data-v-06d9f81b">负责人</view></view><view class="flex margin-top data-v-06d9f81b"><view class="cu-avatar radius lg data-v-06d9f81b" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg)"></view><view class="margin-left data-v-06d9f81b"><view class="flex data-v-06d9f81b"><view class="data-v-06d9f81b">{{item.c}}</view><view class="margin-left-xs light bg-olive padding-left-xs padding-right-xs data-v-06d9f81b">{{item.d}}</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">手机设置:</view><view class="data-v-06d9f81b">{{item.e}}</view></view><view class="flex text-gray data-v-06d9f81b"><view class="data-v-06d9f81b">登录IP</view><view class="data-v-06d9f81b">45.135.228.172</view></view></view><button class="bg-blue btn-lock data-v-06d9f81b" bindtap="{{item.g}}">{{item.f}}</button></view></view><button class="lg cuIcon-add bg-blue round margin-top-xl data-v-06d9f81b" bindtap="{{c}}">添加成员</button><u-popup wx:if="{{x}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{w}}" u-i="06d9f81b-1" bind:__l="__l" u-p="{{x}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{d}}">×</view></view><view class="popup-body data-v-06d9f81b"><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入用户名" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><input class="form-input data-v-06d9f81b" placeholder="请输入昵称" value="{{g}}" bindinput="{{h}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><input class="form-input data-v-06d9f81b" placeholder="请输入手机号" type="number" value="{{i}}" bindinput="{{j}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><input class="form-input data-v-06d9f81b" placeholder="请输入密码6-16位" password value="{{k}}" bindinput="{{l}}"/></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">主部门<text class="text-red data-v-06d9f81b">*</text></view><view class="form-input form-select data-v-06d9f81b" bindtap="{{o}}"><text class="{{['data-v-06d9f81b', n]}}">{{m}}</text></view><up-picker wx:if="{{s}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{p}}" bindcancel="{{q}}" bindclose="{{r}}" u-i="06d9f81b-2,06d9f81b-1" bind:__l="__l" u-p="{{s}}"></up-picker></view></view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{t}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{v}}">确定</button></view></view></u-popup><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3" bind:__l="__l"/></view>

View File

@@ -5,7 +5,7 @@ const _sfc_main = {};
function _sfc_render(_ctx, _cache) {
return {
a: common_assets._imports_0$2,
b: common_assets._imports_1$2
b: common_assets._imports_1$1
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -24,19 +24,37 @@ const _sfc_main = {
url: "/pages/personalcenter/account"
});
};
const handleLogout = () => {
common_vendor.index.showModal({
title: "提示",
content: "确定要退出登录吗?",
success: function(res) {
if (res.confirm) {
console.log("用户点击确定");
common_vendor.index.clearStorageSync();
common_vendor.index.reLaunch({
url: "/pages/login/login"
});
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
};
return (_ctx, _cache) => {
return {
a: common_assets._imports_0$1,
b: common_vendor.o(($event) => Helpcenter()),
c: common_assets._imports_1$1,
d: common_assets._imports_2$1,
c: common_assets._imports_1,
d: common_assets._imports_2,
e: common_vendor.o(($event) => Account()),
f: common_assets._imports_3$1,
f: common_assets._imports_3,
g: common_vendor.o(($event) => notification()),
h: common_assets._imports_4$1,
h: common_assets._imports_4,
i: common_assets._imports_5,
j: common_vendor.o(($event) => Settings()),
k: common_assets._imports_0$1
k: common_assets._imports_0$1,
l: common_vendor.o(($event) => handleLogout())
};
};
}

View File

@@ -1 +1 @@
<view class="title data-v-02345808"><view class="padding data-v-02345808"><view class="text-center data-v-02345808">我的</view><view class="flex justify-around data-v-02345808" style="padding-top:60rpx"><view class="flex data-v-02345808"><view class="cu-avatar xl round margin-left data-v-02345808" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg)"></view><view class="data-v-02345808"><view class="data-v-02345808">测试</view><view class="data-v-02345808">17374339800</view></view></view><button class="bg-blue round cu-btn data-v-02345808">编辑资料</button></view></view></view><view class="padding page data-v-02345808"><view class="padding bg-white radius data-v-02345808"><view class="flex justify-between padding-bottom solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{b}}"><image class="data-v-02345808" src="{{a}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">帮助中心</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808"><image class="data-v-02345808" src="{{c}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">智能客服</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{e}}"><image class="data-v-02345808" src="{{d}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">账号安全</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{g}}"><image class="data-v-02345808" src="{{f}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">新消息通知</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808"><image class="data-v-02345808" src="{{h}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">清除缓存</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{j}}"><image class="data-v-02345808" src="{{i}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">通用设置</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808"><image class="data-v-02345808" src="{{k}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">关于</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view></view><button class="bg-blue round margin-top-xl data-v-02345808">退出登录</button></view>
<view class="title data-v-02345808"><view class="padding data-v-02345808"><view class="text-center data-v-02345808">我的</view><view class="flex justify-around data-v-02345808" style="padding-top:60rpx"><view class="flex data-v-02345808"><view class="cu-avatar xl round margin-left data-v-02345808" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg)"></view><view class="data-v-02345808"><view class="data-v-02345808">测试</view><view class="data-v-02345808">17374339800</view></view></view><button class="bg-blue round cu-btn data-v-02345808">编辑资料</button></view></view></view><view class="padding page data-v-02345808"><view class="padding bg-white radius data-v-02345808"><view class="flex justify-between padding-bottom solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{b}}"><image class="data-v-02345808" src="{{a}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">帮助中心</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808"><image class="data-v-02345808" src="{{c}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">智能客服</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{e}}"><image class="data-v-02345808" src="{{d}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">账号安全</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{g}}"><image class="data-v-02345808" src="{{f}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">新消息通知</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808"><image class="data-v-02345808" src="{{h}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">清除缓存</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808" bindtap="{{j}}"><image class="data-v-02345808" src="{{i}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">通用设置</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view><view class="flex justify-between padding-bottom padding-top solid-bottom data-v-02345808"><view class="flex data-v-02345808"><image class="data-v-02345808" src="{{k}}" style="width:40rpx;height:40rpx"></image><view class="margin-left data-v-02345808">关于</view></view><view class="lg text-gray cuIcon-right data-v-02345808"></view></view></view><button class="bg-blue round margin-top-xl data-v-02345808" bindtap="{{l}}">退出登录</button></view>

View File

@@ -22,24 +22,7 @@
"libVersion": "3.12.0",
"appid": "touristappid",
"projectname": "sanchayibaoguang",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2

View File

@@ -1,16 +0,0 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/index/index",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
}
}

View File

@@ -33,6 +33,13 @@ function addHiddenDanger(params) {
data: params
});
}
function assignHiddenDanger(params) {
return request_request.requestAPI({
url: "/frontend/hazard/assign",
method: "POST",
data: params
});
}
function getMyHiddenDangerList(params) {
return request_request.requestAPI({
url: "/frontend/hazard/my/list",
@@ -47,6 +54,13 @@ function getHiddenDangerDetail(params) {
data: params
});
}
function getHiddenDangerList(params) {
return request_request.requestAPI({
url: "/frontend/hazard/my/list",
method: "GET",
data: params
});
}
function submitRectification(params) {
return request_request.requestAPI({
url: "/frontend/hazard/rectify",
@@ -60,12 +74,80 @@ function getHiddenDangerLabelList() {
method: "GET"
});
}
function getDepartmentPersonUsers(params) {
return request_request.requestAPI({
url: "/frontend/hazard/dept/users",
method: "GET",
data: params
});
}
function addMember(params) {
return request_request.requestAPI({
url: "/frontend/member/add",
method: "POST",
data: params
});
}
function getMemberList(params) {
return request_request.requestAPI({
url: "/frontend/member/list",
method: "GET",
data: params
});
}
function lockOrUnlockMember(params) {
return request_request.requestAPI({
url: "/frontend/member/lock",
method: "POST",
data: params
});
}
function applyDelete(params) {
return request_request.requestAPI({
url: "/frontend/hazard/writeoff/apply",
method: "POST",
data: params
});
}
function getMyWriteOffList(params) {
return request_request.requestAPI({
url: "/frontend/hazard/writeoff/my/list",
method: "GET",
data: params
});
}
function acceptanceRectification(params) {
return request_request.requestAPI({
url: "/frontend/hazard/verify",
method: "POST",
data: params
});
}
function login(params) {
return request_request.requestAPI({
url: "/frontend/auth/login",
method: "POST",
data: params,
noAuth: true
// 登录接口不需要 Authorization
});
}
exports.acceptanceRectification = acceptanceRectification;
exports.addHiddenDanger = addHiddenDanger;
exports.addMember = addMember;
exports.applyDelete = applyDelete;
exports.assignHiddenDanger = assignHiddenDanger;
exports.enterCheckPlan = enterCheckPlan;
exports.getCheckPlanList = getCheckPlanList;
exports.getCheckTaskDetail = getCheckTaskDetail;
exports.getDepartmentPersonUsers = getDepartmentPersonUsers;
exports.getHiddenDangerDetail = getHiddenDangerDetail;
exports.getHiddenDangerLabelList = getHiddenDangerLabelList;
exports.getHiddenDangerList = getHiddenDangerList;
exports.getMemberList = getMemberList;
exports.getMyHiddenDangerList = getMyHiddenDangerList;
exports.getMyWriteOffList = getMyWriteOffList;
exports.lockOrUnlockMember = lockOrUnlockMember;
exports.login = login;
exports.submitCheckResult = submitCheckResult;
exports.submitRectification = submitRectification;

View File

@@ -4,13 +4,12 @@ const request_luchRequest_core_Request = require("./luch-request/core/Request.js
const baseUrl = "http://192.168.1.168:5004";
new request_luchRequest_core_Request.Request({
baseURL: baseUrl,
timeout: 1e4,
header: {
// 'content-type': 'application/json',
"Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiNzQ5NGU2MzAtNTRlYS00ZTM5LWIxYjUtNzc2MzY5NTRhYmJmIn0.7l5CMwFitlpXniZ6PTR5DqN8ASFTFZ1DCUZKjOtr5CpuXWiPHeSW19nY8XKfGdxMvB7j-OnXuSznLRjx-N7K9g"
}
timeout: 1e4
});
const AUTH_TOKEN = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiNTQyMjJlODYtZDUyNS00ZTA0LWI3Y2QtMGU1ZWYzYmIwM2EwIn0.x8zPXafDGVjIDIcAdWsWT3F2fU20QHVLFR15b251LfwpfRt_UaDo1-bvHEyi8hxqVkiStOqi09TTUTPBgjPYkw";
const getToken = () => {
const token = common_vendor.index.getStorageSync("token");
return token ? `Bearer ${token}` : "";
};
const isEmptyObject = (obj) => {
return Object.keys(obj).length === 0;
};
@@ -31,21 +30,28 @@ function showToast(title) {
});
}
const requestAPI = (config) => {
let { url, method = "GET", data = {} } = typeof config === "object" && config.url ? config : { url: config, method: arguments[1] || "GET", data: arguments[2] || {} };
let { url, method = "GET", data = {}, noAuth = false } = typeof config === "object" && config.url ? config : { url: config, method: arguments[1] || "GET", data: arguments[2] || {} };
if (method == "GET" && !isEmptyObject(data)) {
url += "?" + objectToQueryString(data);
}
common_vendor.index.showLoading({
title: "加载中..."
});
const header = {
"Content-Type": "application/json"
};
if (!noAuth) {
const token = getToken();
if (token) {
header["Authorization"] = token;
}
}
return new Promise((resolve, reject) => {
common_vendor.index.request({
url: baseUrl + url,
method,
data,
header: {
"Authorization": AUTH_TOKEN
},
header,
success: (res) => {
common_vendor.index.hideLoading();
if (res.statusCode !== 200) {
@@ -57,8 +63,14 @@ const requestAPI = (config) => {
if (res.data.code === 200 || res.data.code === 0) {
resolve(res.data);
} else if (res.data.code === 401) {
common_vendor.index.removeStorageSync("_user_token_");
common_vendor.index.removeStorageSync("token");
common_vendor.index.removeStorageSync("userInfo");
showToast("登录已过期,请重新登录");
setTimeout(() => {
common_vendor.index.reLaunch({
url: "/pages/login/login"
});
}, 1500);
reject("401");
} else {
showToast(res.data.msg || "请求失败");
@@ -83,6 +95,6 @@ const requestAPI = (config) => {
});
});
};
exports.AUTH_TOKEN = AUTH_TOKEN;
exports.baseUrl = baseUrl;
exports.getToken = getToken;
exports.requestAPI = requestAPI;

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 539 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 947 B

After

Width:  |  Height:  |  Size: 947 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,57 @@
"use strict";
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
props: {
// input的label提示语
label: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.label
},
// 绑定的值
prop: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.prop
},
// 绑定的规则
rules: {
type: Array,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.rules
},
// 是否显示表单域的下划线边框
borderBottom: {
type: [String, Boolean],
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.borderBottom
},
// label的位置left-左边top-上边
labelPosition: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.labelPosition
},
// label的宽度单位px
labelWidth: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.labelWidth
},
// 右侧图标
rightIcon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.rightIcon
},
// 左侧图标
leftIcon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.leftIcon
},
// 是否显示左边的必填星号只作显示用具体校验必填的逻辑请在rules中配置
required: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.required
},
leftIconStyle: {
type: [String, Object],
default: () => uni_modules_uviewPlus_libs_config_props.props.formItem.leftIconStyle
}
}
});
exports.props = props;

View File

@@ -0,0 +1,142 @@
"use strict";
const uni_modules_uviewPlus_components_uFormItem_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const uni_modules_uviewPlus_libs_config_color = require("../../libs/config/color.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-form-item",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uFormItem_props.props],
data() {
return {
// 错误提示语
message: "",
parentData: {
// 提示文本的位置
labelPosition: "left",
// 提示文本对齐方式
labelAlign: "left",
// 提示文本的样式
labelStyle: {},
// 提示文本的宽度
labelWidth: 45,
// 错误提示方式
errorType: "message"
},
color: uni_modules_uviewPlus_libs_config_color.color,
itemRules: []
};
},
// 组件创建完成时将当前实例保存到u-form中
computed: {
propsLine() {
return uni_modules_uviewPlus_libs_config_props.props.line;
}
},
mounted() {
this.init();
},
emits: ["click"],
watch: {
// 监听规则的变化
rules: {
immediate: true,
handler(n) {
this.setRules(n);
}
}
},
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
init() {
this.updateParentData();
if (!this.parent) {
uni_modules_uviewPlus_libs_function_index.error("u-form-item需要结合u-form组件使用");
}
},
// 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
setRules(rules) {
if (rules.length === 0) {
this.itemRules = [];
return;
}
this.itemRules = rules;
},
// 获取父组件的参数
updateParentData() {
this.getParentData("u-form");
},
// 移除u-form-item的校验结果
clearValidate() {
this.message = null;
},
// 清空当前的组件的校验结果,并重置为初始值
resetField() {
const value = uni_modules_uviewPlus_libs_function_index.getProperty(this.parent.originalModel, this.prop);
uni_modules_uviewPlus_libs_function_index.setProperty(this.parent.model, this.prop, value);
this.message = null;
},
// 点击组件
clickHandler() {
this.$emit("click");
}
}
};
if (!Array) {
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
(_easycom_up_icon2 + _easycom_u_line2)();
}
const _easycom_up_icon = () => "../u-icon/u-icon.js";
const _easycom_u_line = () => "../u-line/u-line.js";
if (!Math) {
(_easycom_up_icon + _easycom_u_line)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.required || _ctx.leftIcon || _ctx.label
}, _ctx.required || _ctx.leftIcon || _ctx.label ? common_vendor.e({
b: _ctx.required
}, _ctx.required ? {} : {}, {
c: _ctx.leftIcon
}, _ctx.leftIcon ? {
d: common_vendor.p({
name: _ctx.leftIcon,
["custom-style"]: _ctx.leftIconStyle
})
} : {}, {
e: common_vendor.t(_ctx.label),
f: common_vendor.s($data.parentData.labelStyle),
g: common_vendor.s({
justifyContent: $data.parentData.labelAlign === "left" ? "flex-start" : $data.parentData.labelAlign === "center" ? "center" : "flex-end"
}),
h: $options.addUnit(_ctx.labelWidth || $data.parentData.labelWidth),
i: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? 0 : "5px"
}) : {}, {
j: _ctx.$slots.right
}, _ctx.$slots.right ? {} : {}, {
k: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
l: common_vendor.s($options.addStyle(_ctx.customStyle)),
m: common_vendor.s({
flexDirection: (_ctx.labelPosition || $data.parentData.labelPosition) === "left" ? "row" : "column"
}),
n: !!$data.message && $data.parentData.errorType === "message"
}, !!$data.message && $data.parentData.errorType === "message" ? {
o: common_vendor.t($data.message),
p: $options.addUnit((_ctx.labelPosition || $data.parentData.labelPosition) === "top" ? 0 : _ctx.labelWidth || $data.parentData.labelWidth)
} : {}, {
q: _ctx.borderBottom
}, _ctx.borderBottom ? {
r: common_vendor.p({
color: $data.message && $data.parentData.errorType === "border-bottom" ? $data.color.error : $options.propsLine.color,
customStyle: `margin-top: ${$data.message && $data.parentData.errorType === "message" ? "5px" : 0}`
})
} : {}, {
s: !!$data.message && $data.parentData.errorType === "message" ? 1 : ""
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-42bac3de"]]);
wx.createComponent(Component);

View File

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

View File

@@ -0,0 +1 @@
<view class="{{['u-form-item', 'data-v-42bac3de', s && 'u-form-item--error', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="u-form-item__body data-v-42bac3de" bindtap="{{k}}" style="{{l + ';' + m}}"><block wx:if="{{$slots.label}}"><slot name="label"></slot></block><block wx:else><view wx:if="{{a}}" class="u-form-item__body__left data-v-42bac3de" style="{{'width:' + h + ';' + ('margin-bottom:' + i)}}"><view class="u-form-item__body__left__content data-v-42bac3de"><text wx:if="{{b}}" class="u-form-item__body__left__content__required data-v-42bac3de">*</text><view wx:if="{{c}}" class="u-form-item__body__left__content__icon data-v-42bac3de"><up-icon wx:if="{{d}}" class="data-v-42bac3de" virtualHostClass="data-v-42bac3de" u-i="42bac3de-0" bind:__l="__l" u-p="{{d}}"></up-icon></view><text class="u-form-item__body__left__content__label data-v-42bac3de" style="{{f + ';' + g}}">{{e}}</text></view></view></block><view class="u-form-item__body__right data-v-42bac3de"><view class="u-form-item__body__right__content data-v-42bac3de"><view class="u-form-item__body__right__content__slot data-v-42bac3de"><slot/></view><view wx:if="{{j}}" class="item__body__right__content__icon data-v-42bac3de"><slot name="right"/></view></view></view></view><block wx:if="{{$slots.error}}"><slot name="error"></slot></block><block wx:else><text wx:if="{{n}}" class="u-form-item__body__right__message data-v-42bac3de" style="{{'margin-left:' + p}}">{{o}}</text></block><u-line wx:if="{{q}}" class="data-v-42bac3de" virtualHostClass="data-v-42bac3de" u-i="42bac3de-1" bind:__l="__l" u-p="{{r}}"></u-line></view>

View File

@@ -0,0 +1,94 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.u-form-item.data-v-42bac3de {
display: flex;
flex-direction: column;
font-size: 14px;
color: #303133;
}
.u-form-item__body.data-v-42bac3de {
display: flex;
flex-direction: row;
padding: 10px 0;
}
.u-form-item__body__left.data-v-42bac3de {
display: flex;
flex-direction: row;
align-items: center;
}
.u-form-item__body__left__content.data-v-42bac3de {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
padding-right: 10rpx;
flex: 1;
}
.u-form-item__body__left__content__icon.data-v-42bac3de {
margin-right: 8rpx;
}
.u-form-item__body__left__content__required.data-v-42bac3de {
position: absolute;
left: -9px;
color: #f56c6c;
line-height: 20px;
font-size: 20px;
top: 3px;
}
.u-form-item__body__left__content__label.data-v-42bac3de {
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
color: #303133;
font-size: 15px;
}
.u-form-item__body__right.data-v-42bac3de {
flex: 1;
}
.u-form-item__body__right__content.data-v-42bac3de {
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
}
.u-form-item__body__right__content__slot.data-v-42bac3de {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
}
.u-form-item__body__right__content__icon.data-v-42bac3de {
margin-left: 10rpx;
color: #c0c4cc;
font-size: 30rpx;
}
.u-form-item__body__right__message.data-v-42bac3de {
font-size: 12px;
line-height: 12px;
color: #f56c6c;
}

View File

@@ -0,0 +1,49 @@
"use strict";
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
props: {
// 当前form的需要验证字段的集合
model: {
type: Object,
default: () => uni_modules_uviewPlus_libs_config_props.props.form.model
},
// 验证规则
rules: {
type: [Object, Function, Array],
default: () => uni_modules_uviewPlus_libs_config_props.props.form.rules
},
// 有错误时的提示方式message-提示信息toast-进行toast提示
// border-bottom-下边框呈现红色none-无提示
errorType: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.form.errorType
},
// 是否显示表单域的下划线边框
borderBottom: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.form.borderBottom
},
// label的位置left-左边top-上边
labelPosition: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelPosition
},
// label的宽度单位px
labelWidth: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelWidth
},
// lable字体的对齐方式
labelAlign: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelAlign
},
// lable的样式对象形式
labelStyle: {
type: Object,
default: () => uni_modules_uviewPlus_libs_config_props.props.form.labelStyle
}
}
});
exports.props = props;

View File

@@ -0,0 +1,208 @@
"use strict";
const uni_modules_uviewPlus_components_uForm_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_util_asyncValidator = require("../../libs/util/async-validator.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
const common_vendor = require("../../../../common/vendor.js");
uni_modules_uviewPlus_libs_util_asyncValidator.Schema.warning = function() {
};
const _sfc_main = {
name: "u-form",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uForm_props.props],
provide() {
return {
uForm: this
};
},
data() {
return {
formRules: {},
// 规则校验器
validator: {},
// 原始的model快照用于resetFields方法重置表单时使用
originalModel: null
};
},
watch: {
// 监听规则的变化
rules: {
immediate: true,
handler(n) {
this.setRules(n);
}
},
// 监听属性的变化通知子组件u-form-item重新获取信息
propsChange(n) {
var _a;
if ((_a = this.children) == null ? void 0 : _a.length) {
this.children.map((child) => {
typeof child.updateParentData == "function" && child.updateParentData();
});
}
},
// 监听model的初始值作为重置表单的快照
model: {
immediate: true,
handler(n) {
if (!this.originalModel) {
this.originalModel = uni_modules_uviewPlus_libs_function_index.deepClone(n);
}
}
}
},
computed: {
propsChange() {
return [
this.errorType,
this.borderBottom,
this.labelPosition,
this.labelWidth,
this.labelAlign,
this.labelStyle
];
}
},
created() {
this.children = [];
},
methods: {
// 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
setRules(rules) {
if (Object.keys(rules).length === 0)
return;
if (Object.keys(this.model).length === 0) {
uni_modules_uviewPlus_libs_function_index.error("设置rulesmodel必须设置如果已经设置请刷新页面。");
return;
}
this.formRules = rules;
this.validator = new uni_modules_uviewPlus_libs_util_asyncValidator.Schema(rules);
},
// 清空所有u-form-item组件的内容本质上是调用了u-form-item组件中的resetField()方法
resetFields() {
this.resetModel();
},
// 重置model为初始值的快照
resetModel(obj) {
this.children.map((child) => {
const prop = child == null ? void 0 : child.prop;
const value = uni_modules_uviewPlus_libs_function_index.getProperty(this.originalModel, prop);
uni_modules_uviewPlus_libs_function_index.setProperty(this.model, prop, value);
});
},
// 清空校验结果
clearValidate(props2) {
props2 = [].concat(props2);
this.children.map((child) => {
if (props2[0] === void 0 || props2.includes(child.prop)) {
child.message = null;
}
});
},
// 对部分表单字段进行校验
async validateField(value, callback, event = null, options) {
this.$nextTick(() => {
const errorsRes = [];
value = [].concat(value);
let promises = this.children.map((child) => {
return new Promise((resolve, reject) => {
const childErrors = [];
if (value.includes(child.prop)) {
const propertyVal = uni_modules_uviewPlus_libs_function_index.getProperty(
this.model,
child.prop
);
const propertyChain = child.prop.split(".");
const propertyName = propertyChain[propertyChain.length - 1];
let rule = [];
if (child.itemRules && child.itemRules.length > 0) {
rule = child.itemRules;
} else {
rule = this.formRules[child.prop];
}
if (!rule) {
resolve();
return;
}
const rules = [].concat(rule);
if (!rules.length) {
resolve();
}
for (let i = 0; i < rules.length; i++) {
const ruleItem = rules[i];
const trigger = [].concat(ruleItem == null ? void 0 : ruleItem.trigger);
if (event && !trigger.includes(event)) {
resolve();
continue;
}
const validator = new uni_modules_uviewPlus_libs_util_asyncValidator.Schema({
[propertyName]: ruleItem
});
validator.validate(
{
[propertyName]: propertyVal
},
(errors, fields) => {
var _a;
if (uni_modules_uviewPlus_libs_function_test.test.array(errors)) {
errors.forEach((element) => {
element.prop = child.prop;
});
errorsRes.push(...errors);
childErrors.push(...errors);
}
if (!options || (options == null ? void 0 : options.showErrorMsg) == true) {
child.message = ((_a = childErrors[0]) == null ? void 0 : _a.message) ? childErrors[0].message : null;
}
if (i == rules.length - 1) {
resolve(errorsRes);
}
}
);
}
} else {
resolve({});
}
});
});
Promise.all(promises).then((results) => {
typeof callback === "function" && callback(errorsRes);
}).catch((error2) => {
console.error("An error occurred:", error2);
});
});
},
/**
* 校验全部数据
* @param {Object} options
* @param {Boolean} options.showErrorMsg -是否显示校验信息,
*/
validate(options) {
if (Object.keys(this.formRules).length === 0) {
uni_modules_uviewPlus_libs_function_index.error("未设置rules请看文档说明如果已经设置请刷新页面。");
return;
}
return new Promise((resolve, reject) => {
this.$nextTick(() => {
const formItemProps = this.children.map(
(item) => item.prop
);
this.validateField(formItemProps, (errors) => {
if (errors.length) {
this.errorType === "toast" && uni_modules_uviewPlus_libs_function_index.toast(errors[0].message);
reject(errors);
} else {
resolve(true);
}
}, null, options);
});
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);

View File

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

View File

@@ -0,0 +1 @@
<view class="{{['u-form', virtualHostClass]}}" style="{{virtualHostStyle}}"><slot/></view>

View File

@@ -0,0 +1,37 @@
"use strict";
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
props: {
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.line.color
},
// 长度竖向时表现为高度横向时表现为长度可以为百分比带px单位的值等
length: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.line.length
},
// 线条方向col-竖向row-横向
direction: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.line.direction
},
// 是否显示细边框
hairline: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.line.hairline
},
// 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
margin: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.line.margin
},
// 是否虚线true-虚线false-实线
dashed: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.line.dashed
}
}
});
exports.props = props;

View File

@@ -0,0 +1,38 @@
"use strict";
const uni_modules_uviewPlus_components_uLine_props = require("./props.js");
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
name: "u-line",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLine_props.props],
computed: {
lineStyle() {
const style = {};
style.margin = this.margin;
if (this.direction === "row") {
style.borderBottomWidth = "1px";
style.borderBottomStyle = this.dashed ? "dashed" : "solid";
style.width = uni_modules_uviewPlus_libs_function_index.addUnit(this.length);
if (this.hairline)
style.transform = "scaleY(0.5)";
} else {
style.borderLeftWidth = "1px";
style.borderLeftStyle = this.dashed ? "dashed" : "solid";
style.height = uni_modules_uviewPlus_libs_function_index.addUnit(this.length);
if (this.hairline)
style.transform = "scaleX(0.5)";
}
style.borderColor = this.color;
return uni_modules_uviewPlus_libs_function_index.deepMerge(style, uni_modules_uviewPlus_libs_function_index.addStyle(this.customStyle));
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.s($options.lineStyle)
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-72791e59"]]);
wx.createComponent(Component);

View File

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

View File

@@ -0,0 +1 @@
<view style="{{a + ';' + virtualHostStyle}}" class="{{['u-line', 'data-v-72791e59', virtualHostClass]}}"></view>

View File

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

View File

@@ -585,6 +585,7 @@ exports.deepMerge = deepMerge;
exports.error = error;
exports.formValidate = formValidate;
exports.genLightColor = genLightColor;
exports.getProperty = getProperty;
exports.getWindowInfo = getWindowInfo;
exports.index = index;
exports.os = os;
@@ -592,6 +593,7 @@ exports.padZero = padZero;
exports.page = page;
exports.queryParams = queryParams;
exports.range = range;
exports.setProperty = setProperty;
exports.shallowMerge = shallowMerge;
exports.sleep = sleep;
exports.toast = toast;

Some files were not shown because too many files have changed in this diff Show More