这一版本优化了很多

This commit is contained in:
王利强
2026-06-03 10:16:37 +08:00
parent 8046316216
commit 2af9f1fd59
954 changed files with 58194 additions and 1609 deletions

View File

@@ -49,6 +49,55 @@ const _sfc_main = {
common_vendor.index.__f__("log", "at App.vue:10", "App Hide");
}
};
common_vendor.index.addInterceptor("chooseImage", {
success(res) {
const allowedExtensions = ["bmp", "gif", "jpg", "jpeg", "png"];
const validTempFilePaths = [];
const validTempFiles = [];
let hasInvalid = false;
let invalidExt = "";
res.tempFiles.forEach((file, index) => {
const path = file.path || res.tempFilePaths[index];
const cleanPath = path.split("?")[0];
const ext = cleanPath.split(".").pop().toLowerCase();
if (allowedExtensions.includes(ext)) {
validTempFiles.push(file);
validTempFilePaths.push(res.tempFilePaths[index]);
} else {
hasInvalid = true;
invalidExt = ext;
}
});
if (hasInvalid) {
common_vendor.index.showToast({
title: `已过滤不支持的 .${invalidExt} 格式图片,请上传 png/jpg/jpeg/gif/bmp`,
icon: "none",
duration: 3500
});
}
res.tempFilePaths = validTempFilePaths;
res.tempFiles = validTempFiles;
}
});
common_vendor.index.addInterceptor("uploadFile", {
invoke(args) {
const filePath = args.filePath;
if (filePath) {
const cleanPath = filePath.split("?")[0];
const ext = cleanPath.split(".").pop().toLowerCase();
const allowedExtensions = ["bmp", "gif", "jpg", "jpeg", "png", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", "rar", "zip", "gz", "bz2", "mp4", "avi", "rmvb", "pdf"];
if (!allowedExtensions.includes(ext)) {
common_vendor.index.showToast({
title: `不支持 .${ext} 格式,请上传合规的文件或图片`,
icon: "none",
duration: 3e3
});
return false;
}
}
return args;
}
});
function createApp() {
const app = common_vendor.createSSRApp(_sfc_main);
app.use(uni_modules_uviewPlus_index.uviewPlus);

View File

@@ -53,12 +53,6 @@
"iconPath": "static/tabbar_icon/home_icon.png",
"selectedIconPath": "static/tabbar_icon/home_selectedIcon.png"
},
{
"pagePath": "pages/map/map",
"text": "一张图",
"iconPath": "static/tabbar_icon/address_icon.png",
"selectedIconPath": "static/tabbar_icon/address_selectedIcon.png"
},
{
"pagePath": "pages/Inspectionwarning/Inspectionwarning",
"text": "预警",

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,173 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
if (!Math) {
wdIcon();
}
const wdIcon = () => "../wd-icon/wd-icon.js";
const __default__ = {
name: "wd-button",
options: {
addGlobalClass: true,
virtualHost: true,
styleIsolation: "shared"
}
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
...__default__,
props: common_vendor.buttonProps,
emits: [
"click",
"getuserinfo",
"contact",
"getphonenumber",
"getrealtimephonenumber",
"error",
"launchapp",
"opensetting",
"chooseavatar",
"agreeprivacyauthorization"
],
setup(__props, { emit: __emit }) {
const loadingIcon = (color = "#4D80F0", reverse = true) => {
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${reverse ? color : "#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${reverse ? color : "#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${reverse ? "#fff" : color}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`;
};
const props = __props;
const emit = __emit;
const hoverStartTime = common_vendor.ref(20);
const hoverStayTime = common_vendor.ref(70);
const loadingIconSvg = common_vendor.ref("");
const loadingStyle = common_vendor.computed(() => {
return `background-image: url(${loadingIconSvg.value});`;
});
const openTypeValue = common_vendor.computed(() => {
return props.disabled || props.loading ? void 0 : props.openType;
});
common_vendor.watch(
() => props.loading,
() => {
buildLoadingSvg();
},
{ deep: true, immediate: true }
);
function handleClick(event) {
if (!props.disabled && !props.loading) {
emit("click", event);
}
}
function handleGetAuthorize(event) {
if (props.scope === "phoneNumber") {
handleGetphonenumber(event);
} else if (props.scope === "userInfo") {
handleGetuserinfo(event);
}
}
function handleGetuserinfo(event) {
emit("getuserinfo", event.detail);
}
function handleConcat(event) {
emit("contact", event.detail);
}
function handleGetphonenumber(event) {
emit("getphonenumber", event.detail);
}
function handleGetrealtimephonenumber(event) {
emit("getrealtimephonenumber", event.detail);
}
function handleError(event) {
emit("error", event.detail);
}
function handleLaunchapp(event) {
emit("launchapp", event.detail);
}
function handleOpensetting(event) {
emit("opensetting", event.detail);
}
function handleChooseavatar(event) {
emit("chooseavatar", event.detail);
}
function handleAgreePrivacyAuthorization(event) {
emit("agreeprivacyauthorization", event.detail);
}
function buildLoadingSvg() {
const { loadingColor, type, plain } = props;
let color = loadingColor;
if (!color) {
switch (type) {
case "primary":
color = "#4D80F0";
break;
case "success":
color = "#34d19d";
break;
case "info":
color = "#333";
break;
case "warning":
color = "#f0883a";
break;
case "error":
color = "#fa4350";
break;
case "default":
color = "#333";
break;
}
}
const svg = loadingIcon(color, !plain);
loadingIconSvg.value = `"data:image/svg+xml;base64,${common_vendor.encode(svg)}"`;
}
return (_ctx, _cache) => {
return common_vendor.e({
a: _ctx.loading
}, _ctx.loading ? {
b: common_vendor.s(loadingStyle.value)
} : _ctx.icon ? {
d: common_vendor.p({
["custom-class"]: "wd-button__icon",
name: _ctx.icon,
classPrefix: _ctx.classPrefix
})
} : {}, {
c: _ctx.icon,
e: common_vendor.gei(_ctx, _ctx.buttonId),
f: `${_ctx.disabled || _ctx.loading ? "" : "wd-button--active"}`,
g: common_vendor.s(_ctx.customStyle),
h: common_vendor.n("is-" + _ctx.type),
i: common_vendor.n("is-" + _ctx.size),
j: common_vendor.n(_ctx.round ? "is-round" : ""),
k: common_vendor.n(_ctx.hairline ? "is-hairline" : ""),
l: common_vendor.n(_ctx.plain ? "is-plain" : ""),
m: common_vendor.n(_ctx.disabled ? "is-disabled" : ""),
n: common_vendor.n(_ctx.block ? "is-block" : ""),
o: common_vendor.n(_ctx.loading ? "is-loading" : ""),
p: common_vendor.n(_ctx.customClass),
q: hoverStartTime.value,
r: hoverStayTime.value,
s: openTypeValue.value,
t: _ctx.sendMessageTitle,
v: _ctx.sendMessagePath,
w: _ctx.sendMessageImg,
x: _ctx.appParameter,
y: _ctx.showMessageCard,
z: _ctx.sessionFrom,
A: _ctx.lang,
B: _ctx.hoverStopPropagation,
C: _ctx.scope,
D: common_vendor.o(handleClick),
E: common_vendor.o(handleGetAuthorize),
F: common_vendor.o(handleGetuserinfo),
G: common_vendor.o(handleConcat),
H: common_vendor.o(handleGetphonenumber),
I: common_vendor.o(handleGetrealtimephonenumber),
J: common_vendor.o(handleError),
K: common_vendor.o(handleLaunchapp),
L: common_vendor.o(handleOpensetting),
M: common_vendor.o(handleChooseavatar),
N: common_vendor.o(handleAgreePrivacyAuthorization)
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-aa3a6253"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/node-modules/wot-design-uni/components/wd-button/wd-button.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"wd-icon": "../wd-icon/wd-icon"
}
}

View File

@@ -0,0 +1 @@
<button id="{{e}}" hover-class="{{f}}" style="{{g + ';' + virtualHostStyle}}" class="{{['data-v-aa3a6253', 'wd-button', h, i, j, k, l, m, n, o, p, virtualHostClass]}}" hover-start-time="{{q}}" hover-stay-time="{{r}}" open-type="{{s}}" send-message-title="{{t}}" send-message-path="{{v}}" send-message-img="{{w}}" app-parameter="{{x}}" show-message-card="{{y}}" session-from="{{z}}" lang="{{A}}" hover-stop-propagation="{{B}}" scope="{{C}}" bindtap="{{D}}" bindgetAuthorize="{{E}}" bindgetuserinfo="{{F}}" bindcontact="{{G}}" bindgetphonenumber="{{H}}" bindgetrealtimephonenumber="{{I}}" binderror="{{J}}" bindlaunchapp="{{K}}" bindopensetting="{{L}}" bindchooseavatar="{{M}}" bindagreeprivacyauthorization="{{N}}" hidden="{{virtualHostHidden || false}}"><view class="wd-button__content data-v-aa3a6253"><view wx:if="{{a}}" class="wd-button__loading data-v-aa3a6253"><view class="wd-button__loading-svg data-v-aa3a6253" style="{{b}}"></view></view><wd-icon wx:elif="{{c}}" class="data-v-aa3a6253" virtualHostClass="data-v-aa3a6253" u-i="aa3a6253-0" bind:__l="__l" u-p="{{d}}"></wd-icon><view class="wd-button__text data-v-aa3a6253"><slot/></view></view></button>

View File

@@ -0,0 +1,457 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/**
* 混合宏
*/
/**
* SCSS 配置项命名空间以及BEM
*/
/**
* 辅助函数
*/
/**
* SCSS 配置项命名空间以及BEM
*/
/* 转换成字符串 */
/* 判断是否存在 Modifier */
/* 判断是否存在伪类 */
/**
* 主题色切换
* @params $theme-color 主题色
* @params $type 变暗dark 变亮 'light'
* @params $mix-color 自己设置的混色
*/
/**
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
* @params $open-linear 是否开启线性渐变色
* @params $deg 渐变色角度
* @params $theme-color 当前配色
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
* @params [Array] $per-list 渐变色比例
*/
/**
* BEM定义块b)
*/
/* 定义元素e对于伪类会自动将 e 嵌套在 伪类 底下 */
/* 此方法用于生成穿透样式 */
/* 定义元素e对于伪类会自动将 e 嵌套在 伪类 底下 */
/* 定义状态m */
/* 定义状态m */
/* 对于需要需要嵌套在 m 底下的 e调用这个混合宏一般在切换整个组件的状态如切换颜色的时候 */
/* 状态,生成 is-$state 类名 */
/**
* 常用混合宏
*/
/* 单行超出隐藏 */
/* 多行超出隐藏 */
/* 清除浮动 */
/* 0.5px 边框 指定方向*/
/* 0.5px 边框 环绕 */
/**
* 三角形实现尖角样式,适用于背景透明情况
* @param $size 三角形高,底边为 $size * 2
* @param $bg 三角形背景颜色
*/
/**
* 正方形实现尖角样式,适用于背景不透明情况
* @param $size 正方形边长
* @param $bg 正方形背景颜色
* @param $z-index z-index属性值不得大于外部包裹器
* @param $box-shadow 阴影
*/
/**
* 辅助函数
*/
/**
* SCSS 配置项命名空间以及BEM
*/
/* 转换成字符串 */
/* 判断是否存在 Modifier */
/* 判断是否存在伪类 */
/**
* 主题色切换
* @params $theme-color 主题色
* @params $type 变暗dark 变亮 'light'
* @params $mix-color 自己设置的混色
*/
/**
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
* @params $open-linear 是否开启线性渐变色
* @params $deg 渐变色角度
* @params $theme-color 当前配色
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
* @params [Array] $per-list 渐变色比例
*/
/**
* UI规范基础变量
*/
/*----------------------------------------- Theme color. start ----------------------------------------*/
/* 主题颜色 */
/* 辅助色 */
/* 文字颜色(默认浅色背景下 */
/* 暗黑模式 */
/* 图形颜色 */
/*----------------------------------------- Theme color. end -------------------------------------------*/
/*-------------------------------- Theme color application size. start --------------------------------*/
/* 文字字号 */
/* 文字字重 */
/* 尺寸 */
/*-------------------------------- Theme color application size. end --------------------------------*/
/* component var */
/* action-sheet */
/* badge */
/* button */
/* cell */
/* calendar */
/* checkbox */
/* collapse */
/* divider */
/* drop-menu */
/* input-number */
/* input */
/* textarea */
/* loadmore */
/* message-box */
/* notice-bar */
/* pagination */
/* picker */
/* col-picker */
/* overlay */
/* popup */
/* progress */
/* radio */
/* search */
/* slider */
/* sort-button */
/* steps */
/* switch */
/* tabs */
/* tag */
/* toast */
/* loading */
/* tooltip */
/* popover */
/* grid-item */
/* statustip */
/* card */
/* upload */
/* curtain */
/* notify */
/* skeleton */
/* circle */
/* swiper */
/* swiper-nav */
/* segmented */
/* tabbar */
/* tabbar-item */
/* navbar */
/* navbar-capsule */
/* table */
/* sidebar */
/* sidebar-item */
/* fab */
/* count-down */
/* keyboard */
/* number-keyboard */
/* passwod-input */
/* form-item */
/* backtop */
/* index-bar */
/* text */
/* video-preview */
/* img-cropper */
/* floating-panel */
/* signature */
/* tour */
/* avatar */
/* avatar-group */
/* slide-verify */
.wot-theme-dark .wd-button.is-info.data-v-aa3a6253 {
background: var(--wot-dark-background4, #323233);
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
}
.wot-theme-dark .wd-button.is-plain.data-v-aa3a6253 {
background: transparent;
}
.wot-theme-dark .wd-button.is-plain.is-info.data-v-aa3a6253 {
color: var(--wot-dark-color, var(--wot-color-white, white));
}
.wot-theme-dark .wd-button.is-plain.is-info.data-v-aa3a6253::after {
border-color: var(--wot-dark-background5, #646566);
}
.wot-theme-dark .wd-button.is-text.is-disabled.data-v-aa3a6253 {
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
background: transparent;
}
.wot-theme-dark .wd-button.is-icon.data-v-aa3a6253 {
color: var(--wot-dark-color, var(--wot-color-white, white));
}
.wot-theme-dark .wd-button.is-icon.is-disabled.data-v-aa3a6253 {
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
background: transparent;
}
.wd-button.data-v-aa3a6253 {
margin-left: initial;
margin-right: initial;
position: relative;
display: inline-block;
outline: none;
-webkit-appearance: none;
background: transparent;
box-sizing: border-box;
border: none;
border-radius: 0;
color: var(--wot-button-normal-color, var(--wot-color-title, var(--wot-color-black, black)));
transition: opacity 0.2s;
-webkit-user-select: none;
user-select: none;
font-weight: normal;
}
.wd-button.data-v-aa3a6253::before {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
background: var(--wot-color-black, black);
border: inherit;
border-color: var(--wot-color-black, black);
border-radius: inherit;
transform: translate(-50%, -50%);
opacity: 0;
content: " ";
}
.wd-button.data-v-aa3a6253::after {
border: none;
border-radius: 0;
}
.wd-button__content.data-v-aa3a6253 {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.wd-button--active.data-v-aa3a6253:active::before {
opacity: 0.15;
}
.wd-button.is-disabled.data-v-aa3a6253 {
opacity: var(--wot-button-disabled-opacity, 0.6);
}
.wd-button__loading.data-v-aa3a6253 {
margin-right: 5px;
animation: wd-rotate-aa3a6253 0.8s linear infinite;
animation-duration: 2s;
}
.wd-button__loading-svg.data-v-aa3a6253 {
width: 100%;
height: 100%;
background-size: cover;
background-repeat: no-repeat;
}
.wd-button.is-primary.data-v-aa3a6253 {
background: var(--wot-button-primary-bg-color, var(--wot-color-theme, #4d80f0));
color: var(--wot-button-primary-color, var(--wot-color-white, white));
}
.wd-button.is-success.data-v-aa3a6253 {
background: var(--wot-button-success-bg-color, var(--wot-color-success, #34d19d));
color: var(--wot-button-success-color, var(--wot-color-white, white));
}
.wd-button.is-info.data-v-aa3a6253 {
background: var(--wot-button-info-bg-color, #f0f0f0);
color: var(--wot-button-info-color, var(--wot-color-title, var(--wot-color-black, black)));
}
.wd-button.is-warning.data-v-aa3a6253 {
background: var(--wot-button-warning-bg-color, var(--wot-color-warning, #f0883a));
color: var(--wot-button-warning-color, var(--wot-color-white, white));
}
.wd-button.is-error.data-v-aa3a6253 {
background: var(--wot-button-error-bg-color, var(--wot-color-danger, #fa4350));
color: var(--wot-button-error-color, var(--wot-color-white, white));
}
.wd-button.is-small.data-v-aa3a6253 {
height: var(--wot-button-small-height, 28px);
padding: var(--wot-button-small-padding, 0 12px);
border-radius: var(--wot-button-small-radius, 2px);
font-size: var(--wot-button-small-fs, var(--wot-fs-secondary, 12px));
font-weight: normal;
}
.wd-button.is-small .wd-button__loading.data-v-aa3a6253 {
width: var(--wot-button-small-loading, 14px);
height: var(--wot-button-small-loading, 14px);
}
.wd-button.is-medium.data-v-aa3a6253 {
height: var(--wot-button-medium-height, 36px);
padding: var(--wot-button-medium-padding, 0 16px);
border-radius: var(--wot-button-medium-radius, 4px);
font-size: var(--wot-button-medium-fs, var(--wot-fs-content, 14px));
min-width: 120px;
}
.wd-button.is-medium.is-round.is-icon.data-v-aa3a6253 {
min-width: 0;
border-radius: 50%;
}
.wd-button.is-medium.is-round.is-text.data-v-aa3a6253 {
border-radius: 0;
min-width: 0;
}
.wd-button.is-medium .wd-button__loading.data-v-aa3a6253 {
width: var(--wot-button-medium-loading, 18px);
height: var(--wot-button-medium-loading, 18px);
}
.wd-button.is-large.data-v-aa3a6253 {
height: var(--wot-button-large-height, 44px);
padding: var(--wot-button-large-padding, 0 36px);
border-radius: var(--wot-button-large-radius, 8px);
font-size: var(--wot-button-large-fs, var(--wot-fs-title, 16px));
}
.wd-button.is-large.data-v-aa3a6253::after {
border-radius: var(--wot-button-large-radius, 8px);
}
.wd-button.is-large .wd-button__loading.data-v-aa3a6253 {
width: var(--wot-button-large-loading, 24px);
height: var(--wot-button-large-loading, 24px);
}
.wd-button.is-round.data-v-aa3a6253 {
border-radius: 999px;
}
.wd-button.is-text.data-v-aa3a6253 {
color: var(--wot-button-primary-bg-color, var(--wot-color-theme, #4d80f0));
min-width: 0;
padding: 4px 0;
}
.wd-button.is-text.data-v-aa3a6253::after {
display: none;
}
.wd-button.is-text.wd-button--active.data-v-aa3a6253 {
opacity: var(--wot-button-text-hover-opacity, 0.7);
}
.wd-button.is-text.wd-button--active.data-v-aa3a6253:active::before {
display: none;
}
.wd-button.is-text.is-disabled.data-v-aa3a6253 {
color: var(--wot-button-normal-disabled-color, rgba(0, 0, 0, 0.25));
background: transparent;
}
.wd-button.is-plain.data-v-aa3a6253 {
background: var(--wot-button-plain-bg-color, var(--wot-color-white, white));
border: 1px solid currentColor;
}
.wd-button.is-plain.is-primary.data-v-aa3a6253 {
color: var(--wot-button-primary-bg-color, var(--wot-color-theme, #4d80f0));
}
.wd-button.is-plain.is-success.data-v-aa3a6253 {
color: var(--wot-button-success-bg-color, var(--wot-color-success, #34d19d));
}
.wd-button.is-plain.is-info.data-v-aa3a6253 {
color: var(--wot-button-info-plain-normal-color, rgba(0, 0, 0, 0.85));
border-color: var(--wot-button-info-plain-border-color, rgba(0, 0, 0, 0.45));
}
.wd-button.is-plain.is-warning.data-v-aa3a6253 {
color: var(--wot-button-warning-bg-color, var(--wot-color-warning, #f0883a));
}
.wd-button.is-plain.is-error.data-v-aa3a6253 {
color: var(--wot-button-error-bg-color, var(--wot-color-danger, #fa4350));
}
.wd-button.is-hairline.data-v-aa3a6253 {
border-width: 0;
}
.wd-button.is-hairline.is-plain.data-v-aa3a6253 {
position: relative;
}
.wd-button.is-hairline.is-plain.data-v-aa3a6253::after {
position: absolute;
display: block;
content: " ";
pointer-events: none;
width: 200%;
height: 200%;
left: 0;
top: 0;
border: 1px solid var(--wot-color-border-light, #e8e8e8);
transform: scale(0.5);
box-sizing: border-box;
transform-origin: left top;
}
.wd-button.is-hairline.is-plain.data-v-aa3a6253::before {
border-radius: inherit;
}
.wd-button.is-hairline.is-plain.data-v-aa3a6253::after {
border-color: inherit;
}
.wd-button.is-hairline.is-plain.is-round.data-v-aa3a6253::after {
border-radius: inherit !important;
}
.wd-button.is-hairline.is-plain.is-large.data-v-aa3a6253::after {
border-radius: calc(2 * var(--wot-button-large-radius, 8px));
}
.wd-button.is-hairline.is-plain.is-medium.data-v-aa3a6253::after {
border-radius: calc(2 * var(--wot-button-medium-radius, 4px));
}
.wd-button.is-hairline.is-plain.is-small.data-v-aa3a6253::after {
border-radius: calc(2 * var(--wot-button-small-radius, 2px));
}
.wd-button.is-block.data-v-aa3a6253 {
display: block;
}
.wd-button.is-icon.data-v-aa3a6253 {
width: var(--wot-button-icon-size, 40px);
height: var(--wot-button-icon-size, 40px);
padding: 0;
border-radius: 50%;
color: var(--wot-button-icon-color, rgba(0, 0, 0, 0.65));
}
.wd-button.is-icon.data-v-aa3a6253::after {
display: none;
}
.wd-button.is-icon.data-v-aa3a6253 .wd-button__icon {
margin-right: 0;
}
.wd-button.is-icon.is-disabled.data-v-aa3a6253 {
color: var(--wot-button-icon-disabled-color, var(--wot-color-icon-disabled, #a7a7a7));
background: transparent;
}
.data-v-aa3a6253 .wd-button__icon {
display: block;
margin-right: 6px;
font-size: var(--wot-button-icon-fs, 18px);
vertical-align: middle;
}
.wd-button__text.data-v-aa3a6253 {
-webkit-user-select: none;
user-select: none;
white-space: nowrap;
}
@keyframes wd-rotate-aa3a6253 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@@ -0,0 +1,54 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const __default__ = {
name: "wd-icon",
options: {
virtualHost: true,
addGlobalClass: true,
styleIsolation: "shared"
}
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
...__default__,
props: common_vendor.iconProps,
emits: ["click", "touch"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const isImage = common_vendor.computed(() => {
return common_vendor.isDef(props.name) && props.name.includes("/");
});
const rootClass = common_vendor.computed(() => {
const prefix = props.classPrefix;
return `${prefix} ${props.customClass} ${isImage.value ? "wd-icon--image" : prefix + "-" + props.name}`;
});
const rootStyle = common_vendor.computed(() => {
const style = {};
if (props.color) {
style["color"] = props.color;
}
if (props.size) {
style["font-size"] = common_vendor.addUnit(props.size);
}
return `${common_vendor.objToStyle(style)} ${props.customStyle}`;
});
function handleClick(event) {
emit("click", event);
}
return (_ctx, _cache) => {
return common_vendor.e({
a: isImage.value
}, isImage.value ? {
b: _ctx.name
} : {}, {
c: common_vendor.o(handleClick),
d: common_vendor.n(rootClass.value),
e: common_vendor.s(rootStyle.value),
f: common_vendor.gei(_ctx, "")
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d4a8410a"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/node-modules/wot-design-uni/components/wd-icon/wd-icon.js.map

View File

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

View File

@@ -0,0 +1 @@
<view bindtap="{{c}}" class="{{['data-v-d4a8410a', d, virtualHostClass]}}" style="{{e + ';' + virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{f}}"><image wx:if="{{a}}" class="wd-icon__image data-v-d4a8410a" src="{{b}}"></image></view>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,502 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
if (!Array) {
const _easycom_wd_button2 = common_vendor.resolveComponent("wd-button");
_easycom_wd_button2();
}
const _easycom_wd_button = () => "../wd-button/wd-button.js";
if (!Math) {
_easycom_wd_button();
}
const __default__ = {
name: "wd-signature",
options: {
addGlobalClass: true,
virtualHost: true,
styleIsolation: "shared"
}
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
...__default__,
props: common_vendor.signatureProps,
emits: ["start", "end", "signing", "confirm", "clear"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emit = __emit;
const { translate } = common_vendor.useTranslate("signature");
const { proxy } = common_vendor.getCurrentInstance();
const canvasId = common_vendor.ref(`signature${common_vendor.uuid()}`);
let canvas = null;
const drawing = common_vendor.ref(false);
const pixelRatio = common_vendor.ref(1);
const canvasState = common_vendor.reactive({
canvasWidth: 0,
canvasHeight: 0,
ctx: null
// canvas上下文
});
function isTransparentColor(color) {
if (!color)
return true;
const transparentKeywords = ["transparent", "#0000", "#00000000"];
if (transparentKeywords.includes(color.toLowerCase())) {
return true;
}
const rgbaMatch = color.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d*\.?\d+))?\)$/i);
if (rgbaMatch) {
const alpha = rgbaMatch[4] ? parseFloat(rgbaMatch[4]) : 1;
return alpha === 0;
}
const hslaMatch = color.match(/^hsla?\(\s*(\d+)(?:deg)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(\d*\.?\d+))?\)$/i);
if (hslaMatch) {
const alpha = hslaMatch[4] ? parseFloat(hslaMatch[4]) : 1;
return alpha === 0;
}
const hexMatch = color.match(/^#([0-9a-f]{8}|[0-9a-f]{4})$/i);
if (hexMatch) {
const hex = hexMatch[1];
const alphaHex = hex.length === 8 ? hex.slice(6, 8) : hex.slice(3, 4).repeat(2);
const alpha = parseInt(alphaHex, 16);
return alpha === 0;
}
return false;
}
common_vendor.watch(
() => props.penColor,
() => {
setLine();
}
);
common_vendor.watch(
() => props.lineWidth,
() => {
setLine();
}
);
const canvasStyle = common_vendor.computed(() => {
const style = {};
if (common_vendor.isDef(props.width)) {
style.width = common_vendor.addUnit(props.width);
}
if (common_vendor.isDef(props.height)) {
style.height = common_vendor.addUnit(props.height);
}
return `${common_vendor.objToStyle(style)}`;
});
const disableScroll = common_vendor.computed(() => props.disableScroll);
const enableHistory = common_vendor.computed(() => props.enableHistory);
const lines = common_vendor.ref([]);
const redoLines = common_vendor.ref([]);
const currentLine = common_vendor.ref();
const currentStep = common_vendor.ref(0);
function calculateLineWidth(speed) {
if (!props.pressure)
return props.lineWidth;
const minSpeed = props.minSpeed || 1.5;
const limitedSpeed = Math.min(minSpeed * 10, Math.max(minSpeed, speed));
const addWidth = (props.maxWidth - props.minWidth) * (limitedSpeed - minSpeed) / minSpeed;
const lineWidth = Math.max(props.maxWidth - addWidth, props.minWidth);
return Math.min(lineWidth, props.maxWidth);
}
const getDefaultLineWidth = () => {
if (props.pressure) {
return (props.maxWidth + props.minWidth) / 2;
}
return props.lineWidth;
};
const startDrawing = (e) => {
e.preventDefault();
drawing.value = true;
setLine();
emit("start", e);
const { x, y } = e.touches[0];
currentLine.value = {
points: [
{
x,
y,
t: Date.now()
// 使用 t 替换 width
}
],
color: props.penColor,
width: getDefaultLineWidth(),
backgroundColor: props.backgroundColor,
isPressure: props.pressure
// 添加笔锋模式标记
};
redoLines.value = [];
draw(e);
};
const stopDrawing = (e) => {
e.preventDefault();
drawing.value = false;
if (currentLine.value) {
lines.value.push({
...currentLine.value,
points: currentLine.value.points.map((point) => ({
...point,
t: point.t,
speed: point.speed,
distance: point.distance,
lineWidth: point.lineWidth,
lastX1: point.lastX1,
lastY1: point.lastY1,
lastX2: point.lastX2,
lastY2: point.lastY2,
isFirstPoint: point.isFirstPoint
}))
});
currentStep.value = lines.value.length;
}
currentLine.value = void 0;
const { ctx } = canvasState;
if (ctx)
ctx.beginPath();
emit("end", e);
};
const initCanvas = (forceUpdate = false) => {
if (!forceUpdate && canvasState.canvasHeight && canvasState.canvasWidth) {
return;
}
getContext().then(() => {
const { ctx } = canvasState;
if (ctx && common_vendor.isDef(props.backgroundColor)) {
ctx.setFillStyle(props.backgroundColor);
ctx.fillRect(0, 0, canvasState.canvasWidth, canvasState.canvasHeight);
ctx.draw();
}
});
};
const clear = () => {
lines.value = [];
redoLines.value = [];
currentStep.value = 0;
clearCanvas();
emit("clear");
};
const confirmSignature = () => {
canvasToImage();
};
const draw = (e) => {
e.preventDefault();
const { ctx } = canvasState;
if (!drawing.value || props.disabled || !ctx)
return;
const { x, y } = e.touches[0];
const point = {
x,
y,
t: Date.now()
};
if (currentLine.value) {
const points = currentLine.value.points;
const prePoint = points[points.length - 1];
if (prePoint.t === point.t || prePoint.x === x && prePoint.y === y) {
return;
}
point.distance = Math.sqrt(Math.pow(point.x - prePoint.x, 2) + Math.pow(point.y - prePoint.y, 2));
point.speed = point.distance / (point.t - prePoint.t || 0.1);
if (props.pressure) {
point.lineWidth = calculateLineWidth(point.speed);
if (points.length >= 2) {
const prePoint2 = points[points.length - 2];
if (prePoint2.lineWidth && prePoint.lineWidth) {
const rate = (point.lineWidth - prePoint.lineWidth) / prePoint.lineWidth;
const maxRate = 0.2;
if (Math.abs(rate) > maxRate) {
const per = rate > 0 ? maxRate : -maxRate;
point.lineWidth = prePoint.lineWidth * (1 + per);
}
}
}
}
points.push(point);
if (!props.pressure) {
ctx.beginPath();
ctx.moveTo(prePoint.x, prePoint.y);
ctx.lineTo(point.x, point.y);
ctx.stroke();
ctx.draw(true);
} else if (points.length >= 2) {
drawSmoothLine(prePoint, point);
}
}
emit("signing", e);
};
const redrawCanvas = () => {
const { ctx } = canvasState;
if (!ctx)
return;
if (!isTransparentColor(props.backgroundColor)) {
ctx.setFillStyle(props.backgroundColor);
ctx.fillRect(0, 0, canvasState.canvasWidth, canvasState.canvasHeight);
} else {
ctx.clearRect(0, 0, canvasState.canvasWidth, canvasState.canvasHeight);
}
if (lines.value.length === 0) {
ctx.draw();
return;
}
lines.value.forEach((line) => {
if (!line.points.length)
return;
ctx.setStrokeStyle(line.color);
ctx.setLineJoin("round");
ctx.setLineCap("round");
if (line.isPressure && props.pressure) {
line.points.forEach((point, index) => {
if (index === 0)
return;
const prePoint = line.points[index - 1];
const dis_x = point.x - prePoint.x;
const dis_y = point.y - prePoint.y;
const distance = Math.sqrt(dis_x * dis_x + dis_y * dis_y);
if (distance <= 2) {
point.lastX1 = point.lastX2 = prePoint.x + dis_x * 0.5;
point.lastY1 = point.lastY2 = prePoint.y + dis_y * 0.5;
} else {
const speed = point.speed || 0;
const minSpeed = props.minSpeed || 1.5;
const speedFactor = Math.max(0.1, Math.min(0.9, speed / (minSpeed * 10)));
point.lastX1 = prePoint.x + dis_x * (0.2 + speedFactor * 0.3);
point.lastY1 = prePoint.y + dis_y * (0.2 + speedFactor * 0.3);
point.lastX2 = prePoint.x + dis_x * (0.8 - speedFactor * 0.3);
point.lastY2 = prePoint.y + dis_y * (0.8 - speedFactor * 0.3);
}
const lineWidth = point.lineWidth || line.width;
if (typeof prePoint.lastX1 === "number") {
ctx.setLineWidth(lineWidth);
ctx.beginPath();
ctx.moveTo(prePoint.lastX2, prePoint.lastY2);
ctx.quadraticCurveTo(prePoint.x, prePoint.y, point.lastX1, point.lastY1);
ctx.stroke();
if (!prePoint.isFirstPoint) {
ctx.beginPath();
ctx.moveTo(prePoint.lastX1, prePoint.lastY1);
ctx.quadraticCurveTo(prePoint.x, prePoint.y, prePoint.lastX2, prePoint.lastY2);
ctx.stroke();
}
} else {
point.isFirstPoint = true;
}
});
} else {
ctx.setLineWidth(line.width);
line.points.forEach((point, index) => {
if (index === 0)
return;
const prePoint = line.points[index - 1];
ctx.beginPath();
ctx.moveTo(prePoint.x, prePoint.y);
ctx.lineTo(point.x, point.y);
ctx.stroke();
});
}
});
ctx.draw();
};
const revoke = () => {
if (!lines.value.length)
return;
const step = Math.min(props.step, lines.value.length);
const removedLines = lines.value.splice(lines.value.length - step);
redoLines.value.push(...removedLines);
currentStep.value = Math.max(0, currentStep.value - step);
redrawCanvas();
};
const restore = () => {
if (!redoLines.value.length)
return;
const step = Math.min(props.step, redoLines.value.length);
const restoredLines = redoLines.value.splice(redoLines.value.length - step);
lines.value.push(...restoredLines);
currentStep.value = Math.min(lines.value.length, currentStep.value + step);
redrawCanvas();
};
function drawSmoothLine(prePoint, point) {
const { ctx } = canvasState;
if (!ctx)
return;
const dis_x = point.x - prePoint.x;
const dis_y = point.y - prePoint.y;
const distance = Math.sqrt(dis_x * dis_x + dis_y * dis_y);
if (distance <= 2) {
point.lastX1 = point.lastX2 = prePoint.x + dis_x * 0.5;
point.lastY1 = point.lastY2 = prePoint.y + dis_y * 0.5;
} else {
const speed = point.speed || 0;
const minSpeed = props.minSpeed || 1.5;
const speedFactor = Math.max(0.1, Math.min(0.9, speed / (minSpeed * 10)));
point.lastX1 = prePoint.x + dis_x * (0.2 + speedFactor * 0.3);
point.lastY1 = prePoint.y + dis_y * (0.2 + speedFactor * 0.3);
point.lastX2 = prePoint.x + dis_x * (0.8 - speedFactor * 0.3);
point.lastY2 = prePoint.y + dis_y * (0.8 - speedFactor * 0.3);
}
const lineWidth = point.lineWidth || props.lineWidth;
if (typeof prePoint.lastX1 === "number") {
ctx.setLineWidth(lineWidth);
ctx.beginPath();
ctx.moveTo(prePoint.lastX2, prePoint.lastY2);
ctx.quadraticCurveTo(prePoint.x, prePoint.y, point.lastX1, point.lastY1);
ctx.stroke();
if (!prePoint.isFirstPoint) {
ctx.beginPath();
ctx.moveTo(prePoint.lastX1, prePoint.lastY1);
ctx.quadraticCurveTo(prePoint.x, prePoint.y, prePoint.lastX2, prePoint.lastY2);
ctx.stroke();
}
ctx.draw(true);
} else {
point.isFirstPoint = true;
}
}
common_vendor.onMounted(() => {
initCanvas();
});
common_vendor.onBeforeMount(() => {
pixelRatio.value = common_vendor.getSystemInfo().pixelRatio;
});
function getContext() {
return new Promise((resolve) => {
const { ctx } = canvasState;
if (ctx) {
return resolve(ctx);
}
common_vendor.getRect(`#${canvasId.value}`, false, proxy, true).then((canvasRect) => {
if (canvasRect && canvasRect.node && canvasRect.width && canvasRect.height) {
const canvasInstance = canvasRect.node;
canvasState.ctx = common_vendor.canvas2dAdapter(canvasInstance.getContext("2d"));
canvasInstance.width = canvasRect.width * pixelRatio.value;
canvasInstance.height = canvasRect.height * pixelRatio.value;
canvasState.ctx.scale(pixelRatio.value, pixelRatio.value);
canvas = canvasInstance;
setcanvasState(canvasRect.width, canvasRect.height);
resolve(canvasState.ctx);
}
});
});
}
function setcanvasState(width, height) {
canvasState.canvasHeight = height * pixelRatio.value;
canvasState.canvasWidth = width * pixelRatio.value;
}
function setLine() {
const { ctx } = canvasState;
if (ctx) {
ctx.setLineWidth(getDefaultLineWidth());
ctx.setStrokeStyle(props.penColor);
ctx.setLineJoin("round");
ctx.setLineCap("round");
}
}
function canvasToImage() {
const { fileType, quality, exportScale } = props;
const { canvasWidth, canvasHeight } = canvasState;
common_vendor.index.canvasToTempFilePath(
{
width: canvasWidth,
height: canvasHeight,
destWidth: canvasWidth * exportScale,
destHeight: canvasHeight * exportScale,
fileType,
quality,
canvasId: canvasId.value,
canvas,
success: (res) => {
const result = {
tempFilePath: res.tempFilePath,
width: canvasWidth * exportScale / pixelRatio.value,
height: canvasHeight * exportScale / pixelRatio.value,
success: true
};
emit("confirm", result);
},
fail: () => {
const result = {
tempFilePath: "",
width: canvasWidth * exportScale / pixelRatio.value,
height: canvasHeight * exportScale / pixelRatio.value,
success: false
};
emit("confirm", result);
}
},
proxy
);
}
function clearCanvas() {
const { canvasWidth, canvasHeight, ctx } = canvasState;
if (ctx) {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
if (!isTransparentColor(props.backgroundColor)) {
ctx.setFillStyle(props.backgroundColor);
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
}
ctx.draw();
}
}
__expose({
init: initCanvas,
clear,
confirm: confirmSignature,
restore,
revoke
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.s(canvasStyle.value),
b: canvasState.canvasWidth,
c: canvasState.canvasHeight,
d: canvasId.value,
e: canvasId.value,
f: disableScroll.value,
g: common_vendor.o(startDrawing),
h: common_vendor.o(stopDrawing),
i: common_vendor.o(draw),
j: enableHistory.value
}, enableHistory.value ? {
k: common_vendor.t(_ctx.revokeText || common_vendor.unref(translate)("revokeText")),
l: common_vendor.o(revoke),
m: common_vendor.p({
size: "small",
plain: true,
disabled: lines.value.length <= 0
}),
n: common_vendor.t(_ctx.restoreText || common_vendor.unref(translate)("restoreText")),
o: common_vendor.o(restore),
p: common_vendor.p({
size: "small",
plain: true,
disabled: redoLines.value.length <= 0
})
} : {}, {
q: common_vendor.t(_ctx.clearText || common_vendor.unref(translate)("clearText")),
r: common_vendor.o(clear),
s: common_vendor.p({
size: "small",
plain: true
}),
t: common_vendor.t(_ctx.confirmText || common_vendor.unref(translate)("confirmText")),
v: common_vendor.o(confirmSignature),
w: common_vendor.p({
size: "small"
}),
x: common_vendor.r("footer", {
clear,
confirm: confirmSignature,
currentStep: currentStep.value,
revoke,
restore,
canUndo: lines.value.length > 0,
canRedo: redoLines.value.length > 0,
historyList: lines.value
}),
y: common_vendor.gei(_ctx, "")
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5bbd3260"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/node-modules/wot-design-uni/components/wd-signature/wd-signature.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"wd-button": "../wd-button/wd-button"
}
}

View File

@@ -0,0 +1 @@
<view class="{{['wd-signature', 'data-v-5bbd3260', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{y}}"><view class="wd-signature__content data-v-5bbd3260"><block wx:if="{{r0}}"><canvas class="wd-signature__content-canvas data-v-5bbd3260" style="{{a}}" width="{{b}}" height="{{c}}" canvas-id="{{d}}" id="{{e}}" disable-scroll="{{f}}" bindtouchstart="{{g}}" bindtouchend="{{h}}" bindtouchmove="{{i}}" type="2d"/></block></view><view class="wd-signature__footer data-v-5bbd3260"><block wx:if="{{$slots.footer}}"><slot name="footer"></slot></block><block wx:else><block wx:if="{{j}}"><wd-button wx:if="{{m}}" class="data-v-5bbd3260" virtualHostClass="data-v-5bbd3260" u-s="{{['d']}}" bindclick="{{l}}" u-i="5bbd3260-0" bind:__l="__l" u-p="{{m}}">{{k}}</wd-button><wd-button wx:if="{{p}}" class="data-v-5bbd3260" virtualHostClass="data-v-5bbd3260" u-s="{{['d']}}" bindclick="{{o}}" u-i="5bbd3260-1" bind:__l="__l" u-p="{{p}}">{{n}}</wd-button></block><wd-button wx:if="{{s}}" class="data-v-5bbd3260" virtualHostClass="data-v-5bbd3260" u-s="{{['d']}}" bindclick="{{r}}" u-i="5bbd3260-2" bind:__l="__l" u-p="{{s}}">{{q}}</wd-button><wd-button wx:if="{{w}}" class="data-v-5bbd3260" virtualHostClass="data-v-5bbd3260" u-s="{{['d']}}" bindclick="{{v}}" u-i="5bbd3260-3" bind:__l="__l" u-p="{{w}}">{{t}}</wd-button></block></view></view>

View File

@@ -0,0 +1,214 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/**
* 辅助函数
*/
/**
* SCSS 配置项命名空间以及BEM
*/
/* 转换成字符串 */
/* 判断是否存在 Modifier */
/* 判断是否存在伪类 */
/**
* 主题色切换
* @params $theme-color 主题色
* @params $type 变暗dark 变亮 'light'
* @params $mix-color 自己设置的混色
*/
/**
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
* @params $open-linear 是否开启线性渐变色
* @params $deg 渐变色角度
* @params $theme-color 当前配色
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
* @params [Array] $per-list 渐变色比例
*/
/**
* UI规范基础变量
*/
/*----------------------------------------- Theme color. start ----------------------------------------*/
/* 主题颜色 */
/* 辅助色 */
/* 文字颜色(默认浅色背景下 */
/* 暗黑模式 */
/* 图形颜色 */
/*----------------------------------------- Theme color. end -------------------------------------------*/
/*-------------------------------- Theme color application size. start --------------------------------*/
/* 文字字号 */
/* 文字字重 */
/* 尺寸 */
/*-------------------------------- Theme color application size. end --------------------------------*/
/* component var */
/* action-sheet */
/* badge */
/* button */
/* cell */
/* calendar */
/* checkbox */
/* collapse */
/* divider */
/* drop-menu */
/* input-number */
/* input */
/* textarea */
/* loadmore */
/* message-box */
/* notice-bar */
/* pagination */
/* picker */
/* col-picker */
/* overlay */
/* popup */
/* progress */
/* radio */
/* search */
/* slider */
/* sort-button */
/* steps */
/* switch */
/* tabs */
/* tag */
/* toast */
/* loading */
/* tooltip */
/* popover */
/* grid-item */
/* statustip */
/* card */
/* upload */
/* curtain */
/* notify */
/* skeleton */
/* circle */
/* swiper */
/* swiper-nav */
/* segmented */
/* tabbar */
/* tabbar-item */
/* navbar */
/* navbar-capsule */
/* table */
/* sidebar */
/* sidebar-item */
/* fab */
/* count-down */
/* keyboard */
/* number-keyboard */
/* passwod-input */
/* form-item */
/* backtop */
/* index-bar */
/* text */
/* video-preview */
/* img-cropper */
/* floating-panel */
/* signature */
/* tour */
/* avatar */
/* avatar-group */
/* slide-verify */
/**
* 混合宏
*/
/**
* SCSS 配置项命名空间以及BEM
*/
/**
* 辅助函数
*/
/**
* SCSS 配置项命名空间以及BEM
*/
/* 转换成字符串 */
/* 判断是否存在 Modifier */
/* 判断是否存在伪类 */
/**
* 主题色切换
* @params $theme-color 主题色
* @params $type 变暗dark 变亮 'light'
* @params $mix-color 自己设置的混色
*/
/**
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
* @params $open-linear 是否开启线性渐变色
* @params $deg 渐变色角度
* @params $theme-color 当前配色
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
* @params [Array] $per-list 渐变色比例
*/
/**
* BEM定义块b)
*/
/* 定义元素e对于伪类会自动将 e 嵌套在 伪类 底下 */
/* 此方法用于生成穿透样式 */
/* 定义元素e对于伪类会自动将 e 嵌套在 伪类 底下 */
/* 定义状态m */
/* 定义状态m */
/* 对于需要需要嵌套在 m 底下的 e调用这个混合宏一般在切换整个组件的状态如切换颜色的时候 */
/* 状态,生成 is-$state 类名 */
/**
* 常用混合宏
*/
/* 单行超出隐藏 */
/* 多行超出隐藏 */
/* 清除浮动 */
/* 0.5px 边框 指定方向*/
/* 0.5px 边框 环绕 */
/**
* 三角形实现尖角样式,适用于背景透明情况
* @param $size 三角形高,底边为 $size * 2
* @param $bg 三角形背景颜色
*/
/**
* 正方形实现尖角样式,适用于背景不透明情况
* @param $size 正方形边长
* @param $bg 正方形背景颜色
* @param $z-index z-index属性值不得大于外部包裹器
* @param $box-shadow 阴影
*/
.wd-signature__content.data-v-5bbd3260 {
justify-content: center;
align-items: center;
display: flex;
overflow: hidden;
background: var(--wot-signature-bg, var(--wot-color-white, white));
border-radius: var(--wot-signature-radius, 4px);
border: var(--wot-signature-border, 1px solid var(--wot-color-gray-5, #c8c9cc));
}
.wd-signature__content-canvas.data-v-5bbd3260 {
width: 100%;
}
.wd-signature__footer.data-v-5bbd3260 {
margin-top: var(--wot-signature-footer-margin-top, 8px);
justify-content: flex-end;
display: flex;
}
.wd-signature__footer.data-v-5bbd3260 .wd-button {
margin-left: var(--wot-signature-button-margin-left, 8px);
}

View File

@@ -209,7 +209,7 @@ const _sfc_main = {
const uploadImage = (filePath) => {
common_vendor.index.showLoading({ title: "上传中..." });
common_vendor.index.uploadFile({
url: baseUrl + "/frontend/attachment/upload",
url: request_request.baseUrl + "/frontend/attachment/upload",
filePath,
name: "file",
header: {

View File

@@ -2,6 +2,7 @@
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_request = require("../../request/request.js");
const utils_watermark = require("../../utils/watermark.js");
const request_three_one_api_area = require("../../request/three_one_api/area.js");
if (!Array) {
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
@@ -27,6 +28,8 @@ const _sfc_main = {
__name: "Inspectionresult",
setup(__props) {
const oneTableId = common_vendor.ref("");
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const checkData = common_vendor.ref(null);
const radiolist1 = common_vendor.reactive([
{
@@ -47,13 +50,13 @@ const _sfc_main = {
]);
const radiovalue1 = common_vendor.ref("");
const groupChange = (n) => {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:240", "groupChange", n);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:305", "groupChange", n);
if (n !== "异常") {
clearHazard();
}
};
const radioChange = (n) => {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:248", "radioChange", n);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:313", "radioChange", n);
};
const value1 = common_vendor.ref("");
const showHazardPopup = common_vendor.ref(false);
@@ -62,7 +65,11 @@ const _sfc_main = {
level: 0,
source: 0,
description: "",
tagIndex: 0
tagIndex: 0,
regulationId: null,
// 法律依据ID
regulationName: ""
// 法律依据名称(显示用)
});
const hazardAddress = common_vendor.ref("");
const hazardLng = common_vendor.ref(0);
@@ -72,6 +79,75 @@ const _sfc_main = {
const selectedAreaId = common_vendor.ref("");
const selectedAreaName = common_vendor.ref("");
const tempAreaId = common_vendor.ref("");
const showLawPopup = common_vendor.ref(false);
const lawKeyword = common_vendor.ref("");
const selectedLawId = common_vendor.ref(null);
const selectedLawName = common_vendor.ref("");
const lawList = common_vendor.ref([]);
const lawLoading = common_vendor.ref(false);
const lawPageNum = common_vendor.ref(1);
const lawPageSize = common_vendor.ref(10);
const hasMoreLaw = common_vendor.ref(true);
const openLawPopup = () => {
showLawPopup.value = true;
if (lawList.value.length === 0) {
fetchRegulationList();
}
};
const fetchRegulationList = async (isLoadMore = false) => {
if (lawLoading.value)
return;
lawLoading.value = true;
try {
const params = {
pageNum: lawPageNum.value,
pageSize: lawPageSize.value,
status: 1
// 启用状态
};
if (lawKeyword.value && lawKeyword.value.trim()) {
params.keyword = lawKeyword.value.trim();
}
const res = await request_api.getRegulationList(params);
if (res.code === 0) {
const records = res.data.records || res.data || [];
if (isLoadMore) {
lawList.value = [...lawList.value, ...records];
} else {
lawList.value = records;
}
const total = res.data.total || 0;
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:392", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
};
const searchRegulation = () => {
lawPageNum.value = 1;
lawList.value = [];
hasMoreLaw.value = true;
fetchRegulationList();
};
const loadMoreLaw = () => {
if (!hasMoreLaw.value || lawLoading.value)
return;
lawPageNum.value++;
fetchRegulationList(true);
};
const selectLaw = (item) => {
selectedLawId.value = item.id;
selectedLawName.value = item.depict || item.keyword || "";
};
const confirmLaw = () => {
if (selectedLawId.value) {
hazardFormData.regulationId = selectedLawId.value;
hazardFormData.regulationName = selectedLawName.value;
}
showLawPopup.value = false;
};
const fetchAreaList = async () => {
try {
const res = await request_three_one_api_area.getAreaList();
@@ -79,7 +155,7 @@ const _sfc_main = {
areaList.value = res.data.records;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:288", "获取区域列表失败:", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:436", "获取区域列表失败:", error);
}
};
const confirmAreaSelect = () => {
@@ -104,7 +180,7 @@ const _sfc_main = {
return Math.round(current / total * 100);
});
const levelOptions = common_vendor.ref([
{ id: 1, title: "轻微隐患" },
// { id: 1, title: '轻微隐患' },
{ id: 2, title: "一般隐患" },
{ id: 3, title: "重大隐患" }
]);
@@ -125,7 +201,7 @@ const _sfc_main = {
}));
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:353", "获取标签列表失败:", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:501", "获取标签列表失败:", error);
}
};
const openHazardPopup = () => {
@@ -135,6 +211,10 @@ const _sfc_main = {
showHazardPopup.value = true;
};
const clearHazard = () => {
hazardFormData.regulationId = null;
hazardFormData.regulationName = "";
selectedLawId.value = null;
selectedLawName.value = "";
hazardFormData.title = "";
hazardFormData.level = 0;
hazardFormData.source = 0;
@@ -200,14 +280,27 @@ const _sfc_main = {
});
});
for (let i = 0; i < lists.length; i++) {
const result = await uploadFilePromise(lists[i].url);
let watermarkedUrl = lists[i].url;
try {
const instance = common_vendor.getCurrentInstance();
watermarkedUrl = await utils_watermark.addTimestampWatermark({
tempFilePath: lists[i].url,
canvasId: "watermarkCanvas",
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:609", "加水印失败,将使用原图上传:", e);
}
const result = await uploadFilePromise(watermarkedUrl);
let item = hazardFileList.value[fileListLen];
const serverPath = typeof result === "string" ? result : (result == null ? void 0 : result.url) || (result == null ? void 0 : result.path) || "";
hazardFileList.value.splice(fileListLen, 1, {
...item,
status: "success",
message: "",
url: request_request.baseUrl.replace("/prod-api", "") + serverPath,
url: request_request.toImageUrl(serverPath),
serverPath
});
fileListLen++;
@@ -231,7 +324,7 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:479", "上传失败:", err);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:644", "上传失败:", err);
reject(err);
}
});
@@ -248,13 +341,13 @@ const _sfc_main = {
const fullImageUrl = imageFiles[0].url;
aiAnalyzing.value = true;
try {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:500", "开始调用AI分析接口图片地址:", fullImageUrl);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:665", "开始调用AI分析接口图片地址:", fullImageUrl);
const analyzeRes = await request_api.analyzeHazardImage({
imageUrl: fullImageUrl
});
if (analyzeRes.code === 0 && analyzeRes.data) {
const aiData = analyzeRes.data;
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:507", "AI分析结果:", aiData);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:672", "AI分析结果:", aiData);
if (aiData.title)
hazardFormData.title = aiData.title;
if (aiData.description)
@@ -276,7 +369,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:530", "AI分析接口调用失败:", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:695", "AI分析接口调用失败:", error);
common_vendor.index.showToast({ title: "AI分析失败请重试", icon: "none" });
} finally {
aiAnalyzing.value = false;
@@ -308,6 +401,9 @@ const _sfc_main = {
} else if (file.url && typeof file.url === "object") {
url = file.url.url || file.url.path || "";
}
if (typeof url === "string" && url.startsWith("http")) {
url = url.replace(request_request.imageBaseUrl, "");
}
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
return {
fileName: fileName || "",
@@ -331,26 +427,28 @@ const _sfc_main = {
description: hazardFormData.description || "",
source: ((_c = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _c.title) || "",
tagId,
attachments
attachments,
regulationId: hazardFormData.regulationId || null
};
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:604", "隐患参数:", hazardParams);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:773", "隐患参数:", hazardParams);
const hazardRes = await request_api.addHiddenDanger(hazardParams);
if (hazardRes.code !== 0) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: hazardRes.msg || "新增隐患失败", icon: "none" });
return;
}
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:613", "新增隐患成功");
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:782", "新增隐患成功");
}
const submitParams = {
taskId: (_d = checkData.value) == null ? void 0 : _d.taskId,
result: resultValue,
remark: value1.value
};
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:622", "提交参数:", submitParams);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:791", "提交参数:", submitParams);
const res = await request_api.submitCheckResult(submitParams);
common_vendor.index.hideLoading();
if (res.code === 0) {
clearDraft(false);
if (res.data && res.data.allFinished === true) {
common_vendor.index.showToast({ title: "全部检查已完成", icon: "success" });
setTimeout(() => {
@@ -371,7 +469,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:656", "提交失败:", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:826", "提交失败:", error);
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
}
};
@@ -383,16 +481,158 @@ const _sfc_main = {
const getCheckData = async () => {
try {
const res = await request_api.enterCheckPlan(oneTableId.value);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:675", "检查项数据:", res);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:845", "检查项数据:", res);
if (res.code === 0) {
checkData.value = res.data;
restoreDraft();
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:680", error);
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:852", error);
}
};
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const isInitialized = common_vendor.ref(false);
const getDraftKey = () => {
var _a;
return `draft_inspection_result_${oneTableId.value || ""}_${((_a = checkData.value) == null ? void 0 : _a.currentIndex) || ""}`;
};
const saveDraft = () => {
if (isRestoring.value || !isInitialized.value) {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:867", "【草稿Debug - 巡检】saveDraft 被跳过:", { isRestoring: isRestoring.value, isInitialized: isInitialized.value });
return;
}
const key = getDraftKey();
const hasContent = radiovalue1.value || value1.value || hazardFormData.title || hazardFormData.description || hazardFileList.value.length > 0;
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:877", "【草稿Debug - 巡检】尝试自动保存草稿. Key:", key, "是否有实质内容:", !!hasContent, "当前数据:", {
radiovalue1: radiovalue1.value,
value1: value1.value,
title: hazardFormData.title,
description: hazardFormData.description,
fileCount: hazardFileList.value.length
});
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:887", "【草稿Debug - 巡检】当前表单为空,自动删除本地缓存 Key:", key);
hasDraft.value = false;
return;
}
const data = {
radiovalue1: radiovalue1.value,
value1: value1.value,
hazardFormData: {
title: hazardFormData.title,
level: hazardFormData.level,
source: hazardFormData.source,
description: hazardFormData.description,
tagIndex: hazardFormData.tagIndex
},
hazardFileList: hazardFileList.value,
hazardAddress: hazardAddress.value,
hazardLng: hazardLng.value,
hazardLat: hazardLat.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:908", "【草稿Debug - 巡检】成功保存草稿到 LocalStorage, Key:", key);
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:915", "【草稿Debug - 巡检】手动清空草稿, Key:", key);
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
radiovalue1.value = "";
value1.value = "";
hazardFormData.title = "";
hazardFormData.level = 0;
hazardFormData.source = 0;
hazardFormData.description = "";
hazardFormData.tagIndex = 0;
hazardFileList.value = [];
hazardAddress.value = "";
hazardLng.value = 0;
hazardLat.value = 0;
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:945", "【草稿Debug - 巡检】尝试恢复草稿, Key:", key, "获取本地缓存结果:", !!cached);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.radiovalue1 || data.value1 || data.hazardFormData.title || data.hazardFormData.description || data.hazardFileList && data.hazardFileList.length > 0;
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:955", "【草稿Debug - 巡检】解析本地缓存成功, 是否有实质内容:", !!hasContent, "缓存数据:", data);
if (!hasContent) {
isInitialized.value = true;
return;
}
isRestoring.value = true;
radiovalue1.value = data.radiovalue1 || "";
value1.value = data.value1 || "";
hazardFormData.title = data.hazardFormData.title || "";
hazardFormData.level = data.hazardFormData.level || 0;
hazardFormData.source = data.hazardFormData.source || 0;
hazardFormData.description = data.hazardFormData.description || "";
hazardFormData.tagIndex = data.hazardFormData.tagIndex || 0;
hazardFileList.value = data.hazardFileList || [];
hazardAddress.value = data.hazardAddress || "";
hazardLng.value = data.hazardLng || 0;
hazardLat.value = data.hazardLat || 0;
hasDraft.value = true;
showRestoreBanner.value = true;
common_vendor.nextTick$1(() => {
isRestoring.value = false;
isInitialized.value = true;
if (levelChooseRef.value && levelChooseRef.value.$data) {
levelChooseRef.value.$data.currentIndex = hazardFormData.level;
}
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:982", "【草稿Debug - 巡检】UI与多选组件状态同步重绘完毕");
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:991", "【草稿Debug - 巡检】解析草稿异常:", e);
isRestoring.value = false;
isInitialized.value = true;
}
} else {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:996", "【草稿Debug - 巡检】本地无任何缓存, 页面已安全标记为 initialized");
isInitialized.value = true;
}
};
common_vendor.watch(
() => [
radiovalue1.value,
value1.value,
hazardFormData.title,
hazardFormData.level,
hazardFormData.source,
hazardFormData.description,
hazardFormData.tagIndex,
hazardAddress.value,
hazardFileList.value
],
() => {
if (oneTableId.value) {
saveDraft();
}
},
{ deep: true }
);
common_vendor.onLoad((options) => {
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:686", "接收到的参数:", options);
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:1023", "接收到的参数:", options);
if (options.id) {
oneTableId.value = options.id;
getCheckData();
@@ -459,76 +699,118 @@ const _sfc_main = {
}),
C: common_vendor.o(handleSubmit),
D: common_vendor.o(($event) => showHazardPopup.value = false),
E: common_vendor.o(afterRead),
F: common_vendor.o(deletePic),
G: common_vendor.p({
E: showRestoreBanner.value
}, showRestoreBanner.value ? {
F: common_vendor.o(($event) => clearDraft(true))
} : {}, {
G: common_vendor.o(afterRead),
H: common_vendor.o(deletePic),
I: common_vendor.p({
fileList: hazardFileList.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
H: !aiAnalyzing.value
J: canvasWidth.value,
K: canvasHeight.value,
L: canvasWidth.value + "px",
M: canvasHeight.value + "px",
N: !aiAnalyzing.value
}, !aiAnalyzing.value ? {} : {}, {
I: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
J: aiAnalyzing.value,
K: aiAnalyzing.value,
L: common_vendor.o(handleAiAnalyze),
M: common_vendor.o(($event) => hazardFormData.title = $event),
N: common_vendor.p({
O: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
P: aiAnalyzing.value,
Q: aiAnalyzing.value,
R: common_vendor.o(handleAiAnalyze),
S: common_vendor.o(($event) => hazardFormData.title = $event),
T: common_vendor.p({
placeholder: "请输入内容",
border: "surround",
modelValue: hazardFormData.title
}),
O: common_vendor.sr(levelChooseRef, "643afff0-6,643afff0-3", {
U: common_vendor.sr(levelChooseRef, "643afff0-6,643afff0-3", {
"k": "levelChooseRef"
}),
P: common_vendor.o(($event) => hazardFormData.level = $event),
Q: common_vendor.p({
V: common_vendor.o(($event) => hazardFormData.level = $event),
W: common_vendor.p({
options: levelOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: hazardFormData.level
}),
R: common_vendor.o(($event) => hazardFormData.source = $event),
S: common_vendor.p({
X: common_vendor.o(($event) => hazardFormData.source = $event),
Y: common_vendor.p({
options: sourceOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: hazardFormData.source
}),
T: common_vendor.o(($event) => hazardAddress.value = $event),
U: common_vendor.p({
Z: common_vendor.o(($event) => hazardAddress.value = $event),
aa: common_vendor.p({
placeholder: "请输入地址",
border: "surround",
modelValue: hazardAddress.value
}),
V: common_vendor.o(chooseLocation),
W: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
X: !selectedAreaName.value ? 1 : "",
Y: common_vendor.o(($event) => showAreaPicker.value = true),
Z: common_vendor.o(($event) => hazardFormData.description = $event),
aa: common_vendor.p({
ab: common_vendor.o(chooseLocation),
ac: common_vendor.t(hazardFormData.regulationName || "请选择法律依据"),
ad: !hazardFormData.regulationName ? 1 : "",
ae: common_vendor.o(openLawPopup),
af: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
ag: !selectedAreaName.value ? 1 : "",
ah: common_vendor.o(($event) => showAreaPicker.value = true),
ai: common_vendor.o(($event) => hazardFormData.description = $event),
aj: common_vendor.p({
placeholder: "请输入内容",
modelValue: hazardFormData.description
}),
ab: common_vendor.o(($event) => hazardFormData.tagIndex = $event),
ac: common_vendor.p({
ak: common_vendor.o(($event) => hazardFormData.tagIndex = $event),
al: common_vendor.p({
options: tagOptions.value,
modelValue: hazardFormData.tagIndex
}),
ad: common_vendor.o(($event) => showHazardPopup.value = false),
ae: common_vendor.o(confirmHazard),
af: common_vendor.o(($event) => showHazardPopup.value = false),
ag: common_vendor.p({
am: common_vendor.o(($event) => showHazardPopup.value = false),
an: common_vendor.o(confirmHazard),
ao: common_vendor.o(($event) => showHazardPopup.value = false),
ap: common_vendor.p({
show: showHazardPopup.value,
mode: "center",
round: "20"
round: "20",
safeAreaInsetBottom: false
}),
ah: common_vendor.o(($event) => showAreaPicker.value = false),
ai: common_vendor.o(confirmAreaSelect),
aj: common_vendor.f(areaList.value, (item, k0, i0) => {
aq: common_vendor.o(($event) => showLawPopup.value = false),
ar: common_vendor.o(searchRegulation),
as: lawKeyword.value,
at: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
av: common_vendor.o(searchRegulation),
aw: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
ay: common_vendor.f(lawList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis),
c: selectedLawId.value === item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => selectLaw(item), item.id)
};
}),
az: lawLoading.value
}, lawLoading.value ? {} : {}), {
ax: !lawLoading.value && lawList.value.length === 0,
aA: common_vendor.o(loadMoreLaw),
aB: common_vendor.o(($event) => showLawPopup.value = false),
aC: common_vendor.o(confirmLaw),
aD: common_vendor.o(($event) => showLawPopup.value = false),
aE: common_vendor.p({
show: showLawPopup.value,
mode: "center",
round: "20",
safeAreaInsetBottom: false
}),
aF: common_vendor.o(($event) => showAreaPicker.value = false),
aG: common_vendor.o(confirmAreaSelect),
aH: common_vendor.f(areaList.value, (item, k0, i0) => {
return common_vendor.e({
a: item.color,
b: common_vendor.t(item.name),
@@ -539,15 +821,15 @@ const _sfc_main = {
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
});
}),
ak: areaList.value.length === 0
aI: areaList.value.length === 0
}, areaList.value.length === 0 ? {} : {}, {
al: common_vendor.o(($event) => showAreaPicker.value = false),
am: common_vendor.p({
aJ: common_vendor.o(($event) => showAreaPicker.value = false),
aK: common_vendor.p({
show: showAreaPicker.value,
mode: "bottom",
round: "20"
}),
an: common_vendor.gei(_ctx, "")
aL: common_vendor.gei(_ctx, "")
});
};
}

File diff suppressed because one or more lines are too long

View File

@@ -229,6 +229,8 @@
.popup-footer button.data-v-643afff0 {
flex: 1;
height: 90rpx;
margin: 0 !important;
padding: 0 !important;
line-height: 90rpx;
border-radius: 0;
font-size: 30rpx;
@@ -322,6 +324,91 @@
.picker-popup .picker-item.picker-item-active.data-v-643afff0 {
color: #2667E9;
}
.law-popup.data-v-643afff0 {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
max-height: 80vh;
}
.law-popup .popup-header.data-v-643afff0 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.law-popup .popup-header .popup-title.data-v-643afff0 {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.law-popup .popup-header .popup-close.data-v-643afff0 {
font-size: 40rpx;
color: #999;
cursor: pointer;
}
.search-box.data-v-643afff0 {
display: flex;
align-items: center;
background: #F5F5F5;
border-radius: 40rpx;
padding: 16rpx 24rpx;
margin: 20rpx 30rpx;
}
.search-box .search-icon.data-v-643afff0 {
font-size: 28rpx;
color: #999;
margin-right: 12rpx;
}
.search-box .search-input.data-v-643afff0 {
flex: 1;
font-size: 28rpx;
background: transparent;
border: none;
}
.search-box .search-btn.data-v-643afff0 {
color: #2667E9;
font-size: 26rpx;
margin-left: 16rpx;
cursor: pointer;
}
.loading-tip.data-v-643afff0, .empty-tip.data-v-643afff0 {
text-align: center;
padding: 40rpx;
color: #999;
font-size: 26rpx;
}
.law-list.data-v-643afff0 {
max-height: 500rpx;
padding: 0 30rpx;
}
.law-item.data-v-643afff0 {
padding: 24rpx;
border: 2rpx solid #E5E5E5;
border-radius: 12rpx;
margin-bottom: 16rpx;
font-size: 28rpx;
color: #333;
text-align: left;
}
.law-item .law-title.data-v-643afff0 {
line-height: 1.5;
margin-bottom: 8rpx;
font-weight: bold;
}
.law-item .law-basis.data-v-643afff0 {
font-size: 24rpx;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.law-item-active.data-v-643afff0 {
border-color: #2667E9;
background: #F0F6FF;
}
.area-color-dot.data-v-643afff0 {
width: 24rpx;
height: 24rpx;

View File

@@ -5,12 +5,14 @@ const request_api = require("../../request/api.js");
if (!Array) {
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
(_easycom_up_datetime_picker2 + _easycom_up_input2)();
const _easycom_u_loadmore2 = common_vendor.resolveComponent("u-loadmore");
(_easycom_up_datetime_picker2 + _easycom_up_input2 + _easycom_u_loadmore2)();
}
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_u_loadmore = () => "../../uni_modules/uview-plus/components/u-loadmore/u-loadmore.js";
if (!Math) {
(_easycom_up_datetime_picker + _easycom_up_input)();
(_easycom_up_datetime_picker + _easycom_up_input + _easycom_u_loadmore)();
}
const _sfc_main = {
__name: "Inspectionwarning",
@@ -24,7 +26,8 @@ const _sfc_main = {
const showEndDatePicker = common_vendor.ref(false);
const startDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
const endDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
const statistics = common_vendor.reactive({
const statistics = common_vendor.reactive({ total: 0, overdue: 0, pending: 0, completed: 0, overdueCompleted: 0, onTimeCompleted: 0 });
common_vendor.reactive({
total: 0,
overdue: 0,
completed: 0,
@@ -33,6 +36,7 @@ const _sfc_main = {
const dataList = common_vendor.ref([]);
const pageNum = common_vendor.ref(1);
const pageSize = common_vendor.ref(20);
const loadStatus = common_vendor.ref("loadmore");
const statusTabs = common_vendor.ref([
{ label: "全部状态", value: 0, count: null },
{ label: "逾期未检", value: 1, count: null },
@@ -45,6 +49,7 @@ const _sfc_main = {
const switchStatusTab = (index) => {
activeStatusTab.value = index;
pageNum.value = 1;
dataList.value = [];
fetchData();
};
const formatDate = (timestamp) => {
@@ -56,12 +61,12 @@ const _sfc_main = {
};
const onStartDateConfirm = (e) => {
const dateStr = formatDate(e.value);
searchForm.startDate = `${dateStr} 00:00:00`;
searchForm.startDate = dateStr;
showStartDatePicker.value = false;
};
const onEndDateConfirm = (e) => {
const dateStr = formatDate(e.value);
searchForm.endDate = `${dateStr} 23:59:59`;
searchForm.endDate = dateStr;
showEndDatePicker.value = false;
};
const getStatusClass = (overdueDays) => {
@@ -90,43 +95,64 @@ const _sfc_main = {
};
const fetchData = async () => {
try {
const params = {
pageNum: pageNum.value,
pageSize: pageSize.value
};
if (searchForm.startDate) {
const params = { pageNum: pageNum.value, pageSize: pageSize.value };
if (searchForm.startDate)
params.startDate = searchForm.startDate;
}
if (searchForm.endDate) {
if (searchForm.endDate)
params.endDate = searchForm.endDate;
}
if (searchForm.deptName && searchForm.deptName.trim()) {
if (searchForm.deptName && searchForm.deptName.trim())
params.deptName = searchForm.deptName.trim();
}
const statusValue = statusTabs.value[activeStatusTab.value].value;
if (statusValue !== 0) {
if (statusValue !== 0)
params.inspectionStatus = statusValue;
}
const res = await request_api.getInspectionWarningList(params);
if (res.code === 0) {
if (res.data.statistics) {
statistics.total = res.data.statistics.total || 0;
statistics.overdue = res.data.statistics.overdue || 0;
statistics.completed = res.data.statistics.completed || 0;
statistics.pending = res.data.statistics.pending || 0;
statistics.completed = res.data.statistics.completed || 0;
statistics.overdueCompleted = res.data.statistics.overdueCompleted || 0;
statistics.onTimeCompleted = res.data.statistics.onTimeCompleted || 0;
statusTabs.value[0].count = res.data.statistics.total || 0;
statusTabs.value[1].count = res.data.statistics.overdue || 0;
statusTabs.value[2].count = res.data.statistics.pending || 0;
statusTabs.value[3].count = res.data.statistics.completed || 0;
statusTabs.value[4].count = res.data.statistics.overdueCompleted || 0;
statusTabs.value[5].count = res.data.statistics.onTimeCompleted || 0;
}
if (res.data.page && res.data.page.records) {
dataList.value = res.data.page.records;
const records = res.data.page.records;
if (pageNum.value === 1) {
dataList.value = records;
} else {
dataList.value = [...dataList.value, ...records];
}
const totalRecords = res.data.page.total || 0;
if (dataList.value.length >= totalRecords) {
loadStatus.value = "nomore";
} else {
loadStatus.value = "loadmore";
}
} else {
loadStatus.value = "nomore";
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/Inspectionwarning/Inspectionwarning.vue:277", "获取预警列表失败:", error);
common_vendor.index.__f__("error", "at pages/Inspectionwarning/Inspectionwarning.vue:286", "获取预警列表失败:", error);
}
};
const handleSearch = () => {
pageNum.value = 1;
dataList.value = [];
fetchData();
};
common_vendor.onReachBottom(() => {
if (loadStatus.value === "loadmore") {
pageNum.value++;
fetchData();
}
});
common_vendor.onShow(() => {
fetchData();
});
@@ -167,8 +193,8 @@ const _sfc_main = {
v: common_assets._imports_1,
w: common_vendor.t(statistics.total),
x: common_vendor.t(statistics.overdue),
y: common_vendor.t(statistics.completed),
z: common_vendor.t(statistics.pending),
y: common_vendor.t(statistics.onTimeCompleted),
z: common_vendor.t(statistics.completed),
A: common_vendor.f(statusTabs.value, (tab, index, i0) => {
return common_vendor.e({
a: common_vendor.t(tab.label),
@@ -194,9 +220,15 @@ const _sfc_main = {
j: item.id
};
}),
C: dataList.value.length === 0
C: dataList.value.length > 0
}, dataList.value.length > 0 ? {
D: common_vendor.p({
status: loadStatus.value
})
} : {}, {
E: dataList.value.length === 0
}, dataList.value.length === 0 ? {} : {}, {
D: common_vendor.gei(_ctx, "")
F: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -2,6 +2,7 @@
"navigationBarTitleText": "日常安全检查预警",
"usingComponents": {
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input"
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"u-loadmore": "../../uni_modules/uview-plus/components/u-loadmore/u-loadmore"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -54,10 +54,10 @@ const _sfc_main = {
const res = await request_api.getMyWriteOffList();
if (res.code === 0 && res.data) {
hazardList.value = res.data;
common_vendor.index.__f__("log", "at pages/closeout/application.vue:148", "销号申请列表:", res.data);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:174", "销号申请列表:", res.data);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:151", "获取销号申请列表失败:", error);
common_vendor.index.__f__("error", "at pages/closeout/application.vue:177", "获取销号申请列表失败:", error);
}
};
const fetchAcceptanceList = async () => {
@@ -71,10 +71,10 @@ const _sfc_main = {
} else {
hazardColumns.value = [["暂无可申请销号的隐患"]];
}
common_vendor.index.__f__("log", "at pages/closeout/application.vue:168", "可申请销号的隐患列表:", list);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:194", "可申请销号的隐患列表:", list);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:171", "获取可申请销号隐患列表失败:", error);
common_vendor.index.__f__("error", "at pages/closeout/application.vue:197", "获取可申请销号隐患列表失败:", error);
}
};
const fetchDeptList = async () => {
@@ -99,14 +99,14 @@ const _sfc_main = {
} else {
deptColumns.value = [["暂无人员数据"]];
}
common_vendor.index.__f__("log", "at pages/closeout/application.vue:199", "部门人员列表:", users);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:225", "部门人员列表:", users);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:202", "获取部门人员列表失败:", error);
common_vendor.index.__f__("error", "at pages/closeout/application.vue:228", "获取部门人员列表失败:", error);
}
};
const onDeptConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/closeout/application.vue:208", "选择的人员:", e);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:234", "选择的人员:", e);
if (e.value && e.value.length > 0) {
selectedDeptName.value = e.value[0];
const index = e.indexs[0];
@@ -124,7 +124,7 @@ const _sfc_main = {
showAddPopup.value = true;
};
const onHazardConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/closeout/application.vue:231", "选择的隐患:", e);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:257", "选择的隐患:", e);
if (e.value && e.value.length > 0) {
selectedHazard.value = e.value[0];
const index = e.indexs[0];
@@ -135,7 +135,7 @@ const _sfc_main = {
showHazardPicker.value = false;
};
const onDateConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/closeout/application.vue:245", "选择的日期时间:", e);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:271", "选择的日期时间:", e);
const date = new Date(e.value);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -196,7 +196,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:319", "AI生成销号方案失败:", error);
common_vendor.index.__f__("error", "at pages/closeout/application.vue:345", "AI生成销号方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
@@ -223,7 +223,7 @@ const _sfc_main = {
selfVerifyContent: formData.selfVerifyContent || ""
// 责任单位自行验收情况
};
common_vendor.index.__f__("log", "at pages/closeout/application.vue:344", "提交数据:", params);
common_vendor.index.__f__("log", "at pages/closeout/application.vue:370", "提交数据:", params);
try {
const res = await request_api.applyDelete(params);
if (res.code === 0) {
@@ -235,7 +235,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "申请失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/closeout/application.vue:358", "申请失败:", error);
common_vendor.index.__f__("error", "at pages/closeout/application.vue:384", "申请失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
@@ -278,36 +278,16 @@ const _sfc_main = {
c: common_vendor.o(($event) => showAddPopup.value = false),
d: common_vendor.t(selectedHazard.value || "请选择隐患"),
e: common_vendor.n(selectedHazard.value ? "" : "text-gray"),
f: common_vendor.o(($event) => showHazardPicker.value = true),
g: common_vendor.o(onHazardConfirm),
h: common_vendor.o(($event) => showHazardPicker.value = false),
i: common_vendor.o(($event) => showHazardPicker.value = false),
j: common_vendor.p({
show: showHazardPicker.value,
columns: hazardColumns.value
}),
f: common_vendor.o(($event) => showHazardPicker.value = true)
}, {}, {
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
}),
m: common_vendor.o(($event) => showDatePicker.value = true)
}, {}, {
s: common_vendor.t(selectedDeptName.value || "请选择隐患治理责任单位"),
t: common_vendor.n(selectedDeptName.value ? "" : "text-gray"),
v: common_vendor.o(($event) => showDeptPicker.value = true),
w: common_vendor.o(onDeptConfirm),
x: common_vendor.o(($event) => showDeptPicker.value = false),
y: common_vendor.o(($event) => showDeptPicker.value = false),
z: common_vendor.p({
show: showDeptPicker.value,
columns: deptColumns.value
}),
v: common_vendor.o(($event) => showDeptPicker.value = true)
}, {}, {
A: common_vendor.o(($event) => formData.responsiblePerson = $event),
B: common_vendor.p({
placeholder: "请输入主要负责人",
@@ -340,9 +320,33 @@ const _sfc_main = {
Q: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20"
round: "20",
safeAreaInsetBottom: false
}),
R: common_vendor.gei(_ctx, "")
R: common_vendor.o(onHazardConfirm),
S: common_vendor.o(($event) => showHazardPicker.value = false),
T: common_vendor.o(($event) => showHazardPicker.value = false),
U: common_vendor.p({
show: showHazardPicker.value,
columns: hazardColumns.value
}),
V: common_vendor.o(onDateConfirm),
W: common_vendor.o(($event) => showDatePicker.value = false),
X: common_vendor.o(($event) => showDatePicker.value = false),
Y: common_vendor.o(($event) => dateValue.value = $event),
Z: common_vendor.p({
show: showDatePicker.value,
mode: "datetime",
modelValue: dateValue.value
}),
aa: common_vendor.o(onDeptConfirm),
ab: common_vendor.o(($event) => showDeptPicker.value = false),
ac: common_vendor.o(($event) => showDeptPicker.value = false),
ad: common_vendor.p({
show: showDeptPicker.value,
columns: deptColumns.value
}),
ae: common_vendor.gei(_ctx, "")
});
};
}

File diff suppressed because one or more lines are too long

View File

@@ -85,6 +85,8 @@
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
margin: 0 !important;
padding: 0 !important;
font-size: 30rpx;
}
.popup-footer button.data-v-4b6250eb::after {

View File

@@ -476,7 +476,7 @@ const _sfc_main = {
common_vendor.index.showLoading({ title: "加载中..." });
try {
for (const id of selectedLibraries.value) {
const res = await request_api.getCheckItemListDetail({ itemId: id });
const res = await request_api.getCheckItemListDetail({ id });
if (res.code === 0 && res.data) {
const records = res.data.records || [];
const total = res.data.total || 0;

View File

@@ -2,6 +2,7 @@
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_three_one_api_area = require("../../request/three_one_api/area.js");
const utils_watermark = require("../../utils/watermark.js");
const request_request = require("../../request/request.js");
if (!Array) {
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
@@ -23,6 +24,8 @@ const _sfc_main = {
__name: "Inspection",
setup(__props) {
const showAddPopup = common_vendor.ref(false);
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const levelChooseRef = common_vendor.ref(null);
const userRole = common_vendor.ref("");
const canAcceptance = common_vendor.computed(() => {
@@ -34,10 +37,10 @@ const _sfc_main = {
if (userInfoStr) {
const userInfo = JSON.parse(userInfoStr);
userRole.value = userInfo.role || "";
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:224", "当前用户角色:", userRole.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:283", "当前用户角色:", userRole.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:227", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:286", "获取用户信息失败:", error);
}
};
getUserRole();
@@ -55,7 +58,7 @@ const _sfc_main = {
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:252", "获取任务信息失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:311", "获取任务信息失败:", error);
}
};
common_vendor.onLoad((options) => {
@@ -72,8 +75,12 @@ const _sfc_main = {
// 隐患描述
tagIndex: 0,
// 隐患标签索引
source: ""
source: 0,
// 隐患来源
regulationId: null,
// 法律依据ID
regulationName: ""
// 法律依据名称(显示用)
});
common_vendor.ref(0);
const lng = common_vendor.ref(0);
@@ -84,6 +91,75 @@ const _sfc_main = {
const selectedAreaId = common_vendor.ref("");
const selectedAreaName = common_vendor.ref("");
const tempAreaId = common_vendor.ref("");
const showLawPopup = common_vendor.ref(false);
const lawKeyword = common_vendor.ref("");
const selectedLawId = common_vendor.ref(null);
const selectedLawName = common_vendor.ref("");
const lawList = common_vendor.ref([]);
const lawLoading = common_vendor.ref(false);
const lawPageNum = common_vendor.ref(1);
const lawPageSize = common_vendor.ref(10);
const hasMoreLaw = common_vendor.ref(true);
const openLawPopup = () => {
showLawPopup.value = true;
if (lawList.value.length === 0) {
fetchRegulationList();
}
};
const fetchRegulationList = async (isLoadMore = false) => {
if (lawLoading.value)
return;
lawLoading.value = true;
try {
const params = {
pageNum: lawPageNum.value,
pageSize: lawPageSize.value,
status: 1
// 启用状态
};
if (lawKeyword.value && lawKeyword.value.trim()) {
params.keyword = lawKeyword.value.trim();
}
const res = await request_api.getRegulationList(params);
if (res.code === 0) {
const records = res.data.records || res.data || [];
if (isLoadMore) {
lawList.value = [...lawList.value, ...records];
} else {
lawList.value = records;
}
const total = res.data.total || 0;
hasMoreLaw.value = lawList.value.length < total;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:394", "获取法规列表失败:", error);
} finally {
lawLoading.value = false;
}
};
const searchRegulation = () => {
lawPageNum.value = 1;
lawList.value = [];
hasMoreLaw.value = true;
fetchRegulationList();
};
const loadMoreLaw = () => {
if (!hasMoreLaw.value || lawLoading.value)
return;
lawPageNum.value++;
fetchRegulationList(true);
};
const selectLaw = (item) => {
selectedLawId.value = item.id;
selectedLawName.value = item.depict || item.keyword || "";
};
const confirmLaw = () => {
if (selectedLawId.value) {
formData.regulationId = selectedLawId.value;
formData.regulationName = selectedLawName.value;
}
showLawPopup.value = false;
};
const fetchAreaList = async () => {
try {
const res = await request_three_one_api_area.getAreaList();
@@ -91,7 +167,7 @@ const _sfc_main = {
areaList.value = res.data.records;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:296", "获取区域列表失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:438", "获取区域列表失败:", error);
}
};
fetchAreaList();
@@ -104,26 +180,26 @@ const _sfc_main = {
showAreaPicker.value = false;
};
const chooseLocation = () => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:312", "chooseLocation called");
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:454", "chooseLocation called");
showAddPopup.value = false;
setTimeout(() => {
common_vendor.index.getLocation({
type: "gcj02",
// 使用国测局坐标系(腾讯地图使用)
success: (locationRes) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:321", "获取当前位置成功:", locationRes);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:463", "获取当前位置成功:", locationRes);
common_vendor.index.chooseLocation({
latitude: locationRes.latitude,
longitude: locationRes.longitude,
success: (res) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:327", "选择位置成功:", res);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:469", "选择位置成功:", res);
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
lng.value = res.longitude;
lat.value = res.latitude;
showAddPopup.value = true;
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:336", "选择位置失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:478", "选择位置失败:", err);
showAddPopup.value = true;
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({
@@ -135,17 +211,17 @@ const _sfc_main = {
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:350", "获取当前位置失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:492", "获取当前位置失败:", err);
common_vendor.index.chooseLocation({
success: (res) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:354", "选择位置成功:", res);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:496", "选择位置成功:", res);
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
lng.value = res.longitude;
lat.value = res.latitude;
showAddPopup.value = true;
},
fail: (chooseErr) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:361", "选择位置失败:", chooseErr);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:503", "选择位置失败:", chooseErr);
showAddPopup.value = true;
if (chooseErr.errMsg && chooseErr.errMsg.indexOf("cancel") === -1) {
common_vendor.index.showToast({
@@ -160,7 +236,7 @@ const _sfc_main = {
}, 300);
};
const handleAdd = async () => {
var _a;
var _a, _b;
if (!formData.title) {
common_vendor.index.showToast({
title: "请输入隐患标题",
@@ -187,12 +263,12 @@ const _sfc_main = {
});
const selectedTag = tagOptions.value[formData.tagIndex];
const tagId = selectedTag ? selectedTag.id : null;
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:408", "innnn", sourceOptions);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:550", "innnn", sourceOptions);
const params = {
title: formData.title,
//标题
level: formData.level + 1,
// 1.轻微隐患 2.一般隐患 3.重大隐患
level: ((_a = levelOptions.value[formData.level]) == null ? void 0 : _a.id) || 2,
// 2.一般隐患 3.重大隐患
lng: lng.value || 0,
//经度
lat: lat.value || 0,
@@ -209,12 +285,14 @@ const _sfc_main = {
//关联任务ID
checkPointId: checkPointId.value,
//关联检查点ID
source: ((_a = sourceOptions.value[formData.source]) == null ? void 0 : _a.title) || "",
source: ((_b = sourceOptions.value[formData.source]) == null ? void 0 : _b.title) || "",
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
attachments
attachments,
//附件列表(图片/视频)
regulationId: formData.regulationId || null
// 法律依据ID
};
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:426", "提交的参数:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:569", "提交的参数:", params);
try {
const res = await request_api.addHiddenDanger(params);
if (res.code === 0) {
@@ -231,6 +309,10 @@ const _sfc_main = {
selectedAreaId.value = "";
selectedAreaName.value = "";
fileList1.value = [];
formData.regulationId = null;
formData.regulationName = "";
selectedLawId.value = null;
selectedLawName.value = "";
fetchHiddenDangerList();
} else {
common_vendor.index.showToast({
@@ -239,7 +321,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:454", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:602", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -259,7 +341,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:475", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:623", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -309,7 +391,20 @@ const _sfc_main = {
});
});
for (let i = 0; i < lists.length; i++) {
const result = await uploadFilePromise(lists[i].url);
let watermarkedUrl = lists[i].url;
try {
const instance = common_vendor.getCurrentInstance();
watermarkedUrl = await utils_watermark.addTimestampWatermark({
tempFilePath: lists[i].url,
canvasId: "watermarkCanvas",
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:697", "加水印失败,将使用原图上传:", e);
}
const result = await uploadFilePromise(watermarkedUrl);
let item = fileList1.value[fileListLen];
const serverPath = typeof result === "string" ? result : (result == null ? void 0 : result.url) || (result == null ? void 0 : result.path) || "";
fileList1.value.splice(fileListLen, 1, {
@@ -317,7 +412,7 @@ const _sfc_main = {
status: "success",
message: "",
// url: baseUrl + serverPath,
url: request_request.baseUrl.replace("/prod-api", "") + serverPath,
url: request_request.toImageUrl(serverPath),
serverPath
});
fileListLen++;
@@ -341,7 +436,7 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:571", "上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:732", "上传失败:", err);
reject(err);
}
});
@@ -359,20 +454,20 @@ const _sfc_main = {
const fullImageUrl = imageFiles[0].url;
aiAnalyzing.value = true;
try {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:593", "开始调用AI分析接口图片地址:", fullImageUrl);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:754", "开始调用AI分析接口图片地址:", fullImageUrl);
const analyzeRes = await request_api.analyzeHazardImage({
// imageUrl: 'https://yx.zhihuixiangxi.com:58880/1.png' ,
imageUrl: fullImageUrl
});
if (analyzeRes.code === 0 && analyzeRes.data) {
const aiData = analyzeRes.data;
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:601", "AI分析结果:", aiData);
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:762", "AI分析结果:", aiData);
if (aiData.title)
formData.title = aiData.title;
if (aiData.description)
formData.description = aiData.description;
if (aiData.level) {
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 1, "一般隐患": 1, "重大": 2, "重大隐患": 2 };
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 0, "一般隐患": 0, "重大": 1, "重大隐患": 1 };
const levelIndex = levelMap[aiData.level];
if (levelIndex !== void 0) {
formData.level = levelIndex;
@@ -388,7 +483,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:624", "AI分析接口调用失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:785", "AI分析接口调用失败:", error);
common_vendor.index.showToast({ title: "AI分析失败请重试", icon: "none" });
} finally {
aiAnalyzing.value = false;
@@ -410,7 +505,7 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:647", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:808", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
@@ -419,10 +514,10 @@ const _sfc_main = {
};
fetchTagOptions();
const levelOptions = common_vendor.ref([
{
id: 1,
title: "轻微隐患"
},
// {
// id: 1,
// title: '轻微隐患'
// },
{
id: 2,
title: "一般隐患"
@@ -452,7 +547,7 @@ const _sfc_main = {
]);
common_vendor.watch(() => formData.source, (newVal) => {
const selected = sourceOptions.value[newVal];
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:693", "隐患来源选择结果:", {
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:855", "隐患来源选择结果:", {
索引: newVal,
选中项: selected,
id: selected == null ? void 0 : selected.id,
@@ -460,19 +555,20 @@ const _sfc_main = {
});
});
const statusTabs = common_vendor.ref([
{ label: "全部状态", value: "" },
{ label: "待验收", value: "待验收" },
{ label: "待整改", value: "待整改" },
{ label: "待交办", value: "待交办" },
{ label: "验收通过", value: "验收通过" }
{ label: "全部", value: null },
{ label: "待交办", value: 1 },
{ label: "待整改", value: 2 },
{ label: "待验收", value: 3 },
{ label: "待销号", value: 4 },
{ label: "已完成", value: 5 }
]);
const activeTab = common_vendor.ref(0);
const filteredList = common_vendor.computed(() => {
const currentTab = statusTabs.value[activeTab.value];
if (!currentTab || !currentTab.value) {
if (!currentTab || currentTab.value === null) {
return hiddenDangerList.value;
}
return hiddenDangerList.value.filter((item) => item.statusName === currentTab.value);
return hiddenDangerList.value.filter((item) => item.status === currentTab.value);
});
return (_ctx, _cache) => {
return common_vendor.e({
@@ -530,70 +626,106 @@ const _sfc_main = {
fileList: fileList1.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
i: !aiAnalyzing.value
i: canvasWidth.value,
j: canvasHeight.value,
k: canvasWidth.value + "px",
l: canvasHeight.value + "px",
m: !aiAnalyzing.value
}, !aiAnalyzing.value ? {} : {}, {
j: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
k: aiAnalyzing.value,
l: aiAnalyzing.value,
m: common_vendor.o(handleAiAnalyze),
n: common_vendor.o(($event) => formData.title = $event),
o: common_vendor.p({
n: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
o: aiAnalyzing.value,
p: aiAnalyzing.value,
q: common_vendor.o(handleAiAnalyze),
r: common_vendor.o(($event) => formData.title = $event),
s: common_vendor.p({
placeholder: "请输入内容",
border: "surround",
modelValue: formData.title
}),
p: common_vendor.sr(levelChooseRef, "b44c631d-3,b44c631d-0", {
t: common_vendor.sr(levelChooseRef, "b44c631d-3,b44c631d-0", {
"k": "levelChooseRef"
}),
q: common_vendor.o(($event) => formData.level = $event),
r: common_vendor.p({
v: common_vendor.o(($event) => formData.level = $event),
w: common_vendor.p({
options: levelOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: formData.level
}),
s: common_vendor.o(($event) => formData.source = $event),
t: common_vendor.p({
x: common_vendor.o(($event) => formData.source = $event),
y: common_vendor.p({
options: sourceOptions.value,
wrap: false,
["item-width"]: "183rpx",
["item-height"]: "72rpx",
modelValue: formData.source
}),
v: common_vendor.o(($event) => selectedAddress.value = $event),
w: common_vendor.p({
z: common_vendor.o(($event) => selectedAddress.value = $event),
A: common_vendor.p({
placeholder: "请输入地址",
border: "surround",
modelValue: selectedAddress.value
}),
x: common_vendor.o(chooseLocation),
y: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
z: !selectedAreaName.value ? 1 : "",
A: common_vendor.o(($event) => showAreaPicker.value = true),
B: common_vendor.o(($event) => formData.description = $event),
C: common_vendor.p({
B: common_vendor.o(chooseLocation),
C: common_vendor.t(formData.regulationName || "请选择法律依据"),
D: !formData.regulationName ? 1 : "",
E: common_vendor.o(openLawPopup),
F: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
G: !selectedAreaName.value ? 1 : "",
H: common_vendor.o(($event) => showAreaPicker.value = true),
I: common_vendor.o(($event) => formData.description = $event),
J: common_vendor.p({
placeholder: "请输入内容",
modelValue: formData.description
}),
D: common_vendor.o(($event) => formData.tagIndex = $event),
E: common_vendor.p({
K: common_vendor.o(($event) => formData.tagIndex = $event),
L: common_vendor.p({
options: tagOptions.value,
modelValue: formData.tagIndex
}),
F: common_vendor.o(($event) => showAddPopup.value = false),
G: common_vendor.o(handleAdd),
H: common_vendor.o(($event) => showAddPopup.value = false),
I: common_vendor.p({
M: common_vendor.o(($event) => showAddPopup.value = false),
N: common_vendor.o(handleAdd),
O: common_vendor.o(($event) => showAddPopup.value = false),
P: common_vendor.p({
show: showAddPopup.value,
mode: "center",
round: "20"
}),
J: common_vendor.o(($event) => showAreaPicker.value = false),
K: common_vendor.o(confirmAreaSelect),
L: common_vendor.f(areaList.value, (item, k0, i0) => {
Q: common_vendor.o(($event) => showLawPopup.value = false),
R: common_vendor.o(searchRegulation),
S: lawKeyword.value,
T: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
U: common_vendor.o(searchRegulation),
V: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
X: common_vendor.f(lawList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis),
c: selectedLawId.value === item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => selectLaw(item), item.id)
};
}),
Y: lawLoading.value
}, lawLoading.value ? {} : {}), {
W: !lawLoading.value && lawList.value.length === 0,
Z: common_vendor.o(loadMoreLaw),
aa: common_vendor.o(($event) => showLawPopup.value = false),
ab: common_vendor.o(confirmLaw),
ac: common_vendor.o(($event) => showLawPopup.value = false),
ad: common_vendor.p({
show: showLawPopup.value,
mode: "center",
round: "20"
}),
ae: common_vendor.o(($event) => showAreaPicker.value = false),
af: common_vendor.o(confirmAreaSelect),
ag: common_vendor.f(areaList.value, (item, k0, i0) => {
return common_vendor.e({
a: item.color,
b: common_vendor.t(item.name),
@@ -604,15 +736,15 @@ const _sfc_main = {
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
});
}),
M: areaList.value.length === 0
ah: areaList.value.length === 0
}, areaList.value.length === 0 ? {} : {}, {
N: common_vendor.o(($event) => showAreaPicker.value = false),
O: common_vendor.p({
ai: common_vendor.o(($event) => showAreaPicker.value = false),
aj: common_vendor.p({
show: showAreaPicker.value,
mode: "bottom",
round: "20"
}),
P: common_vendor.gei(_ctx, "")
ak: common_vendor.gei(_ctx, "")
});
};
}

File diff suppressed because one or more lines are too long

View File

@@ -316,6 +316,114 @@
background: #2667E9;
border-radius: 3rpx;
}
.law-popup.data-v-b44c631d {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
overflow: hidden;
max-height: 80vh;
}
.law-popup .popup-header.data-v-b44c631d {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.law-popup .popup-header .popup-title.data-v-b44c631d {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.law-popup .popup-header .popup-close.data-v-b44c631d {
font-size: 40rpx;
color: #999;
cursor: pointer;
}
.search-box.data-v-b44c631d {
display: flex;
align-items: center;
background: #F5F5F5;
border-radius: 40rpx;
padding: 16rpx 24rpx;
margin: 20rpx 30rpx;
}
.search-box .search-icon.data-v-b44c631d {
font-size: 28rpx;
color: #999;
margin-right: 12rpx;
}
.search-box .search-input.data-v-b44c631d {
flex: 1;
font-size: 28rpx;
background: transparent;
border: none;
}
.search-box .search-btn.data-v-b44c631d {
color: #2667E9;
font-size: 26rpx;
margin-left: 16rpx;
cursor: pointer;
}
.loading-tip.data-v-b44c631d, .empty-tip.data-v-b44c631d {
text-align: center;
padding: 40rpx;
color: #999;
font-size: 26rpx;
}
.law-list.data-v-b44c631d {
max-height: 400rpx;
padding: 0 30rpx;
}
.law-item.data-v-b44c631d {
padding: 24rpx;
border: 2rpx solid #E5E5E5;
border-radius: 12rpx;
margin-bottom: 16rpx;
font-size: 28rpx;
color: #333;
}
.law-item .law-title.data-v-b44c631d {
line-height: 1.5;
margin-bottom: 8rpx;
font-weight: bold;
}
.law-item .law-basis.data-v-b44c631d {
font-size: 24rpx;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.law-item-active.data-v-b44c631d {
border-color: #2667E9;
background: #F0F6FF;
}
.popup-footer.data-v-b44c631d {
display: flex;
padding: 30rpx;
border-top: 1rpx solid #eee;
gap: 20rpx;
}
.popup-footer button.data-v-b44c631d {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
border-radius: 40rpx;
}
.popup-footer button.data-v-b44c631d::after {
border: none;
}
.popup-footer .btn-cancel.data-v-b44c631d {
background: #f5f5f5;
color: #666;
}
.popup-footer .btn-confirm.data-v-b44c631d {
background: #2667E9;
color: #fff;
}
/**
* 这里是uni-app内置的常用样式变量
*
@@ -343,6 +451,18 @@
/* 透明度 */
/* 文章场景相关 */
/* 全局样式覆盖 up-tag 文字居中 */
.card-actions {
margin-top: 20rpx;
}
.card-actions .cu-btn {
padding: 0 24rpx !important;
font-size: 28rpx !important;
height: 64rpx !important;
line-height: 64rpx !important;
white-space: nowrap !important;
flex-shrink: 0 !important;
width: auto !important;
}
.u-tag {
justify-content: center !important;
}

View File

@@ -2,15 +2,18 @@
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_request = require("../../request/request.js");
const utils_watermark = require("../../utils/watermark.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
(_easycom_up_textarea2 + _easycom_up_upload2)();
const _easycom_wd_signature2 = common_vendor.resolveComponent("wd-signature");
(_easycom_up_textarea2 + _easycom_up_upload2 + _easycom_wd_signature2)();
}
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
const _easycom_wd_signature = () => "../../node-modules/wot-design-uni/components/wd-signature/wd-signature.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_upload)();
(_easycom_up_textarea + _easycom_up_upload + _easycom_wd_signature)();
}
const _sfc_main = {
__name: "acceptance",
@@ -30,6 +33,21 @@ const _sfc_main = {
// 验收备注
});
const fileList1 = common_vendor.ref([]);
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const showCanvas = common_vendor.ref(true);
const signatureUrl = common_vendor.ref("");
const signatureServerPath = common_vendor.ref("");
const signatureWidth = common_vendor.ref(340);
const signatureRef = common_vendor.ref(null);
const isSignatureEmpty = common_vendor.ref(true);
const isSubmitting = common_vendor.ref(false);
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const isInitialized = common_vendor.ref(false);
const signaturePaths = common_vendor.ref([]);
const getDraftKey = () => `draft_accept_${rectifyId.value || ""}`;
const getFullPath = (filePath) => {
if (!filePath)
return "";
@@ -59,15 +77,15 @@ const _sfc_main = {
if (assign.rectify.attachments) {
rectifyAttachments.value = assign.rectify.attachments;
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:108", "整改记录:", rectifyData);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:109", "整改附件:", rectifyAttachments.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:167", "整改记录:", rectifyData);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:168", "整改附件:", rectifyAttachments.value);
}
}
} else {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:116", "获取隐患详情失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:175", "获取隐患详情失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
@@ -81,7 +99,7 @@ const _sfc_main = {
if (options.assignId) {
assignId.value = options.assignId;
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:131", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:190", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
fetchDetail();
});
const handleCancel = () => {
@@ -95,6 +113,31 @@ const _sfc_main = {
});
return;
}
if (showCanvas.value) {
if (!signatureRef.value || isSignatureEmpty.value) {
common_vendor.index.showToast({
title: "请进行电子签名",
icon: "none"
});
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
signatureRef.value.confirm();
} else {
if (!signatureServerPath.value) {
common_vendor.index.showToast({
title: "请进行电子签名",
icon: "none"
});
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
await executeSubmit();
}
};
const executeSubmit = async () => {
const attachments = fileList1.value.map((file) => {
let url = "";
if (typeof file.url === "string") {
@@ -102,6 +145,9 @@ const _sfc_main = {
} else if (file.url && typeof file.url === "object") {
url = file.url.url || file.url.path || "";
}
if (typeof url === "string" && url.startsWith("http")) {
url = url.replace(request_request.imageBaseUrl, "");
}
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
return {
fileName: fileName || "",
@@ -114,12 +160,16 @@ const _sfc_main = {
rectifyId: Number(rectifyId.value),
result: formData.result,
verifyRemark: formData.verifyRemark || "",
attachments
attachments,
signPath: signatureServerPath.value || ""
// 电子签名路径
};
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:176", "提交验收参数:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:271", "提交验收参数:", params);
try {
const res = await request_api.acceptanceRectification(params);
common_vendor.index.hideLoading();
if (res.code === 0) {
clearDraft(false);
common_vendor.index.showToast({
title: "验收成功",
icon: "success"
@@ -134,16 +184,29 @@ const _sfc_main = {
});
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:195", "验收失败:", error);
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:293", "验收失败:", error);
common_vendor.index.showToast({
title: "请求失败",
icon: "none"
});
} finally {
isSubmitting.value = false;
}
};
const deletePic = (event) => {
fileList1.value.splice(event.index, 1);
};
const addWatermark = (tempFilePath) => {
const instance = common_vendor.getCurrentInstance();
return utils_watermark.addTimestampWatermark({
tempFilePath,
canvasId: "watermarkCanvas",
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance
});
};
const afterRead = async (event) => {
let lists = [].concat(event.file);
let fileListLen = fileList1.value.length;
@@ -151,18 +214,29 @@ const _sfc_main = {
fileList1.value.push({
...item,
status: "uploading",
message: "上传中"
message: "处理中..."
});
});
for (let i = 0; i < lists.length; i++) {
const result = await uploadFilePromise(lists[i].url);
let item = fileList1.value[fileListLen];
fileList1.value.splice(fileListLen, 1, {
...item,
status: "success",
message: "",
url: result
});
try {
const watermarkedUrl = await addWatermark(lists[i].url);
const result = await uploadFilePromise(watermarkedUrl);
let item = fileList1.value[fileListLen];
fileList1.value.splice(fileListLen, 1, {
...item,
status: "success",
message: "",
url: request_request.toImageUrl(result.url || result.filePath || result)
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:352", "加水印或上传失败:", e);
let item = fileList1.value[fileListLen];
fileList1.value.splice(fileListLen, 1, {
...item,
status: "failed",
message: "处理失败"
});
}
fileListLen++;
}
};
@@ -184,12 +258,173 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:250", "上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:382", "上传失败:", err);
reject(err);
}
});
});
};
const saveDraft = () => {
if (isRestoring.value || !isInitialized.value)
return;
const key = getDraftKey();
const hasContent = formData.verifyRemark || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
return;
}
const data = {
formData: {
result: formData.result,
verifyRemark: formData.verifyRemark
},
fileList1: fileList1.value,
signatureServerPath: signatureServerPath.value,
signatureUrl: signatureUrl.value,
showCanvas: showCanvas.value,
signaturePaths: signaturePaths.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
formData.result = 1;
formData.verifyRemark = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
showCanvas.value = true;
signaturePaths.value = [];
if (signatureRef.value) {
signatureRef.value.clear();
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.formData.verifyRemark || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
if (!hasContent) {
isInitialized.value = true;
return;
}
isRestoring.value = true;
formData.result = data.formData.result !== void 0 ? data.formData.result : 1;
formData.verifyRemark = data.formData.verifyRemark || "";
fileList1.value = data.fileList1 || [];
signatureServerPath.value = data.signatureServerPath || "";
signatureUrl.value = data.signatureUrl || "";
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
signaturePaths.value = data.signaturePaths || [];
hasDraft.value = true;
showRestoreBanner.value = true;
if (signaturePaths.value.length > 0) {
setTimeout(() => {
if (signatureRef.value) {
isSignatureEmpty.value = false;
}
}, 450);
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
isInitialized.value = true;
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:502", "解析草稿失败:", e);
isRestoring.value = false;
isInitialized.value = true;
}
} else {
isInitialized.value = true;
}
};
common_vendor.watch(
() => [
formData.result,
formData.verifyRemark,
fileList1.value,
signatureServerPath.value,
signaturePaths.value
],
() => {
if (rectifyId.value) {
saveDraft();
}
},
{ deep: true }
);
const clearSignature = () => {
isSignatureEmpty.value = true;
if (signatureRef.value) {
signatureRef.value.clear();
}
};
const reSign = () => {
isSignatureEmpty.value = true;
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
common_vendor.nextTick$1(() => {
if (signatureRef.value) {
signatureRef.value.clear();
}
});
};
const onSignatureConfirm = async (tempFilePath) => {
try {
const res = await uploadFilePromise(tempFilePath);
const path = res && typeof res === "object" ? res.url || res.filePath || "" : res || "";
signatureServerPath.value = path;
signatureUrl.value = path.startsWith("http") ? path : request_request.baseUrl.replace("/api", "") + path;
if (isSubmitting.value) {
await executeSubmit();
}
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:573", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
common_vendor.onLoad((options) => {
try {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:584", "获取系统信息失败:", e);
}
if (options.rectifyId) {
rectifyId.value = options.rectifyId;
}
if (options.hazardId) {
hazardId.value = options.hazardId;
}
if (options.assignId) {
assignId.value = options.assignId;
}
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:595", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
fetchDetail();
restoreDraft();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(rectifyData.rectifyPlan || "暂无"),
@@ -219,11 +454,44 @@ const _sfc_main = {
fileList: fileList1.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
n: common_vendor.o(handleCancel),
o: common_vendor.o(handleSubmit),
p: common_vendor.gei(_ctx, "")
n: canvasWidth.value,
o: canvasHeight.value,
p: canvasWidth.value + "px",
q: canvasHeight.value + "px",
r: showCanvas.value
}, showCanvas.value ? {
s: common_vendor.o(clearSignature)
} : {
t: common_vendor.o(reSign)
}, {
v: !showCanvas.value
}, !showCanvas.value ? {
w: signatureUrl.value
} : {}, {
x: showCanvas.value
}, showCanvas.value ? {
y: common_vendor.sr(signatureRef, "39f9b795-2", {
"k": "signatureRef"
}),
z: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
A: common_vendor.o(($event) => isSignatureEmpty.value = false),
B: common_vendor.o(($event) => isSignatureEmpty.value = false),
C: common_vendor.o(($event) => isSignatureEmpty.value = true),
D: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
penColor: "#000000",
lineWidth: 3,
enableHistory: false
})
} : {}, {
E: common_vendor.o(handleCancel),
F: common_vendor.o(handleSubmit),
G: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -2,6 +2,7 @@
"navigationBarTitleText": "隐患验收",
"usingComponents": {
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload"
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature"
}
}

View File

@@ -1 +1 @@
<view class="{{['page', 'padding', 'data-v-39f9b795', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{p}}"><view class="padding bg-white radius data-v-39f9b795"><view class="text-gray margin-bottom data-v-39f9b795">整改记录</view><view class="padding solid radius data-v-39f9b795"><view class="flex data-v-39f9b795"><view class="data-v-39f9b795">整改方案:</view><view class="data-v-39f9b795">{{a}}</view></view><view class="flex margin-top-sm data-v-39f9b795"><view class="data-v-39f9b795">完成情况:</view><view class="data-v-39f9b795">{{b}}</view></view><view class="margin-top-sm data-v-39f9b795"><view class="data-v-39f9b795">整改附件:</view><view wx:if="{{c}}" class="flex margin-top-xs data-v-39f9b795" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{d}}" wx:for-item="img" wx:key="a" class="data-v-39f9b795" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill" bindtap="{{img.c}}"></image></view><view wx:else class="text-gray text-sm margin-top-xs data-v-39f9b795">暂无附件</view></view></view><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收结果</view><view class="text-red data-v-39f9b795">*</view></view><view class="flex data-v-39f9b795" style="gap:20rpx"><button class="{{['data-v-39f9b795', 'result-btn', e]}}" bindtap="{{f}}">通过</button><button class="{{['data-v-39f9b795', 'result-btn', g]}}" bindtap="{{h}}">不通过</button></view><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收备注</view></view><up-textarea wx:if="{{j}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" u-i="39f9b795-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-textarea><view class="flex margin-bottom margin-top data-v-39f9b795"><view class="text-gray data-v-39f9b795">验收图片/视频</view></view><up-upload wx:if="{{m}}" class="data-v-39f9b795" virtualHostClass="data-v-39f9b795" bindafterRead="{{k}}" binddelete="{{l}}" u-i="39f9b795-1" bind:__l="__l" u-p="{{m}}"></up-upload><view class="flex margin-top-xl data-v-39f9b795" style="gap:20rpx"><button class="round flex-sub data-v-39f9b795" bindtap="{{n}}">取消</button><button class="bg-blue round flex-sub data-v-39f9b795" bindtap="{{o}}">提交验收</button></view></view></view>
<view class="{{['page', 'padding', 'data-v-39f9b795', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{G}}"><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="data-v-39f9b795"><view class="data-v-39f9b795" style="color:#999;margin-bottom:10rpx">整改方案:</view><view class="data-v-39f9b795" style="word-break:break-all;line-height:1.6;color:#333">{{a}}</view></view><view class="margin-top data-v-39f9b795"><view class="data-v-39f9b795" style="color:#999;margin-bottom:10rpx">完成情况:</view><view class="data-v-39f9b795" style="word-break:break-all;line-height:1.6;color:#333">{{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><canvas class="data-v-39f9b795" canvas-id="watermarkCanvas" width="{{n}}" height="{{o}}" style="{{'width:' + p + ';' + ('height:' + q) + ';' + ('position:' + 'fixed') + ';' + ('left:' + '-9999px') + ';' + ('top:' + '-9999px')}}"></canvas><view class="flex justify-between margin-bottom margin-top-sm align-center data-v-39f9b795"><view class="text-gray flex align-center data-v-39f9b795"> 电子签名 <view class="text-red data-v-39f9b795">*</view></view><button wx:if="{{r}}" class="cu-btn sm round line-blue data-v-39f9b795" style="margin:0;padding:0 20rpx;height:50rpx;font-size:22rpx" bindtap="{{s}}">清除重写</button><button wx:else class="cu-btn sm round line-blue data-v-39f9b795" style="margin:0;padding:0 20rpx;height:50rpx;font-size:22rpx" bindtap="{{t}}">重新签名</button></view><view class="signature-box margin-bottom data-v-39f9b795"><view wx:if="{{v}}" class="signature-display flex align-center justify-center data-v-39f9b795" style="width:100%;height:160px;background-color:#f8f8f8;display:flex;align-items:center;justify-content:center"><image src="{{w}}" class="signature-img data-v-39f9b795" mode="aspectFit" style="width:100%;height:100%"></image></view><view wx:if="{{x}}" class="signature-pad-wrap data-v-39f9b795" style="border:1px dashed #dcdfe6;border-radius:8rpx;overflow:hidden;background-color:#f8f8f8"><wd-signature wx:if="{{D}}" class="r data-v-39f9b795" virtualHostClass="r data-v-39f9b795" u-s="{{['footer']}}" u-r="signatureRef" bindconfirm="{{z}}" bindstart="{{A}}" bindsigning="{{B}}" bindclear="{{C}}" u-i="39f9b795-2" bind:__l="__l" u-p="{{D}}"><view slot="footer"></view></wd-signature></view></view><view class="flex margin-top-xl data-v-39f9b795" style="gap:20rpx"><button class="round flex-sub data-v-39f9b795" bindtap="{{E}}">取消</button><button class="bg-blue round flex-sub data-v-39f9b795" bindtap="{{F}}">提交验收</button></view></view></view>

View File

@@ -43,4 +43,20 @@
.result-btn.active.data-v-39f9b795 {
background: #2667E9;
color: #fff;
}
.signature-box.data-v-39f9b795 {
width: 100%;
min-height: 240rpx;
background: #f8f8f8;
border: 1rpx dashed #dcdfe6;
border-radius: 8rpx;
margin-top: 16rpx;
}
.signature-box .signature-img.data-v-39f9b795 {
width: 100%;
height: 100%;
}
.signature-box .signature-placeholder.data-v-39f9b795 {
color: #909399;
font-size: 28rpx;
}

View File

@@ -41,14 +41,14 @@ const _sfc_main = {
});
userList.value = users;
userColumns.value = [users.map((u) => u.name)];
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:83", "整改人员列表:", users);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:91", "整改人员列表:", users);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:86", "获取部门人员失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:94", "获取部门人员失败:", error);
}
};
const onUserConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:92", "选择的人员:", e);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:100", "选择的人员:", e);
if (e.value && e.value.length > 0) {
selectedUser.value = e.value[0];
const user = userList.value.find((u) => u.name === e.value[0]);
@@ -59,7 +59,7 @@ const _sfc_main = {
showUserPicker.value = false;
};
const onDateConfirm = (e) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:106", "选择的日期时间:", e);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:114", "选择的日期时间:", e);
const date = new Date(e.value);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -92,10 +92,11 @@ const _sfc_main = {
assignRemark: ""
// 交办备注(可选)
};
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:142", "提交数据:", params);
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:150", "提交数据:", params);
try {
const res = await request_api.assignHiddenDanger(params);
if (res.code === 0) {
clearDraft(false);
common_vendor.index.showToast({ title: "交办成功", icon: "success" });
setTimeout(() => {
common_vendor.index.navigateBack();
@@ -104,45 +105,122 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:155", "交办失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:164", "交办失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const getDraftKey = () => `draft_assign_${hazardId.value || ""}`;
const saveDraft = () => {
if (isRestoring.value)
return;
const key = getDraftKey();
const hasContent = selectedDate.value;
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
return;
}
const data = {
selectedDate: selectedDate.value,
dateValue: dateValue.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
selectedDate.value = "";
dateValue.value = Date.now();
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.selectedDate;
if (!hasContent)
return;
isRestoring.value = true;
selectedDate.value = data.selectedDate || "";
dateValue.value = data.dateValue || Date.now();
hasDraft.value = true;
showRestoreBanner.value = true;
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:239", "解析草稿失败:", e);
isRestoring.value = false;
}
}
};
common_vendor.watch(
() => [selectedDate.value],
() => {
if (hazardId.value) {
saveDraft();
}
}
);
common_vendor.onLoad((options) => {
if (options.hazardId)
hazardId.value = options.hazardId;
if (options.assignId)
assignId.value = options.assignId;
fetchDeptUsers();
restoreDraft();
});
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({
return common_vendor.e({
a: showRestoreBanner.value
}, showRestoreBanner.value ? {
b: common_vendor.o(($event) => clearDraft(true))
} : {}, {
c: common_vendor.t(selectedUser.value || "请选择整改人员"),
d: common_vendor.n(selectedUser.value ? "" : "text-gray"),
e: common_vendor.o(($event) => showUserPicker.value = true),
f: common_vendor.o(onUserConfirm),
g: common_vendor.o(($event) => showUserPicker.value = false),
h: common_vendor.o(($event) => showUserPicker.value = false),
i: common_vendor.p({
show: showUserPicker.value,
columns: userColumns.value
}),
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({
j: common_vendor.t(selectedDate.value || "请选择整改期限"),
k: common_vendor.n(selectedDate.value ? "" : "text-gray"),
l: common_vendor.o(($event) => showDatePicker.value = true),
m: common_vendor.o(onDateConfirm),
n: common_vendor.o(($event) => showDatePicker.value = false),
o: common_vendor.o(($event) => showDatePicker.value = false),
p: common_vendor.o(($event) => dateValue.value = $event),
q: common_vendor.p({
show: showDatePicker.value,
mode: "datetime",
modelValue: dateValue.value
}),
p: common_vendor.o(handleCancel),
q: common_vendor.o(handleSubmit),
r: common_vendor.gei(_ctx, "")
};
r: common_vendor.o(handleCancel),
s: common_vendor.o(handleSubmit),
t: common_vendor.gei(_ctx, "")
});
};
}
};

View File

@@ -1 +1 @@
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{r}}"><view class="padding radius bg-white data-v-6209e844"><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">整改人员</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{c}}"><text class="{{['data-v-6209e844', b]}}">{{a}}</text></view><up-picker wx:if="{{g}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{d}}" bindcancel="{{e}}" bindclose="{{f}}" u-i="6209e844-0" bind:__l="__l" u-p="{{g}}"></up-picker><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{j}}"><text class="{{['data-v-6209e844', i]}}">{{h}}</text></view><up-datetime-picker wx:if="{{o}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{k}}" bindcancel="{{l}}" bindclose="{{m}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{n}}" u-p="{{o}}"></up-datetime-picker><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{p}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{q}}">确认</button></view></view></view>
<view class="{{['padding', 'page', 'data-v-6209e844', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{t}}"><view class="padding radius bg-white data-v-6209e844"><view wx:if="{{a}}" class="bg-orange-light text-orange padding-sm radius margin-bottom flex justify-between align-center data-v-6209e844" style="font-size:24rpx;background-color:#FFF7EB;border:1rpx solid #FFE4CC;width:100%;box-sizing:border-box;display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-bottom:20rpx"><view class="flex align-center data-v-6209e844" style="display:flex;flex-direction:row;align-items:center"><text class="cuIcon-info margin-right-xs data-v-6209e844" style="margin-right:10rpx"></text><text class="data-v-6209e844">已自动恢复您上次未提交的内容</text></view><text class="text-blue text-bold data-v-6209e844" style="cursor:pointer;padding:0 10rpx;color:#2667E9;font-weight:bold" bindtap="{{b}}">清空草稿</text></view><view class="flex margin-bottom data-v-6209e844"><view class="text-gray data-v-6209e844">整改人员</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{e}}"><text class="{{['data-v-6209e844', d]}}">{{c}}</text></view><up-picker wx:if="{{i}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{f}}" bindcancel="{{g}}" bindclose="{{h}}" u-i="6209e844-0" bind:__l="__l" u-p="{{i}}"></up-picker><view class="flex margin-bottom margin-top data-v-6209e844"><view class="text-gray data-v-6209e844">整改期限</view><view class="text-red data-v-6209e844">*</view></view><view class="picker-input data-v-6209e844" bindtap="{{l}}"><text class="{{['data-v-6209e844', k]}}">{{j}}</text></view><up-datetime-picker wx:if="{{q}}" class="data-v-6209e844" virtualHostClass="data-v-6209e844" bindconfirm="{{m}}" bindcancel="{{n}}" bindclose="{{o}}" u-i="6209e844-1" bind:__l="__l" bindupdateModelValue="{{p}}" u-p="{{q}}"></up-datetime-picker><view class="btn-group margin-top-xl data-v-6209e844"><button class="btn-cancel data-v-6209e844" bindtap="{{r}}">取消</button><button class="btn-confirm bg-blue data-v-6209e844" bindtap="{{s}}">确认</button></view></view></view>

View File

@@ -2,6 +2,7 @@
const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js");
const request_request = require("../../request/request.js");
const utils_watermark = require("../../utils/watermark.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
@@ -10,7 +11,8 @@ if (!Array) {
const _easycom_up_checkbox_group2 = common_vendor.resolveComponent("up-checkbox-group");
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_checkbox2 + _easycom_up_checkbox_group2 + _easycom_u_popup2 + _easycom_up_upload2)();
const _easycom_wd_signature2 = common_vendor.resolveComponent("wd-signature");
(_easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_checkbox2 + _easycom_up_checkbox_group2 + _easycom_u_popup2 + _easycom_up_upload2 + _easycom_wd_signature2)();
}
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";
@@ -19,8 +21,9 @@ const _easycom_up_checkbox = () => "../../uni_modules/uview-plus/components/u-ch
const _easycom_up_checkbox_group = () => "../../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group.js";
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
const _easycom_wd_signature = () => "../../node-modules/wot-design-uni/components/wd-signature/wd-signature.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_checkbox + _easycom_up_checkbox_group + _easycom_u_popup + _easycom_up_upload)();
(_easycom_up_textarea + _easycom_up_input + _easycom_up_datetime_picker + _easycom_up_checkbox + _easycom_up_checkbox_group + _easycom_u_popup + _easycom_up_upload + _easycom_wd_signature)();
}
const _sfc_main = {
__name: "rectification",
@@ -29,6 +32,32 @@ const _sfc_main = {
const assignId = common_vendor.ref("");
const rectifyId = common_vendor.ref("");
const isEdit = common_vendor.ref(false);
const canvasWidth = common_vendor.ref(300);
const canvasHeight = common_vendor.ref(300);
const showCanvas = common_vendor.ref(true);
const signatureUrl = common_vendor.ref("");
const signatureServerPath = common_vendor.ref("");
const signatureWidth = common_vendor.ref(340);
const signatureRef = common_vendor.ref(null);
const isSignatureEmpty = common_vendor.ref(true);
const isSubmitting = common_vendor.ref(false);
const clearSignature = () => {
isSignatureEmpty.value = true;
if (signatureRef.value) {
signatureRef.value.clear();
}
};
const reSign = () => {
isSignatureEmpty.value = true;
showCanvas.value = true;
signatureUrl.value = "";
signatureServerPath.value = "";
common_vendor.nextTick$1(() => {
if (signatureRef.value) {
signatureRef.value.clear();
}
});
};
const formData = common_vendor.reactive({
rectifyPlan: "",
// 整改方案
@@ -55,15 +84,15 @@ const _sfc_main = {
return `${selectedUsers.value[0].name}${selectedUsers.value.length}`;
});
const onUserChange = (ids) => {
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:125", "选中的ID:", ids);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:211", "选中的ID:", ids);
};
const confirmUserSelect = () => {
selectedUsers.value = cateList.value.filter((item) => selectedUserIds.value.includes(item.id));
showUserPopup.value = false;
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:133", "选中的整改人员:", selectedUsers.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:219", "选中的整改人员:", selectedUsers.value);
};
const fetchDeptUsers = async () => {
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:138", "当前hazardId:", hazardId.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:224", "当前hazardId:", hazardId.value);
try {
const res = await request_api.getDeptUsersWithSubordinates({ hazardId: hazardId.value });
if (res.code === 0 && res.data) {
@@ -79,10 +108,10 @@ const _sfc_main = {
}
});
cateList.value = userList;
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:156", "整改人员列表:", cateList.value);
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:242", "整改人员列表:", cateList.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:159", "获取部门人员失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:245", "获取部门人员失败:", error);
}
};
const fileList1 = common_vendor.ref([]);
@@ -100,13 +129,28 @@ const _sfc_main = {
});
});
for (let i = 0; i < lists.length; i++) {
const result = await uploadFilePromise(lists[i].url);
let watermarkedUrl = lists[i].url;
try {
const instance = common_vendor.getCurrentInstance();
watermarkedUrl = await utils_watermark.addTimestampWatermark({
tempFilePath: lists[i].url,
canvasId: "watermarkCanvas",
canvasWidthRef: canvasWidth,
canvasHeightRef: canvasHeight,
instance
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:281", "加水印失败,将使用原图上传:", e);
}
const result = await uploadFilePromise(watermarkedUrl);
let item = fileList1.value[fileListLen];
const serverPath = typeof result === "string" ? result : (result == null ? void 0 : result.url) || (result == null ? void 0 : result.filePath) || (result == null ? void 0 : result.path) || "";
fileList1.value.splice(fileListLen, 1, {
...item,
status: "success",
message: "",
url: result
url: request_request.toImageUrl(serverPath),
serverPath
});
fileListLen++;
}
@@ -129,12 +173,84 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:214", "上传失败:", err);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:317", "上传失败:", err);
reject(err);
}
});
});
};
const executeSubmit = async () => {
const attachments = fileList1.value.map((file) => {
const path = request_request.toRelativeFilePath(file.serverPath || file.filePath || file.url || "");
const fileName = path ? path.split("/").pop() : file.name || "";
return {
fileName: fileName || "",
filePath: path || "",
fileType: file.type || "image/png",
fileSize: file.size || 0
};
});
const params = {
hazardId: hazardId.value,
assignId: assignId.value,
rectifyPlan: formData.rectifyPlan,
rectifyResult: formData.rectifyResult,
planCost: Number(formData.planCost) || 0,
actualCost: Number(formData.actualCost) || 0,
attachments,
// 整改人员ID数组
rectifyUserIds: selectedUserIds.value.map((id) => Number(id)),
signPath: signatureServerPath.value || ""
// 电子签名路径
};
if (rectifyId.value) {
params.rectifyId = rectifyId.value;
}
try {
const res = await request_api.submitRectification(params);
common_vendor.index.hideLoading();
if (res.code === 0) {
clearDraft(false);
common_vendor.index.showToast({
title: isEdit.value ? "保存成功" : "提交成功",
icon: "success"
});
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
} else {
common_vendor.index.showToast({
title: res.msg || (isEdit.value ? "保存失败" : "提交失败"),
icon: "none"
});
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:377", "提交整改失败:", error);
common_vendor.index.showToast({
title: "操作失败",
icon: "none"
});
} finally {
isSubmitting.value = false;
}
};
const onSignatureConfirm = async (tempFilePath) => {
try {
const res = await uploadFilePromise(tempFilePath);
const path = res && typeof res === "object" ? res.url || res.filePath || "" : res || "";
signatureServerPath.value = request_request.toRelativeFilePath(path);
signatureUrl.value = request_request.toImageUrl(signatureServerPath.value);
if (isSubmitting.value) {
await executeSubmit();
}
} catch (err) {
isSubmitting.value = false;
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:402", "签名上传失败:", err);
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
}
};
const handleSubmit = async () => {
if (!formData.rectifyPlan) {
common_vendor.index.showToast({
@@ -157,57 +273,28 @@ const _sfc_main = {
});
return;
}
const attachments = fileList1.value.map((file) => {
let url = "";
if (typeof file.url === "string") {
url = file.url;
} else if (file.url && typeof file.url === "object") {
url = file.url.url || file.url.path || "";
}
const fileName = typeof url === "string" && url ? url.split("/").pop() : file.name || "";
return {
fileName: fileName || "",
filePath: url || "",
fileType: file.type || "image/png",
fileSize: file.size || 0
};
});
const params = {
hazardId: hazardId.value,
assignId: assignId.value,
rectifyPlan: formData.rectifyPlan,
rectifyResult: formData.rectifyResult,
planCost: Number(formData.planCost) || 0,
actualCost: Number(formData.actualCost) || 0,
attachments,
// 整改人员ID数组
rectifyUserIds: selectedUserIds.value.map((id) => Number(id))
};
if (rectifyId.value) {
params.rectifyId = rectifyId.value;
}
try {
const res = await request_api.submitRectification(params);
if (res.code === 0) {
if (showCanvas.value) {
if (!signatureRef.value || isSignatureEmpty.value) {
common_vendor.index.showToast({
title: isEdit.value ? "保存成功" : "提交成功",
icon: "success"
});
setTimeout(() => {
common_vendor.index.navigateBack();
}, 1500);
} else {
common_vendor.index.showToast({
title: res.msg || (isEdit.value ? "保存失败" : "提交失败"),
title: "请进行电子签名",
icon: "none"
});
return;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:296", "提交整改失败:", error);
common_vendor.index.showToast({
title: "操作失败",
icon: "none"
});
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
signatureRef.value.confirm();
} else {
if (!signatureServerPath.value) {
common_vendor.index.showToast({
title: "请进行电子签名",
icon: "none"
});
return;
}
isSubmitting.value = true;
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
await executeSubmit();
}
};
const fetchRectifyDetail = async () => {
@@ -221,18 +308,26 @@ const _sfc_main = {
formData.rectifyResult = data.rectifyResult || "";
formData.planCost = data.planCost ? String(data.planCost) : "";
formData.actualCost = data.actualCost ? String(data.actualCost) : "";
if (data.signPath) {
signatureServerPath.value = request_request.toRelativeFilePath(data.signPath);
signatureUrl.value = request_request.toImageUrl(signatureServerPath.value);
showCanvas.value = false;
}
hazardId.value = data.hazardId || "";
assignId.value = data.assignId || "";
await fetchDeptUsers();
if (data.attachments && data.attachments.length > 0) {
fileList1.value = data.attachments.map((att) => ({
url: att.filePath.startsWith("http") ? att.filePath : request_request.baseUrl.replace("/api", "") + att.filePath,
status: "success",
message: "",
name: att.fileName,
type: att.fileType,
filePath: att.filePath
// 保存原始路径用于提交
}));
fileList1.value = data.attachments.map((att) => {
const serverPath = request_request.toRelativeFilePath(att.filePath);
return {
url: request_request.toImageUrl(serverPath),
status: "success",
message: "",
name: att.fileName,
type: att.fileType,
serverPath
};
});
}
if (data.memberIds) {
const memberIdArr = data.memberIds.split(",").map((id) => String(id.trim()));
@@ -250,7 +345,7 @@ const _sfc_main = {
}
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:356", "获取整改详情失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:600", "获取整改详情失败:", error);
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
}
};
@@ -281,70 +376,198 @@ const _sfc_main = {
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:393", "AI生成整改方案失败:", error);
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:637", "AI生成整改方案失败:", error);
common_vendor.index.showToast({ title: "AI生成失败请重试", icon: "none" });
} finally {
aiGenerating.value = false;
}
};
const hasDraft = common_vendor.ref(false);
const showRestoreBanner = common_vendor.ref(false);
const isRestoring = common_vendor.ref(false);
const signaturePaths = common_vendor.ref([]);
const getDraftKey = () => `draft_rectify_${hazardId.value || ""}_${rectifyId.value || ""}`;
const saveDraft = () => {
if (isRestoring.value)
return;
const key = getDraftKey();
const hasContent = formData.rectifyPlan || formData.rectifyResult || formData.planCost || formData.actualCost || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
if (!hasContent) {
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
return;
}
const data = {
formData: {
rectifyPlan: formData.rectifyPlan,
rectifyResult: formData.rectifyResult,
planCost: formData.planCost,
actualCost: formData.actualCost
},
fileList1: fileList1.value,
signatureServerPath: signatureServerPath.value,
signatureUrl: signatureUrl.value,
showCanvas: showCanvas.value,
signaturePaths: signaturePaths.value
};
common_vendor.index.setStorageSync(key, JSON.stringify(data));
hasDraft.value = true;
};
const clearDraft = (showToast = true) => {
const key = getDraftKey();
common_vendor.index.removeStorageSync(key);
hasDraft.value = false;
showRestoreBanner.value = false;
isRestoring.value = true;
formData.rectifyPlan = "";
formData.rectifyResult = "";
formData.planCost = "";
formData.actualCost = "";
fileList1.value = [];
signatureServerPath.value = "";
signatureUrl.value = "";
showCanvas.value = true;
signaturePaths.value = [];
if (signatureRef.value) {
signatureRef.value.clear();
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
if (showToast) {
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
}
};
const restoreDraft = () => {
const key = getDraftKey();
const cached = common_vendor.index.getStorageSync(key);
if (cached) {
try {
const data = JSON.parse(cached);
const hasContent = data.formData.rectifyPlan || data.formData.rectifyResult || data.formData.planCost || data.formData.actualCost || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
if (!hasContent)
return;
isRestoring.value = true;
formData.rectifyPlan = data.formData.rectifyPlan || "";
formData.rectifyResult = data.formData.rectifyResult || "";
formData.planCost = data.formData.planCost || "";
formData.actualCost = data.formData.actualCost || "";
fileList1.value = data.fileList1 || [];
signatureServerPath.value = data.signatureServerPath || "";
signatureUrl.value = data.signatureUrl || "";
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
signaturePaths.value = data.signaturePaths || [];
hasDraft.value = true;
showRestoreBanner.value = true;
if (signaturePaths.value.length > 0) {
setTimeout(() => {
if (signatureRef.value) {
isSignatureEmpty.value = false;
}
}, 450);
}
common_vendor.nextTick$1(() => {
isRestoring.value = false;
});
common_vendor.index.showToast({
title: "已自动恢复您上次未提交的内容",
icon: "none",
duration: 2500
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:772", "解析草稿失败:", e);
isRestoring.value = false;
}
}
};
common_vendor.watch(
() => [
formData.rectifyPlan,
formData.rectifyResult,
formData.planCost,
formData.actualCost,
fileList1.value,
signatureServerPath.value,
signaturePaths.value
],
() => {
if (hazardId.value || rectifyId.value) {
saveDraft();
}
},
{ deep: true }
);
common_vendor.onLoad((options) => {
try {
const sysInfo = common_vendor.index.getSystemInfoSync();
signatureWidth.value = sysInfo.windowWidth - 40;
} catch (e) {
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:803", "获取系统信息失败:", e);
}
if (options.hazardId) {
hazardId.value = options.hazardId;
}
if (options.assignId) {
assignId.value = options.assignId;
}
fetchDeptUsers();
if (!options.rectifyId)
fetchDeptUsers();
if (options.rectifyId) {
rectifyId.value = options.rectifyId;
isEdit.value = options.isEdit === "1";
fetchRectifyDetail();
} else {
restoreDraft();
}
});
return (_ctx, _cache) => {
return common_vendor.e({
a: !aiGenerating.value
a: showRestoreBanner.value
}, showRestoreBanner.value ? {
b: common_vendor.o(($event) => clearDraft(true))
} : {}, {
c: !aiGenerating.value
}, !aiGenerating.value ? {} : {}, {
b: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI生成整改方案"),
c: aiGenerating.value,
d: aiGenerating.value,
e: common_vendor.o(handleAiGenerate),
f: common_vendor.o(($event) => formData.rectifyPlan = $event),
g: common_vendor.p({
d: common_vendor.t(aiGenerating.value ? "AI生成中..." : "AI生成整改方案"),
e: aiGenerating.value,
f: aiGenerating.value,
g: common_vendor.o(handleAiGenerate),
h: common_vendor.o(($event) => formData.rectifyPlan = $event),
i: common_vendor.p({
placeholder: "请输入内容",
maxlength: -1,
autoHeight: true,
modelValue: formData.rectifyPlan
}),
h: common_vendor.o(($event) => formData.rectifyResult = $event),
i: common_vendor.p({
j: common_vendor.o(($event) => formData.rectifyResult = $event),
k: common_vendor.p({
placeholder: "请输入内容",
modelValue: formData.rectifyResult
}),
j: common_vendor.o(($event) => formData.planCost = $event),
k: common_vendor.p({
l: common_vendor.o(($event) => formData.planCost = $event),
m: common_vendor.p({
placeholder: "请输入内容",
type: "number",
modelValue: formData.planCost
}),
l: common_vendor.o(($event) => formData.actualCost = $event),
m: common_vendor.p({
n: common_vendor.o(($event) => formData.actualCost = $event),
o: common_vendor.p({
placeholder: "请输入内容",
type: "number",
modelValue: formData.actualCost
}),
n: common_vendor.o(($event) => value1.value = $event),
o: common_vendor.p({
p: common_vendor.o(($event) => value1.value = $event),
q: common_vendor.p({
hasInput: true,
show: show.value,
mode: "date",
modelValue: value1.value
}),
p: common_vendor.t(selectedUsers.value.length > 0 ? selectedUsersText.value : "请选择整改人员(可多选)"),
q: selectedUsers.value.length === 0 ? 1 : "",
r: common_vendor.o(($event) => showUserPopup.value = true),
s: common_vendor.o(($event) => showUserPopup.value = false),
t: common_vendor.f(cateList.value, (item, k0, i0) => {
r: common_vendor.t(selectedUsers.value.length > 0 ? selectedUsersText.value : "请选择整改人员(可多选)"),
s: selectedUsers.value.length === 0 ? 1 : "",
t: common_vendor.o(($event) => showUserPopup.value = true),
v: common_vendor.o(($event) => showUserPopup.value = false),
w: common_vendor.f(cateList.value, (item, k0, i0) => {
return {
a: "f18ba0ce-7-" + i0 + ",f18ba0ce-6",
b: common_vendor.p({
@@ -356,31 +579,64 @@ const _sfc_main = {
c: item.id
};
}),
v: common_vendor.o(onUserChange),
w: common_vendor.o(($event) => selectedUserIds.value = $event),
x: common_vendor.p({
x: common_vendor.o(onUserChange),
y: common_vendor.o(($event) => selectedUserIds.value = $event),
z: common_vendor.p({
placement: "column",
modelValue: selectedUserIds.value
}),
y: common_vendor.o(($event) => showUserPopup.value = false),
z: common_vendor.o(confirmUserSelect),
A: common_vendor.o(($event) => showUserPopup.value = false),
B: common_vendor.p({
B: common_vendor.o(confirmUserSelect),
C: common_vendor.o(($event) => showUserPopup.value = false),
D: common_vendor.p({
show: showUserPopup.value,
mode: "bottom",
round: "20"
}),
C: common_vendor.o(afterRead),
D: common_vendor.o(deletePic),
E: common_vendor.p({
E: common_vendor.o(afterRead),
F: common_vendor.o(deletePic),
G: common_vendor.p({
fileList: fileList1.value,
name: "1",
multiple: true,
imageMode: "aspectFill",
maxCount: 10
}),
F: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
G: common_vendor.o(handleSubmit),
H: common_vendor.gei(_ctx, "")
H: canvasWidth.value,
I: canvasHeight.value,
J: canvasWidth.value + "px",
K: canvasHeight.value + "px",
L: showCanvas.value
}, showCanvas.value ? {
M: common_vendor.o(clearSignature)
} : {
N: common_vendor.o(reSign)
}, {
O: !showCanvas.value
}, !showCanvas.value ? {
P: signatureUrl.value
} : {}, {
Q: showCanvas.value && !showUserPopup.value
}, showCanvas.value && !showUserPopup.value ? {
R: common_vendor.sr(signatureRef, "f18ba0ce-9", {
"k": "signatureRef"
}),
S: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
T: common_vendor.o(($event) => isSignatureEmpty.value = false),
U: common_vendor.o(($event) => isSignatureEmpty.value = false),
V: common_vendor.o(($event) => isSignatureEmpty.value = true),
W: common_vendor.p({
width: signatureWidth.value,
height: 160,
backgroundColor: "#f8f8f8",
penColor: "#000000",
lineWidth: 3,
enableHistory: false
})
} : {}, {
X: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
Y: common_vendor.o(handleSubmit),
Z: common_vendor.gei(_ctx, "")
});
};
}

View File

@@ -7,6 +7,7 @@
"up-checkbox": "../../uni_modules/uview-plus/components/u-checkbox/u-checkbox",
"up-checkbox-group": "../../uni_modules/uview-plus/components/u-checkbox-group/u-checkbox-group",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload"
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
"wd-signature": "../../node-modules/wot-design-uni/components/wd-signature/wd-signature"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -127,6 +127,7 @@
.user-popup .popup-footer.data-v-f18ba0ce {
display: flex;
border-top: 1rpx solid #eee;
padding-bottom: env(safe-area-inset-bottom);
}
.user-popup .popup-footer button.data-v-f18ba0ce {
flex: 1;
@@ -144,4 +145,68 @@
}
.user-popup .popup-footer .btn-confirm.data-v-f18ba0ce {
color: #fff;
}
.signature-box.data-v-f18ba0ce {
width: 100%;
min-height: 240rpx;
background: #f8f8f8;
border: 1rpx dashed #dcdfe6;
border-radius: 8rpx;
margin-top: 16rpx;
}
.signature-box .signature-img.data-v-f18ba0ce {
width: 100%;
height: 100%;
}
.signature-box .signature-placeholder.data-v-f18ba0ce {
color: #909399;
font-size: 28rpx;
}
.signature-popup.data-v-f18ba0ce {
width: 650rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.signature-popup .popup-header.data-v-f18ba0ce {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #eee;
}
.signature-popup .popup-header .popup-title.data-v-f18ba0ce {
font-size: 32rpx;
color: #333;
}
.signature-popup .popup-header .popup-close.data-v-f18ba0ce {
font-size: 40rpx;
color: #999;
line-height: 1;
}
.signature-popup .popup-body.data-v-f18ba0ce {
padding: 40rpx 30rpx;
background: #fff;
}
.signature-popup .popup-footer.data-v-f18ba0ce {
display: flex;
padding: 0 30rpx 30rpx;
gap: 20rpx;
}
.signature-popup .popup-footer button.data-v-f18ba0ce {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
border-radius: 40rpx;
}
.signature-popup .popup-footer button.data-v-f18ba0ce::after {
border: none;
}
.signature-popup .popup-footer .btn-cancel.data-v-f18ba0ce {
background: #f5f5f5;
color: #666;
}
.signature-popup .popup-footer .btn-confirm.data-v-f18ba0ce {
color: #fff;
}

View File

@@ -175,28 +175,35 @@ const _sfc_main = {
name: ""
});
const hiddenDangerData = common_vendor.ref([]);
const dangerTabs = common_vendor.ref(["全部状态", "待验收", "待整改", "待交办", "验收通过"]);
const dangerTabs = common_vendor.ref([
{ label: "全部", value: null },
{ label: "待交办", value: 1 },
{ label: "待整改", value: 2 },
{ label: "待验收", value: 3 },
{ label: "待销号", value: 4 },
{ label: "已完成", value: 5 }
]);
const activeDangerTab = common_vendor.ref(0);
const switchDangerTab = (index) => {
activeDangerTab.value = index;
};
const filteredDangerData = common_vendor.computed(() => {
if (activeDangerTab.value === 0) {
const activeTab = dangerTabs.value[activeDangerTab.value];
if (!activeTab || activeTab.value === null) {
return hiddenDangerData.value;
}
const status = dangerTabs.value[activeDangerTab.value];
return hiddenDangerData.value.filter((item) => item.statusName === status);
return hiddenDangerData.value.filter((item) => item.status === activeTab.value);
});
const getHiddenDangerLists = async () => {
try {
const res = await request_api.getHiddenDangerList(hiddenDangerParams.value);
common_vendor.index.__f__("log", "at pages/index/index.vue:396", res);
common_vendor.index.__f__("log", "at pages/index/index.vue:403", res);
if (res.code === 0) {
hiddenDangerData.value = res.data.records;
common_vendor.index.__f__("log", "at pages/index/index.vue:399", hiddenDangerData.value, 1111);
common_vendor.index.__f__("log", "at pages/index/index.vue:406", hiddenDangerData.value, 1111);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:402", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:409", error);
} finally {
loading.value = false;
}
@@ -272,7 +279,7 @@ const _sfc_main = {
}),
i: common_vendor.f(dangerTabs.value, (tab, index, i0) => {
return {
a: common_vendor.t(tab),
a: common_vendor.t(tab.label),
b: activeDangerTab.value === index ? 1 : "",
c: index,
d: common_vendor.o(($event) => switchDangerTab(index), index)

File diff suppressed because one or more lines are too long

View File

@@ -3,16 +3,16 @@ 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_u_popup2 = common_vendor.resolveComponent("u-popup");
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
const _component_TabBar = common_vendor.resolveComponent("TabBar");
(_easycom_up_input2 + _easycom_up_picker2 + _easycom_u_popup2 + _component_TabBar)();
(_easycom_up_input2 + _easycom_u_popup2 + _easycom_up_picker2 + _component_TabBar)();
}
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_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
if (!Math) {
(_easycom_up_input + _easycom_up_picker + _easycom_u_popup)();
(_easycom_up_input + _easycom_u_popup + _easycom_up_picker)();
}
const _sfc_main = {
__name: "membermanagemen",
@@ -39,10 +39,10 @@ const _sfc_main = {
const userInfoStr = common_vendor.index.getStorageSync("userInfo");
if (userInfoStr) {
userInfo.value = JSON.parse(userInfoStr);
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:142", "用户信息:", userInfo.value);
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:147", "用户信息:", userInfo.value);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:145", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:150", "获取用户信息失败:", error);
}
};
const list = common_vendor.ref([]);
@@ -51,10 +51,10 @@ const _sfc_main = {
const res = await request_api.getMemberList();
if (res.code === 0 && res.data) {
list.value = res.data;
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:158", "成员列表:", res.data);
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:163", "成员列表:", res.data);
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:161", "获取成员列表失败:", error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:166", "获取成员列表失败:", error);
}
};
const showPopup = common_vendor.ref(false);
@@ -120,7 +120,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "添加失败", icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:244", "添加成员失败:", error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:249", "添加成员失败:", error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
};
@@ -147,7 +147,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: result.msg || `${actionText}失败`, icon: "none" });
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:275", `${actionText}成员失败:`, error);
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:280", `${actionText}成员失败:`, error);
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
}
}
@@ -205,20 +205,21 @@ const _sfc_main = {
n: common_vendor.t(selectedRoleName.value || "请选择角色类型"),
o: common_vendor.n(selectedRoleName.value ? "" : "text-gray"),
p: common_vendor.o(($event) => showRolePicker.value = true),
q: common_vendor.o(onRoleConfirm),
r: common_vendor.o(($event) => showRolePicker.value = false),
s: common_vendor.o(($event) => showRolePicker.value = false),
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({
show: showRolePicker.value,
columns: roleColumns
}),
v: common_vendor.o(($event) => showPopup.value = false),
w: common_vendor.o(handleSubmit),
x: common_vendor.o(($event) => showPopup.value = false),
y: common_vendor.p({
show: showPopup.value,
mode: "center",
round: "20"
round: "20",
safeAreaInsetBottom: false
}),
v: common_vendor.o(onRoleConfirm),
w: common_vendor.o(($event) => showRolePicker.value = false),
x: common_vendor.o(($event) => showRolePicker.value = false),
y: common_vendor.p({
show: showRolePicker.value,
columns: roleColumns
}),
z: common_vendor.gei(_ctx, "")
};

View File

@@ -2,7 +2,7 @@
"navigationBarTitleText": "成员管理",
"usingComponents": {
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker"
}
}

View File

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

View File

@@ -128,6 +128,10 @@
border: none;
}
.popup-content.data-v-06d9f81b {
position: relative;
z-index: 99;
transform: translateZ(0);
-webkit-transform: translateZ(0);
width: 600rpx;
background: #fff;
border-radius: 20rpx;
@@ -150,6 +154,10 @@
line-height: 1;
}
.popup-body.data-v-06d9f81b {
position: relative;
z-index: 100;
transform: translateZ(0);
-webkit-transform: translateZ(0);
padding: 30rpx;
max-height: 700rpx;
overflow-y: auto;
@@ -183,6 +191,8 @@
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
margin: 0;
padding: 0;
font-size: 30rpx;
}
.popup-footer button.data-v-06d9f81b::after {

View File

@@ -1,7 +1,7 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const request_luchRequest_core_Request = require("./luch-request/core/Request.js");
const baseUrl = "https://yingji.hexieapi.com/prod-api";
const baseUrl = "http://192.168.1.168:5004";
const imageBaseUrl = baseUrl.replace(/\/prod-api\/?$/, "");
new request_luchRequest_core_Request.Request({
baseURL: baseUrl,
@@ -112,8 +112,23 @@ const toImageUrl = (filePath) => {
const normalized = p.startsWith("/") ? p : `/${p}`;
return imageBaseUrl + normalized;
};
const toRelativeFilePath = (filePath) => {
if (!filePath)
return "";
let p = String(filePath);
if (p.startsWith("http://") || p.startsWith("https://")) {
p = p.replace(/^https?:\/\/[^/]+/, "");
}
p = p.replace(/^\/prod-api(?=\/|$)/, "");
if (!p.startsWith("/")) {
p = `/${p}`;
}
return p;
};
exports.baseUrl = baseUrl;
exports.getToken = getToken;
exports.imageBaseUrl = imageBaseUrl;
exports.requestAPI = requestAPI;
exports.toImageUrl = toImageUrl;
exports.toRelativeFilePath = toRelativeFilePath;
//# sourceMappingURL=../../.sourcemap/mp-weixin/request/request.js.map

View File

@@ -0,0 +1,99 @@
"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: {
// 组件状态loadmore-加载前的状态loading-加载中的状态nomore-没有更多的状态
status: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.status
},
// 组件背景色
bgColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.bgColor
},
// 是否显示加载中的图标
icon: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.icon
},
// 字体大小
fontSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.fontSize
},
// 图标大小
iconSize: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.iconSize
},
// 字体颜色
color: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.color
},
// 加载中状态的图标spinner-花朵状图标circle-圆圈状semicircle-半圆
loadingIcon: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.loadingIcon
},
// 加载前的提示语
loadmoreText: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.loadmoreText
},
// 加载中提示语
loadingText: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.loadingText
},
// 没有更多的提示语
nomoreText: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.nomoreText
},
// 在“没有更多”状态下,是否显示粗点
isDot: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.isDot
},
// 加载中图标的颜色
iconColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.iconColor
},
// 上边距
marginTop: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.marginTop
},
// 下边距
marginBottom: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.marginBottom
},
// 高度单位px
height: {
type: [String, Number],
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.height
},
// 是否显示左边分割线
line: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.line
},
// 线条颜色
lineColor: {
type: String,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.lineColor
},
// 是否虚线true-虚线false-实线
dashed: {
type: Boolean,
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.dashed
}
}
});
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-loadmore/props.js.map

View File

@@ -0,0 +1,105 @@
"use strict";
const uni_modules_uviewPlus_components_uLoadmore_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-loadmore",
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLoadmore_props.props],
data() {
return {
// 粗点
dotText: "●"
};
},
computed: {
// 加载的文字显示的样式
loadTextStyle() {
return {
color: this.color,
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize),
lineHeight: uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize),
backgroundColor: this.bgColor
};
},
// 显示的提示文字
showText() {
let text = "";
if (this.status == "loadmore")
text = this.loadmoreText;
else if (this.status == "loading")
text = this.loadingText;
else if (this.status == "nomore" && this.isDot)
text = this.dotText;
else
text = this.nomoreText;
return text;
}
},
emits: ["loadmore"],
methods: {
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
loadMore() {
if (this.status == "loadmore")
this.$emit("loadmore");
}
}
};
if (!Array) {
const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon");
(_easycom_u_line2 + _easycom_u_loading_icon2)();
}
const _easycom_u_line = () => "../u-line/u-line.js";
const _easycom_u_loading_icon = () => "../u-loading-icon/u-loading-icon.js";
if (!Math) {
(_easycom_u_line + _easycom_u_loading_icon)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.line
}, _ctx.line ? {
b: common_vendor.p({
length: "140rpx",
color: _ctx.lineColor,
hairline: false,
dashed: _ctx.dashed
})
} : {}, {
c: _ctx.status === "loading" && _ctx.icon
}, _ctx.status === "loading" && _ctx.icon ? {
d: common_vendor.p({
color: _ctx.iconColor,
size: _ctx.iconSize,
mode: _ctx.loadingIcon
})
} : {}, {
e: common_vendor.t($options.showText),
f: common_vendor.s($options.loadTextStyle),
g: common_vendor.n(_ctx.status == "nomore" && _ctx.isDot == true ? "u-loadmore__content__dot-text" : "u-loadmore__content__text"),
h: common_vendor.o((...args) => $options.loadMore && $options.loadMore(...args)),
i: common_vendor.n(_ctx.status == "loadmore" || _ctx.status == "nomore" ? "u-more" : ""),
j: _ctx.line
}, _ctx.line ? {
k: common_vendor.p({
length: "140rpx",
color: _ctx.lineColor,
hairline: false,
dashed: _ctx.dashed
})
} : {}, {
l: common_vendor.s($options.addStyle(_ctx.customStyle)),
m: common_vendor.s({
backgroundColor: _ctx.bgColor,
marginBottom: $options.addUnit(_ctx.marginBottom),
marginTop: $options.addUnit(_ctx.marginTop),
height: $options.addUnit(_ctx.height)
}),
n: common_vendor.gei(_ctx, "")
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4ccc1478"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.js.map

View File

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

View File

@@ -0,0 +1 @@
<view style="{{l + ';' + m + ';' + virtualHostStyle}}" class="{{['u-loadmore', 'data-v-4ccc1478', virtualHostClass]}}" hidden="{{virtualHostHidden || false}}" id="{{n}}"><u-line wx:if="{{a}}" class="data-v-4ccc1478" virtualHostClass="data-v-4ccc1478" u-i="4ccc1478-0" bind:__l="__l" u-p="{{b}}"></u-line><view class="{{[i, 'u-loadmore__content', 'data-v-4ccc1478']}}"><view wx:if="{{c}}" class="u-loadmore__content__icon-wrap data-v-4ccc1478"><u-loading-icon wx:if="{{d}}" class="data-v-4ccc1478" virtualHostClass="data-v-4ccc1478" u-i="4ccc1478-1" bind:__l="__l" u-p="{{d}}"></u-loading-icon></view><text style="{{f}}" class="{{['u-line-1', 'data-v-4ccc1478', g]}}" bindtap="{{h}}">{{e}}</text></view><u-line wx:if="{{j}}" class="data-v-4ccc1478" virtualHostClass="data-v-4ccc1478" u-i="4ccc1478-2" bind:__l="__l" u-p="{{k}}"></u-line></view>

View File

@@ -0,0 +1,51 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* uni.scss */
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.u-loadmore.data-v-4ccc1478 {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex: 1;
}
.u-loadmore__content.data-v-4ccc1478 {
margin: 0 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.u-loadmore__content__icon-wrap.data-v-4ccc1478 {
margin-right: 8px;
}
.u-loadmore__content__text.data-v-4ccc1478 {
font-size: 14px;
color: #606266;
}
.u-loadmore__content__dot-text.data-v-4ccc1478 {
font-size: 15px;
color: #909193;
}

View File

@@ -0,0 +1,68 @@
"use strict";
const common_vendor = require("../common/vendor.js");
function addTimestampWatermark({ tempFilePath, canvasId = "watermarkCanvas", canvasWidthRef, canvasHeightRef, instance }) {
return new Promise((resolve, reject) => {
common_vendor.index.getImageInfo({
src: tempFilePath,
success: (imageInfo) => {
const imgWidth = imageInfo.width;
const imgHeight = imageInfo.height;
if (canvasWidthRef && canvasWidthRef.value !== void 0) {
canvasWidthRef.value = imgWidth;
}
if (canvasHeightRef && canvasHeightRef.value !== void 0) {
canvasHeightRef.value = imgHeight;
}
common_vendor.nextTick$1(() => {
const ctx = common_vendor.index.createCanvasContext(canvasId, instance);
if (!ctx) {
reject("创建水印画布上下文失败");
return;
}
ctx.drawImage(tempFilePath, 0, 0, imgWidth, imgHeight);
const now = /* @__PURE__ */ new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
const hours = String(now.getHours()).padStart(2, "0");
const minutes = String(now.getMinutes()).padStart(2, "0");
const seconds = String(now.getSeconds()).padStart(2, "0");
const timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
const fontSize = Math.max(14, Math.floor(imgWidth * (14 / 375)));
ctx.setFontSize(fontSize);
ctx.setFillStyle("#C9CBD4");
ctx.setShadow(2, 2, 4, "rgba(0, 0, 0, 0.6)");
const padding = fontSize;
const textWidth = timeStr.length * (fontSize * 0.55);
const x = imgWidth - textWidth - padding;
const y = imgHeight - padding;
ctx.fillText(timeStr, x, y);
ctx.draw(false, () => {
setTimeout(() => {
common_vendor.index.canvasToTempFilePath({
canvasId,
destWidth: imgWidth,
destHeight: imgHeight,
fileType: "jpg",
quality: 0.9,
success: (exportRes) => {
resolve(exportRes.tempFilePath);
},
fail: (err) => {
common_vendor.index.__f__("error", "at utils/watermark.js:80", "导出带水印图片失败:", err);
reject(err);
}
}, instance);
}, 150);
});
});
},
fail: (err) => {
common_vendor.index.__f__("error", "at utils/watermark.js:89", "获取图片信息失败:", err);
reject(err);
}
});
});
}
exports.addTimestampWatermark = addTimestampWatermark;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/watermark.js.map