if (typeof Promise !== "undefined" && !Promise.prototype.finally) { Promise.prototype.finally = function(callback) { const promise = this.constructor; return this.then( (value) => promise.resolve(callback()).then(() => value), (reason) => promise.resolve(callback()).then(() => { throw reason; }) ); }; } ; if (typeof uni !== "undefined" && uni && uni.requireGlobal) { const global = uni.requireGlobal(); ArrayBuffer = global.ArrayBuffer; Int8Array = global.Int8Array; Uint8Array = global.Uint8Array; Uint8ClampedArray = global.Uint8ClampedArray; Int16Array = global.Int16Array; Uint16Array = global.Uint16Array; Int32Array = global.Int32Array; Uint32Array = global.Uint32Array; Float32Array = global.Float32Array; Float64Array = global.Float64Array; BigInt64Array = global.BigInt64Array; BigUint64Array = global.BigUint64Array; } ; if (uni.restoreGlobal) { uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval); } (function(vue) { "use strict"; var _a, _b; const stringProp = (defaultVal) => ({ type: String, default: defaultVal }); const stringOrObjectProp = (defaultVal) => ({ type: [String, Object], default: defaultVal }); const baseProps = { /** * 自定义根节点样式 */ customStyle: stringOrObjectProp(""), /** * 自定义根节点样式类 */ customClass: stringProp("") }; const TransitionProps = { ...baseProps, show: { type: Boolean, default: true }, name: { type: String, default: "fade" }, mode: { type: String, default: "" }, duration: { type: [Number, Object], default: 300 }, timingFunction: { type: String, default: "cubic-bezier(0.2, 0.8, 0.2, 1)" }, delay: { type: Number, default: 0 }, appear: { type: Boolean, default: false } }; const ON_SHOW = "onShow"; const ON_READY = "onReady"; function formatAppLog(type, filename, ...args) { if (uni.__log__) { uni.__log__(type, filename, ...args); } else { console[type].apply(console, [...args, filename]); } } function resolveEasycom(component, easycom2) { return typeof component === "string" ? easycom2 : component; } const createLifeCycleHook = (lifecycle, flag2 = 0) => (hook, target = vue.getCurrentInstance()) => { !vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target); }; const onShow = /* @__PURE__ */ createLifeCycleHook( ON_SHOW, 1 | 2 /* HookFlags.PAGE */ ); const onReady = /* @__PURE__ */ createLifeCycleHook( ON_READY, 2 /* HookFlags.PAGE */ ); function queryParams(data = {}, isPrefix = true, arrayFormat = "brackets") { const prefix = isPrefix ? "?" : ""; const _result = []; if (!["indices", "brackets", "repeat", "comma"].includes(arrayFormat)) arrayFormat = "brackets"; for (const key in data) { const value = data[key]; if (["", void 0, null].includes(value)) { continue; } if (Array.isArray(value)) { switch (arrayFormat) { case "indices": for (let i2 = 0; i2 < value.length; i2++) { _result.push(`${key}[${i2}]=${value[i2]}`); } break; case "brackets": value.forEach((_value) => { _result.push(`${key}[]=${_value}`); }); break; case "repeat": value.forEach((_value) => { _result.push(`${key}=${_value}`); }); break; case "comma": let commaStr = ""; value.forEach((_value) => { commaStr += (commaStr ? "," : "") + _value; }); _result.push(`${key}=${commaStr}`); break; default: value.forEach((_value) => { _result.push(`${key}[]=${_value}`); }); } } else { _result.push(`${key}=${value}`); } } return _result.length ? prefix + _result.join("&") : ""; } class Router { // route: (options?: string | RouterConfig, params?: Record) => Promise; constructor() { this.config = { type: "navigateTo", url: "", delta: 1, // navigateBack页面后退时,回退的层数 params: {}, // 传递的参数 animationType: "pop-in", // 窗口动画,只在APP有效 animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效 intercept: false // 是否需要拦截 }; this.route = this.route.bind(this); } // 判断url前面是否有"/",如果没有则加上,否则无法跳转 addRootPath(url2) { return url2[0] === "/" ? url2 : `/${url2}`; } // 整合路由参数 mixinParam(url2, params) { url2 = url2 && this.addRootPath(url2); let query = ""; if (/.*\/.*\?.*=.*/.test(url2)) { query = uni.$u.queryParams(params, false); return url2 + "&" + query; } else { query = uni.$u.queryParams(params); return url2 + query; } } /** * 路由跳转主方法 * @param options 跳转配置或url字符串 * @param params 跳转参数 */ async route(options = {}, params = {}) { let mergeConfig = {}; if (typeof options === "string") { mergeConfig.url = this.mixinParam(options, params); mergeConfig.type = "navigateTo"; } else { mergeConfig = uni.$u.deepMerge(this.config, options); mergeConfig.url = this.mixinParam(options.url || "", options.params || {}); } if (params.intercept) { this.config.intercept = params.intercept; } mergeConfig.params = params; mergeConfig = uni.$u.deepMerge(this.config, mergeConfig); if (uni.$u.routeIntercept && typeof uni.$u.routeIntercept === "function") { const isNext = await new Promise((resolve) => { uni.$u.routeIntercept(mergeConfig, resolve); }); isNext && this.openPage(mergeConfig); } else { this.openPage(mergeConfig); } } // 执行路由跳转 openPage(config2) { const { url: url2 = "", type = "", delta = 1, animationDuration = 300 } = config2; if (type == "navigateTo" || type == "to") { uni.navigateTo({ url: url2, animationDuration }); } if (type == "redirectTo" || type == "redirect") { uni.redirectTo({ url: url2 }); } if (type == "switchTab" || type == "tab") { uni.switchTab({ url: url2 }); } if (type == "reLaunch" || type == "launch") { uni.reLaunch({ url: url2 }); } if (type == "navigateBack" || type == "back") { uni.navigateBack({ delta }); } } } const route = new Router().route; if (!String.prototype.padStart) { String.prototype.padStart = function(maxLength, fillString = " ") { if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError("fillString must be String"); let str = this; if (str.length >= maxLength) return String(str); let fillLength = maxLength - str.length, times = Math.ceil(fillLength / fillString.length); while (times >>= 1) { fillString += fillString; if (times === 1) { fillString += fillString; } } return fillString.slice(0, fillLength) + str; }; } function timeFormat(dateTime = null, fmt = "yyyy-mm-dd") { if (!dateTime) dateTime = Number(/* @__PURE__ */ new Date()); if (typeof dateTime === "number" || typeof dateTime === "string") { if (dateTime.toString().length == 10) dateTime = Number(dateTime) * 1e3; } const date2 = new Date(dateTime); let ret; const opt = { "y+": date2.getFullYear().toString(), // 年 "m+": (date2.getMonth() + 1).toString(), // 月 "d+": date2.getDate().toString(), // 日 "h+": date2.getHours().toString(), // 时 "M+": date2.getMinutes().toString(), // 分 "s+": date2.getSeconds().toString() // 秒 // 有其他格式化字符需求可以继续添加,必须转化成字符串 }; for (const k in opt) { ret = new RegExp("(" + k + ")").exec(fmt); if (ret) { fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0")); } } return fmt; } function timeFrom(dateTime = null, format = "yyyy-mm-dd") { if (!dateTime) dateTime = Number(/* @__PURE__ */ new Date()); if (typeof dateTime === "number" || typeof dateTime === "string") { if (dateTime.toString().length == 10) dateTime = Number(dateTime) * 1e3; } const timestamp = +new Date(Number(dateTime)); const timer = (Number(/* @__PURE__ */ new Date()) - timestamp) / 1e3; let tips = ""; switch (true) { case timer < 300: tips = "刚刚"; break; case (timer >= 300 && timer < 3600): tips = parseInt(String(timer / 60)) + "分钟前"; break; case (timer >= 3600 && timer < 86400): tips = parseInt(String(timer / 3600)) + "小时前"; break; case (timer >= 86400 && timer < 2592e3): tips = parseInt(String(timer / 86400)) + "天前"; break; default: if (format === false) { if (timer >= 2592e3 && timer < 365 * 86400) { tips = parseInt(String(timer / (86400 * 30))) + "个月前"; } else { tips = parseInt(String(timer / (86400 * 365))) + "年前"; } } else { tips = timeFormat(timestamp, format); } } return tips; } function colorGradient(startColor = "rgb(0, 0, 0)", endColor = "rgb(255, 255, 255)", step = 10) { const startRGB = hexToRgb(startColor, false); const [startR, startG, startB] = startRGB; const endRGB = hexToRgb(endColor, false); const [endR, endG, endB] = endRGB; const sR = (endR - startR) / step; const sG = (endG - startG) / step; const sB = (endB - startB) / step; const colorArr = []; for (let i2 = 0; i2 < step; i2++) { const hex = rgbToHex( `rgb(${Math.round(sR * i2 + startR)},${Math.round(sG * i2 + startG)},${Math.round(sB * i2 + startB)})` ); colorArr.push(hex); } return colorArr; } function hexToRgb(sColor, str = true) { const reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; sColor = sColor.toLowerCase(); if (sColor && reg.test(sColor)) { if (sColor.length === 4) { let sColorNew = "#"; for (let i2 = 1; i2 < 4; i2 += 1) { sColorNew += sColor.slice(i2, i2 + 1).concat(sColor.slice(i2, i2 + 1)); } sColor = sColorNew; } const sColorChange = [ parseInt("0x" + sColor.slice(1, 3)), parseInt("0x" + sColor.slice(3, 5)), parseInt("0x" + sColor.slice(5, 7)) ]; if (!str) { return sColorChange; } else { return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`; } } else if (/^(rgb|RGB)/.test(sColor)) { const arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); return arr.map((val) => Number(val)); } else { return sColor; } } function rgbToHex(rgb) { const reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; if (/^(rgb|RGB)/.test(rgb)) { const aColor = rgb.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); let strHex = "#"; for (let i2 = 0; i2 < aColor.length; i2++) { let hex = Number(aColor[i2]).toString(16); hex = hex.length == 1 ? "0" + hex : hex; strHex += hex; } if (strHex.length !== 7) { strHex = rgb; } return strHex; } else if (reg.test(rgb)) { const aNum = rgb.replace(/#/, "").split(""); if (aNum.length === 6) { return rgb; } else if (aNum.length === 3) { let numHex = "#"; for (let i2 = 0; i2 < aNum.length; i2 += 1) { numHex += aNum[i2] + aNum[i2]; } return numHex; } } else { return rgb; } return rgb; } function colorToRgba(color2, alpha = 0.3) { color2 = rgbToHex(color2); const reg = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/; let sColor = color2.toLowerCase(); if (sColor && reg.test(sColor)) { if (sColor.length === 4) { let sColorNew = "#"; for (let i2 = 1; i2 < 4; i2 += 1) { sColorNew += sColor.slice(i2, i2 + 1).concat(sColor.slice(i2, i2 + 1)); } sColor = sColorNew; } const sColorChange = [ parseInt("0x" + sColor.slice(1, 3)), parseInt("0x" + sColor.slice(3, 5)), parseInt("0x" + sColor.slice(5, 7)) ]; return `rgba(${sColorChange.join(",")},${alpha})`; } else { return sColor; } } const colorGradients = { colorGradient, hexToRgb, rgbToHex, colorToRgba }; function guid(len = 32, firstU = true, radix) { const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""); const uuid = []; const base = radix || chars.length; if (len) { for (let i2 = 0; i2 < len; i2++) uuid[i2] = chars[0 | Math.random() * base]; } else { let r2; uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-"; uuid[14] = "4"; for (let i2 = 0; i2 < 36; i2++) { if (!uuid[i2]) { r2 = 0 | Math.random() * 16; uuid[i2] = chars[i2 == 19 ? r2 & 3 | 8 : r2]; } } } if (firstU) { uuid.shift(); return "u" + uuid.join(""); } else { return uuid.join(""); } } const version = "0.5.9"; const config = vue.reactive({ v: version, version, // 主题名称 type: ["primary", "success", "info", "error", "warning"], // 默认为官方主题名称 defaultTheme: "uviewpro", // 默认为亮色模式 defaultDarkMode: "light", // 默认为中文 defaultLocale: "zh-CN" }); const lightPalette = { primary: "#2979ff", primaryDark: "#2b85e4", primaryDisabled: "#a0cfff", primaryLight: "#ecf5ff", success: "#19be6b", successDark: "#18b566", successDisabled: "#71d5a1", successLight: "#dbf1e1", warning: "#ff9900", warningDark: "#f29100", warningDisabled: "#fcbd71", warningLight: "#fdf6ec", error: "#fa3534", errorDark: "#dd6161", errorDisabled: "#fab6b6", errorLight: "#fef0f0", info: "#909399", infoDark: "#82848a", infoDisabled: "#c8c9cc", infoLight: "#f4f4f5", whiteColor: "#ffffff", blackColor: "#000000", mainColor: "#303133", contentColor: "#606266", tipsColor: "#909399", lightColor: "#c0c4cc", borderColor: "#dcdfe6", dividerColor: "#e4e7ed", maskColor: "rgba(0, 0, 0, 0.4)", shadowColor: "rgba(0, 0, 0, 0.1)", bgColor: "#f3f4f6", bgWhite: "#ffffff", bgGrayLight: "#f1f1f1", bgGrayDark: "#2f343c", bgBlack: "#000000" }; const darkPalette = { primary: "#8ab4ff", primaryDark: "#5f8dff", primaryDisabled: "#3d4f74", primaryLight: "#1d273f", success: "#4ade80", successDark: "#1f9d57", successDisabled: "#2f4d3d", successLight: "#10291f", warning: "#fbbf24", warningDark: "#c88f00", warningDisabled: "#4a3b17", warningLight: "#2b1f05", error: "#ff6b6b", errorDark: "#d83a3a", errorDisabled: "#4f2323", errorLight: "#2d1414", info: "#a0a7b8", infoDark: "#7c8394", infoDisabled: "#3b3f4c", infoLight: "#1d2029", whiteColor: "#f5f6f7", blackColor: "#f5f6f7", mainColor: "#f5f6f7", contentColor: "#cfd3dc", tipsColor: "#9aa1af", lightColor: "#6b7082", borderColor: "#3a4251", dividerColor: "#3a4251", maskColor: "rgba(0, 0, 0, 0.6)", shadowColor: "rgba(0, 0, 0, 0.3)", bgColor: "#111827", bgWhite: "#000000", bgGrayLight: "#1a1a1a", bgGrayDark: "#f5f7fa", bgBlack: "#ffffff" }; const lightCss = { "--u-background": "#ffffff", "--u-surface": "#f7f8fa", "--u-text": "#303133" }; const darkCss = { "--u-background": "#0f1115", "--u-surface": "#1c2233", "--u-text": "#f5f6f7" }; const defaultThemes = [ { name: config.defaultTheme, label: "默认蓝", description: "uView Pro 默认主题,支持亮色与暗黑模式", color: lightPalette, darkColor: darkPalette, css: lightCss, darkCss } ]; const color$2 = vue.reactive({ ...lightPalette }); function getSystemDarkMode() { try { if (typeof uni !== "undefined" && typeof uni.getSystemInfoSync === "function") { const systemInfo = uni.getSystemInfoSync(); const theme = systemInfo.osTheme || systemInfo.theme || "light"; if (theme === "dark") { return "dark"; } if (theme === "light") { return "light"; } } } catch (e2) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/system-theme.ts:22", "[system-theme] getSystemDarkMode failed", e2); } return "light"; } const zhCN = { name: "zh-CN", label: "简体中文", locale: "zh-Hans", uActionSheet: { cancelText: "取消" }, uUpload: { uploadText: "选择图片", retry: "点击重试", overSize: "超出允许的文件大小", overMaxCount: "超出最大允许的文件个数", reUpload: "重新上传", uploadFailed: "上传失败,请重试", modalTitle: "提示", modalCancelText: "取消", modalConfirmText: "确定", deleteConfirm: "您确定要删除此项吗?", terminatedRemove: "已终止移除", removeSuccess: "移除成功", previewFailed: "预览图片失败", notAllowedExt: "不允许选择{ext}格式的文件", noAction: "请配置上传地址" }, uVerificationCode: { startText: "获取验证码", changeText: "X秒重新获取", endText: "重新获取" }, uSection: { subTitle: "更多" }, uSelect: { cancelText: "取消", confirmText: "确认" }, uSearch: { placeholder: "请输入关键字", actionText: "搜索" }, uNoNetwork: { tips: "哎呀,网络信号丢失", checkNetwork: "请检查网络,或前往", setting: "设置", retry: "重试", noConnection: "无网络连接", connected: "网络已连接" }, uReadMore: { closeText: "展开阅读全文", openText: "收起" }, uPagination: { prevText: "上一页", nextText: "下一页" }, uPicker: { cancelText: "取消", confirmText: "确认" }, uModal: { title: "提示", content: "内容", confirmText: "确认", cancelText: "取消" }, uLoadmore: { loadmore: "加载更多", loading: "正在加载...", nomore: "没有更多了" }, uLink: { mpTips: "链接已复制,请在浏览器打开" }, uKeyboard: { cancelText: "取消", confirmText: "确认", number: "数字键盘", idCard: "身份证键盘", plate: "车牌号键盘" }, uInput: { placeholder: "请输入内容" }, uCalendar: { startText: "开始", endText: "结束", toolTip: "选择日期", outOfRange: "日期超出范围啦~", year: "年", month: "月", sun: "日", mon: "一", tue: "二", wed: "三", thu: "四", fri: "五", sat: "六", confirmText: "确定", to: "至" }, uEmpty: { car: "购物车为空", page: "页面不存在", search: "没有搜索结果", address: "没有收货地址", wifi: "没有WiFi", order: "订单为空", coupon: "没有优惠券", favor: "暂无收藏", permission: "无权限", history: "无历史记录", news: "无新闻列表", message: "消息列表为空", list: "列表为空", data: "数据为空" }, uCountDown: { day: "天", hour: "时", minute: "分", second: "秒" }, uFullScreen: { title: "发现新版本", upgrade: "升级" } }; const enUS = { name: "en-US", label: "English", locale: "en", uActionSheet: { cancelText: "Cancel" }, uUpload: { uploadText: "Select Image", retry: "Retry", overSize: "File size exceeds allowed limit", overMaxCount: "Exceeds maximum allowed number of files", reUpload: "Re-upload", uploadFailed: "Upload failed, please try again", modalTitle: "Notice", modalCancelText: "Cancel", modalConfirmText: "Confirm", deleteConfirm: "Are you sure you want to delete this item?", terminatedRemove: "Removal cancelled", removeSuccess: "Removed successfully", previewFailed: "Failed to preview image", notAllowedExt: "Files with {ext} format are not allowed", noAction: "Please configure upload address" }, uVerificationCode: { startText: "Get Code", changeText: "Retry in Xs", endText: "Retry" }, uSection: { subTitle: "More" }, uSelect: { cancelText: "Cancel", confirmText: "Confirm" }, uSearch: { placeholder: "Please enter keywords", actionText: "Search" }, uNoNetwork: { tips: "Ooops, network disconnected", checkNetwork: "Please check network or go to", setting: "Settings", retry: "Retry", noConnection: "No network connection", connected: "Network connected" }, uReadMore: { closeText: "Read More", openText: "Collapse" }, uPagination: { prevText: "Prev", nextText: "Next" }, uPicker: { cancelText: "Cancel", confirmText: "Confirm" }, uModal: { title: "Notice", content: "Content", confirmText: "Confirm", cancelText: "Cancel" }, uLoadmore: { loadmore: "Load more", loading: "Loading...", nomore: "No more" }, uLink: { mpTips: "Link copied, please open it in browser" }, uKeyboard: { cancelText: "Cancel", confirmText: "Confirm", number: "Number Keyboard", idCard: "ID Card Keyboard", plate: "Plate Keyboard" }, uInput: { placeholder: "Please enter" }, uCalendar: { startText: "Start", endText: "End", toolTip: "Select date", outOfRange: "Date out of range", year: "", month: "", sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat", confirmText: "Confirm", to: " to " }, uEmpty: { car: "Shopping cart is empty", page: "Page not found", search: "No search results", address: "No shipping address", wifi: "No WiFi", order: "No orders", coupon: "No coupons", favor: "No favorites", permission: "No permission", history: "No history", news: "No news", message: "No messages", list: "No list", data: "No data" }, uCountDown: { day: "days", hour: "hours", minute: "minutes", second: "Second" }, uFullScreen: { title: "New Version Available", upgrade: "Upgrade" } }; const localePack = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, enUS, zhCN }, Symbol.toStringTag, { value: "Module" })); const THEME_STORAGE_KEY = "uview-pro-theme"; const DARK_MODE_STORAGE_KEY = "uview-pro-dark-mode"; const LOCALE_STORAGE_KEY = "uview-pro-locale"; const DEFAULT_LIGHT_TOKENS = ((_a = defaultThemes[0]) == null ? void 0 : _a.color) || {}; const DEFAULT_DARK_TOKENS = ((_b = defaultThemes[0]) == null ? void 0 : _b.darkColor) || {}; const STRUCTURAL_TOKENS = /* @__PURE__ */ new Set([ "bgColor", "bgWhite", "bgGrayLight", "bgGrayDark", "bgBlack", "borderColor", "lightColor", "mainColor", "contentColor", "tipsColor", "whiteColor", "blackColor", "dividerColor", "maskColor", "shadowColor" ]); class ConfigProvider { constructor() { this.themesRef = vue.ref([]); this.currentThemeRef = vue.ref(null); this.darkModeRef = vue.ref(config.defaultDarkMode); this.cssVarsRef = vue.ref({}); this.localesRef = vue.ref([]); this.currentLocaleRef = vue.ref(null); this.baseColorTokens = DEFAULT_LIGHT_TOKENS; this.baseDarkColorTokens = DEFAULT_DARK_TOKENS; this.debug = false; this.systemDarkModeMediaQuery = null; this.lastAppliedCssKeys = []; this.interval = 0; this.initSystemDarkModeListener(); } /** * 初始化系统暗黑模式监听器 * 支持 H5、App、小程序等平台 */ initSystemDarkModeListener() { try { if (typeof window !== "undefined" && window.matchMedia) { this.systemDarkModeMediaQuery = window.matchMedia("(prefers-color-scheme: dark)"); const listener = () => { if (this.darkModeRef.value === "auto") { this.applyTheme(this.currentThemeRef.value); } }; if (this.systemDarkModeMediaQuery.addEventListener) { this.systemDarkModeMediaQuery.addEventListener("change", listener); } else if (this.systemDarkModeMediaQuery.addListener) { this.systemDarkModeMediaQuery.addListener(listener); } } } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:98", "[ConfigProvider] H5 system dark mode listener failed", e2); } try { if (typeof uni !== "undefined" && typeof uni.onThemeChange === "function") { uni.onThemeChange((res) => { formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:105", "[ConfigProvider] system theme changed", res); if (this.darkModeRef.value === "auto") { this.applyTheme(this.currentThemeRef.value); } }); } } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:113", "[ConfigProvider] uni-app system dark mode listener failed", e2); } this.initAppEvent(); } /** * App 平台事件监听 * 经测试 uni.onThemeChange 在 App 平台目前没生效,暂时只能通过定时检查 */ initAppEvent() { try { if (this.interval) clearInterval(this.interval); this.interval = setInterval(() => { if (this.darkModeRef.value === "auto") { this.applyTheme(this.currentThemeRef.value); } }, 5e3); } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:134", "[ConfigProvider] setInterval failed", e2); } } /** * 检测当前是否应该使用暗黑模式 */ isSystemDarkMode() { try { if (this.systemDarkModeMediaQuery) { return this.systemDarkModeMediaQuery.matches; } } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:147", "[ConfigProvider] matchMedia check failed", e2); } try { return getSystemDarkMode() === "dark"; } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:152", "[ConfigProvider] native system theme check failed", e2); return false; } } /** * 初始化主题系统 * @param themes 可用主题数组 * @param defaultTheme 可选默认主题名 */ initTheme(themes, defaultConfig, isForce) { const normalizedThemes = this.normalizeThemes(themes); if (!normalizedThemes.length) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:165", "[ConfigProvider] init called with empty themes"); return; } if (defaultConfig) { if (typeof defaultConfig === "string") { config.defaultTheme = defaultConfig || config.defaultTheme; } else if (typeof defaultConfig === "object") { const { defaultTheme, defaultDarkMode } = defaultConfig; config.defaultTheme = defaultTheme || config.defaultTheme; config.defaultDarkMode = defaultDarkMode || config.defaultDarkMode; } } this.themesRef.value = normalizedThemes.slice(); const saved = this.readStorage(THEME_STORAGE_KEY); let initialName = saved || config.defaultTheme || this.themesRef.value[0].name; if (isForce && config.defaultTheme) initialName = config.defaultTheme; let found = this.themesRef.value.find((t2) => t2.name === initialName); if (!found) found = this.themesRef.value.find((t2) => t2.name === config.defaultTheme); if (!found) found = this.themesRef.value[0]; this.currentThemeRef.value = found; this.initDarkMode(config.defaultDarkMode, isForce); this.applyTheme(found); if (this.debug) formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:201", "[ConfigProvider] initialized, theme=", found.name, "darkMode=", this.darkModeRef.value); return this; } /** * 初始化暗黑模式设置 * @param darkMode */ initDarkMode(darkMode, isForce) { const savedDarkMode = this.readStorage(DARK_MODE_STORAGE_KEY); let darkModeValue = savedDarkMode || darkMode || config.defaultDarkMode; if (isForce && darkMode) darkModeValue = darkMode; this.darkModeRef.value = darkModeValue; } /** * 初始化国际化数据 * @param locales 可选的 locale 列表(对象数组,包含 name 字段) * @param defaultLocaleName 可选默认 locale 名称 */ initLocales(locales, defaultLocaleName, isForce) { const normalized = this.normalizeLocales(locales); if (!normalized.length) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:226", "[ConfigProvider] initLocales called with empty locales"); return; } this.localesRef.value = normalized.slice(); const saved = this.readStorage(LOCALE_STORAGE_KEY); let initialName = saved || defaultLocaleName || config.defaultLocale; if (isForce && defaultLocaleName) initialName = defaultLocaleName; let found = this.localesRef.value.find((l2) => l2.name === initialName); if (!found) found = this.localesRef.value.find((l2) => l2.name === config.defaultLocale); if (!found) found = this.localesRef.value[0]; this.currentLocaleRef.value = found; if (this.debug) formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:244", "[ConfigProvider] locales initialized, locale=", found == null ? void 0 : found.name); return this; } /** * 归一化 locale 配置,保证始终至少有一个默认 locale */ normalizeLocales(locales) { let builtinList = []; try { builtinList = Object.values(localePack || {}).filter((v2) => v2 && typeof v2 === "object"); } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:258", "[ConfigProvider] normalizeLocales read builtin failed", e2); } if (!Array.isArray(locales) || !locales.length) { return builtinList.slice(); } const map = /* @__PURE__ */ new Map(); builtinList.forEach((item) => { if (item && item.name) { map.set(item.name, { ...item || {} }); } }); locales.forEach((loc) => { if (!loc || !loc.name) return; const existing = map.get(loc.name); if (!existing) { map.set(loc.name, { ...loc || {} }); return; } const merged = { ...existing }; Object.keys(loc).forEach((k) => { const v2 = loc[k]; if (v2 != null && typeof v2 === "object" && !Array.isArray(v2) && typeof merged[k] === "object") { merged[k] = { ...merged[k] || {}, ...v2 || {} }; } else { merged[k] = v2; } }); map.set(loc.name, merged); }); return Array.from(map.values()); } /** * 获取所有可用 locale */ getLocales() { return this.localesRef.value.slice(); } /** * 获取当前 locale 对象 */ getCurrentLocale() { return this.currentLocaleRef.value; } /** * 切换 locale 并持久化 */ setLocale(localeName) { if (!this.localesRef.value || this.localesRef.value.length === 0) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:318", "[ConfigProvider] setLocale called but locales list empty"); return; } const locale = this.localesRef.value.find((l2) => l2.name === localeName); if (!locale) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:323", "[ConfigProvider] locale not found:", localeName); return; } this.currentLocaleRef.value = locale; this.writeStorage(LOCALE_STORAGE_KEY, localeName); if (this.debug) formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:328", "[ConfigProvider] setLocale ->", localeName); } /** * 翻译函数 * 支持 key 路径,例如 'calendar.placeholder' * replacements 支持数组或对象替换占位符 {0} 或 {name} */ t(key, replacements, localeName) { try { if (!Array.isArray(this.localesRef.value) || this.localesRef.value.length === 0) { this.initLocales(); } } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:343", "[ConfigProvider] lazy initLocales failed", e2); } const localeObj = localeName && this.localesRef.value.find((l2) => l2.name === localeName) || this.currentLocaleRef.value; if (!localeObj) return key; const parts = key.split("."); let cur = localeObj; for (let i2 = 0; i2 < parts.length; i2++) { if (cur == null) break; cur = cur[parts[i2]]; } let text = typeof cur === "string" ? cur : key; if (replacements != null) { if (Array.isArray(replacements)) { replacements.forEach((val, idx) => { text = text.split(`{${idx}}`).join(String(val)); }); } else if (typeof replacements === "object") { Object.keys(replacements).forEach((k) => { text = text.split(`{${k}}`).join(String(replacements[k])); }); } } return text; } /** * 获取所有可用主题 */ getThemes() { return this.themesRef.value.slice(); } /** * 获取当前主题 */ getCurrentTheme() { return this.currentThemeRef.value; } /** * 切换主题并持久化 */ setTheme(themeName) { if (!this.themesRef.value || this.themesRef.value.length === 0) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:389", "[ConfigProvider] setTheme called but themes list empty"); return; } const theme = this.themesRef.value.find((t2) => t2.name === themeName); if (!theme) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:395", "[ConfigProvider] theme not found:", themeName); return; } this.currentThemeRef.value = theme; this.applyTheme(theme); this.writeStorage(THEME_STORAGE_KEY, themeName); if (this.debug) formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:407", "[ConfigProvider] setTheme ->", themeName); } /** * 运行时更新当前主题颜色并应用(不持久化) * @param colors 主题颜色键值,支持部分更新 */ setThemeColor(colors) { if (!colors || Object.keys(colors).length === 0) return; if (!this.currentThemeRef.value) { formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:417", "[ConfigProvider] setThemeColor called but no current theme"); return; } const mode = this.getActiveMode(); if (mode === "dark") { const existing = this.currentThemeRef.value.darkColor || {}; this.currentThemeRef.value.darkColor = { ...existing, ...colors }; } else { const existing = this.currentThemeRef.value.color || {}; this.currentThemeRef.value.color = { ...existing, ...colors }; } this.applyTheme(this.currentThemeRef.value); if (this.debug) formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:440", "[ConfigProvider] setThemeColor ->", colors); } /** * 获取当前暗黑模式设置 */ getDarkMode() { return this.darkModeRef.value; } /** * 设置暗黑模式 * @param mode 'auto' (跟随系统) | 'light' (强制亮色) | 'dark' (强制暗黑) */ setDarkMode(mode) { this.darkModeRef.value = mode; this.writeStorage(DARK_MODE_STORAGE_KEY, mode); this.applyTheme(this.currentThemeRef.value); if (this.debug) formatAppLog("log", "at uni_modules/uview-pro/libs/util/config-provider.ts:462", "[ConfigProvider] setDarkMode ->", mode); } /** * 检查当前是否处于暗黑模式 */ isInDarkMode() { const mode = this.darkModeRef.value; if (mode === "dark") return true; if (mode === "light") return false; return this.isSystemDarkMode(); } /** * 归一化主题配置,保证始终至少有一个默认主题 */ normalizeThemes(themes) { if (Array.isArray(themes) && themes.length) { return this.mergeThemes(defaultThemes, themes); } return defaultThemes.slice(); } mergeThemes(...lists) { const map = /* @__PURE__ */ new Map(); lists.filter((list) => Array.isArray(list) && list.length > 0).forEach((list) => { list.forEach((theme) => { const normalized = this.ensureDarkVariant({ ...theme, color: this.applyColorFallbacks(theme.color), darkColor: theme.darkColor ? { ...theme.darkColor } : void 0, css: theme.css ? { ...theme.css } : void 0, darkCss: theme.darkCss ? { ...theme.darkCss } : void 0 }); map.set(normalized.name, normalized); }); }); return Array.from(map.values()); } ensureDarkVariant(theme) { const finalDark = this.buildDarkPalette(theme); return { ...theme, darkColor: this.applyDarkFallbacks(finalDark) }; } buildDarkPalette(theme) { const provided = theme.darkColor || {}; const generated = this.generateDarkFromLight(theme.color || {}, provided); return { ...generated, ...provided }; } /** * 应用亮色主题 */ applyColorFallbacks(color2) { return { ...this.baseColorTokens || {}, ...color2 || {} }; } /** * 应用暗黑主题 */ applyDarkFallbacks(color2) { return { ...this.baseDarkColorTokens || {}, ...color2 || {} }; } filterNonStructuralTokens(palette) { const result = {}; Object.entries(palette || {}).forEach(([key, value]) => { if (!this.isStructuralToken(key)) { result[key] = value; } }); return result; } generateDarkFromLight(palette, provided) { const result = {}; const nonStructural = this.filterNonStructuralTokens(palette); Object.entries(nonStructural).forEach(([key, value]) => { var _a2; if (typeof value !== "string") return; if (provided && Object.prototype.hasOwnProperty.call(provided, key)) { return; } const fallback = (_a2 = this.baseDarkColorTokens) == null ? void 0 : _a2[key]; result[key] = this.createDarkVariantFromLight(value, fallback); }); return result; } createDarkVariantFromLight(color2, fallback) { const normalized = this.normalizeHex(color2); const fallbackHex = fallback ? this.normalizeHex(fallback) : null; if (normalized && fallbackHex) { return this.mixHex(normalized, fallbackHex, 0.6); } if (fallbackHex) return fallbackHex; return normalized || color2; } normalizeHex(color2) { if (!color2) return null; const hex = color2.trim(); if (/^#([0-9a-fA-F]{6})$/.test(hex)) return hex.toLowerCase(); return null; } mixHex(fromHex, toHex, ratio) { const from = this.hexToRgb(fromHex); const to = this.hexToRgb(toHex); if (!from || !to) return toHex; const clamp = (val) => Math.min(255, Math.max(0, Math.round(val))); const r2 = clamp(from.r * (1 - ratio) + to.r * ratio); const g2 = clamp(from.g * (1 - ratio) + to.g * ratio); const b2 = clamp(from.b * (1 - ratio) + to.b * ratio); return this.rgbToHex(r2, g2, b2); } hexToRgb(hex) { const match = /^#([0-9a-fA-F]{6})$/.exec(hex); if (!match) return null; return { r: parseInt(match[1].slice(0, 2), 16), g: parseInt(match[1].slice(2, 4), 16), b: parseInt(match[1].slice(4, 6), 16) }; } rgbToHex(r2, g2, b2) { const toHex = (val) => val.toString(16).padStart(2, "0"); return `#${toHex(r2)}${toHex(g2)}${toHex(b2)}`; } isStructuralToken(token) { return STRUCTURAL_TOKENS.has(token); } /** * 运行时同步主题颜色($u.color) * 更新响应式 color 对象,确保所有使用 $u.color 的地方都能响应式更新 */ syncRuntimeTheme(palette) { var _a2; try { const defaultPalette = this.getActiveMode() === "dark" ? this.baseDarkColorTokens : this.baseColorTokens; const mergedPalette = { ...defaultPalette, ...palette }; Object.keys(mergedPalette).forEach((key) => { const value = mergedPalette[key]; if (value != null) { color$2[key] = value; } }); if (typeof uni !== "undefined" && ((_a2 = uni == null ? void 0 : uni.$u) == null ? void 0 : _a2.color)) { uni.$u.color = color$2; } } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:640", "[ConfigProvider] sync runtime theme failed", e2); } } /** * 获取当前激活的模式 */ getActiveMode() { return this.isInDarkMode() ? "dark" : "light"; } /** * 获取当前主题的配色方案 */ getPaletteForMode(theme, mode) { if (mode === "dark") { return theme.darkColor && Object.keys(theme.darkColor).length ? theme.darkColor : theme.color || {}; } return theme.color || {}; } /** * 获取当前主题的CSS变量覆盖 */ getCssOverrides(theme, mode) { if (mode === "dark") { return (theme.darkCss && Object.keys(theme.darkCss).length ? theme.darkCss : theme.css) || {}; } return theme.css || {}; } /** * 读取Storage key */ readStorage(key) { try { if (typeof uni === "undefined" || typeof uni.getStorageSync !== "function") return null; const value = uni.getStorageSync(key); return value ?? null; } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:680", "[ConfigProvider] failed to read storage", e2); return null; } } /** * 写入Storage key value */ writeStorage(key, value) { try { if (typeof uni === "undefined" || typeof uni.setStorageSync !== "function") return; uni.setStorageSync(key, value); } catch (e2) { if (this.debug) formatAppLog("warn", "at uni_modules/uview-pro/libs/util/config-provider.ts:693", "[ConfigProvider] failed to write storage", e2); } } /** * 更新文档主题模式 H5 */ updateDocumentMode(mode) { if (typeof document === "undefined" || !document.documentElement) return; const root = document.documentElement; root.dataset.uThemeMode = mode; root.classList.remove("u-theme-light", "u-theme-dark"); root.classList.add(`u-theme-${mode}`); } /** * 转换为 CSS 变量名称 */ toCssVarName(key, prefix = "--u") { const types = config.type; if (types.some((type) => key.startsWith(type))) { prefix += "-type"; } const kebab = key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(); return `${prefix}-${kebab}`; } /** * 添加 RGB 值 */ attachRgbVar(target, varName, value) { if (typeof value !== "string") return; const hex = value.startsWith("#") ? value.slice(1) : ""; if (!/^[0-9a-fA-F]{6}$/.test(hex)) return; const r2 = parseInt(hex.slice(0, 2), 16); const g2 = parseInt(hex.slice(2, 4), 16); const b2 = parseInt(hex.slice(4, 6), 16); target[`${varName}-rgb`] = `${r2}, ${g2}, ${b2}`; } /** * 构建 CSS 变量映射表 * 生成格式: */ buildCssVarMap(theme, mode) { const map = { "--u-theme-mode": mode }; const palette = this.getPaletteForMode(theme, mode); const cssOverrides = this.getCssOverrides(theme, mode); const applyEntry = (key, value) => { if (value == null) return; const strValue = String(value); if (key.startsWith("--")) { map[key] = strValue; this.attachRgbVar(map, key, strValue); return; } const cssVarName = this.toCssVarName(key); map[cssVarName] = strValue; this.attachRgbVar(map, cssVarName, strValue); }; Object.entries(palette || {}).forEach(([key, value]) => applyEntry(key, value)); Object.entries(cssOverrides || {}).forEach(([key, value]) => applyEntry(key, value)); return map; } /** * 刷新 CSS 变量 H5 */ flushCssVars(vars) { if (typeof document === "undefined" || !document.documentElement) return; const root = document.documentElement; this.lastAppliedCssKeys.forEach((key) => { root.style.removeProperty(key); }); Object.entries(vars).forEach(([key, value]) => { root.style.setProperty(key, value); }); this.lastAppliedCssKeys = Object.keys(vars); } /** * 将主题应用到运行时: * - 1) 调用 uni.$u.setColor(theme.color) 如果存在 * - 2) 在 H5 环境中,将 css map 注入到 document.documentElement 的 CSS 变量中 * - 3) 支持暗黑模式:根据 darkColor 或 color 应用相应的颜色 */ applyTheme(theme) { if (!theme) return; const mode = this.getActiveMode(); const palette = this.getPaletteForMode(theme, mode); this.syncRuntimeTheme(palette); const cssVarMap = this.buildCssVarMap(theme, mode); this.cssVarsRef.value = cssVarMap; this.flushCssVars(cssVarMap); this.updateDocumentMode(mode); } } const configProvider = new ConfigProvider(); function getColor(name) { if (color$2[name]) { return color$2[name]; } return lightPalette[name] || ""; } function setColor(theme) { if (theme) { configProvider.setThemeColor(theme); } } function type2icon(type = "success", fill = false) { if (!["primary", "info", "error", "warning", "success"].includes(type)) type = "success"; let iconName = ""; switch (type) { case "primary": iconName = "info-circle"; break; case "info": iconName = "info-circle"; break; case "error": iconName = "close-circle"; break; case "warning": iconName = "error-circle"; break; case "success": iconName = "checkmark-circle"; break; default: iconName = "checkmark-circle"; } if (fill) iconName += "-fill"; return iconName; } function randomArray(array2 = []) { return array2.sort(() => Math.random() - 0.5); } function deepClone(obj, cache = /* @__PURE__ */ new WeakMap()) { if (obj === null || typeof obj !== "object") return obj; if (cache.has(obj)) return cache.get(obj); let clone; if (obj instanceof Date) { clone = new Date(obj.getTime()); } else if (obj instanceof RegExp) { clone = new RegExp(obj); } else if (obj instanceof Map) { clone = new Map(Array.from(obj, ([key, value]) => [key, deepClone(value, cache)])); } else if (obj instanceof Set) { clone = new Set(Array.from(obj, (value) => deepClone(value, cache))); } else if (Array.isArray(obj)) { clone = obj.map((value) => deepClone(value, cache)); } else if (Object.prototype.toString.call(obj) === "[object Object]") { clone = Object.create(Object.getPrototypeOf(obj)); cache.set(obj, clone); for (const [key, value] of Object.entries(obj)) { clone[key] = deepClone(value, cache); } } else { clone = Object.assign({}, obj); } cache.set(obj, clone); return clone; } function deepMerge(target = {}, source = {}) { target = deepClone(target); if (typeof target !== "object" || target === null || typeof source !== "object" || source === null) return target; const merged = Array.isArray(target) ? target.slice() : Object.assign({}, target); for (const prop in source) { if (!Object.prototype.hasOwnProperty.call(source, prop)) continue; const sourceValue = source[prop]; const targetValue = merged[prop]; if (sourceValue instanceof Date) { merged[prop] = new Date(sourceValue); } else if (sourceValue instanceof RegExp) { merged[prop] = new RegExp(sourceValue); } else if (sourceValue instanceof Map) { merged[prop] = new Map(sourceValue); } else if (sourceValue instanceof Set) { merged[prop] = new Set(sourceValue); } else if (typeof sourceValue === "object" && sourceValue !== null) { merged[prop] = deepMerge(targetValue, sourceValue); } else { merged[prop] = sourceValue; } } return merged; } function email(value) { return /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/.test( value ); } function mobile(value) { return /^1[3-9]\d{9}$/.test(value); } function url(value) { return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value); } function date(value) { return !/Invalid|NaN/.test(new Date(value).toString()); } function dateISO(value) { return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value); } function number(value) { return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(value); } function digits(value) { return /^\d+$/.test(value); } function idCard(value) { return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value); } function carNo(value) { const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/; const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/; if (value.length === 7) { return creg.test(value); } else if (value.length === 8) { return xreg.test(value); } else { return false; } } function amount(value) { return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value); } function chinese(value) { let reg = /^[\u4e00-\u9fa5]+$/gi; return reg.test(value); } function letter(value) { return /^[a-zA-Z]*$/.test(value); } function enOrNum(value) { let reg = /^[0-9a-zA-Z]*$/g; return reg.test(value); } function contains(value, param) { return value.indexOf(param) >= 0; } function range(value, param) { return value >= param[0] && value <= param[1]; } function rangeLength(value, param) { return value.length >= param[0] && value.length <= param[1]; } function landline(value) { let reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/; return reg.test(value); } function empty(value) { switch (typeof value) { case "undefined": return true; case "string": if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, "").length == 0) return true; break; case "boolean": if (!value) return true; break; case "number": if (0 === value || isNaN(value)) return true; break; case "object": if (null === value || value.length === 0) return true; for (var i2 in value) { return false; } return true; } return false; } function jsonString(value) { if (typeof value == "string") { try { var obj = JSON.parse(value); if (typeof obj == "object" && obj) { return true; } else { return false; } } catch (e2) { return false; } } return false; } function array(value) { if (typeof Array.isArray === "function") { return Array.isArray(value); } else { return Object.prototype.toString.call(value) === "[object Array]"; } } function object(value) { return Object.prototype.toString.call(value) === "[object Object]"; } function code(value, len = 6) { return new RegExp(`^\\d{${len}}$`).test(value); } function func(value) { return typeof value === "function"; } function promise(value) { return object(value) && func(value.then) && func(value.catch); } function image(value) { const newValue = value.split("?")[0]; const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; return IMAGE_REGEXP.test(newValue); } function video(value) { const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i; return VIDEO_REGEXP.test(value); } function regExp(o2) { return o2 && Object.prototype.toString.call(o2) === "[object RegExp]"; } function string(value) { return typeof value === "string"; } const test = { email, mobile, url, date, dateISO, number, digits, idCard, carNo, amount, chinese, letter, enOrNum, contains, range, rangeLength, empty, isEmpty: empty, jsonString, landline, object, array, code, func, promise, video, image, regExp, string }; function addUnit(value = "auto", unit = "rpx") { const strValue = String(value); if (!strValue) return ""; if (strValue === "auto") return strValue; if (strValue.includes(" ")) { return strValue.split(" ").map((s2) => { if (s2 === "auto" || /^-?\d*\.?\d+(%|px|rpx|em|rem|vh|vw)$/.test(s2)) return s2; return test.number(s2) ? `${s2}${unit}` : s2; }).join(" "); } if (/^-?\d*\.?\d+(%|px|rpx|em|rem|vh|vw)$/.test(strValue)) return strValue; return test.number(strValue) ? `${strValue}${unit}` : strValue; } function random(min, max) { if (min >= 0 && max > 0 && max >= min) { const gab = max - min + 1; return Math.floor(Math.random() * gab + min); } else { return 0; } } function trim(str, pos = "both") { if (pos === "both") { return str.replace(/^\s+|\s+$/g, ""); } else if (pos === "left") { return str.replace(/^\s*/, ""); } else if (pos === "right") { return str.replace(/(\s*$)/g, ""); } else if (pos === "all") { return str.replace(/\s+/g, ""); } else { return str; } } function toast(title, option = 1500) { uni.showToast({ title, icon: typeof option === "string" ? option : typeof option === "object" ? option.icon || "none" : "none", duration: typeof option === "number" ? option : typeof option === "object" ? option.duration || "1500" : 1500 }); } function getParent(name, keys) { var _a2; let parent = this.$parent; while (parent) { if (((_a2 = parent.$options) == null ? void 0 : _a2.name) !== name) { parent = parent.$parent; } else { const data = {}; if (Array.isArray(keys)) { keys.forEach((val) => { data[val] = (parent == null ? void 0 : parent[val]) ? parent[val] : ""; }); } else { for (const i2 in keys) { if (Array.isArray(keys[i2])) { if (keys[i2].length) { data[i2] = keys[i2]; } else { data[i2] = parent[i2]; } } else if (keys[i2] && keys[i2].constructor === Object) { if (Object.keys(keys[i2]).length) { data[i2] = keys[i2]; } else { data[i2] = parent[i2]; } } else { data[i2] = keys[i2] || keys[i2] === false ? keys[i2] : parent[i2]; } } } return data; } } return {}; } function $parent(componentName, _instance = null) { var _a2; const instance = _instance || vue.getCurrentInstance(); let parent = instance && instance.parent; if (!componentName) return parent; while (parent) { const name = (_a2 = parent.type) == null ? void 0 : _a2.name; if (name === componentName) { return parent; } parent = parent.parent; } return null; } function os$1() { return uni.getSystemInfoSync().platform; } function sys() { return uni.getSystemInfoSync(); } let timeout = null; function debounce(func2, wait = 500, immediate = false) { if (timeout !== null) clearTimeout(timeout); if (immediate) { const callNow = !timeout; timeout = setTimeout(() => { timeout = null; }, wait); if (callNow) typeof func2 === "function" && func2(); } else { timeout = setTimeout(() => { typeof func2 === "function" && func2(); }, wait); } } let flag; function throttle(func2, wait = 500, immediate = true) { if (immediate) { if (!flag) { flag = true; typeof func2 === "function" && func2(); setTimeout(() => { flag = false; }, wait); } } else { if (!flag) { flag = true; setTimeout(() => { flag = false; typeof func2 === "function" && func2(); }, wait); } } } function getRect(selector, _instance = null, all = false) { const instance = _instance || vue.getCurrentInstance(); return new Promise((resolve) => { uni.createSelectorQuery().in(instance == null ? void 0 : instance.proxy)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => { if (all && Array.isArray(rect) && rect.length) { resolve(rect); } if (!all && rect) { resolve(rect); } }).exec(); }); } function UniCopy(text, config2) { const opt = Object.assign({ data: text }, config2); uni.setClipboardData(opt); } function clipboard(content, options) { const text = String(content); const defaultOpt = { showToast: true, success: () => { }, fail: () => { }, complete: () => { } }; const config2 = Object.assign(defaultOpt, options); UniCopy(text, config2); } const zIndex = { toast: 10090, noNetwork: 10080, // popup包含popup,actionSheet,keyboard,picker的值 popup: 10075, mask: 10070, navbar: 980, topTips: 975, sticky: 970, indexListSticky: 965, tabbar: 998 }; function mitt(all) { all = all || /* @__PURE__ */ new Map(); return { /** * A Map of event names to registered handler functions. */ all, /** * Register an event handler for the given type. * @param {string|symbol} type Type of event to listen for, or `'*'` for all events * @param {Function} handler Function to call in response to given event * @memberOf mitt */ on(type, handler) { const handlers = all.get(type); if (handlers) { handlers.push(handler); } else { all.set(type, [handler]); } }, /** * Remove an event handler for the given type. * If `handler` is omitted, all handlers of the given type are removed. * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler) * @param {Function} [handler] Handler function to remove * @memberOf mitt */ off(type, handler) { const handlers = all.get(type); if (handlers) { if (handler) { handlers.splice(handlers.indexOf(handler) >>> 0, 1); } else { all.set(type, []); } } }, /** * Invoke all handlers for the given type. * If present, `'*'` handlers are invoked after type-matched handlers. * * Note: Manually firing '*' handlers is not supported. * * @param {string|symbol} type The event type to invoke * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler * @memberOf mitt */ emit(type, evt) { let handlers = all.get(type); if (handlers) { [...handlers].forEach((handler) => { handler(evt); }); } handlers = all.get("*"); if (handlers) { [...handlers].forEach((handler) => { handler(type, evt); }); } }, /** * Clear all */ clear() { this.all.clear(); } }; } const IGNORE_REQUEST_KEYS = ["baseUrl", "meta"]; class Request { constructor() { this.config = { baseUrl: "", // 请求的根域名 header: {}, // 默认的请求头 method: "POST", // 请求方式 dataType: "json", // 设置为json,返回后uni.request会对数据进行一次JSON.parse responseType: "text", // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可 timeout: 6e4, meta: { originalData: true, // 是否在拦截器中返回服务端的原始数据,见文档说明 toast: false, // 是否在请求出错时,弹出toast loading: false // 是否显示加载中 } }; this.interceptor = { request: null, response: null }; } /** * 将全局配置合并到本次请求的 options 中 * - 忽略 IGNORE_REQUEST_KEYS 中的字段(如 meta) * - 对 header 使用深合并(全局 header 为默认,options.header 优先) * - 对对象类型的字段尝试深合并,基础类型以 options 值优先 * - 处理 baseUrl:若存在全局 baseUrl 且 options.url 非完整 url(非 http 开头),则合并成完整 URL */ mergeGlobalConfigToOptions(options) { const mergedOptions = { ...options }; for (const key of Object.keys(this.config)) { if (IGNORE_REQUEST_KEYS.includes(key)) { continue; } const cfgVal = this.config[key]; const optVal = options[key]; if (cfgVal === void 0) continue; if (key === "header") { mergedOptions.header = deepMerge(cfgVal || {}, optVal || {}); continue; } if (typeof cfgVal === "string" || typeof cfgVal === "number" || typeof cfgVal === "boolean") { mergedOptions[key] = optVal !== void 0 ? optVal : cfgVal; continue; } if (typeof cfgVal === "object" && !Array.isArray(cfgVal)) { mergedOptions[key] = deepMerge(cfgVal || {}, optVal || {}); continue; } if (optVal === void 0) { mergedOptions[key] = cfgVal; } } const baseUrl = this.config.baseUrl; if (baseUrl && mergedOptions.url && typeof mergedOptions.url === "string" && mergedOptions.url.indexOf("http") !== 0) { mergedOptions.url = baseUrl + (mergedOptions.url.indexOf("/") === 0 ? mergedOptions.url : `/${mergedOptions.url}`); } if (!mergedOptions.url) { mergedOptions.url = ""; } return mergedOptions; } /** * 设置全局默认配置 * @param customConfig 自定义配置 */ setConfig(customConfig) { this.config = deepMerge(this.config, customConfig); } /** * 主要请求部分 * @param options 请求参数 */ request(options) { const mergedMeta = { ...this.config.meta, ...options.meta || {} }; options.meta = mergedMeta; options.url = options.url || ""; options.params = options.params || {}; options = this.mergeGlobalConfigToOptions(options); if (this.interceptor.request && typeof this.interceptor.request === "function") { const interceptorRequest = this.interceptor.request(options); if (!interceptorRequest) { return new Promise(() => { }); } this.options = interceptorRequest; } return new Promise((resolve, reject) => { options.complete = (response) => { const meta = options.meta || this.config.meta || {}; const originalData = meta.originalData ?? false; response.config = options; if (originalData) { if (this.interceptor.response && typeof this.interceptor.response === "function") { const resInterceptors = this.interceptor.response(response); if (resInterceptors !== false) { resolve(resInterceptors); } else { reject(response); } } else { resolve(response); } } else { if (response.statusCode === 200) { if (this.interceptor.response && typeof this.interceptor.response === "function") { const resInterceptors = this.interceptor.response(response.data); if (resInterceptors !== false) { resolve(resInterceptors); } else { reject(response.data); } } else { resolve(response.data); } } else { reject(response); } } }; uni.request(options); }); } get(url2, data = {}, options = {}) { return this.request({ method: "GET", url: url2, data, header: options.header || {}, meta: options.meta }); } post(url2, data = {}, options = {}) { return this.request({ url: url2, method: "POST", data, header: options.header || {}, meta: options.meta }); } put(url2, data = {}, options = {}) { return this.request({ url: url2, method: "PUT", data, header: options.header || {}, meta: options.meta }); } delete(url2, data = {}, options = {}) { return this.request({ url: url2, method: "DELETE", data, header: options.header || {}, meta: options.meta }); } } const httpInstance = new Request(); const originalConsole = { log: console.log, info: console.info, warn: console.warn, error: console.error, debug: console.debug, trace: console.trace, table: console.table, time: console.time, timeEnd: console.timeEnd, group: console.group, groupEnd: console.groupEnd, groupCollapsed: console.groupCollapsed, assert: console.assert, clear: console.clear, count: console.count, countReset: console.countReset }; Object.keys(originalConsole).forEach((key) => { const methodKey = key; if (!originalConsole[methodKey]) { originalConsole[methodKey] = () => { }; } }); class Logger { constructor() { this.debugMode = false; this.prefix = "[uViewPro]"; this.showCallerInfo = true; } /** * 设置调试模式 * @param enabled 是否启用调试模式 */ setDebugMode(enabled) { this.debugMode = !!enabled; if (this.debugMode) { formatAppLog("log", "at uni_modules/uview-pro/libs/util/logger.ts:64", "[uViewPro] Debug mode enabled"); } else { formatAppLog("log", "at uni_modules/uview-pro/libs/util/logger.ts:66", "[uViewPro] Debug mode disabled"); } return this; } /** * 设置是否显示调用者信息(文件名和行号) * @param show 是否显示调用者信息 */ setShowCallerInfo(show) { this.showCallerInfo = !!show; return this; } /** * 设置日志前缀 * @param prefix 日志前缀 */ setPrefix(prefix) { if (prefix) this.prefix = prefix; return this; } /** * 获取当前调试模式状态 * @returns 当前调试模式状态 */ getDebugMode() { return this.debugMode; } /** * 从文件路径中提取纯净的文件名(去除查询参数和路径) * @param filePath 文件路径 * @returns 纯净的文件名 */ extractFileName(filePath) { if (!filePath) return ""; const withoutQuery = filePath.split("?")[0]; const parts = withoutQuery.split(/[/\\]/); const fileNameWithExt = parts.pop() || ""; return fileNameWithExt; } /** * 获取调用者信息(文件名和行号) * @returns 调用者信息字符串 */ getCallerInfo() { if (!this.showCallerInfo) return ""; try { const error = new Error(); const stack = error.stack; if (!stack) return ""; const stackLines = stack.split("\n"); for (let i2 = 3; i2 < stackLines.length; i2++) { const line = stackLines[i2].trim(); if (line && !line.includes("logger.ts") && !line.includes("Logger.") && !line.includes("at Object.")) { const match = line.match(/\(?(.*):(\d+):(\d+)\)?/); if (match) { const filePath = match[1]; const lineNumber = match[2]; const fileName = this.extractFileName(filePath); return `[${fileName}:${lineNumber}]`; } break; } } } catch (e2) { } return ""; } /** * 通用日志输出方法 * @param level 日志级别 * @param args 日志参数 */ output(level, ...args) { if (!this.debugMode || !originalConsole[level]) return; const method = originalConsole[level]; const callerInfo = this.getCallerInfo(); if (this.prefix) { if (callerInfo) { method(`${this.prefix}${callerInfo}`, ...args); } else { method(this.prefix, ...args); } } else { if (callerInfo) { method(callerInfo, ...args); } else { method(...args); } } } /** * 普通日志 * @param args 日志参数 */ log(...args) { this.output("log", ...args); } /** * 信息日志 * @param args 日志参数 */ info(...args) { this.output("info", ...args); } /** * 警告日志 * @param args 日志参数 */ warn(...args) { this.output("warn", ...args); } /** * 错误日志 * @param args 日志参数 */ error(...args) { this.output("error", ...args); } /** * 调试日志 * @param args 日志参数 */ debug(...args) { if (!originalConsole.debug) return; this.output("debug", ...args); } /** * 堆栈跟踪 * @param args 日志参数 */ trace(...args) { if (!originalConsole.trace) return; this.output("trace", ...args); } /** * 表格输出 * @param data 表格数据 * @param columns 列名(可选) */ table(data, columns) { if (!this.debugMode || !originalConsole.table) return; if (this.prefix) { originalConsole.log(this.prefix); } originalConsole.table(data, columns); } /** * 开始计时 * @param label 计时器标签 */ time(label) { if (!this.debugMode || !originalConsole.time) return; const fullLabel = this.prefix ? `${this.prefix} ${label}` : label; originalConsole.time(fullLabel); } /** * 结束计时 * @param label 计时器标签 */ timeEnd(label) { if (!this.debugMode || !originalConsole.timeEnd) return; const fullLabel = this.prefix ? `${this.prefix} ${label}` : label; originalConsole.timeEnd(fullLabel); } /** * 分组日志 * @param label 分组标签 */ group(label) { if (!this.debugMode || !originalConsole.group) return; const fullLabel = this.prefix ? `${this.prefix} ${label}` : label; originalConsole.group(fullLabel); } /** * 结束分组 */ groupEnd() { if (!this.debugMode || !originalConsole.groupEnd) return; originalConsole.groupEnd(); } /** * 分组日志(默认折叠) * @param label 分组标签 */ groupCollapsed(label) { if (!this.debugMode || !originalConsole.groupCollapsed) return; const fullLabel = this.prefix ? `${this.prefix} ${label}` : label; originalConsole.groupCollapsed(fullLabel); } /** * 断言 * @param condition 条件 * @param message 错误消息 */ assert(condition, ...message) { if (!this.debugMode || !originalConsole.assert) return; if (this.prefix) { originalConsole.assert(condition, this.prefix, ...message); } else { originalConsole.assert(condition, ...message); } } /** * 清空控制台 */ clear() { if (!this.debugMode || !originalConsole.clear) return; originalConsole.clear(); } /** * 计数器 * @param label 计数器标签 */ count(label) { if (!this.debugMode || !originalConsole.count) return; const fullLabel = this.prefix && label ? `${this.prefix} ${label}` : label || this.prefix; originalConsole.count(fullLabel); } /** * 重置计数器 * @param label 计数器标签 */ countReset(label) { if (!this.debugMode || !originalConsole.countReset) return; const fullLabel = this.prefix && label ? `${this.prefix} ${label}` : label || this.prefix; originalConsole.countReset(fullLabel); } /** * 带样式的日志 * @param style CSS样式 * @param message 消息内容 */ styled(style, message) { if (!this.debugMode) return; const callerInfo = this.getCallerInfo(); const fullMessage = callerInfo ? `${message} ${callerInfo}` : message; if (this.prefix) { formatAppLog("log", "at uni_modules/uview-pro/libs/util/logger.ts:353", `%c${this.prefix} ${fullMessage}`, style); } else { formatAppLog("log", "at uni_modules/uview-pro/libs/util/logger.ts:355", `%c${fullMessage}`, style); } } } const logger = new Logger(); const PARENT_CONTEXT_SYMBOL = Symbol("parent_context"); function generateInstanceId(componentName) { return `${componentName}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`; } function findParentInstance(name, instance) { var _a2, _b2; if (!instance) return null; let parent = instance.parent; while (parent) { const parentName = ((_a2 = parent.type) == null ? void 0 : _a2.name) || ((_b2 = parent.type) == null ? void 0 : _b2.__name); if (parentName === name) { return parent; } parent = parent.parent; } return null; } function getParentContext(name, instance) { var _a2; const parentInstance = findParentInstance(name, instance); return ((_a2 = parentInstance == null ? void 0 : parentInstance.proxy) == null ? void 0 : _a2[PARENT_CONTEXT_SYMBOL]) || null; } function findAllChildComponents(componentName, instance) { const components = []; function traverse(currentInstance) { var _a2; if (!(currentInstance == null ? void 0 : currentInstance.subTree)) return; const subTree = ((_a2 = currentInstance.subTree) == null ? void 0 : _a2.children) || []; const children = Array.isArray(subTree) ? subTree : [subTree]; children.forEach((vnode) => { var _a3, _b2; const child = vnode.component; if (!child) return; const name = ((_a3 = child.type) == null ? void 0 : _a3.name) || ((_b2 = child.type) == null ? void 0 : _b2.__name); if (name === componentName) { components.push(child); } traverse(child); }); } traverse(instance); logger.log(`Found ${components.length} ${componentName} components`); return components; } function useParent(componentName) { const instance = vue.getCurrentInstance(); if (!instance) { throw new Error("useParent must be called within setup function"); } const name = componentName || instance.type.name || instance.type.__name; if (!name) { throw new Error("Component name is required for useParent"); } const children = vue.reactive([]); const childrenMap = /* @__PURE__ */ new Map(); const broadcast = (event, data, childIds) => { const targetChildren = childIds ? (Array.isArray(childIds) ? childIds : [childIds]).map((id) => childrenMap.get(id)).filter(Boolean) : Array.from(childrenMap.values()); logger.log(`Parent ${name} broadcasting event: ${event} to ${targetChildren.length} children`); targetChildren.forEach((child) => { const exposed = child.getExposed(); if (exposed && typeof exposed[event] === "function") { try { exposed[event](data); } catch (error) { logger.warn(`Error calling child method ${event}:`, error); } } }); }; const broadcastToChildren = (componentName2, event, data) => { logger.log(`Parent ${name} broadcasting event: ${event} to all ${componentName2} components`); const childComponents = findAllChildComponents(componentName2, instance); let successCount = 0; childComponents.forEach((childComponent) => { const exposed = childComponent.exposed || childComponent.proxy; if (exposed && typeof exposed[event] === "function") { try { exposed[event](data); successCount++; } catch (error) { logger.warn(`Error calling ${componentName2} method ${event}:`, error); } } }); logger.log( `Parent ${name} successfully called ${successCount} of ${childComponents.length} ${componentName2} components` ); }; const parentContext = { name, addChild(child) { if (!childrenMap.has(child.id)) { childrenMap.set(child.id, child); children.push(child); logger.log(`Parent ${name} added child: ${child.name}`); } }, removeChild(childId) { if (childrenMap.has(childId)) { childrenMap.get(childId); childrenMap.delete(childId); const index = children.findIndex((c2) => c2.id === childId); if (index > -1) children.splice(index, 1); logger.log(`Parent ${name} removed child: ${childId}`); } }, broadcast, broadcastToChildren, getChildren: () => Array.from(childrenMap.values()), getExposed: () => instance.exposed || {}, getChildExposed(childId) { var _a2; const child = childrenMap.get(childId); return ((_a2 = child == null ? void 0 : child.getExposed) == null ? void 0 : _a2.call(child)) || {}; }, getChildrenExposed() { return Array.from(childrenMap.values()).filter((child) => child.getExposed).map((child) => ({ id: child.id, name: child.name, exposed: child.getExposed() })).filter((item) => Object.keys(item.exposed).length > 0); }, getInstance: () => instance }; if (instance.proxy) { instance.proxy[PARENT_CONTEXT_SYMBOL] = parentContext; } vue.onUnmounted(() => { childrenMap.forEach((_2, childId) => parentContext.removeChild(childId)); if (instance.proxy) { delete instance.proxy[PARENT_CONTEXT_SYMBOL]; } logger.log(`Parent ${name} unmounted and cleaned up`); }); return { parentName: name, children, broadcast, broadcastToChildren, getChildren: parentContext.getChildren, getChildExposed: parentContext.getChildExposed, getChildrenExposed: parentContext.getChildrenExposed, getExposed: parentContext.getExposed, getInstance: parentContext.getInstance }; } function useChildren(componentName, parentName) { const instance = vue.getCurrentInstance(); if (!instance) { throw new Error("useChildren must be called within setup function"); } const name = componentName || instance.type.name || instance.type.__name; const instanceId = generateInstanceId(name || "anonymous"); const parentRef = vue.ref(null); const parentExposed = vue.ref({}); const createSimulatedParentContext = (parentInstance) => { var _a2, _b2; return { name: ((_a2 = parentInstance == null ? void 0 : parentInstance.type) == null ? void 0 : _a2.name) || ((_b2 = parentInstance == null ? void 0 : parentInstance.type) == null ? void 0 : _b2.__name) || "unknown", addChild: () => logger.log("Simulated parent added child"), removeChild: () => logger.log("Simulated parent removed child"), broadcast: () => logger.log("Simulated parent broadcasting"), broadcastToChildren: () => logger.log("Simulated parent broadcasting to children"), getChildren: () => [], getExposed: () => (parentInstance == null ? void 0 : parentInstance.exposed) || {}, getChildExposed: () => ({}), getChildrenExposed: () => [], getInstance: () => parentInstance }; }; const getParentExposed = () => { if (parentRef.value) { const exposed = parentRef.value.getExposed(); parentExposed.value = exposed; return exposed; } return {}; }; const getExposed = () => instance.exposed || {}; const findParent = () => { var _a2; if (parentName) { const parentContext = getParentContext(parentName, instance); if (parentContext) { if (!parentContext.getInstance) { parentContext.getInstance = () => findParentInstance(parentName, instance); } return parentContext; } const parentInstance = findParentInstance(parentName, instance); if (parentInstance) { return createSimulatedParentContext(parentInstance); } } let current = instance.parent; while (current) { const context = (_a2 = current.proxy) == null ? void 0 : _a2[PARENT_CONTEXT_SYMBOL]; if (context) { if (!context.getInstance) { context.getInstance = () => current; } return context; } current = current.parent; } return instance.parent ? createSimulatedParentContext(instance.parent) : null; }; const linkParent = () => { const parent = findParent(); if (parent) { parentRef.value = parent; if (parent.addChild && childContext) { parent.addChild(childContext); } getParentExposed(); logger.log(`Child ${name || "anonymous"} linked to parent ${parent.name}`); return true; } logger.log(`Child ${name || "anonymous"} no parent found, working in standalone mode`); return false; }; const emitToParent = (event, data) => { if (parentRef.value) { const exposed = getParentExposed(); if (exposed && typeof exposed[event] === "function") { try { exposed[event](data, instanceId, name); } catch (error) { logger.warn(`Error calling parent method ${event}:`, error); } } } }; const getChildIndex = () => { if (!parentRef.value) return -1; try { const children = parentRef.value.getChildren(); return children.findIndex((child) => child.id === instanceId); } catch (error) { return -1; } }; const childContext = { id: instanceId, name: name || "anonymous", getChildIndex, emitToParent, getParentExposed, getInstance: () => instance, getExposed }; logger.log(`Child ${name || "anonymous"} registered, looking for parent`); vue.onMounted(() => { let connected = linkParent(); vue.nextTick(() => { connected = linkParent(); if (!connected) { setTimeout(linkParent, 500); } }); }); vue.onUnmounted(() => { var _a2; if ((_a2 = parentRef.value) == null ? void 0 : _a2.removeChild) { parentRef.value.removeChild(instanceId); } logger.log(`Child ${name || "anonymous"} unmounted`); }); return { childId: instanceId, childName: name || "anonymous", childIndex: vue.computed(getChildIndex), parent: parentRef, emitToParent, getParentExposed, parentExposed: vue.computed(() => parentExposed.value), getExposed }; } configProvider.themesRef; configProvider.currentThemeRef; configProvider.darkModeRef; function initTheme(themes, defaultConfig, isForce) { if (Array.isArray(themes) && themes.length > 0) { configProvider.initTheme(themes, defaultConfig, isForce); return; } configProvider.initTheme(defaultThemes, defaultConfig); } function useLocale(namespace) { const createTranslateFunction = (ns) => { return (key, replacements, localeName) => { const fullKey = ns ? `${ns}.${key}` : key; return configProvider.t(fullKey, replacements, localeName); }; }; return { // 响应式引用 currentLocale: configProvider.currentLocaleRef, locales: configProvider.localesRef, // 方法 t: createTranslateFunction(namespace), setLocale: (name) => configProvider.setLocale(name), getLocales: () => configProvider.getLocales(), getCurrentLocale: () => configProvider.getCurrentLocale(), initLocales: (locales, defaultLocaleName, isForce) => configProvider.initLocales(locales, defaultLocaleName, isForce) }; } function formatPrice(number2, decimals = 0, decimalPoint = ".", thousandsSeparator = ",") { function round(num, precision) { const factor = Math.pow(10, precision); return (Math.round(num * factor) / factor).toFixed(precision); } let numStr = String(number2).replace(/[^0-9+\-Ee.]/g, ""); const n2 = !isFinite(+numStr) ? 0 : +numStr; const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals); const sep = thousandsSeparator ?? ","; const dec = decimalPoint ?? "."; let s2 = []; s2 = (prec ? round(n2, prec) : Math.round(n2).toString()).split("."); const re2 = /(-?\d+)(\d{3})/; while (re2.test(s2[0])) { s2[0] = s2[0].replace(re2, `$1${sep}$2`); } if ((s2[1] || "").length < prec) { s2[1] = s2[1] || ""; s2[1] += "0".repeat(prec - s2[1].length); } return s2.join(dec); } function formatName(name) { if (name.length === 2) { return name.charAt(0) + "*"; } else if (name.length > 2) { const masked = "*".repeat(name.length - 2); return name.charAt(0) + masked + name.charAt(name.length - 1); } else { return name; } } function addStyle(customStyle, target = "object") { if (test.empty(customStyle) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string") { return customStyle; } if (target === "object") { const trimmedStyle = trim(customStyle); const styleArray = trimmedStyle.split(";"); const style = {}; for (let i2 = 0; i2 < styleArray.length; i2++) { if (styleArray[i2]) { const item = styleArray[i2].split(":"); if (item.length === 2) { style[trim(item[0])] = trim(item[1]); } } } return style; } let string2 = ""; for (const i2 in customStyle) { if (Object.prototype.hasOwnProperty.call(customStyle, i2)) { const key = i2.replace(/([A-Z])/g, "-$1").toLowerCase(); string2 += `${key}:${customStyle[i2]};`; } } return trim(string2); } function toStyle(...styles) { if (styles.length === 1 && Array.isArray(styles[0])) { styles = styles[0].slice(); } const map = /* @__PURE__ */ new Map(); const processString = (str) => { if (!str) return; const parts = str.split(";"); for (let part of parts) { part = part.trim(); if (!part) continue; const idx = part.indexOf(":"); if (idx === -1) continue; const key = trim(part.slice(0, idx)); const val = trim(part.slice(idx + 1)); if (key === "" || val === "") continue; const k = kebabCase(key); map.set(k, val); } }; const processObject = (obj) => { if (!obj) return; Object.keys(obj).forEach((key) => { const val = obj[key]; if (val == null || val === "") return; const k = kebabCase(key); map.set(k, val); }); }; for (const item of styles) { if (item == null || item === "") continue; if (test.string(item)) { processString(item); } else if (test.array(item)) { item.forEach((el) => { if (test.string(el)) processString(el); else if (test.object(el)) processObject(el); }); } else if (test.object(item)) { processObject(item); } } if (map.size === 0) return ""; const result = Array.from(map.entries()).map(([k, v2]) => `${k}:${String(v2)}`).join(";"); return result ? result.endsWith(";") ? result : result + ";" : ""; } function kebabCase(word) { const newWord = word.replace(/[A-Z]/g, function(match) { return "-" + match; }).toLowerCase(); return newWord; } function sleep(value = 30) { return new Promise((resolve) => { setTimeout(() => { resolve(true); }, value); }); } const $u = { queryParams, route, timeFormat, date: timeFormat, // 另名date timeFrom, colorGradient: colorGradients.colorGradient, colorToRgba: colorGradients.colorToRgba, guid, color: color$2, getColor, setColor, sys, os: os$1, type2icon, randomArray, hexToRgb: colorGradients.hexToRgb, rgbToHex: colorGradients.rgbToHex, test, random, deepClone, deepMerge, getParent, $parent, clipboard, addUnit, trim, type: ["primary", "success", "error", "warning", "info"], http: httpInstance, toast, config, // uView配置信息相关,比如版本号 zIndex, debounce, throttle, mitt: mitt(), getRect, formatPrice, formatName, addStyle, toStyle, kebabCase, sleep }; const install = (app, options) => { var _a2, _b2, _c; try { if (options) { if (options == null ? void 0 : options.theme) { const optTheme = options.theme; if (Array.isArray(optTheme)) { initTheme(optTheme); } else if (typeof optTheme === "object" && optTheme.themes) { initTheme( optTheme.themes, { defaultTheme: optTheme.defaultTheme, defaultDarkMode: optTheme.defaultDarkMode }, optTheme.isForce ); } else { const defaultTheme = defaultThemes[0]; if (defaultTheme) { const mergedTheme = { ...defaultTheme, color: { ...defaultTheme.color, ...optTheme } }; initTheme([mergedTheme], defaultTheme.name); } } } else { initTheme(); } try { if (options == null ? void 0 : options.locale) { const optLocale = options.locale; if (typeof optLocale === "string") { configProvider.initLocales(void 0, optLocale); } else if (Array.isArray(optLocale)) { configProvider.initLocales(optLocale); } else if (optLocale && typeof optLocale === "object") { configProvider.initLocales(optLocale.locales, optLocale.defaultLocale, optLocale.isForce); } else { configProvider.initLocales(); } } else { configProvider.initLocales(); } } catch (e2) { formatAppLog("error", "at uni_modules/uview-pro/index.ts:74", "[install locales] Error:", e2); } logger.setDebugMode(((_a2 = options == null ? void 0 : options.log) == null ? void 0 : _a2.debug) ?? false).setPrefix(((_b2 = options == null ? void 0 : options.log) == null ? void 0 : _b2.prefix) || "").setShowCallerInfo(((_c = options == null ? void 0 : options.log) == null ? void 0 : _c.showCallerInfo) ?? true); } else { initTheme(); configProvider.initLocales(); } } catch (error) { formatAppLog("error", "at uni_modules/uview-pro/index.ts:88", "[install options] Error:", error); } uni.$u = $u; app.config.globalProperties.$u = $u; }; const uViewPro = { install }; const __default__$e = { name: "u-transition", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({ ...__default__$e, props: TransitionProps, emits: [ "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled" ], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const props = __props; const emit = __emit; const normalizeDuration = (duration) => { if (typeof duration === "number") { return { enter: duration, leave: duration }; } return { enter: (duration == null ? void 0 : duration.enter) ?? 300, leave: (duration == null ? void 0 : duration.leave) ?? (duration == null ? void 0 : duration.enter) ?? 300 }; }; const rootRef = vue.ref(); const rendered = vue.ref(props.show); const animationPhase = vue.ref(""); const animating = vue.ref(false); const initialized = vue.ref(false); const transitionDuration = vue.computed(() => normalizeDuration(props.duration)); const animationStyle = vue.computed(() => { const currentDuration = animationPhase.value === "leave" ? transitionDuration.value.leave : transitionDuration.value.enter; return { "--u-transition-duration-enter": `${transitionDuration.value.enter}ms`, "--u-transition-duration-leave": `${transitionDuration.value.leave}ms`, "--u-transition-delay": `${props.delay}ms`, "--u-transition-timing": props.timingFunction, animationDuration: `${currentDuration}ms`, animationDelay: `${props.delay}ms`, animationTimingFunction: props.timingFunction }; }); const animationClass = vue.computed(() => { if (!animationPhase.value) { return ""; } return `u-transition-${props.name}-${animationPhase.value}`; }); const getEl = () => rootRef.value; const startEnter = () => { if (animating.value && animationPhase.value === "enter") { return; } if (animating.value && animationPhase.value === "leave") { emit("leave-cancelled", getEl()); } rendered.value = true; animationPhase.value = "enter"; animating.value = true; emit("before-enter", getEl()); }; const startLeave = () => { if (!rendered.value) { return; } if (animating.value && animationPhase.value === "leave") { return; } if (animating.value && animationPhase.value === "enter") { emit("enter-cancelled", getEl()); } animationPhase.value = "leave"; animating.value = true; emit("before-leave", getEl()); }; const handleAnimationStart = () => { if (animationPhase.value === "enter") { emit("enter", getEl()); } else if (animationPhase.value === "leave") { emit("leave", getEl()); } }; const handleAnimationEnd = () => { if (animationPhase.value === "enter") { animating.value = false; animationPhase.value = ""; emit("after-enter", getEl()); return; } if (animationPhase.value === "leave") { animating.value = false; animationPhase.value = ""; rendered.value = false; emit("after-leave", getEl()); } }; const shouldWaitForAnimation = (newPhase) => { if (!animating.value) return false; const currentPhase = animationPhase.value; if (props.mode === "out-in" && currentPhase === "leave" && newPhase === "enter") { return true; } if (props.mode === "in-out" && currentPhase === "enter" && newPhase === "leave") { return true; } return false; }; vue.watch( () => props.show, (value) => { if (!initialized.value) { initialized.value = true; if (value) { rendered.value = true; if (props.appear) { vue.nextTick(() => startEnter()); } } else { rendered.value = false; } return; } if (value) { if (shouldWaitForAnimation("enter")) { vue.nextTick(() => { if (!animating.value) { startEnter(); } }); } else { startEnter(); } } else { if (shouldWaitForAnimation("leave")) { vue.nextTick(() => { if (!animating.value) { startLeave(); } }); } else { startLeave(); } } }, { immediate: true } ); const __returned__ = { props, emit, normalizeDuration, rootRef, rendered, animationPhase, animating, initialized, transitionDuration, animationStyle, animationClass, getEl, startEnter, startLeave, handleAnimationStart, handleAnimationEnd, shouldWaitForAnimation, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) { return $setup.rendered ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, ref: "rootRef", class: vue.normalizeClass(["u-transition", [_ctx.customClass, $setup.animationClass]]), style: vue.normalizeStyle($setup.$u.toStyle($setup.animationStyle, _ctx.customStyle)), onAnimationstart: $setup.handleAnimationStart, onAnimationend: $setup.handleAnimationEnd }, [ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 38 /* CLASS, STYLE, NEED_HYDRATION */ )) : vue.createCommentVNode("v-if", true); } const __easycom_0$7 = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$R], ["__scopeId", "data-v-1098449d"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-transition/u-transition.vue"]]); const IconProps = { ...baseProps, /** 图标名称,见示例图标集 */ name: { type: String, default: "" }, /** 图标颜色,可接受主题色 */ color: { type: String, default: "" }, /** 字体大小,单位rpx(默认32) */ size: { type: [Number, String], default: "inherit" }, /** 是否显示粗体 */ bold: { type: Boolean, default: false }, /** 点击图标的时候传递事件出去的index(用于区分点击了哪一个) */ index: { type: [Number, String], default: "" }, /** 触摸图标时的类名 */ hoverClass: { type: String, default: "" }, /** 自定义扩展前缀,方便用户扩展自己的图标库 */ customPrefix: { type: String, default: "uicon" }, /** 图标右边或者下面的文字 */ label: { type: [String, Number], default: "" }, /** label的位置,只能右边或者下边 */ labelPos: { type: String, default: "right" }, /** label的大小,单位rpx(默认28) */ labelSize: { type: [String, Number], default: "28" }, /** label的颜色 */ labelColor: { type: String, default: "var(--u-content-color)" }, /** label与图标的距离(横向排列),单位rpx(默认6) */ marginLeft: { type: [String, Number], default: "6" }, /** label与图标的距离(竖向排列),单位rpx(默认6) */ marginTop: { type: [String, Number], default: "6" }, /** label与图标的距离(竖向排列),单位rpx(默认6) */ marginRight: { type: [String, Number], default: "6" }, /** label与图标的距离(竖向排列),单位rpx(默认6) */ marginBottom: { type: [String, Number], default: "6" }, /** label与图标的距离,单位rpx,权重高于 margin */ space: { type: [String, Number], default: "" }, /** 图片的mode,参考uni-app image组件 */ imgMode: { type: String, default: "widthFix" }, /** 用于显示图片小图标时,图片的宽度,单位rpx */ width: { type: [String, Number], default: "" }, /** 用于显示图片小图标时,图片的高度,单位rpx */ height: { type: [String, Number], default: "" }, /** 用于解决某些情况下,让图标垂直居中的用途,单位rpx */ top: { type: [String, Number], default: 0 }, /** 是否为DecimalIcon */ showDecimalIcon: { type: Boolean, default: false }, /** 背景颜色,可接受主题色,仅Decimal时有效 */ inactiveColor: { type: String, default: "var(--u-divider-color)" }, /** 显示的百分比,仅Decimal时有效 */ percent: { type: [Number, String], default: "50" } }; const __default__$d = { name: "u-icon", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({ ...__default__$d, props: IconProps, emits: ["click", "touchstart"], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const emit = __emit; const props = __props; const iconClass = vue.computed(() => { let classes = []; classes.push(props.customPrefix + "-" + props.name); if (props.customPrefix === "uicon") { classes.push("u-iconfont"); } else { classes.push(props.customPrefix); } if (props.showDecimalIcon && props.inactiveColor && $u.config.type.includes(props.inactiveColor)) { classes.push("u-icon__icon--" + props.inactiveColor); } else if (props.color && $u.config.type.includes(props.color)) { classes.push("u-icon__icon--" + props.color); } return classes; }); const iconStyle = vue.computed(() => { const style = { fontSize: props.size === "inherit" ? "inherit" : $u.addUnit(props.size), fontWeight: props.bold ? "bold" : "normal", // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中 top: $u.addUnit(props.top) }; if (props.showDecimalIcon && props.inactiveColor && !$u.config.type.includes(props.inactiveColor)) { style.color = props.inactiveColor; } else if (props.color && !$u.config.type.includes(props.color)) { style.color = props.color; } return style; }); const isImg = vue.computed(() => { return props.name.indexOf("/") !== -1; }); const imgStyle = vue.computed(() => { const style = { width: props.width ? $u.addUnit(props.width) : $u.addUnit(props.size), height: props.height ? $u.addUnit(props.height) : $u.addUnit(props.size) }; return style; }); const decimalIconStyle = vue.computed(() => { const style = { fontSize: props.size === "inherit" ? "inherit" : $u.addUnit(props.size), fontWeight: props.bold ? "bold" : "normal", // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中 top: $u.addUnit(props.top), width: props.percent + "%" }; if (props.color && !$u.config.type.includes(props.color)) { style.color = props.color; } return style; }); const decimalIconClass = vue.computed(() => { let classes = []; classes.push(props.customPrefix + "-" + props.name); if (props.customPrefix === "uicon") { classes.push("u-iconfont"); } else { classes.push(props.customPrefix); } if (props.color && $u.config.type.includes(props.color)) { classes.push("u-icon__icon--" + props.color); } else { classes.push("u-icon__icon--primary"); } return classes; }); const labelStyle = vue.computed(() => { return { color: props.labelColor, fontSize: $u.addUnit(props.labelSize), marginLeft: props.labelPos === "right" ? $u.addUnit(props.space || props.marginLeft) : 0, marginTop: props.labelPos === "bottom" ? $u.addUnit(props.space || props.marginTop) : 0, marginRight: props.labelPos === "left" ? $u.addUnit(props.space || props.marginRight) : 0, marginBottom: props.labelPos === "top" ? $u.addUnit(props.space || props.marginBottom) : 0 }; }); function onClick(event) { emit("click", props.index || event); } function onTouchstart(event) { emit("touchstart", props.index || event); } const __returned__ = { emit, props, iconClass, iconStyle, isImg, imgStyle, decimalIconStyle, decimalIconClass, labelStyle, onClick, onTouchstart, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock( "view", { style: vue.normalizeStyle($setup.$u.toStyle(_ctx.customStyle)), class: vue.normalizeClass(["u-icon", ["u-icon--" + _ctx.labelPos, _ctx.customClass]]), onClick: $setup.onClick }, [ $setup.isImg ? (vue.openBlock(), vue.createElementBlock("image", { key: 0, class: "u-icon__img", src: $setup.props.name, mode: _ctx.imgMode, style: vue.normalizeStyle([$setup.imgStyle]) }, null, 12, ["src", "mode"])) : (vue.openBlock(), vue.createElementBlock("text", { key: 1, class: vue.normalizeClass(["u-icon__icon", $setup.iconClass]), style: vue.normalizeStyle($setup.$u.toStyle($setup.iconStyle)), "hover-class": _ctx.hoverClass, onTouchstart: $setup.onTouchstart }, [ _ctx.showDecimalIcon ? (vue.openBlock(), vue.createElementBlock("text", { key: 0, style: vue.normalizeStyle($setup.$u.toStyle($setup.decimalIconStyle)), class: vue.normalizeClass([$setup.decimalIconClass, "u-icon__decimal"]), "hover-class": _ctx.hoverClass }, null, 14, ["hover-class"])) : vue.createCommentVNode("v-if", true) ], 46, ["hover-class"])), _ctx.label !== "" ? (vue.openBlock(), vue.createElementBlock( "text", { key: 2, class: "u-icon__label", style: vue.normalizeStyle($setup.labelStyle) }, vue.toDisplayString(_ctx.label), 5 /* TEXT, STYLE */ )) : vue.createCommentVNode("v-if", true) ], 6 /* CLASS, STYLE */ ); } const __easycom_0$6 = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$Q], ["__scopeId", "data-v-b4d1c4b2"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-icon/u-icon.vue"]]); const BadgeProps = { ...baseProps, /** 使用预设的背景颜色 primary,warning,success,error,info */ type: { type: String, default: "error" }, /** Badge的尺寸,default, mini */ size: { type: String, default: "default" }, /** 是否是圆点 */ isDot: { type: Boolean, default: false }, /** 显示的数值内容 */ count: { type: [Number, String], default: void 0 }, /** 展示封顶的数字值 */ overflowCount: { type: Number, default: 99 }, /** 当数值为 0 时,是否展示 Badge */ showZero: { type: Boolean, default: false }, /** 位置偏移 [number, number] */ offset: { type: Array, default: () => [20, 20] }, /** 是否开启绝对定位,开启了offset才会起作用 */ absolute: { type: Boolean, default: true }, /** 字体大小 */ fontSize: { type: [String, Number], default: "24" }, /** 字体颜色 */ color: { type: String, default: "var(--u-white-color)" }, /** badge的背景颜色 */ bgColor: { type: String, default: "" }, /** 是否让badge组件的中心点和父组件右上角重合,配置的话,offset将会失效 */ isCenter: { type: Boolean, default: false } }; const __default__$c = { name: "u-badge", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({ ...__default__$c, props: BadgeProps, setup(__props, { expose: __expose }) { __expose(); const props = __props; const boxStyle = vue.computed(() => { let style = {}; if (props.isCenter) { style.top = 0; style.right = 0; style.transform = "translateY(-50%) translateX(50%)"; } else { style.top = props.offset[0] + "rpx"; style.right = props.offset[1] + "rpx"; style.transform = "translateY(0) translateX(0)"; } if (props.size === "mini") { style.transform = style.transform + " scale(0.8)"; } return style; }); const showText = vue.computed(() => { if (props.isDot) return ""; else { if (Number(props.count) > props.overflowCount) return `${props.overflowCount}+`; else return props.count; } }); const show = vue.computed(() => { if (Number(props.count) === 0 && props.showZero === false) return false; else return true; }); const __returned__ = { props, boxStyle, showText, show, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) { return $setup.show ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: vue.normalizeClass(["u-badge", [ _ctx.isDot ? "u-badge-dot" : "", _ctx.size === "mini" ? "u-badge-mini" : "", _ctx.type ? "u-badge--bg--" + _ctx.type : "", _ctx.customClass ]]), style: vue.normalizeStyle( $setup.$u.toStyle( { top: _ctx.offset[0] + "rpx", right: _ctx.offset[1] + "rpx", fontSize: _ctx.fontSize + "rpx", position: _ctx.absolute ? "absolute" : "static", color: _ctx.color, backgroundColor: _ctx.bgColor }, $setup.boxStyle, _ctx.customStyle ) ) }, vue.toDisplayString($setup.showText), 7 /* TEXT, CLASS, STYLE */ )) : vue.createCommentVNode("v-if", true); } const __easycom_1$5 = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$P], ["__scopeId", "data-v-53906a69"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-badge/u-badge.vue"]]); const GapProps = { ...baseProps, /** 背景颜色 */ bgColor: { type: String, default: "transparent" }, /** 高度 */ height: { type: [String, Number], default: 30 }, /** 与上一个组件的距离 */ marginTop: { type: [String, Number], default: 0 }, /** 与下一个组件的距离 */ marginBottom: { type: [String, Number], default: 0 } }; const __default__$b = { name: "u-gap", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({ ...__default__$b, props: GapProps, setup(__props, { expose: __expose }) { __expose(); const props = __props; const gapStyle = vue.computed(() => { return { backgroundColor: props.bgColor, height: $u.addUnit(props.height), marginTop: $u.addUnit(props.marginTop), marginBottom: $u.addUnit(props.marginBottom) }; }); const __returned__ = { props, gapStyle, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock( "view", { class: "u-gap", style: vue.normalizeStyle($setup.$u.toStyle($setup.gapStyle, _ctx.customStyle)) }, null, 4 /* STYLE */ ); } const __easycom_2$2 = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$O], ["__scopeId", "data-v-d6b0a321"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-gap/u-gap.vue"]]); const TabbarProps = { ...baseProps, /** 是否显示tabbar */ show: { type: Boolean, default: true }, /** v-model绑定当前激活项的值 */ modelValue: { type: [String, Number], default: 0 }, /** tabbar背景色 */ bgColor: { type: String, default: "var(--u-bg-white)" }, /** tabbar高度,单位任意,数值默认rpx */ height: { type: [String, Number], default: "50px" }, /** 非凸起图标的大小,单位任意,数值默认rpx */ iconSize: { type: [String, Number], default: 40 }, /** 凸起图标的大小,单位任意,数值默认rpx */ midButtonSize: { type: [String, Number], default: 100 }, /** 文本大小,单位任意,数值默认rpx */ textSize: { type: [String, Number], default: 26 }, /** 激活时的颜色 */ activeColor: { type: String, default: "var(--u-type-primary)" }, /** 未激活时的颜色 */ inactiveColor: { type: String, default: "var(--u-content-color)" }, /** 是否显示中部凸起按钮 */ midButton: { type: Boolean, default: false }, /** tabbar配置项数组 */ list: { type: Array, default: () => [] }, /** 切换前回调,返回true或Promise */ beforeSwitch: { type: Function, default: null }, /** 是否显示顶部横线 */ borderTop: { type: Boolean, default: true }, /** 是否隐藏原生tabbar */ hideTabBar: { type: Boolean, default: true }, /** z-index层级 */ zIndex: { type: [String, Number], default: zIndex.tabbar }, /** icon和text的间距,单位任意,数值默认rpx */ gap: { type: [String, Number], default: 8 } }; const __default__$a = { name: "u-tabbar", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({ ...__default__$a, props: TabbarProps, emits: ["change", "update:modelValue"], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const props = __props; const emit = __emit; const uZIndex = vue.computed(() => (props == null ? void 0 : props.zIndex) ?? $u.zIndex.tabbar); const midButtonLeft = vue.ref("50%"); const pageUrl = vue.ref(""); vue.onMounted(() => { const pages2 = getCurrentPages(); pageUrl.value = pages2[pages2.length - 1].route; if (props.midButton) getMidButtonLeft(); }); const elIconPath = vue.computed(() => { return (index) => { var _a2; const pagePath = (_a2 = props.list[index]) == null ? void 0 : _a2.pagePath; if (pagePath) { if (pagePath === pageUrl.value || pagePath === "/" + pageUrl.value) { return props.list[index].selectedIconPath; } else { return props.list[index].iconPath; } } else { return index == props.modelValue ? props.list[index].selectedIconPath : props.list[index].iconPath; } }; }); const elColor = vue.computed(() => { return (index) => { var _a2; const pagePath = (_a2 = props.list[index]) == null ? void 0 : _a2.pagePath; if (pagePath) { if (pagePath === pageUrl.value || pagePath === "/" + pageUrl.value) return props.activeColor; else return props.inactiveColor; } else { return index == props.modelValue ? props.activeColor : props.inactiveColor; } }; }); function getCustomPrefix(index) { var _a2; const customIcon = (_a2 = props.list[index]) == null ? void 0 : _a2.customIcon; if (customIcon === void 0 || customIcon === null || customIcon === "") { return "uicon"; } if (typeof customIcon === "string") { return customIcon; } if (typeof customIcon === "boolean") { return customIcon ? "custom-icon" : "uicon"; } return "uicon"; } async function clickHandler(index) { if (props.beforeSwitch && typeof props.beforeSwitch === "function") { let beforeSwitchResult = props.beforeSwitch(index); if (typeof beforeSwitchResult === "object" && beforeSwitchResult !== null && typeof beforeSwitchResult.then === "function") { await beforeSwitchResult.then(() => { switchTab(index); }).catch(() => { }); } else if (beforeSwitchResult === true) { switchTab(index); } } else { switchTab(index); } } function switchTab(index) { var _a2; emit("change", index); if ((_a2 = props.list[index]) == null ? void 0 : _a2.pagePath) { uni.switchTab({ url: props.list[index].pagePath }); } else { emit("update:modelValue", index); } } function getOffsetRight(count, isDot) { if (isDot) { return -20; } else if (count > 9) { return -40; } else { return -30; } } function getBadgeOffsetTop(count, isDot) { return -2; } function getIconSize(index) { const item = props.list[index] || {}; if (props.midButton && item.midButton) { return props.midButtonSize; } if (item.iconSize !== void 0 && item.iconSize !== null && item.iconSize !== "") { return item.iconSize; } return props.iconSize; } function getTextSize(index) { const item = props.list[index] || {}; if (item.textSize !== void 0 && item.textSize !== null && item.textSize !== "") { return item.textSize; } return props.textSize; } function getMidButtonLeft() { const windowWidth = $u.sys().windowWidth; midButtonLeft.value = windowWidth / 2 + "px"; } function containerStyle(index) { const style = {}; const item = props.list[index] || {}; if (props.midButton && item.midButton) { const iconSizeRaw = getIconSize(index); const numericSize = parseFloat(String(iconSizeRaw)) || parseFloat(String(props.midButtonSize)) || 100; style.paddingTop = $u.addUnit(numericSize / 2 + 8); style.boxSizing = "border-box"; } return $u.toStyle(style); } const __returned__ = { props, emit, uZIndex, midButtonLeft, pageUrl, elIconPath, elColor, getCustomPrefix, clickHandler, switchTab, getOffsetRight, getBadgeOffsetTop, getIconSize, getTextSize, getMidButtonLeft, containerStyle, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); const _component_u_badge = resolveEasycom(vue.resolveDynamicComponent("u-badge"), __easycom_1$5); const _component_u_gap = resolveEasycom(vue.resolveDynamicComponent("u-gap"), __easycom_2$2); return $setup.props.show ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: vue.normalizeClass(["u-tabbar", _ctx.customClass]), style: vue.normalizeStyle($setup.$u.toStyle(_ctx.customStyle)), onTouchmove: vue.withModifiers(() => { }, ["stop", "prevent"]) }, [ vue.createElementVNode( "view", { class: vue.normalizeClass(["u-tabbar__content safe-area-inset-bottom", { "u-border-top": $setup.props.borderTop }]), style: vue.normalizeStyle({ height: $setup.$u.addUnit($setup.props.height), backgroundColor: $setup.props.bgColor, zIndex: $setup.uZIndex }) }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.props.list, (item, index) => { return vue.openBlock(), vue.createElementBlock("view", { class: vue.normalizeClass(["u-tabbar__content__item", { "u-tabbar__content__circle": $setup.props.midButton && item.midButton }]), key: index, onClick: vue.withModifiers(($event) => $setup.clickHandler(index), ["stop"]), style: vue.normalizeStyle({ backgroundColor: $setup.props.bgColor }) }, [ vue.createElementVNode( "view", { class: vue.normalizeClass(["u-tabbar__content__item__container", { "u-tabbar__content__circle__container": $setup.props.midButton && item.midButton }]), style: vue.normalizeStyle($setup.containerStyle(index)) }, [ item.iconPath || item.selectedIconPath ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: vue.normalizeClass([ $setup.props.midButton && item.midButton ? "u-tabbar__content__circle__icon" : "u-tabbar__content__item__icon" ]) }, [ vue.createVNode(_component_u_icon, { size: $setup.getIconSize(index), name: $setup.elIconPath(index), "img-mode": "scaleToFill", color: $setup.elColor(index), "custom-prefix": $setup.getCustomPrefix(index) }, null, 8, ["size", "name", "color", "custom-prefix"]), item.count || item.isDot ? (vue.openBlock(), vue.createBlock(_component_u_badge, { key: 0, count: item.count, "is-dot": item.isDot, offset: [ $setup.getBadgeOffsetTop(item.count || 0, item.isDot || false), $setup.getOffsetRight(item.count || 0, item.isDot || false) ] }, null, 8, ["count", "is-dot", "offset"])) : vue.createCommentVNode("v-if", true) ], 2 /* CLASS */ )) : vue.createCommentVNode("v-if", true), vue.createVNode(_component_u_gap, { height: _ctx.gap }, null, 8, ["height"]), item.text ? (vue.openBlock(), vue.createElementBlock( "view", { key: 1, class: vue.normalizeClass(["u-tabbar__content__item__text", { "u-tabbar__content__item__text--center": item.text && !(item.iconPath || item.selectedIconPath) }]) }, [ vue.createElementVNode( "text", { class: "u-line-1", style: vue.normalizeStyle({ color: $setup.elColor(index), fontSize: $setup.$u.addUnit($setup.getTextSize(index)) }) }, vue.toDisplayString(item.text), 5 /* TEXT, STYLE */ ) ], 2 /* CLASS */ )) : vue.createCommentVNode("v-if", true) ], 6 /* CLASS, STYLE */ ) ], 14, ["onClick"]); }), 128 /* KEYED_FRAGMENT */ )), $setup.props.midButton ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: vue.normalizeClass(["u-tabbar__content__circle__border", { "u-border": $setup.props.borderTop }]), style: vue.normalizeStyle({ backgroundColor: $setup.props.bgColor, left: $setup.midButtonLeft }) }, null, 6 /* CLASS, STYLE */ )) : vue.createCommentVNode("v-if", true) ], 6 /* CLASS, STYLE */ ), vue.createElementVNode( "view", { class: "u-fixed-placeholder safe-area-inset-bottom", style: vue.normalizeStyle({ height: `calc(${$setup.$u.addUnit($setup.props.height)} + ${$setup.props.midButton ? "60rpx" : "1px"})` }) }, null, 4 /* STYLE */ ) ], 38 /* CLASS, STYLE, NEED_HYDRATION */ )) : vue.createCommentVNode("v-if", true); } const __easycom_1$4 = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$N], ["__scopeId", "data-v-62b8a246"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-tabbar/u-tabbar.vue"]]); const LoadingProps = { ...baseProps, /** 动画的类型 */ mode: { type: String, default: "circle" }, /** 动画的颜色 */ color: { type: String, default: "var(--u-light-color)" }, /** 加载图标的大小,单位rpx */ size: { type: [String, Number], default: "34" }, /** 是否显示动画 */ show: { type: Boolean, default: true } }; const __default__$9 = { name: "u-loading", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({ ...__default__$9, props: LoadingProps, setup(__props, { expose: __expose }) { __expose(); const props = __props; const cricleStyle = vue.computed(() => { let style = {}; style.width = props.size + "rpx"; style.height = props.size + "rpx"; if (props.mode === "circle") { style.borderColor = `var(--u-divider-color) var(--u-divider-color) var(--u-divider-color) ${props.color ? props.color : "var(--u-light-color)"}`; } return style; }); const __returned__ = { props, cricleStyle, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) { return _ctx.show ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: vue.normalizeClass(["u-loading", [_ctx.mode === "circle" ? "u-loading-circle" : "u-loading-flower", _ctx.customClass]]), style: vue.normalizeStyle($setup.$u.toStyle($setup.cricleStyle, _ctx.customStyle)) }, null, 6 /* CLASS, STYLE */ )) : vue.createCommentVNode("v-if", true); } const __easycom_0$5 = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$M], ["__scopeId", "data-v-a5d64378"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-loading/u-loading.vue"]]); const _sfc_main$M = { __name: "chartCard", props: { height: { type: Number, default: 0 }, bgColor: { type: String, default: "#ffffff" }, loading: { type: Boolean, default: false }, margin: { type: String, default: "0" }, padding: { type: String, default: "20rpx" }, title: { type: String, default: "" }, // titFontSize: { // }, titFontColor: { type: String, default: "#333333" }, showTitLine: { type: Boolean, default: false } }, setup(__props, { expose: __expose }) { __expose(); const props = __props; const __returned__ = { props }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_loading = resolveEasycom(vue.resolveDynamicComponent("u-loading"), __easycom_0$5); return vue.openBlock(), vue.createElementBlock( "view", { class: "coust-chart box-shadow", style: vue.normalizeStyle({ height: $setup.props.height > 0 ? `${$setup.props.height}rpx` : "auto", background: $setup.props.bgColor, margin: $setup.props.margin, padding: $setup.props.padding }) }, [ $setup.props.title ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: "coust-chart-tit", style: vue.normalizeStyle({ color: $setup.props.titFontColor, borderBottom: $setup.props.showTitLine ? "1rpx solid var(--u-border-color)" : "none" }) }, vue.toDisplayString($setup.props.title), 5 /* TEXT, STYLE */ )) : vue.createCommentVNode("v-if", true), vue.withDirectives(vue.createElementVNode( "view", { class: "coust-loading" }, [ vue.createVNode(_component_u_loading, { size: "40", mode: "flower" }) ], 512 /* NEED_PATCH */ ), [ [vue.vShow, $setup.props.loading] ]), vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 4 /* STYLE */ ); } const CardModule = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$L], ["__scopeId", "data-v-392405c3"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/components/chartCard.vue"]]); const _sfc_main$L = { __name: "projectCard", setup(__props, { expose: __expose }) { __expose(); const loading = vue.ref(false); const handleSkip = () => { uni.navigateTo({ url: `/pages/penetrate/project` }); }; const __returned__ = { loading, handleSkip, ref: vue.ref, ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { loading: $setup.loading, margin: "30rpx 0 0 0", padding: "20rpx 10rpx 80rpx 10rpx", "bg-color": "linear-gradient(#1e5ca3, #3094ff)" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "project" }, [ vue.createElementVNode("view", { class: "project-col", onClick: $setup.handleSkip }, [ vue.createElementVNode("text", { class: "project-col-num" }, "1024"), vue.createElementVNode("text", { class: "project-col-lab u-margin-top-10" }, "在建项目") ]), vue.createElementVNode("view", { class: "project-col" }, [ vue.createElementVNode("text", { class: "project-col-num" }, "1024"), vue.createElementVNode("text", { class: "project-col-lab u-margin-top-10" }, "停工项目") ]), vue.createElementVNode("view", { class: "project-col" }, [ vue.createElementVNode("text", { class: "project-col-num" }, "1024111"), vue.createElementVNode("text", { class: "project-col-lab u-margin-top-10" }, "参建人数") ]), vue.createElementVNode("view", { class: "project-col" }, [ vue.createElementVNode("text", { class: "project-col-num" }, "1024"), vue.createElementVNode("text", { class: "project-col-lab u-margin-top-10" }, "在施危大工程") ]) ]) ]), _: 1 /* STABLE */ }, 8, ["loading"]); } const ProjectCard = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$K], ["__scopeId", "data-v-663f3f74"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/projectCard.vue"]]); const _sfc_main$K = { __name: "safeHoursCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "安全工时" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "safe-hours" }, [ vue.createElementVNode("text", null, "9024145"), vue.createElementVNode("text", null, "万") ]) ]), _: 1 /* STABLE */ }); } const SafeHoursCard = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$J], ["__scopeId", "data-v-ba25975a"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/safeHoursCard.vue"]]); const _sfc_main$J = { __name: "organizerCard", setup(__props, { expose: __expose }) { __expose(); const loading = vue.ref(false); const __returned__ = { loading, ref: vue.ref, ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { loading: $setup.loading, margin: "0 0 30rpx 0", title: "组织机构人员" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "organizer" }, [ vue.createElementVNode("view", { class: "row u-flex u-padding-20 u-margin-bottom-20" }, [ vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "集团总人数"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "总监"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "专职"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "企业"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]) ]), vue.createElementVNode("view", { class: "organizer-tit" }, "分支机构"), vue.createElementVNode("view", { class: "row u-flex u-padding-20 u-margin-bottom-20" }, [ vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "总监"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "专职"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]) ]), vue.createElementVNode("view", { class: "organizer-tit" }, "注安师"), vue.createElementVNode("view", { class: "row u-flex u-padding-20 u-margin-bottom-20" }, [ vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "在岗职业"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]) ]), vue.createElementVNode("view", { class: "organizer-tit" }, "项目人数"), vue.createElementVNode("view", { class: "row u-flex u-padding-20 u-margin-bottom-20" }, [ vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "总监"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "专职"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "安全监护"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]) ]), vue.createElementVNode("view", { class: "organizer-tit" }, "三类人员"), vue.createElementVNode("view", { class: "row u-flex u-padding-20" }, [ vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "A证"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "B证"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]), vue.createElementVNode("view", { class: "row_li u-flex u-row-center" }, [ vue.createElementVNode("text", { class: "organizer-lab" }, "C证"), vue.createElementVNode("text", { class: "organizer_num" }, "13273") ]) ]) ]) ]), _: 1 /* STABLE */ }, 8, ["loading"]); } const OrganizerCard = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$I], ["__scopeId", "data-v-03c91fe4"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/organizerCard.vue"]]); const easycom = { autoscan: true, custom: { "^u-(.*)": "uview-pro/components/u-$1/u-$1.vue" } }; const pages = [ { path: "pages/index/index", style: { navigationBarTitleText: "首页" } }, { path: "pages/penetrate/project", style: { navigationBarTitleText: "项目" } } ]; const globalStyle = { navigationBarTextStyle: "white", navigationBarTitleText: "中国化学", navigationBarBackgroundColor: "#17447a", backgroundColor: "#FFFFFF" }; const uniIdRouter = {}; const e = { easycom, pages, globalStyle, uniIdRouter }; var define_process_env_UNI_SECURE_NETWORK_CONFIG_default = []; function t$1(e2) { return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2; } function n(e2, t2, n2) { return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) { return function() { throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs"); }(null == t3 && n2.path); } }, n2.exports), n2.exports; } var s = n(function(e2, t2) { var n2; e2.exports = (n2 = n2 || function(e3, t3) { var n3 = Object.create || /* @__PURE__ */ function() { function e4() { } return function(t4) { var n4; return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4; }; }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) { var t4 = n3(this); return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() { t4.$super.init.apply(this, arguments); }), t4.init.prototype = t4, t4.$super = this, t4; }, create: function() { var e4 = this.extend(); return e4.init.apply(e4, arguments), e4; }, init: function() { }, mixIn: function(e4) { for (var t4 in e4) e4.hasOwnProperty(t4) && (this[t4] = e4[t4]); e4.hasOwnProperty("toString") && (this.toString = e4.toString); }, clone: function() { return this.init.prototype.extend(this); } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) { e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length; }, toString: function(e4) { return (e4 || c2).stringify(this); }, concat: function(e4) { var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes; if (this.clamp(), s3 % 4) for (var i3 = 0; i3 < r3; i3++) { var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255; t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8; } else for (i3 = 0; i3 < r3; i3 += 4) t4[s3 + i3 >>> 2] = n4[i3 >>> 2]; return this.sigBytes += r3, this; }, clamp: function() { var t4 = this.words, n4 = this.sigBytes; t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4); }, clone: function() { var e4 = i2.clone.call(this); return e4.words = this.words.slice(0), e4; }, random: function(t4) { for (var n4, s3 = [], r3 = function(t5) { t5 = t5; var n5 = 987654321, s4 = 4294967295; return function() { var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4; return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1); }; }, i3 = 0; i3 < t4; i3 += 4) { var a3 = r3(4294967296 * (n4 || e3.random())); n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0); } return new o2.init(s3, t4); } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) { for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) { var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255; s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16)); } return s3.join(""); }, parse: function(e4) { for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2) n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4; return new o2.init(n4, t4 / 2); } }, u2 = a2.Latin1 = { stringify: function(e4) { for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) { var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255; s3.push(String.fromCharCode(i3)); } return s3.join(""); }, parse: function(e4) { for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++) n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8; return new o2.init(n4, t4); } }, l2 = a2.Utf8 = { stringify: function(e4) { try { return decodeURIComponent(escape(u2.stringify(e4))); } catch (e5) { throw new Error("Malformed UTF-8 data"); } }, parse: function(e4) { return u2.parse(unescape(encodeURIComponent(e4))); } }, h2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() { this._data = new o2.init(), this._nDataBytes = 0; }, _append: function(e4) { "string" == typeof e4 && (e4 = l2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes; }, _process: function(t4) { var n4 = this._data, s3 = n4.words, r3 = n4.sigBytes, i3 = this.blockSize, a3 = r3 / (4 * i3), c3 = (a3 = t4 ? e3.ceil(a3) : e3.max((0 | a3) - this._minBufferSize, 0)) * i3, u3 = e3.min(4 * c3, r3); if (c3) { for (var l3 = 0; l3 < c3; l3 += i3) this._doProcessBlock(s3, l3); var h3 = s3.splice(0, c3); n4.sigBytes -= u3; } return new o2.init(h3, u3); }, clone: function() { var e4 = i2.clone.call(this); return e4._data = this._data.clone(), e4; }, _minBufferSize: 0 }); r2.Hasher = h2.extend({ cfg: i2.extend(), init: function(e4) { this.cfg = this.cfg.extend(e4), this.reset(); }, reset: function() { h2.reset.call(this), this._doReset(); }, update: function(e4) { return this._append(e4), this._process(), this; }, finalize: function(e4) { return e4 && this._append(e4), this._doFinalize(); }, blockSize: 16, _createHelper: function(e4) { return function(t4, n4) { return new e4.init(n4).finalize(t4); }; }, _createHmacHelper: function(e4) { return function(t4, n4) { return new d2.HMAC.init(e4, n4).finalize(t4); }; } }); var d2 = s2.algo = {}; return s2; }(Math), n2); }), r = s, i = (n(function(e2, t2) { var n2; e2.exports = (n2 = r, function(e3) { var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = []; !function() { for (var t4 = 0; t4 < 64; t4++) a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0; }(); var c2 = o2.MD5 = i2.extend({ _doReset: function() { this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]); }, _doProcessBlock: function(e4, t4) { for (var n3 = 0; n3 < 16; n3++) { var s3 = t4 + n3, r3 = e4[s3]; e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8); } var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k2 = e4[t4 + 13], A2 = e4[t4 + 14], T2 = e4[t4 + 15], C2 = i3[0], P2 = i3[1], O2 = i3[2], E2 = i3[3]; C2 = u2(C2, P2, O2, E2, o3, 7, a2[0]), E2 = u2(E2, C2, P2, O2, c3, 12, a2[1]), O2 = u2(O2, E2, C2, P2, p2, 17, a2[2]), P2 = u2(P2, O2, E2, C2, f2, 22, a2[3]), C2 = u2(C2, P2, O2, E2, g2, 7, a2[4]), E2 = u2(E2, C2, P2, O2, m2, 12, a2[5]), O2 = u2(O2, E2, C2, P2, y2, 17, a2[6]), P2 = u2(P2, O2, E2, C2, _2, 22, a2[7]), C2 = u2(C2, P2, O2, E2, w2, 7, a2[8]), E2 = u2(E2, C2, P2, O2, v2, 12, a2[9]), O2 = u2(O2, E2, C2, P2, I2, 17, a2[10]), P2 = u2(P2, O2, E2, C2, S2, 22, a2[11]), C2 = u2(C2, P2, O2, E2, b2, 7, a2[12]), E2 = u2(E2, C2, P2, O2, k2, 12, a2[13]), O2 = u2(O2, E2, C2, P2, A2, 17, a2[14]), C2 = l2(C2, P2 = u2(P2, O2, E2, C2, T2, 22, a2[15]), O2, E2, c3, 5, a2[16]), E2 = l2(E2, C2, P2, O2, y2, 9, a2[17]), O2 = l2(O2, E2, C2, P2, S2, 14, a2[18]), P2 = l2(P2, O2, E2, C2, o3, 20, a2[19]), C2 = l2(C2, P2, O2, E2, m2, 5, a2[20]), E2 = l2(E2, C2, P2, O2, I2, 9, a2[21]), O2 = l2(O2, E2, C2, P2, T2, 14, a2[22]), P2 = l2(P2, O2, E2, C2, g2, 20, a2[23]), C2 = l2(C2, P2, O2, E2, v2, 5, a2[24]), E2 = l2(E2, C2, P2, O2, A2, 9, a2[25]), O2 = l2(O2, E2, C2, P2, f2, 14, a2[26]), P2 = l2(P2, O2, E2, C2, w2, 20, a2[27]), C2 = l2(C2, P2, O2, E2, k2, 5, a2[28]), E2 = l2(E2, C2, P2, O2, p2, 9, a2[29]), O2 = l2(O2, E2, C2, P2, _2, 14, a2[30]), C2 = h2(C2, P2 = l2(P2, O2, E2, C2, b2, 20, a2[31]), O2, E2, m2, 4, a2[32]), E2 = h2(E2, C2, P2, O2, w2, 11, a2[33]), O2 = h2(O2, E2, C2, P2, S2, 16, a2[34]), P2 = h2(P2, O2, E2, C2, A2, 23, a2[35]), C2 = h2(C2, P2, O2, E2, c3, 4, a2[36]), E2 = h2(E2, C2, P2, O2, g2, 11, a2[37]), O2 = h2(O2, E2, C2, P2, _2, 16, a2[38]), P2 = h2(P2, O2, E2, C2, I2, 23, a2[39]), C2 = h2(C2, P2, O2, E2, k2, 4, a2[40]), E2 = h2(E2, C2, P2, O2, o3, 11, a2[41]), O2 = h2(O2, E2, C2, P2, f2, 16, a2[42]), P2 = h2(P2, O2, E2, C2, y2, 23, a2[43]), C2 = h2(C2, P2, O2, E2, v2, 4, a2[44]), E2 = h2(E2, C2, P2, O2, b2, 11, a2[45]), O2 = h2(O2, E2, C2, P2, T2, 16, a2[46]), C2 = d2(C2, P2 = h2(P2, O2, E2, C2, p2, 23, a2[47]), O2, E2, o3, 6, a2[48]), E2 = d2(E2, C2, P2, O2, _2, 10, a2[49]), O2 = d2(O2, E2, C2, P2, A2, 15, a2[50]), P2 = d2(P2, O2, E2, C2, m2, 21, a2[51]), C2 = d2(C2, P2, O2, E2, b2, 6, a2[52]), E2 = d2(E2, C2, P2, O2, f2, 10, a2[53]), O2 = d2(O2, E2, C2, P2, I2, 15, a2[54]), P2 = d2(P2, O2, E2, C2, c3, 21, a2[55]), C2 = d2(C2, P2, O2, E2, w2, 6, a2[56]), E2 = d2(E2, C2, P2, O2, T2, 10, a2[57]), O2 = d2(O2, E2, C2, P2, y2, 15, a2[58]), P2 = d2(P2, O2, E2, C2, k2, 21, a2[59]), C2 = d2(C2, P2, O2, E2, g2, 6, a2[60]), E2 = d2(E2, C2, P2, O2, S2, 10, a2[61]), O2 = d2(O2, E2, C2, P2, p2, 15, a2[62]), P2 = d2(P2, O2, E2, C2, v2, 21, a2[63]), i3[0] = i3[0] + C2 | 0, i3[1] = i3[1] + P2 | 0, i3[2] = i3[2] + O2 | 0, i3[3] = i3[3] + E2 | 0; }, _doFinalize: function() { var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes; n3[r3 >>> 5] |= 128 << 24 - r3 % 32; var i3 = e3.floor(s3 / 4294967296), o3 = s3; n3[15 + (r3 + 64 >>> 9 << 4)] = 16711935 & (i3 << 8 | i3 >>> 24) | 4278255360 & (i3 << 24 | i3 >>> 8), n3[14 + (r3 + 64 >>> 9 << 4)] = 16711935 & (o3 << 8 | o3 >>> 24) | 4278255360 & (o3 << 24 | o3 >>> 8), t4.sigBytes = 4 * (n3.length + 1), this._process(); for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) { var l3 = c3[u3]; c3[u3] = 16711935 & (l3 << 8 | l3 >>> 24) | 4278255360 & (l3 << 24 | l3 >>> 8); } return a3; }, clone: function() { var e4 = i2.clone.call(this); return e4._hash = this._hash.clone(), e4; } }); function u2(e4, t4, n3, s3, r3, i3, o3) { var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3; return (a3 << i3 | a3 >>> 32 - i3) + t4; } function l2(e4, t4, n3, s3, r3, i3, o3) { var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3; return (a3 << i3 | a3 >>> 32 - i3) + t4; } function h2(e4, t4, n3, s3, r3, i3, o3) { var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3; return (a3 << i3 | a3 >>> 32 - i3) + t4; } function d2(e4, t4, n3, s3, r3, i3, o3) { var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3; return (a3 << i3 | a3 >>> 32 - i3) + t4; } t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2); }(Math), n2.MD5); }), n(function(e2, t2) { var n2; e2.exports = (n2 = r, void function() { var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8; e3.algo.HMAC = t3.extend({ init: function(e4, t4) { e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4)); var n3 = e4.blockSize, r2 = 4 * n3; t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp(); for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++) a2[u2] ^= 1549556828, c2[u2] ^= 909522486; i2.sigBytes = o2.sigBytes = r2, this.reset(); }, reset: function() { var e4 = this._hasher; e4.reset(), e4.update(this._iKey); }, update: function(e4) { return this._hasher.update(e4), this; }, finalize: function(e4) { var t4 = this._hasher, n3 = t4.finalize(e4); return t4.reset(), t4.finalize(this._oKey.clone().concat(n3)); } }); }()); }), n(function(e2, t2) { e2.exports = r.HmacMD5; })), o = n(function(e2, t2) { e2.exports = r.enc.Utf8; }), a = n(function(e2, t2) { var n2; e2.exports = (n2 = r, function() { var e3 = n2, t3 = e3.lib.WordArray; function s2(e4, n3, s3) { for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++) if (o2 % 4) { var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2; r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++; } return t3.create(r2, i2); } e3.enc.Base64 = { stringify: function(e4) { var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map; e4.clamp(); for (var r2 = [], i2 = 0; i2 < n3; i2 += 3) for (var o2 = (t4[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255) << 16 | (t4[i2 + 1 >>> 2] >>> 24 - (i2 + 1) % 4 * 8 & 255) << 8 | t4[i2 + 2 >>> 2] >>> 24 - (i2 + 2) % 4 * 8 & 255, a2 = 0; a2 < 4 && i2 + 0.75 * a2 < n3; a2++) r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63)); var c2 = s3.charAt(64); if (c2) for (; r2.length % 4; ) r2.push(c2); return r2.join(""); }, parse: function(e4) { var t4 = e4.length, n3 = this._map, r2 = this._reverseMap; if (!r2) { r2 = this._reverseMap = []; for (var i2 = 0; i2 < n3.length; i2++) r2[n3.charCodeAt(i2)] = i2; } var o2 = n3.charAt(64); if (o2) { var a2 = e4.indexOf(o2); -1 !== a2 && (t4 = a2); } return s2(e4, t4, r2); }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }; }(), n2.enc.Base64); }); const c = "FUNCTION", u = "OBJECT", l = "CLIENT_DB", h = "pending", d = "fulfilled", p = "rejected"; function f(e2) { return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase(); } function g(e2) { return "object" === f(e2); } function m(e2) { return "function" == typeof e2; } function y(e2) { return function() { try { return e2.apply(e2, arguments); } catch (e3) { console.error(e3); } }; } const _ = "REJECTED", w = "NOT_PENDING"; class v { constructor({ createPromise: e2, retryRule: t2 = _ } = {}) { this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2; } get needRetry() { if (!this.status) return true; switch (this.retryRule) { case _: return this.status === p; case w: return this.status !== h; } } exec() { return this.needRetry ? (this.status = h, this.promise = this.createPromise().then((e2) => (this.status = d, Promise.resolve(e2)), (e2) => (this.status = p, Promise.reject(e2))), this.promise) : this.promise; } } function I(e2) { return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2; } const S = true, b = "app", A = I(define_process_env_UNI_SECURE_NETWORK_CONFIG_default), T = b, C = I(""), P = I("[]") || []; let E = ""; try { E = "__UNI__611B013"; } catch (e2) { } let x, L = {}; function U(e2, t2 = {}) { var n2, s2; return n2 = L, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (L[e2] = t2), L[e2]; } function R() { return x || (x = function() { if ("undefined" != typeof globalThis) return globalThis; if ("undefined" != typeof self) return self; if ("undefined" != typeof window) return window; function e2() { return this; } return void 0 !== e2() ? e2() : new Function("return this")(); }(), x); } L = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {}; const N = ["invoke", "success", "fail", "complete"], D = U("_globalUniCloudInterceptor"); function M(e2, t2) { D[e2] || (D[e2] = {}), g(t2) && Object.keys(t2).forEach((n2) => { N.indexOf(n2) > -1 && function(e3, t3, n3) { let s2 = D[e3][t3]; s2 || (s2 = D[e3][t3] = []), -1 === s2.indexOf(n3) && m(n3) && s2.push(n3); }(e2, n2, t2[n2]); }); } function q(e2, t2) { D[e2] || (D[e2] = {}), g(t2) ? Object.keys(t2).forEach((n2) => { N.indexOf(n2) > -1 && function(e3, t3, n3) { const s2 = D[e3][t3]; if (!s2) return; const r2 = s2.indexOf(n3); r2 > -1 && s2.splice(r2, 1); }(e2, n2, t2[n2]); }) : delete D[e2]; } function F(e2, t2) { return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve(); } function K(e2, t2) { return D[e2] && D[e2][t2] || []; } function j(e2) { M("callObject", e2); } const $ = U("_globalUniCloudListener"), B = "response", W = "needLogin", H = "refreshToken", J = "failover", z = "clientdb", V = "cloudfunction", G = "cloudobject"; function Q(e2) { return $[e2] || ($[e2] = []), $[e2]; } function Y(e2, t2) { const n2 = Q(e2); n2.includes(t2) || n2.push(t2); } function X(e2, t2) { const n2 = Q(e2), s2 = n2.indexOf(t2); -1 !== s2 && n2.splice(s2, 1); } function Z(e2, t2) { const n2 = Q(e2); for (let e3 = 0; e3 < n2.length; e3++) { (0, n2[e3])(t2); } } let ee, te = false; function ne() { return ee || (ee = new Promise((e2) => { te && e2(), function t2() { if ("function" == typeof getCurrentPages) { const t3 = getCurrentPages(); t3 && t3[0] && (te = true, e2()); } te || setTimeout(() => { t2(); }, 30); }(); }), ee); } function se(e2) { const t2 = {}; for (const n2 in e2) { const s2 = e2[n2]; m(s2) && (t2[n2] = y(s2)); } return t2; } class re extends Error { constructor(e2) { const t2 = e2.message || e2.errMsg || "unknown system error"; super(t2), this.errMsg = t2, this.code = this.errCode = e2.code || e2.errCode || "SYSTEM_ERROR", this.errSubject = this.subject = e2.subject || e2.errSubject, this.cause = e2.cause, this.requestId = e2.requestId; } toJson(e2 = 0) { if (!(e2 >= 10)) return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause }; } } var ie = { request: (e2) => uni.request(e2), uploadFile: (e2) => uni.uploadFile(e2), setStorageSync: (e2, t2) => uni.setStorageSync(e2, t2), getStorageSync: (e2) => uni.getStorageSync(e2), removeStorageSync: (e2) => uni.removeStorageSync(e2), clearStorageSync: () => uni.clearStorageSync(), connectSocket: (e2) => uni.connectSocket(e2) }; function oe(e2) { return e2 && oe(e2.__v_raw) || e2; } function ae() { return { token: ie.getStorageSync("uni_id_token") || ie.getStorageSync("uniIdToken"), tokenExpired: ie.getStorageSync("uni_id_token_expired") }; } function ce({ token: e2, tokenExpired: t2 } = {}) { e2 && ie.setStorageSync("uni_id_token", e2), t2 && ie.setStorageSync("uni_id_token_expired", t2); } let ue, le; function he() { return ue || (ue = uni.getSystemInfoSync()), ue; } function de() { let e2, t2; try { if (uni.getLaunchOptionsSync) { if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return; const { scene: n2, channel: s2 } = uni.getLaunchOptionsSync(); e2 = s2, t2 = n2; } } catch (e3) { } return { channel: e2, scene: t2 }; } let pe = {}; function fe() { const e2 = uni.getLocale && uni.getLocale() || "en"; if (le) return { ...pe, ...le, locale: e2, LOCALE: e2 }; const t2 = he(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["appId", "appLanguage", "appName", "appVersion", "appVersionCode", "appWgtVersion", "browserName", "browserVersion", "deviceBrand", "deviceId", "deviceModel", "deviceType", "osName", "osVersion", "romName", "romVersion", "ua", "hostName", "hostVersion", "uniPlatform", "uniRuntimeVersion", "uniRuntimeVersionCode", "uniCompilerVersion", "uniCompilerVersionCode"]; for (const e3 in t2) Object.hasOwnProperty.call(t2, e3) && -1 === o2.indexOf(e3) && delete t2[e3]; return le = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...de(), ...t2 }, { ...pe, ...le, locale: e2, LOCALE: e2 }; } var ge = { sign: function(e2, t2) { let n2 = ""; return Object.keys(e2).sort().forEach(function(t3) { e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]); }), n2 = n2.slice(1), i(n2, t2).toString(); }, wrappedRequest: function(e2, t2) { return new Promise((n2, s2) => { t2(Object.assign(e2, { complete(e3) { e3 || (e3 = {}); const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"]; if (!e3.statusCode || e3.statusCode >= 400) { const n3 = e3.data && e3.data.error && e3.data.error.code || "SYS_ERR", r3 = e3.data && e3.data.error && e3.data.error.message || e3.errMsg || "request:fail"; return s2(new re({ code: n3, message: r3, requestId: t3 })); } const r2 = e3.data; if (r2.error) return s2(new re({ code: r2.error.code, message: r2.error.message, requestId: t3 })); r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2); } })); }); }, toBase64: function(e2) { return a.stringify(o.parse(e2)); } }; var me = class { constructor(e2) { ["spaceId", "clientSecret"].forEach((t2) => { if (!Object.prototype.hasOwnProperty.call(e2, t2)) throw new Error(`${t2} required`); }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = ie, this._getAccessTokenPromiseHub = new v({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => { if (!e3.result || !e3.result.accessToken) throw new re({ code: "AUTH_FAILED", message: "获取accessToken失败" }); this.setAccessToken(e3.result.accessToken); }), retryRule: w }); } get hasAccessToken() { return !!this.accessToken; } setAccessToken(e2) { this.accessToken = e2; } requestWrapped(e2) { return ge.wrappedRequest(e2, this.adapter.request); } requestAuth(e2) { return this.requestWrapped(e2); } request(e2, t2) { return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => { !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3(); }).then(() => this.getAccessToken()).then(() => { const t4 = this.rebuildRequest(e2); return this.request(t4, true); })) : this.getAccessToken().then(() => { const t3 = this.rebuildRequest(e2); return this.request(t3, true); })); } rebuildRequest(e2) { const t2 = Object.assign({}, e2); return t2.data.token = this.accessToken, t2.header["x-basement-token"] = this.accessToken, t2.header["x-serverless-sign"] = ge.sign(t2.data, this.config.clientSecret), t2; } setupRequest(e2, t2) { const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" }; return "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = ge.sign(n2, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: s2 }; } getAccessToken() { return this._getAccessTokenPromiseHub.exec(); } async authorize() { await this.getAccessToken(); } callFunction(e2) { const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) }; return this.request({ ...this.setupRequest(t2), timeout: e2.timeout }); } getOSSUploadOptionsFromPath(e2) { const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) }; return this.request(this.setupRequest(t2)); } uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) { return new Promise((o2, a2) => { const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) { e3 && e3.statusCode < 400 ? o2(e3) : a2(new re({ code: "UPLOAD_FAILED", message: "文件上传失败" })); }, fail(e3) { a2(new re({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" })); } }); "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => { i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend }); }); }); } reportOSSUpload(e2) { const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) }; return this.request(this.setupRequest(t2)); } async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) { if ("string" !== f(t2)) throw new re({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" }); if (!(t2 = t2.trim())) throw new re({ code: "INVALID_PARAM", message: "cloudPath不可为空" }); if (/:\/\//.test(t2)) throw new re({ code: "INVALID_PARAM", message: "cloudPath不合法" }); const o2 = i2 && i2.envType || this.config.envType; if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1)) throw new re({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" }); const a2 = (await this.getOSSUploadOptionsFromPath({ env: o2, filename: s2 ? t2.split("/").pop() : t2, fileId: s2 ? t2 : void 0 })).result, c2 = "https://" + a2.cdnDomain + "/" + a2.ossPath, { securityToken: u2, accessKeyId: l2, signature: h2, host: d2, ossPath: p2, id: g2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: l2, Signature: h2, host: d2, id: g2, key: p2, policy: m2, success_action_status: 200 }; if (u2 && (_2["x-oss-security-token"] = u2), y2) { const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: g2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" }); _2.callback = ge.toBase64(e3); } const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 }; if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2) return { success: true, filePath: e2, fileID: c2 }; if ((await this.reportOSSUpload({ id: g2 })).success) return { success: true, filePath: e2, fileID: c2 }; throw new re({ code: "UPLOAD_FAILED", message: "文件上传失败" }); } getTempFileURL({ fileList: e2 } = {}) { return new Promise((t2, n2) => { Array.isArray(e2) && 0 !== e2.length || n2(new re({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), this.getFileInfo({ fileList: e2 }).then((n3) => { t2({ fileList: e2.map((e3, t3) => { const s2 = n3.fileList[t3]; return { fileID: e3, tempFileURL: s2 && s2.url || e3 }; }) }); }); }); } async getFileInfo({ fileList: e2 } = {}) { if (!Array.isArray(e2) || 0 === e2.length) throw new re({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" }); const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) }; return { fileList: (await this.request(this.setupRequest(t2))).result }; } }; var ye = { init(e2) { const t2 = new me(e2), n2 = { signInAnonymously: function() { return t2.authorize(); }, getLoginState: function() { return Promise.resolve(false); } }; return t2.auth = function() { return n2; }, t2.customAuth = t2.auth, t2; } }; const _e = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:"; var we; !function(e2) { e2.local = "local", e2.none = "none", e2.session = "session"; }(we || (we = {})); var ve = function() { }, Ie = n(function(e2, t2) { var n2; e2.exports = (n2 = r, function(e3) { var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [], c2 = []; !function() { function t4(t5) { for (var n4 = e3.sqrt(t5), s4 = 2; s4 <= n4; s4++) if (!(t5 % s4)) return false; return true; } function n3(e4) { return 4294967296 * (e4 - (0 | e4)) | 0; } for (var s3 = 2, r3 = 0; r3 < 64; ) t4(s3) && (r3 < 8 && (a2[r3] = n3(e3.pow(s3, 0.5))), c2[r3] = n3(e3.pow(s3, 1 / 3)), r3++), s3++; }(); var u2 = [], l2 = o2.SHA256 = i2.extend({ _doReset: function() { this._hash = new r2.init(a2.slice(0)); }, _doProcessBlock: function(e4, t4) { for (var n3 = this._hash.words, s3 = n3[0], r3 = n3[1], i3 = n3[2], o3 = n3[3], a3 = n3[4], l3 = n3[5], h2 = n3[6], d2 = n3[7], p2 = 0; p2 < 64; p2++) { if (p2 < 16) u2[p2] = 0 | e4[t4 + p2]; else { var f2 = u2[p2 - 15], g2 = (f2 << 25 | f2 >>> 7) ^ (f2 << 14 | f2 >>> 18) ^ f2 >>> 3, m2 = u2[p2 - 2], y2 = (m2 << 15 | m2 >>> 17) ^ (m2 << 13 | m2 >>> 19) ^ m2 >>> 10; u2[p2] = g2 + u2[p2 - 7] + y2 + u2[p2 - 16]; } var _2 = s3 & r3 ^ s3 & i3 ^ r3 & i3, w2 = (s3 << 30 | s3 >>> 2) ^ (s3 << 19 | s3 >>> 13) ^ (s3 << 10 | s3 >>> 22), v2 = d2 + ((a3 << 26 | a3 >>> 6) ^ (a3 << 21 | a3 >>> 11) ^ (a3 << 7 | a3 >>> 25)) + (a3 & l3 ^ ~a3 & h2) + c2[p2] + u2[p2]; d2 = h2, h2 = l3, l3 = a3, a3 = o3 + v2 | 0, o3 = i3, i3 = r3, r3 = s3, s3 = v2 + (w2 + _2) | 0; } n3[0] = n3[0] + s3 | 0, n3[1] = n3[1] + r3 | 0, n3[2] = n3[2] + i3 | 0, n3[3] = n3[3] + o3 | 0, n3[4] = n3[4] + a3 | 0, n3[5] = n3[5] + l3 | 0, n3[6] = n3[6] + h2 | 0, n3[7] = n3[7] + d2 | 0; }, _doFinalize: function() { var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes; return n3[r3 >>> 5] |= 128 << 24 - r3 % 32, n3[14 + (r3 + 64 >>> 9 << 4)] = e3.floor(s3 / 4294967296), n3[15 + (r3 + 64 >>> 9 << 4)] = s3, t4.sigBytes = 4 * n3.length, this._process(), this._hash; }, clone: function() { var e4 = i2.clone.call(this); return e4._hash = this._hash.clone(), e4; } }); t3.SHA256 = i2._createHelper(l2), t3.HmacSHA256 = i2._createHmacHelper(l2); }(Math), n2.SHA256); }), Se = Ie, be = n(function(e2, t2) { e2.exports = r.HmacSHA256; }); const ke = () => { let e2; if (!Promise) { e2 = () => { }, e2.promise = {}; const t3 = () => { throw new re({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' }); }; return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2; } const t2 = new Promise((t3, n2) => { e2 = (e3, s2) => e3 ? n2(e3) : t3(s2); }); return e2.promise = t2, e2; }; function Ae(e2) { return void 0 === e2; } function Te(e2) { return "[object Null]" === Object.prototype.toString.call(e2); } function Ce(e2 = "") { return e2.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题:.*)/, "$1"); } function Pe(e2 = 32) { const t2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n2 = t2.length; let s2 = ""; for (let r2 = 0; r2 < e2; r2++) s2 += t2.charAt(Math.floor(Math.random() * n2)); return s2; } var Oe; function Ee(e2) { const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]); var n2; for (const e3 of t2) { const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3; if (t3()) return { adapter: n3(), runtime: s2 }; } } !function(e2) { e2.WEB = "web", e2.WX_MP = "wx_mp"; }(Oe || (Oe = {})); const xe = { adapter: null, runtime: void 0 }, Le = ["anonymousUuidKey"]; class Ue extends ve { constructor() { super(), xe.adapter.root.tcbObject || (xe.adapter.root.tcbObject = {}); } setItem(e2, t2) { xe.adapter.root.tcbObject[e2] = t2; } getItem(e2) { return xe.adapter.root.tcbObject[e2]; } removeItem(e2) { delete xe.adapter.root.tcbObject[e2]; } clear() { delete xe.adapter.root.tcbObject; } } function Re(e2, t2) { switch (e2) { case "local": return t2.localStorage || new Ue(); case "none": return new Ue(); default: return t2.sessionStorage || new Ue(); } } class Ne { constructor(e2) { if (!this._storage) { this._persistence = xe.adapter.primaryStorage || e2.persistence, this._storage = Re(this._persistence, xe.adapter); const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = "device_id", a2 = `token_type_${e2.env}`, c2 = `user_info_${e2.env}`; this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: c2, deviceIdKey: o2, tokenTypeKey: a2 }; } } updatePersistence(e2) { if (e2 === this._persistence) return; const t2 = "local" === this._persistence; this._persistence = e2; const n2 = Re(e2, xe.adapter); for (const e3 in this.keys) { const s2 = this.keys[e3]; if (t2 && Le.includes(e3)) continue; const r2 = this._storage.getItem(s2); Ae(r2) || Te(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2)); } this._storage = n2; } setStore(e2, t2, n2) { if (!this._storage) return; const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2); try { this._storage.setItem(e2, r2); } catch (e3) { throw e3; } } getStore(e2, t2) { try { if (!this._storage) return; } catch (e3) { return ""; } t2 = t2 || "localCachev1"; const n2 = this._storage.getItem(e2); if (!n2) return ""; if (n2.indexOf(t2) >= 0) { return JSON.parse(n2).content; } return ""; } removeStore(e2) { this._storage.removeItem(e2); } } const De = {}, Me = {}; function qe(e2) { return De[e2]; } class Fe { constructor(e2, t2) { this.data = t2 || null, this.name = e2; } } class Ke extends Fe { constructor(e2, t2) { super("error", { error: e2, data: t2 }), this.error = e2; } } const je = new class { constructor() { this._listeners = {}; } on(e2, t2) { return function(e3, t3, n2) { n2[e3] = n2[e3] || [], n2[e3].push(t3); }(e2, t2, this._listeners), this; } off(e2, t2) { return function(e3, t3, n2) { if (n2 && n2[e3]) { const s2 = n2[e3].indexOf(t3); -1 !== s2 && n2[e3].splice(s2, 1); } }(e2, t2, this._listeners), this; } fire(e2, t2) { if (e2 instanceof Ke) return console.error(e2.error), this; const n2 = "string" == typeof e2 ? new Fe(e2, t2 || {}) : e2; const s2 = n2.name; if (this._listens(s2)) { n2.target = this; const e3 = this._listeners[s2] ? [...this._listeners[s2]] : []; for (const t3 of e3) t3.call(this, n2); } return this; } _listens(e2) { return this._listeners[e2] && this._listeners[e2].length > 0; } }(); function $e(e2, t2) { je.on(e2, t2); } function Be(e2, t2 = {}) { je.fire(e2, t2); } function We(e2, t2) { je.off(e2, t2); } const He = "loginStateChanged", Je = "loginStateExpire", ze = "loginTypeChanged", Ve = "anonymousConverted", Ge = "refreshAccessToken"; var Qe; !function(e2) { e2.ANONYMOUS = "ANONYMOUS", e2.WECHAT = "WECHAT", e2.WECHAT_PUBLIC = "WECHAT-PUBLIC", e2.WECHAT_OPEN = "WECHAT-OPEN", e2.CUSTOM = "CUSTOM", e2.EMAIL = "EMAIL", e2.USERNAME = "USERNAME", e2.NULL = "NULL"; }(Qe || (Qe = {})); class Ye { constructor() { this._fnPromiseMap = /* @__PURE__ */ new Map(); } async run(e2, t2) { let n2 = this._fnPromiseMap.get(e2); return n2 || (n2 = new Promise(async (n3, s2) => { try { await this._runIdlePromise(); const s3 = t2(); n3(await s3); } catch (e3) { s2(e3); } finally { this._fnPromiseMap.delete(e2); } }), this._fnPromiseMap.set(e2, n2)), n2; } _runIdlePromise() { return Promise.resolve(); } } class Xe { constructor(e2) { this._singlePromise = new Ye(), this._cache = qe(e2.env), this._baseURL = `https://${e2.env}.ap-shanghai.tcb-api.tencentcloudapi.com`, this._reqClass = new xe.adapter.reqClass({ timeout: e2.timeout, timeoutMsg: `请求在${e2.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }); } _getDeviceId() { if (this._deviceID) return this._deviceID; const { deviceIdKey: e2 } = this._cache.keys; let t2 = this._cache.getStore(e2); return "string" == typeof t2 && t2.length >= 16 && t2.length <= 48 || (t2 = Pe(), this._cache.setStore(e2, t2)), this._deviceID = t2, t2; } async _request(e2, t2, n2 = {}) { const s2 = { "x-request-id": Pe(), "x-device-id": this._getDeviceId() }; if (n2.withAccessToken) { const { tokenTypeKey: e3 } = this._cache.keys, t3 = await this.getAccessToken(), n3 = this._cache.getStore(e3); s2.authorization = `${n3} ${t3}`; } return this._reqClass["get" === n2.method ? "get" : "post"]({ url: `${this._baseURL}${e2}`, data: t2, headers: s2 }); } async _fetchAccessToken() { const { loginTypeKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2, tokenTypeKey: s2 } = this._cache.keys, r2 = this._cache.getStore(e2); if (r2 && r2 !== Qe.ANONYMOUS) throw new re({ code: "INVALID_OPERATION", message: "非匿名登录不支持刷新 access token" }); const i2 = await this._singlePromise.run("fetchAccessToken", async () => (await this._request("/auth/v1/signin/anonymously", {}, { method: "post" })).data), { access_token: o2, expires_in: a2, token_type: c2 } = i2; return this._cache.setStore(s2, c2), this._cache.setStore(t2, o2), this._cache.setStore(n2, Date.now() + 1e3 * a2), o2; } isAccessTokenExpired(e2, t2) { let n2 = true; return e2 && t2 && (n2 = t2 < Date.now()), n2; } async getAccessToken() { const { accessTokenKey: e2, accessTokenExpireKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2), s2 = this._cache.getStore(t2); return this.isAccessTokenExpired(n2, s2) ? this._fetchAccessToken() : n2; } async refreshAccessToken() { const { accessTokenKey: e2, accessTokenExpireKey: t2, loginTypeKey: n2 } = this._cache.keys; return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.setStore(n2, Qe.ANONYMOUS), this.getAccessToken(); } async getUserInfo() { return this._singlePromise.run("getUserInfo", async () => (await this._request("/auth/v1/user/me", {}, { withAccessToken: true, method: "get" })).data); } } const Ze = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], et = { "X-SDK-Version": "1.3.5" }; function tt(e2, t2, n2) { const s2 = e2[t2]; e2[t2] = function(t3) { const r2 = {}, i2 = {}; n2.forEach((n3) => { const { data: s3, headers: o3 } = n3.call(e2, t3); Object.assign(r2, s3), Object.assign(i2, o3); }); const o2 = t3.data; return o2 && (() => { var e3; if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3)) t3.data = { ...o2, ...r2 }; else for (const e4 in r2) o2.append(e4, r2[e4]); })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3); }; } function nt() { const e2 = Math.random().toString(16).slice(2); return { data: { seqId: e2 }, headers: { ...et, "x-seqid": e2 } }; } class st { constructor(e2 = {}) { var t2; this.config = e2, this._reqClass = new xe.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = qe(this.config.env), this._localCache = (t2 = this.config.env, Me[t2]), this.oauth = new Xe(this.config), tt(this._reqClass, "post", [nt]), tt(this._reqClass, "upload", [nt]), tt(this._reqClass, "download", [nt]); } async post(e2) { return await this._reqClass.post(e2); } async upload(e2) { return await this._reqClass.upload(e2); } async download(e2) { return await this._reqClass.download(e2); } async refreshAccessToken() { let e2, t2; this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken()); try { e2 = await this._refreshAccessTokenPromise; } catch (e3) { t2 = e3; } if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2) throw t2; return e2; } async _refreshAccessToken() { const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys; this._cache.removeStore(e2), this._cache.removeStore(t2); let i2 = this._cache.getStore(n2); if (!i2) throw new re({ message: "未登录CloudBase" }); const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2); if (a2.data.code) { const { code: e3 } = a2.data; if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) { if (this._cache.getStore(s2) === Qe.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) { const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 }); return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken(); } Be(Je), this._cache.removeStore(n2); } throw new re({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` }); } if (a2.data.access_token) return Be(Ge), this._cache.setStore(e2, a2.data.access_token), this._cache.setStore(t2, a2.data.access_token_expire + Date.now()), { accessToken: a2.data.access_token, accessTokenExpire: a2.data.access_token_expire }; a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken()); } async getAccessToken() { const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys; if (!this._cache.getStore(n2)) throw new re({ message: "refresh token不存在,登录状态异常" }); let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true; return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 }; } async request(e2, t2, n2) { const s2 = `x-tcb-trace_${this.config.env}`; let r2 = "application/x-www-form-urlencoded"; const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 }; let o2; if (-1 === Ze.indexOf(e2) && (this._cache.keys, i2.access_token = await this.oauth.getAccessToken()), "storage.uploadFile" === e2) { o2 = new FormData(); for (let e3 in o2) o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]); r2 = "multipart/form-data"; } else { r2 = "application/json", o2 = {}; for (let e3 in i2) void 0 !== i2[e3] && (o2[e3] = i2[e3]); } let a2 = { headers: { "content-type": r2 } }; n2 && n2.timeout && (a2.timeout = n2.timeout), n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress); const c2 = this._localCache.getStore(s2); c2 && (a2.headers["X-TCB-Trace"] = c2); const { parse: u2, inQuery: l2, search: h2 } = t2; let d2 = { env: this.config.env }; u2 && (d2.parse = true), l2 && (d2 = { ...l2, ...d2 }); let p2 = function(e3, t3, n3 = {}) { const s3 = /\?/.test(t3); let r3 = ""; for (let e4 in n3) "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`; return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`; }(_e, "//tcb-api.tencentcloudapi.com/web", d2); h2 && (p2 += h2); const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"]; if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data) throw new re({ code: "NETWORK_ERROR", message: "network request error" }); return f2; } async send(e2, t2 = {}, n2 = {}) { const s2 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress }); if (("ACCESS_TOKEN_DISABLED" === s2.data.code || "ACCESS_TOKEN_EXPIRED" === s2.data.code) && -1 === Ze.indexOf(e2)) { await this.oauth.refreshAccessToken(); const s3 = await this.request(e2, t2, { ...n2, onUploadProgress: t2.onUploadProgress }); if (s3.data.code) throw new re({ code: s3.data.code, message: Ce(s3.data.message) }); return s3.data; } if (s2.data.code) throw new re({ code: s2.data.code, message: Ce(s2.data.message) }); return s2.data; } setRefreshToken(e2) { const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys; this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2); } } const rt = {}; function it(e2) { return rt[e2]; } class ot { constructor(e2) { this.config = e2, this._cache = qe(e2.env), this._request = it(e2.env); } setRefreshToken(e2) { const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys; this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2); } setAccessToken(e2, t2) { const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys; this._cache.setStore(n2, e2), this._cache.setStore(s2, t2); } async refreshUserInfo() { const { data: e2 } = await this._request.send("auth.getUserInfo", {}); return this.setLocalUserInfo(e2), e2; } setLocalUserInfo(e2) { const { userInfoKey: t2 } = this._cache.keys; this._cache.setStore(t2, e2); } } class at { constructor(e2) { if (!e2) throw new re({ code: "PARAM_ERROR", message: "envId is not defined" }); this._envId = e2, this._cache = qe(this._envId), this._request = it(this._envId), this.setUserInfo(); } linkWithTicket(e2) { if ("string" != typeof e2) throw new re({ code: "PARAM_ERROR", message: "ticket must be string" }); return this._request.send("auth.linkWithTicket", { ticket: e2 }); } linkWithRedirect(e2) { e2.signInWithRedirect(); } updatePassword(e2, t2) { return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 }); } updateEmail(e2) { return this._request.send("auth.updateEmail", { newEmail: e2 }); } updateUsername(e2) { if ("string" != typeof e2) throw new re({ code: "PARAM_ERROR", message: "username must be a string" }); return this._request.send("auth.updateUsername", { username: e2 }); } async getLinkedUidList() { const { data: e2 } = await this._request.send("auth.getLinkedUidList", {}); let t2 = false; const { users: n2 } = e2; return n2.forEach((e3) => { e3.wxOpenId && e3.wxPublicId && (t2 = true); }), { users: n2, hasPrimaryUid: t2 }; } setPrimaryUid(e2) { return this._request.send("auth.setPrimaryUid", { uid: e2 }); } unlink(e2) { return this._request.send("auth.unlink", { platform: e2 }); } async update(e2) { const { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 } = e2, { data: a2 } = await this._request.send("auth.updateUserInfo", { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 }); this.setLocalUserInfo(a2); } async refresh() { const e2 = await this._request.oauth.getUserInfo(); return this.setLocalUserInfo(e2), e2; } setUserInfo() { const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2); ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => { this[e3] = t2[e3]; }), this.location = { country: t2.country, province: t2.province, city: t2.city }; } setLocalUserInfo(e2) { const { userInfoKey: t2 } = this._cache.keys; this._cache.setStore(t2, e2), this.setUserInfo(); } } class ct { constructor(e2) { if (!e2) throw new re({ code: "PARAM_ERROR", message: "envId is not defined" }); this._cache = qe(e2); const { refreshTokenKey: t2, accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys, r2 = this._cache.getStore(t2), i2 = this._cache.getStore(n2), o2 = this._cache.getStore(s2); this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new at(e2); } get isAnonymousAuth() { return this.loginType === Qe.ANONYMOUS; } get isCustomAuth() { return this.loginType === Qe.CUSTOM; } get isWeixinAuth() { return this.loginType === Qe.WECHAT || this.loginType === Qe.WECHAT_OPEN || this.loginType === Qe.WECHAT_PUBLIC; } get loginType() { return this._cache.getStore(this._cache.keys.loginTypeKey); } } class ut extends ot { async signIn() { this._cache.updatePersistence("local"), await this._request.oauth.getAccessToken(), Be(He), Be(ze, { env: this.config.env, loginType: Qe.ANONYMOUS, persistence: "local" }); const e2 = new ct(this.config.env); return await e2.user.refresh(), e2; } async linkAndRetrieveDataWithTicket(e2) { const { anonymousUuidKey: t2, refreshTokenKey: n2 } = this._cache.keys, s2 = this._cache.getStore(t2), r2 = this._cache.getStore(n2), i2 = await this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s2, refresh_token: r2, ticket: e2 }); if (i2.refresh_token) return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), Be(Ve, { env: this.config.env }), Be(ze, { loginType: Qe.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } }; throw new re({ message: "匿名转化失败" }); } _setAnonymousUUID(e2) { const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys; this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, Qe.ANONYMOUS); } _clearAnonymousUUID() { this._cache.removeStore(this._cache.keys.anonymousUuidKey); } } class lt extends ot { async signIn(e2) { if ("string" != typeof e2) throw new re({ code: "PARAM_ERROR", message: "ticket must be a string" }); const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" }); if (n2.refresh_token) return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), Be(He), Be(ze, { env: this.config.env, loginType: Qe.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new ct(this.config.env); throw new re({ message: "自定义登录失败" }); } } class ht extends ot { async signIn(e2, t2) { if ("string" != typeof e2) throw new re({ code: "PARAM_ERROR", message: "email must be a string" }); const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: "EMAIL", email: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token: i2, access_token_expire: o2 } = s2; if (r2) return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Be(He), Be(ze, { env: this.config.env, loginType: Qe.EMAIL, persistence: this.config.persistence }), new ct(this.config.env); throw s2.code ? new re({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new re({ message: "邮箱登录失败" }); } async activate(e2) { return this._request.send("auth.activateEndUserMail", { token: e2 }); } async resetPasswordWithToken(e2, t2) { return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 }); } } class dt extends ot { async signIn(e2, t2) { if ("string" != typeof e2) throw new re({ code: "PARAM_ERROR", message: "username must be a string" }); "string" != typeof t2 && (t2 = "", console.warn("password is empty")); const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: Qe.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2; if (r2) return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Be(He), Be(ze, { env: this.config.env, loginType: Qe.USERNAME, persistence: this.config.persistence }), new ct(this.config.env); throw s2.code ? new re({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new re({ message: "用户名密码登录失败" }); } } class pt { constructor(e2) { this.config = e2, this._cache = qe(e2.env), this._request = it(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), $e(ze, this._onLoginTypeChanged); } get currentUser() { const e2 = this.hasLoginState(); return e2 && e2.user || null; } get loginType() { return this._cache.getStore(this._cache.keys.loginTypeKey); } anonymousAuthProvider() { return new ut(this.config); } customAuthProvider() { return new lt(this.config); } emailAuthProvider() { return new ht(this.config); } usernameAuthProvider() { return new dt(this.config); } async signInAnonymously() { return new ut(this.config).signIn(); } async signInWithEmailAndPassword(e2, t2) { return new ht(this.config).signIn(e2, t2); } signInWithUsernameAndPassword(e2, t2) { return new dt(this.config).signIn(e2, t2); } async linkAndRetrieveDataWithTicket(e2) { this._anonymousAuthProvider || (this._anonymousAuthProvider = new ut(this.config)), $e(Ve, this._onAnonymousConverted); return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2); } async signOut() { if (this.loginType === Qe.ANONYMOUS) throw new re({ message: "匿名用户不支持登出操作" }); const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2); if (!s2) return; const r2 = await this._request.send("auth.logout", { refresh_token: s2 }); return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), Be(He), Be(ze, { env: this.config.env, loginType: Qe.NULL, persistence: this.config.persistence }), r2; } async signUpWithEmailAndPassword(e2, t2) { return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 }); } async sendPasswordResetEmail(e2) { return this._request.send("auth.sendPasswordResetEmail", { email: e2 }); } onLoginStateChanged(e2) { $e(He, () => { const t3 = this.hasLoginState(); e2.call(this, t3); }); const t2 = this.hasLoginState(); e2.call(this, t2); } onLoginStateExpired(e2) { $e(Je, e2.bind(this)); } onAccessTokenRefreshed(e2) { $e(Ge, e2.bind(this)); } onAnonymousConverted(e2) { $e(Ve, e2.bind(this)); } onLoginTypeChanged(e2) { $e(ze, () => { const t2 = this.hasLoginState(); e2.call(this, t2); }); } async getAccessToken() { return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env }; } hasLoginState() { const { accessTokenKey: e2, accessTokenExpireKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2), s2 = this._cache.getStore(t2); return this._request.oauth.isAccessTokenExpired(n2, s2) ? null : new ct(this.config.env); } async isUsernameRegistered(e2) { if ("string" != typeof e2) throw new re({ code: "PARAM_ERROR", message: "username must be a string" }); const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 }); return t2 && t2.isRegistered; } getLoginState() { return Promise.resolve(this.hasLoginState()); } async signInWithTicket(e2) { return new lt(this.config).signIn(e2); } shouldRefreshAccessToken(e2) { this._request._shouldRefreshAccessTokenHook = e2.bind(this); } getUserInfo() { return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId }); } getAuthHeader() { const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2); return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 }; } _onAnonymousConverted(e2) { const { env: t2 } = e2.data; t2 === this.config.env && this._cache.updatePersistence(this.config.persistence); } _onLoginTypeChanged(e2) { const { loginType: t2, persistence: n2, env: s2 } = e2.data; s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2)); } } const ft = function(e2, t2) { t2 = t2 || ke(); const n2 = it(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2; return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => { const { data: { url: a2, authorization: c2, token: u2, fileId: l2, cosFileId: h2 }, requestId: d2 } = e3, p2 = { key: s2, signature: c2, "x-cos-meta-fileid": h2, success_action_status: "201", "x-cos-security-token": u2 }; n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => { 201 === e4.statusCode ? t2(null, { fileID: l2, requestId: d2 }) : t2(new re({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` })); }).catch((e4) => { t2(e4); }); }).catch((e3) => { t2(e3); }), t2.promise; }, gt = function(e2, t2) { t2 = t2 || ke(); const n2 = it(this.config.env), { cloudPath: s2 } = e2; return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => { t2(null, e3); }).catch((e3) => { t2(e3); }), t2.promise; }, mt = function({ fileList: e2 }, t2) { if (t2 = t2 || ke(), !e2 || !Array.isArray(e2)) return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" }; for (let t3 of e2) if (!t3 || "string" != typeof t3) return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" }; const n2 = { fileid_list: e2 }; return it(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => { e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId }); }).catch((e3) => { t2(e3); }), t2.promise; }, yt = function({ fileList: e2 }, t2) { t2 = t2 || ke(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" }); let n2 = []; for (let s3 of e2) "object" == typeof s3 ? (s3.hasOwnProperty("fileID") && s3.hasOwnProperty("maxAge") || t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n2.push({ fileid: s3.fileID, max_age: s3.maxAge })) : "string" == typeof s3 ? n2.push({ fileid: s3 }) : t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" }); const s2 = { file_list: n2 }; return it(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => { e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId }); }).catch((e3) => { t2(e3); }), t2.promise; }, _t = async function({ fileID: e2 }, t2) { const n2 = (await yt.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0]; if ("SUCCESS" !== n2.code) return t2 ? t2(n2) : new Promise((e3) => { e3(n2); }); const s2 = it(this.config.env); let r2 = n2.download_url; if (r2 = encodeURI(r2), !t2) return s2.download({ url: r2 }); t2(await s2.download({ url: r2 })); }, wt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2, timeout: i2 }, o2) { const a2 = o2 || ke(); let c2; try { c2 = t2 ? JSON.stringify(t2) : ""; } catch (e3) { return Promise.reject(e3); } if (!e2) return Promise.reject(new re({ code: "PARAM_ERROR", message: "函数名不能为空" })); const u2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: c2 }; return it(this.config.env).send("functions.invokeFunction", u2, { timeout: i2 }).then((e3) => { if (e3.code) a2(null, e3); else { let t3 = e3.data.response_data; if (s2) a2(null, { result: t3, requestId: e3.requestId }); else try { t3 = JSON.parse(e3.data.response_data), a2(null, { result: t3, requestId: e3.requestId }); } catch (e4) { a2(new re({ message: "response data must be json" })); } } return a2.promise; }).catch((e3) => { a2(e3); }), a2.promise; }, vt = { timeout: 15e3, persistence: "session" }, It = {}; class St { constructor(e2) { this.config = e2 || this.config, this.authObj = void 0; } init(e2) { switch (xe.adapter || (this.requestClient = new xe.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...vt, ...e2 }, true) { case this.config.timeout > 6e5: console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5; break; case this.config.timeout < 100: console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100; } return new St(this.config); } auth({ persistence: e2 } = {}) { if (this.authObj) return this.authObj; const t2 = e2 || xe.adapter.primaryStorage || vt.persistence; var n2; return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) { const { env: t3 } = e3; De[t3] = new Ne(e3), Me[t3] = new Ne({ ...e3, persistence: "local" }); }(this.config), n2 = this.config, rt[n2.env] = new st(n2), this.authObj = new pt(this.config), this.authObj; } on(e2, t2) { return $e.apply(this, [e2, t2]); } off(e2, t2) { return We.apply(this, [e2, t2]); } callFunction(e2, t2) { return wt.apply(this, [e2, t2]); } deleteFile(e2, t2) { return mt.apply(this, [e2, t2]); } getTempFileURL(e2, t2) { return yt.apply(this, [e2, t2]); } downloadFile(e2, t2) { return _t.apply(this, [e2, t2]); } uploadFile(e2, t2) { return ft.apply(this, [e2, t2]); } getUploadMetadata(e2, t2) { return gt.apply(this, [e2, t2]); } registerExtension(e2) { It[e2.name] = e2; } async invokeExtension(e2, t2) { const n2 = It[e2]; if (!n2) throw new re({ message: `扩展${e2} 必须先注册` }); return await n2.invoke(t2, this); } useAdapters(e2) { const { adapter: t2, runtime: n2 } = Ee(e2) || {}; t2 && (xe.adapter = t2), n2 && (xe.runtime = n2); } } var bt = new St(); function kt(e2, t2, n2) { void 0 === n2 && (n2 = {}); var s2 = /\?/.test(t2), r2 = ""; for (var i2 in n2) "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]); return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2; } class At { get(e2) { const { url: t2, data: n2, headers: s2, timeout: r2 } = e2; return new Promise((e3, i2) => { ie.request({ url: kt("https:", t2), data: n2, method: "GET", header: s2, timeout: r2, success(t3) { e3(t3); }, fail(e4) { i2(e4); } }); }); } post(e2) { const { url: t2, data: n2, headers: s2, timeout: r2 } = e2; return new Promise((e3, i2) => { ie.request({ url: kt("https:", t2), data: n2, method: "POST", header: s2, timeout: r2, success(t3) { e3(t3); }, fail(e4) { i2(e4); } }); }); } upload(e2) { return new Promise((t2, n2) => { const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = ie.uploadFile({ url: kt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) { const n3 = { statusCode: e3.statusCode, data: e3.data || {} }; 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3); }, fail(e3) { n2(new Error(e3.errMsg || "uploadFile:fail")); } }); "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => { e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend }); }); }); } } const Tt = { setItem(e2, t2) { ie.setStorageSync(e2, t2); }, getItem: (e2) => ie.getStorageSync(e2), removeItem(e2) { ie.removeStorageSync(e2); }, clear() { ie.clearStorageSync(); } }; var Ct = { genAdapter: function() { return { root: {}, reqClass: At, localStorage: Tt, primaryStorage: "local" }; }, isMatch: function() { return true; }, runtime: "uni_app" }; bt.useAdapters(Ct); const Pt = bt, Ot = Pt.init; Pt.init = function(e2) { e2.env = e2.spaceId; const t2 = Ot.call(this, e2); t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId; const n2 = t2.auth; return t2.auth = function(e3) { const t3 = n2.call(this, e3); return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => { var n3; t3[e4] = (n3 = t3[e4], function(e5) { e5 = e5 || {}; const { success: t4, fail: s2, complete: r2 } = se(e5); if (!(t4 || s2 || r2)) return n3.call(this, e5); n3.call(this, e5).then((e6) => { t4 && t4(e6), r2 && r2(e6); }, (e6) => { s2 && s2(e6), r2 && r2(e6); }); }).bind(t3); }), t3; }, t2.customAuth = t2.auth, t2; }; var Et = Pt; async function xt(e2, t2) { const n2 = `http://${e2}:${t2}/system/ping`; try { const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => { ie.request({ ...s2, success(t4) { e4(t4); }, fail(e5) { t3(e5); } }); })); return !(!e3.data || 0 !== e3.data.code); } catch (e3) { return false; } var s2; } async function Lt(e2, t2) { let n2; for (let s2 = 0; s2 < e2.length; s2++) { const r2 = e2[s2]; if (await xt(r2, t2)) { n2 = r2; break; } } return { address: n2, port: t2 }; } const Ut = { "serverless.file.resource.generateProximalSign": "storage/generate-proximal-sign", "serverless.file.resource.report": "storage/report", "serverless.file.resource.delete": "storage/delete", "serverless.file.resource.getTempFileURL": "storage/get-temp-file-url" }; var Rt = class { constructor(e2) { if (["spaceId", "clientSecret"].forEach((t2) => { if (!Object.prototype.hasOwnProperty.call(e2, t2)) throw new Error(`${t2} required`); }), !e2.endpoint) throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效"); this.config = Object.assign({}, e2), this.config.provider = "dcloud", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.adapter = ie; } async request(e2, t2 = true) { const n2 = t2; return e2 = n2 ? await this.setupLocalRequest(e2) : this.setupRequest(e2), Promise.resolve().then(() => n2 ? this.requestLocal(e2) : ge.wrappedRequest(e2, this.adapter.request)); } requestLocal(e2) { return new Promise((t2, n2) => { this.adapter.request(Object.assign(e2, { complete(e3) { if (e3 || (e3 = {}), !e3.statusCode || e3.statusCode >= 400) { const t3 = e3.data && e3.data.code || "SYS_ERR", s2 = e3.data && e3.data.message || "request:fail"; return n2(new re({ code: t3, message: s2 })); } t2({ success: true, result: e3.data }); } })); }); } setupRequest(e2) { const t2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), n2 = { "Content-Type": "application/json" }; n2["x-serverless-sign"] = ge.sign(t2, this.config.clientSecret); const s2 = fe(); n2["x-client-info"] = encodeURIComponent(JSON.stringify(s2)); const { token: r2 } = ae(); return n2["x-client-token"] = r2, { url: this.config.requestUrl, method: "POST", data: t2, dataType: "json", header: JSON.parse(JSON.stringify(n2)) }; } async setupLocalRequest(e2) { const t2 = fe(), { token: n2 } = ae(), s2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now(), clientInfo: t2, token: n2 }), { address: r2, servePort: i2 } = this.__dev__ && this.__dev__.debugInfo || {}, { address: o2 } = await Lt(r2, i2); return { url: `http://${o2}:${i2}/${Ut[e2.method]}`, method: "POST", data: s2, dataType: "json", header: JSON.parse(JSON.stringify({ "Content-Type": "application/json" })) }; } callFunction(e2) { const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) }; return this.request(t2, false); } getUploadFileOptions(e2) { const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) }; return this.request(t2); } reportUploadFile(e2) { const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) }; return this.request(t2); } uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) { if (!t2) throw new re({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" }); let r2; return this.getUploadFileOptions({ cloudPath: t2 }).then((t3) => { const { url: i2, formData: o2, name: a2 } = t3.result; return r2 = t3.result.fileUrl, new Promise((t4, r3) => { const c2 = this.adapter.uploadFile({ url: i2, formData: o2, name: a2, filePath: e2, fileType: n2, success(e3) { e3 && e3.statusCode < 400 ? t4(e3) : r3(new re({ code: "UPLOAD_FAILED", message: "文件上传失败" })); }, fail(e3) { r3(new re({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" })); } }); "function" == typeof s2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => { s2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend }); }); }); }).then(() => this.reportUploadFile({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => { t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new re({ code: "UPLOAD_FAILED", message: "文件上传失败" })); })); } deleteFile({ fileList: e2 }) { const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) }; return this.request(t2).then((e3) => { if (e3.success) return e3.result; throw new re({ code: "DELETE_FILE_FAILED", message: "删除文件失败" }); }); } getTempFileURL({ fileList: e2, maxAge: t2 } = {}) { if (!Array.isArray(e2) || 0 === e2.length) throw new re({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" }); const n2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2, maxAge: t2 }) }; return this.request(n2).then((e3) => { if (e3.success) return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) }; throw new re({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" }); }); } }; var Nt = { init(e2) { const t2 = new Rt(e2), n2 = { signInAnonymously: function() { return Promise.resolve(); }, getLoginState: function() { return Promise.resolve(false); } }; return t2.auth = function() { return n2; }, t2.customAuth = t2.auth, t2; } }, Dt = n(function(e2, t2) { e2.exports = r.enc.Hex; }); function Mt() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) { var t2 = 16 * Math.random() | 0; return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16); }); } function qt(e2 = "", t2 = {}) { const { data: n2, functionName: s2, method: r2, headers: i2, signHeaderKeys: o2 = [], config: a2 } = t2, c2 = String(Date.now()), u2 = Mt(), l2 = Object.assign({}, i2, { "x-from-app-id": a2.spaceAppId, "x-from-env-id": a2.spaceId, "x-to-env-id": a2.spaceId, "x-from-instance-id": c2, "x-from-function-name": s2, "x-client-timestamp": c2, "x-alipay-source": "client", "x-request-id": u2, "x-alipay-callid": u2, "x-trace-id": u2 }), h2 = ["x-from-app-id", "x-from-env-id", "x-to-env-id", "x-from-instance-id", "x-from-function-name", "x-client-timestamp"].concat(o2), [d2 = "", p2 = ""] = e2.split("?") || [], f2 = function(e3) { const t3 = e3.signedHeaders.join(";"), n3 = e3.signedHeaders.map((t4) => `${t4.toLowerCase()}:${e3.headers[t4]} `).join(""), s3 = Se(e3.body).toString(Dt), r3 = `${e3.method.toUpperCase()} ${e3.path} ${e3.query} ${n3} ${t3} ${s3} `, i3 = Se(r3).toString(Dt), o3 = `HMAC-SHA256 ${e3.timestamp} ${i3} `, a3 = be(o3, e3.secretKey).toString(Dt); return `HMAC-SHA256 Credential=${e3.secretId}, SignedHeaders=${t3}, Signature=${a3}`; }({ path: d2, query: p2, method: r2, headers: l2, timestamp: c2, body: JSON.stringify(n2), secretId: a2.accessKey, secretKey: a2.secretKey, signedHeaders: h2.sort() }); return { url: `${a2.endpoint}${e2}`, headers: Object.assign({}, l2, { Authorization: f2 }) }; } function Ft({ url: e2, data: t2, method: n2 = "POST", headers: s2 = {}, timeout: r2 }) { return new Promise((i2, o2) => { ie.request({ url: e2, method: n2, data: "object" == typeof t2 ? JSON.stringify(t2) : t2, header: s2, dataType: "json", timeout: r2, complete: (e3 = {}) => { const t3 = s2["x-trace-id"] || ""; if (!e3.statusCode || e3.statusCode >= 400) { const { message: n3, errMsg: s3, trace_id: r3 } = e3.data || {}; return o2(new re({ code: "SYS_ERR", message: n3 || s3 || "request:fail", requestId: r3 || t3 })); } i2({ status: e3.statusCode, data: e3.data, headers: e3.header, requestId: t3 }); } }); }); } function Kt(e2, t2) { const { path: n2, data: s2, method: r2 = "GET" } = e2, { url: i2, headers: o2 } = qt(n2, { functionName: "", data: s2, method: r2, headers: { "x-alipay-cloud-mode": "oss", "x-data-api-type": "oss", "x-expire-timestamp": String(Date.now() + 6e4) }, signHeaderKeys: ["x-data-api-type", "x-expire-timestamp"], config: t2 }); return Ft({ url: i2, data: s2, method: r2, headers: o2 }).then((e3) => { const t3 = e3.data || {}; if (!t3.success) throw new re({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId }); return t3.data || {}; }).catch((e3) => { throw new re({ code: e3.errCode, message: e3.errMsg, requestId: e3.requestId }); }); } function jt(e2 = "") { const t2 = e2.trim().replace(/^cloud:\/\//, ""), n2 = t2.indexOf("/"); if (n2 <= 0) throw new re({ code: "INVALID_PARAM", message: "fileID不合法" }); const s2 = t2.substring(0, n2), r2 = t2.substring(n2 + 1); return s2 !== this.config.spaceId && console.warn("file ".concat(e2, " does not belong to env ").concat(this.config.spaceId)), r2; } function $t(e2 = "") { return "cloud://".concat(this.config.spaceId, "/").concat(e2.replace(/^\/+/, "")); } class Bt { constructor(e2) { this.config = e2; } signedURL(e2, t2 = {}) { const n2 = `/ws/function/${e2}`, s2 = this.config.wsEndpoint.replace(/^ws(s)?:\/\//, ""), r2 = Object.assign({}, t2, { accessKeyId: this.config.accessKey, signatureNonce: Mt(), timestamp: "" + Date.now() }), i2 = [n2, ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function(e3) { return r2[e3] ? "".concat(e3, "=").concat(r2[e3]) : null; }).filter(Boolean).join("&"), `host:${s2}`].join("\n"), o2 = ["HMAC-SHA256", Se(i2).toString(Dt)].join("\n"), a2 = be(o2, this.config.secretKey).toString(Dt), c2 = Object.keys(r2).map((e3) => `${e3}=${encodeURIComponent(r2[e3])}`).join("&"); return `${this.config.wsEndpoint}${n2}?${c2}&signature=${a2}`; } } class Wt { constructor(e2) { this.config = e2; } signedURL(e2, t2 = {}) { const n2 = `/ws/sse/function/${e2}`, s2 = this.config.endpoint.replace(/^http(s)?:\/\//, ""), r2 = Object.assign({}, t2, { accessKeyId: this.config.accessKey, signatureNonce: Mt(), timestamp: "" + Date.now() }), i2 = ["accessKeyId", "authorization", "signatureNonce", "timestamp"].sort().map(function(e3) { return r2[e3] ? "".concat(e3, "=").concat(r2[e3]) : null; }).filter(Boolean).join("&"), o2 = [n2.replace("/ws", ""), i2, `host:${s2}`].join("\n"), a2 = ["HMAC-SHA256", Se(o2).toString(Dt)].join("\n"), c2 = be(a2, this.config.secretKey).toString(Dt), u2 = Object.keys(r2).map((e3) => `${e3}=${encodeURIComponent(r2[e3])}`).join("&"); return `${this.config.endpoint}${n2}?${u2}&signature=${c2}`; } } var Ht = class { constructor(e2) { if (["spaceId", "spaceAppId", "accessKey", "secretKey"].forEach((t2) => { if (!Object.prototype.hasOwnProperty.call(e2, t2)) throw new Error(`${t2} required`); }), e2.endpoint) { if ("string" != typeof e2.endpoint) throw new Error("endpoint must be string"); if (!/^https:\/\//.test(e2.endpoint)) throw new Error("endpoint must start with https://"); e2.endpoint = e2.endpoint.replace(/\/$/, ""); } this.config = Object.assign({}, e2, { endpoint: e2.endpoint || `https://${e2.spaceId}.api-hz.cloudbasefunction.cn`, wsEndpoint: e2.wsEndpoint || `wss://${e2.spaceId}.api-hz.cloudbasefunction.cn` }), this._websocket = new Bt(this.config), this._sse = new Wt(this.config); } callFunction(e2) { return function(e3, t2) { const { name: n2, data: s2, async: r2 = false, timeout: i2 } = e3, o2 = "POST", a2 = { "x-to-function-name": n2 }; r2 && (a2["x-function-invoke-type"] = "async"); const { url: c2, headers: u2 } = qt("/functions/invokeFunction", { functionName: n2, data: s2, method: o2, headers: a2, signHeaderKeys: ["x-to-function-name"], config: t2 }); return Ft({ url: c2, data: s2, method: o2, headers: u2, timeout: i2 }).then((e4) => { let t3 = 0; if (r2) { const n3 = e4.data || {}; t3 = "200" === n3.errCode ? 0 : n3.errCode, e4.data = n3.data || {}, e4.errMsg = n3.errMsg; } if (0 !== t3) throw new re({ code: t3, message: e4.errMsg, requestId: e4.requestId }); return { errCode: t3, success: 0 === t3, requestId: e4.requestId, result: e4.data }; }).catch((e4) => { throw new re({ code: e4.errCode, message: e4.errMsg, requestId: e4.requestId }); }); }(e2, this.config); } uploadFileToOSS({ url: e2, filePath: t2, fileType: n2, formData: s2, onUploadProgress: r2 }) { return new Promise((i2, o2) => { const a2 = ie.uploadFile({ url: e2, filePath: t2, fileType: n2, formData: s2, name: "file", success(e3) { e3 && e3.statusCode < 400 ? i2(e3) : o2(new re({ code: "UPLOAD_FAILED", message: "文件上传失败" })); }, fail(e3) { o2(new re({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" })); } }); "function" == typeof r2 && a2 && "function" == typeof a2.onProgressUpdate && a2.onProgressUpdate((e3) => { r2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend }); }); }); } async uploadFile({ filePath: e2, cloudPath: t2 = "", fileType: n2 = "image", onUploadProgress: s2 }) { if ("string" !== f(t2)) throw new re({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" }); if (!(t2 = t2.trim())) throw new re({ code: "INVALID_PARAM", message: "cloudPath不可为空" }); if (/:\/\//.test(t2)) throw new re({ code: "INVALID_PARAM", message: "cloudPath不合法" }); const r2 = await Kt({ path: "/".concat(t2.replace(/^\//, ""), "?post_url") }, this.config), { file_id: i2, upload_url: o2, form_data: a2 } = r2, c2 = a2 && a2.reduce((e3, t3) => (e3[t3.key] = t3.value, e3), {}); return this.uploadFileToOSS({ url: o2, filePath: e2, fileType: n2, formData: c2, onUploadProgress: s2 }).then(() => ({ fileID: i2 })); } async getTempFileURL({ fileList: e2 }) { return new Promise((t2, n2) => { (!e2 || e2.length < 0) && t2({ code: "INVALID_PARAM", message: "fileList不能为空数组" }), e2.length > 50 && t2({ code: "INVALID_PARAM", message: "fileList数组长度不能超过50" }); const s2 = []; for (const n3 of e2) { let e3; "string" !== f(n3) && t2({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" }); try { e3 = jt.call(this, n3); } catch (t3) { console.warn(t3.errCode, t3.errMsg), e3 = n3; } s2.push({ file_id: e3, expire: 600 }); } Kt({ path: "/?download_url", data: { file_list: s2 }, method: "POST" }, this.config).then((e3) => { const { file_list: n3 = [] } = e3; t2({ fileList: n3.map((e4) => ({ fileID: $t.call(this, e4.file_id), tempFileURL: e4.download_url })) }); }).catch((e3) => n2(e3)); }); } async connectWebSocket(e2) { const { name: t2, query: n2 } = e2; return ie.connectSocket({ url: this._websocket.signedURL(t2, n2), complete: () => { } }); } requestSSE(e2) { const { name: t2, data: n2 } = e2; return ie.request({ method: "POST", url: this._sse.signedURL(t2), data: n2, header: { "content-type": "application/json" }, dataType: "json" }); } }; var Jt = { init: (e2) => { e2.provider = "alipay"; const t2 = new Ht(e2); return t2.auth = function() { return { signInAnonymously: function() { return Promise.resolve(); }, getLoginState: function() { return Promise.resolve(true); } }; }, t2; } }; function zt({ data: e2 }) { let t2; t2 = fe(); const n2 = JSON.parse(JSON.stringify(e2 || {})); if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) { const { token: e3 } = ae(); e3 && (n2.uniIdToken = e3); } return n2; } const Vt = { enable: false, interval: 0, space: {} }; let Gt = null, Qt = 0, Yt = false; function Xt() { return Array.isArray(P) && P.length ? P[0] : {}; } function Zt(e2) { return `${e2}_${Xt().spaceId || "default"}`; } function en() { if (Gt) return Gt; try { const e2 = ie.getStorageSync(Zt("UNICLOUD_FAILOVER_CONFIG")); if (g(e2)) return Gt = e2, e2; } catch (e2) { } return null; } function tn(e2) { Qt = e2; try { ie.setStorageSync(Zt("UNICLOUD_FAILOVER_LAST_REQUEST"), e2); } catch (e3) { } } function nn(e2) { if (null === e2 || e2 < 0) return false; if (0 === e2) return true; const t2 = function() { if (Qt) return Qt; try { const e3 = ie.getStorageSync(Zt("UNICLOUD_FAILOVER_LAST_REQUEST")); if (e3 && "number" == typeof e3) return Qt = e3, e3; } catch (e3) { } return 0; }(); if (!t2) return true; return Date.now() - t2 >= e2; } async function sn() { const e2 = Xt(), { failoverEndpoint: t2 } = e2; if (!t2) return null; if (Yt) return en(); Yt = true; try { const e3 = `${t2}/.unicloud/failover-cfg.json`, n2 = await ie.request({ url: e3, method: "GET", dataType: "json", timeout: 5e3 }); if (tn(Date.now()), 200 !== n2.statusCode || !g(n2.data)) return null; const s2 = { ...Vt, ...n2.data }, { enable: r2 = false, interval: i2 = 0, space: o2 = {} } = s2, a2 = en(), c2 = a2 && a2.enable, u2 = function(e4, t3) { if (!e4) return t3.enable; if (e4.enable !== t3.enable) return true; if (e4.interval !== t3.interval) return true; if (t3._lastModifiedAt && e4._lastModifiedAt !== t3._lastModifiedAt) return true; if (JSON.stringify(e4.space) !== JSON.stringify(t3.space)) return true; return false; }(a2, s2); return function(e4) { try { Gt = e4, e4 && e4.enable ? ie.setStorageSync(Zt("UNICLOUD_FAILOVER_CONFIG"), e4) : (ie.removeStorageSync(Zt("UNICLOUD_FAILOVER_CONFIG")), ie.removeStorageSync(Zt("UNICLOUD_FAILOVER_LAST_REQUEST"))); } catch (e5) { } }({ enable: r2, interval: i2, space: o2, _lastModifiedAt: n2.data._lastModifiedAt || Date.now() }), u2 && Z(J, { isEnabled: r2, hasStatusChanged: c2 !== r2, failoverSpace: o2 }), s2; } catch (e3) { return en(); } finally { Yt = false; } } async function rn(e2 = {}) { await this.__dev__.initLocalNetwork(); const { localAddress: t2, localPort: n2 } = this.__dev__, s2 = Xt(), r2 = { aliyun: "aliyun", tencent: "tcb", alipay: "alipay", dcloud: "dcloud" }[s2.provider], i2 = s2.spaceId, o2 = `http://${t2}:${n2}/system/check-function`, a2 = `http://${t2}:${n2}/cloudfunctions/${e2.name}`; return new Promise((t3, n3) => { ie.request({ method: "POST", url: o2, data: { name: e2.name, platform: T, provider: r2, spaceId: i2 }, timeout: 3e3, success(e3) { t3(e3); }, fail() { t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } }); } }); }).then(({ data: e3 } = {}) => { const { code: t3, message: n3 } = e3 || {}; return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" }; }).then(({ code: t3, message: n3 }) => { if (0 !== t3) { switch (t3) { case "MODULE_ENCRYPTED": console.error(`此云函数(${e2.name})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`); break; case "FUNCTION_ENCRYPTED": console.error(`此云函数(${e2.name})已加密不可本地调试,自动切换为云端已部署的云函数`); break; case "ACTION_ENCRYPTED": console.error(n3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境"); break; case "NETWORK_ERROR": console.error(n3 || "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下"); break; case "SWITCH_TO_CLOUD": break; default: { const e3 = `检测本地调试服务出现错误:${n3},请检查网络环境或重启客户端再试`; throw console.error(e3), new Error(e3); } } return this._callCloudFunction(e2); } return new Promise((t4, n4) => { const s3 = zt.call(this, { data: e2.data }); ie.request({ method: "POST", url: a2, data: { provider: r2, platform: T, param: s3 }, timeout: e2.timeout, success: ({ statusCode: e3, data: s4 } = {}) => !e3 || e3 >= 400 ? n4(new re({ code: s4.code || "SYS_ERR", message: s4.message || "request:fail" })) : t4({ result: s4 }), fail(e3) { n4(new re({ code: e3.code || e3.errCode || "SYS_ERR", message: e3.message || e3.errMsg || "request:fail" })); } }); }); }); } const on = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }]; var an = /[\\^$.*+?()[\]{}|]/g, cn = RegExp(an.source); function un(e2, t2, n2) { return e2.replace(new RegExp((s2 = t2) && cn.test(s2) ? s2.replace(an, "\\$&") : s2, "g"), n2); var s2; } const hn = "request", dn = "response", pn = "both", fn = { code: 2e4, message: "System error" }, gn = { code: 20101, message: "Invalid client" }; function _n(e2) { const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {}; return new re({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || fn.code, message: r2 || o2, cause: a2 }); } let ts; function os({ secretType: e2 } = {}) { return e2 === hn || e2 === dn || e2 === pn; } function as({ name: e2, data: t2 = {} } = {}) { return "DCloud-clientDB" === e2 && "encryption" === t2.redirectTo && "getAppClientKey" === t2.action; } function cs({ provider: e2, spaceId: t2, functionName: n2 } = {}) { const { appId: s2, uniPlatform: r2, osName: i2 } = he(); let o2 = r2; "app" === r2 && (o2 = i2); const a2 = function({ provider: e3, spaceId: t3 } = {}) { const n3 = A; if (!n3) return {}; e3 = /* @__PURE__ */ function(e4) { return "tencent" === e4 ? "tcb" : e4; }(e3); const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3); return s3 && s3.config; }({ provider: e2, spaceId: t2 }); if (!a2 || !a2.accessControl || !a2.accessControl.enable) return false; const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2); if (0 === u2.length) return true; const l2 = function(e3, t3) { let n3, s3, r3; for (let i3 = 0; i3 < e3.length; i3++) { const o3 = e3[i3]; o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3; } return n3 || s3 || r3; }(u2, n2); if (!l2) return false; if ((c2[l2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase())) return true; throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), _n(gn); } function us({ functionName: e2, result: t2, logPvd: n2 }) { if (this.__dev__.debugLog && t2 && t2.requestId) { const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId }); console.log(`[${n2}-request]${s2}[/${n2}-request]`); } } function ls(e2) { const t2 = e2.callFunction, n2 = function(n3) { const s2 = n3.name; n3.data = zt.call(e2, { data: n3.data }); const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb", alipay: "alipay", dcloud: "dcloud" }[this.config.provider], i2 = os(n3), o2 = as(n3), a2 = i2 || o2; return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && us.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && us.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) { for (let s3 = 0; s3 < n4.length; s3++) { const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3); if (!a3) continue; let c2 = i3; for (let e5 = 1; e5 < a3.length; e5++) c2 = un(c2, `{$${e5}}`, a3[e5]); for (const e5 in t3) c2 = un(c2, `{${e5}}`, t3[e5]); return "replace" === o3 ? c2 : e4 + c2; } return e4; }({ message: `[${n3.name}]: ${e3.message}`, formatter: on, extraInfo: { functionName: s2 } })), Promise.reject(e3))); }; e2.callFunction = function(t3) { const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name; let o2, a2; if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && P ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = rn), o2 = rn) : o2 = n2, o2 = o2.bind(e2), as(t3)) a2 = n2.call(e2, t3); else if (os(t3)) { a2 = new ts({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3); } else if (cs({ provider: s2, spaceId: r2, functionName: i2 })) { a2 = new ts({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3); } else a2 = o2(t3); return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2.then((e3) => e3); }; } ts = class { constructor() { throw _n({ message: `Platform ${T} is not enabled, please check whether secure network module is enabled in your manifest.json` }); } }; const hs = Symbol("CLIENT_DB_INTERNAL"); function ds(e2, t2) { return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = hs, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) { if ("_uniClient" === n2) return null; if ("symbol" == typeof n2) return e3[n2]; if (n2 in e3 || "string" != typeof n2) { const t3 = e3[n2]; return "function" == typeof t3 ? t3.bind(e3) : t3; } return t2.get(e3, n2, s2); } }); } function ps(e2) { return { on: (t2, n2) => { e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2); }, off: (t2, n2) => { e2[t2] = e2[t2] || []; const s2 = e2[t2].indexOf(n2); -1 !== s2 && e2[t2].splice(s2, 1); } }; } const fs = ["db.Geo", "db.command", "command.aggregate"]; function gs(e2, t2) { return fs.indexOf(`${e2}.${t2}`) > -1; } function ms(e2) { switch (f(e2 = oe(e2))) { case "array": return e2.map((e3) => ms(e3)); case "object": return e2._internalType === hs || Object.keys(e2).forEach((t2) => { e2[t2] = ms(e2[t2]); }), e2; case "regexp": return { $regexp: { source: e2.source, flags: e2.flags } }; case "date": return { $date: e2.toISOString() }; default: return e2; } } function ys(e2) { return e2 && e2.content && e2.content.$method; } class _s { constructor(e2, t2, n2) { this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2; } toJSON() { let e2 = this; const t2 = [e2.content]; for (; e2.prevStage; ) e2 = e2.prevStage, t2.push(e2.content); return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: ms(e3.$param) })) }; } toString() { return JSON.stringify(this.toJSON()); } getAction() { const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method); return e2 && e2.$param && e2.$param[0]; } getCommand() { return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) }; } get isAggregate() { let e2 = this; for (; e2; ) { const t2 = ys(e2), n2 = ys(e2.prevStage); if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2) return true; e2 = e2.prevStage; } return false; } get isCommand() { let e2 = this; for (; e2; ) { if ("command" === ys(e2)) return true; e2 = e2.prevStage; } return false; } get isAggregateCommand() { let e2 = this; for (; e2; ) { const t2 = ys(e2), n2 = ys(e2.prevStage); if ("aggregate" === t2 && "command" === n2) return true; e2 = e2.prevStage; } return false; } getNextStageFn(e2) { const t2 = this; return function() { return ws({ $method: e2, $param: ms(Array.from(arguments)) }, t2, t2._database); }; } get count() { return this.isAggregate ? this.getNextStageFn("count") : function() { return this._send("count", Array.from(arguments)); }; } get remove() { return this.isCommand ? this.getNextStageFn("remove") : function() { return this._send("remove", Array.from(arguments)); }; } get() { return this._send("get", Array.from(arguments)); } get add() { return this.isCommand ? this.getNextStageFn("add") : function() { return this._send("add", Array.from(arguments)); }; } update() { return this._send("update", Array.from(arguments)); } end() { return this._send("end", Array.from(arguments)); } get set() { return this.isCommand ? this.getNextStageFn("set") : function() { throw new Error("JQL禁止使用set方法"); }; } _send(e2, t2) { const n2 = this.getAction(), s2 = this.getCommand(); if (s2.$db.push({ $method: e2, $param: ms(t2) }), S) { const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param; t3 && 1 === t3.length && "string" == typeof e3.$param[0] && e3.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。"); } return this._database._callCloudFunction({ action: n2, command: s2 }); } } function ws(e2, t2, n2) { return ds(new _s(e2, t2, n2), { get(e3, t3) { let s2 = "db"; return e3 && e3.content && (s2 = e3.content.$method), gs(s2, t3) ? ws({ $method: t3 }, e3, n2) : function() { return ws({ $method: t3, $param: ms(Array.from(arguments)) }, e3, n2); }; } }); } function vs({ path: e2, method: t2 }) { return class { constructor() { this.param = Array.from(arguments); } toJSON() { return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] }; } toString() { return JSON.stringify(this.toJSON()); } }; } function Is(e2, t2 = {}) { return ds(new e2(t2), { get: (e3, t3) => gs("db", t3) ? ws({ $method: t3 }, null, e3) : function() { return ws({ $method: t3, $param: ms(Array.from(arguments)) }, null, e3); } }); } class Ss extends class { constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) { this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t2 || (this.auth = ps(this._authCallBacks)), this._isJQL = t2, Object.assign(this, ps(this._dbCallBacks)), this.env = ds({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = ds({}, { get: (e3, t3) => vs({ path: ["Geo"], method: t3 }) }), this.serverDate = vs({ path: [], method: "serverDate" }), this.RegExp = vs({ path: [], method: "RegExp" }); } getCloudEnv(e2) { if ("string" != typeof e2 || !e2.trim()) throw new Error("getCloudEnv参数错误"); return { $env: e2.replace("$cloudEnv_", "") }; } _callback(e2, t2) { const n2 = this._dbCallBacks; n2[e2] && n2[e2].forEach((e3) => { e3(...t2); }); } _callbackAuth(e2, t2) { const n2 = this._authCallBacks; n2[e2] && n2[e2].forEach((e3) => { e3(...t2); }); } multiSend() { const e2 = Array.from(arguments), t2 = e2.map((e3) => { const t3 = e3.getAction(), n2 = e3.getCommand(); if ("getTemp" !== n2.$db[n2.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp"); return { action: t3, command: n2 }; }); return this._callCloudFunction({ multiCommand: t2, queryList: e2 }); } startTransaction() { throw new Error("JQL 事务仅支持在云端使用"); } commit() { throw new Error("JQL 事务仅支持在云端使用"); } rollback() { throw new Error("JQL 事务仅支持在云端使用"); } } { _parseResult(e2) { return this._isJQL ? e2.result : e2; } _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) { function r2(e3, t3) { if (n2 && s2) for (let n3 = 0; n3 < s2.length; n3++) { const r3 = s2[n3]; r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3])); } } const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database"; function a2(e3) { return i2._callback("error", [e3]), F(K(o2, "fail"), e3).then(() => F(K(o2, "complete"), e3)).then(() => (r2(null, e3), Z(B, { type: z, content: e3 }), Promise.reject(e3))); } const c2 = F(K(o2, "invoke")), u2 = this._uniClient; return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: l, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => { const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result; if (u3) for (let e4 = 0; e4 < u3.length; e4++) { const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console["warn" === t4 ? "error" : t4] || console.log; let i3 = "[System Info]" + n4; s4 && (i3 = `${i3} 详细信息:${s4}`), r3(i3); } if (t3) { return a2(new re({ code: t3, message: n3, requestId: e3.requestId })); } e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (ce({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Z(H, { token: s3, tokenExpired: c3 })); const l2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }]; for (let t4 = 0; t4 < l2.length; t4++) { const { prop: n4, tips: s4 } = l2[t4]; if (n4 in e3.result) { const t5 = e3.result[n4]; Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) }); } } return function(e4) { return F(K(o2, "success"), e4).then(() => F(K(o2, "complete"), e4)).then(() => { r2(e4, null); const t4 = i2._parseResult(e4); return Z(B, { type: z, content: t4 }), Promise.resolve(t4); }); }(e3); }, (e3) => { /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"); return a2(new re({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId })); }); } } const bs = "token无效,跳转登录页面", ks = "token过期,跳转登录页面", As = { TOKEN_INVALID_TOKEN_EXPIRED: ks, TOKEN_INVALID_INVALID_CLIENTID: bs, TOKEN_INVALID: bs, TOKEN_INVALID_WRONG_TOKEN: bs, TOKEN_INVALID_ANONYMOUS_USER: bs }, Ts = { "uni-id-token-expired": ks, "uni-id-check-token-failed": bs, "uni-id-token-not-exist": bs, "uni-id-check-device-feature-failed": bs }, Cs = { ...As, ...Ts, default: "用户未登录或登录状态过期,自动跳转登录页面" }; function Ps(e2, t2) { let n2 = ""; return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, ""); } function Os(e2 = [], t2 = "") { const n2 = [], s2 = []; return e2.forEach((e3) => { true === e3.needLogin ? n2.push(Ps(t2, e3.path)) : false === e3.needLogin && s2.push(Ps(t2, e3.path)); }), { needLoginPage: n2, notNeedLoginPage: s2 }; } function Es(e2) { return e2.split("?")[0].replace(/^\//, ""); } function xs() { return function(e2) { let t2 = e2 && e2.$page && e2.$page.fullPath; return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : ""; }(function() { const e2 = getCurrentPages(); return e2[e2.length - 1]; }()); } function Ls() { return Es(xs()); } function Us(e2 = "", t2 = {}) { if (!e2) return false; if (!(t2 && t2.list && t2.list.length)) return false; const n2 = t2.list, s2 = Es(e2); return n2.some((e3) => e3.pagePath === s2); } const Rs = !!e.uniIdRouter; const { loginPage: Ns, routerNeedLogin: Ds, resToLogin: Ms, needLoginPage: qs, notNeedLoginPage: Fs, loginPageInTabBar: Ks } = function({ pages: t2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = e) { const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = Os(t2), { needLoginPage: l2, notNeedLoginPage: h2 } = function(e2 = []) { const t3 = [], n3 = []; return e2.forEach((e3) => { const { root: s3, pages: r3 = [] } = e3, { needLoginPage: i3, notNeedLoginPage: o3 } = Os(r3, s3); t3.push(...i3), n3.push(...o3); }), { needLoginPage: t3, notNeedLoginPage: n3 }; }(n2); return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...l2], notNeedLoginPage: [...u2, ...h2], loginPageInTabBar: Us(i2, r2) }; }(); if (qs.indexOf(Ns) > -1) throw new Error(`Login page [${Ns}] should not be "needLogin", please check your pages.json`); function js(e2) { const t2 = Ls(); if ("/" === e2.charAt(0)) return e2; const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/"); i2.pop(); for (let e3 = 0; e3 < r2.length; e3++) { const t3 = r2[e3]; ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3); } return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : ""); } function $s(e2, t2) { return new RegExp(t2).test(e2); } function Bs({ redirect: e2 }) { const t2 = Es(e2), n2 = Es(Ns); return Ls() !== n2 && t2 !== n2; } function Ws({ api: e2, redirect: t2 } = {}) { if (!t2 || !Bs({ redirect: t2 })) return; const n2 = function(e3, t3) { return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3; }(Ns, t2); Ks ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo"); const s2 = { navigateTo: uni.navigateTo, redirectTo: uni.redirectTo, switchTab: uni.switchTab, reLaunch: uni.reLaunch }; setTimeout(() => { s2[e2]({ url: n2 }); }, 0); } function Hs({ url: e2 } = {}) { const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() { const { token: e3, tokenExpired: t3 } = ae(); let n3; if (e3) { if (t3 < Date.now()) { const e4 = "uni-id-token-expired"; n3 = { errCode: e4, errMsg: Cs[e4] }; } } else { const e4 = "uni-id-check-token-failed"; n3 = { errCode: e4, errMsg: Cs[e4] }; } return n3; }(); if (function(e3) { const t3 = Es(js(e3)); return !(Fs.indexOf(t3) > -1) && (qs.indexOf(t3) > -1 || Ds.some((n3) => $s(t3, n3) || $s(e3, n3))); }(e2) && n2) { n2.uniIdRedirectUrl = e2; if (Q(W).length > 0) return setTimeout(() => { Z(W, n2); }, 0), t2.abortLoginPageJump = true, t2; t2.autoToLoginPage = true; } return t2; } function Js() { const e2 = xs(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = Hs({ url: e2 }); t2 || n2 && Ws({ api: "redirectTo", redirect: e2 }); } function zs() { Js(); const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]; for (let t2 = 0; t2 < e2.length; t2++) { const n2 = e2[t2]; uni.addInterceptor(n2, { invoke(e3) { const { abortLoginPageJump: t3, autoToLoginPage: s2 } = Hs({ url: e3.url }); return t3 ? e3 : s2 ? (Ws({ api: n2, redirect: js(e3.url) }), false) : e3; } }); } } function Vs() { this.onResponse((e2) => { const { type: t2, content: n2 } = e2; let s2 = false; switch (t2) { case "cloudobject": s2 = function(e3) { if ("object" != typeof e3) return false; const { errCode: t3 } = e3 || {}; return t3 in Cs; }(n2); break; case "clientdb": s2 = function(e3) { if ("object" != typeof e3) return false; const { errCode: t3 } = e3 || {}; return t3 in As; }(n2); } s2 && function(e3 = {}) { const t3 = Q(W); ne().then(() => { const n3 = xs(); if (n3 && Bs({ redirect: n3 })) return t3.length > 0 ? Z(W, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (Ns && Ws({ api: "navigateTo", redirect: n3 })); }); }(n2); }); } function Gs(e2) { e2.onNeedLogin = function(e3) { Y(W, e3); }, e2.offNeedLogin = function(e3) { X(W, e3); }, Rs && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = true, ne().then(() => { zs.call(e2); }), Ms && Vs.call(e2))); } function Qs(e2) { e2.onFailover = function(e3) { Y(J, e3); }, e2.offFailover = function(e3) { X(J, e3); }, e2.refreshFailoverConfig = function() { return e2.config, tn(0), sn(); }, e2.clearFailoverConfig = function() { !function() { Gt = null, Qt = 0; try { ie.removeStorageSync(Zt("UNICLOUD_FAILOVER_CONFIG")), ie.removeStorageSync(Zt("UNICLOUD_FAILOVER_LAST_REQUEST")); } catch (e3) { } }(); }; } function Ys(e2) { !function(e3) { e3.onResponse = function(e4) { Y(B, e4); }, e3.offResponse = function(e4) { X(B, e4); }; }(e2), Gs(e2), function(e3) { e3.onRefreshToken = function(e4) { Y(H, e4); }, e3.offRefreshToken = function(e4) { X(H, e4); }; }(e2), Qs(e2); } const Xs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", Zs = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/; function er(e2) { return decodeURIComponent(function(e3) { if (e3 = String(e3).replace(/[\t\n\f\r ]+/g, ""), !Zs.test(e3)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."); var t2; e3 += "==".slice(2 - (3 & e3.length)); for (var n2, s2, r2 = "", i2 = 0; i2 < e3.length; ) t2 = Xs.indexOf(e3.charAt(i2++)) << 18 | Xs.indexOf(e3.charAt(i2++)) << 12 | (n2 = Xs.indexOf(e3.charAt(i2++))) << 6 | (s2 = Xs.indexOf(e3.charAt(i2++))), r2 += 64 === n2 ? String.fromCharCode(t2 >> 16 & 255) : 64 === s2 ? String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255) : String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255, 255 & t2); return r2; }(e2).split("").map(function(e3) { return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2); }).join("")); } function tr() { const e2 = ae().token || "", t2 = e2.split("."); if (!e2 || 3 !== t2.length) return { uid: null, role: [], permission: [], tokenExpired: 0 }; let n2; try { n2 = JSON.parse(er(t2[1])); } catch (e3) { throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message); } return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2; } var nr = n(function(e2, t2) { Object.defineProperty(t2, "__esModule", { value: true }); const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail"; function r2(e3, t3) { return e3.tempFiles.forEach((e4, n3) => { e4.name || (e4.name = e4.path.substring(e4.path.lastIndexOf("/") + 1)), t3 && (e4.fileType = t3), e4.cloudPath = Date.now() + "_" + n3 + e4.name.substring(e4.name.lastIndexOf(".")); }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3; } function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) { return t3.then((e4) => { if (s3) { const t4 = s3(e4); if (void 0 !== t4) return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5); } return e4; }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) { (t5 = Object.assign({}, t5)).errMsg = n2; const i3 = t5.tempFiles, o2 = i3.length; let a2 = 0; return new Promise((n3) => { for (; a2 < s4; ) c2(); function c2() { const s5 = a2++; if (s5 >= o2) return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5)); const u2 = i3[s5]; e4.uploadFile({ provider: u2.provider, filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, cloudPathAsRealPath: u2.cloudPathAsRealPath, onUploadProgress(e5) { e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5); } }).then((e5) => { u2.url = e5.fileID, s5 < o2 && c2(); }).catch((e5) => { u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2(); }); } }); }(e3, t4, 5, r3)); } t2.initChooseAndUploadFile = function(e3) { return function(t3 = { type: "all" }) { return "image" === t3.type ? i2(e3, function(e4) { const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4; return new Promise((e5, a2) => { uni.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) { e5(r2(t5, "image")); }, fail(e6) { a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) }); } }); }); }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) { const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4; return new Promise((e5, c2) => { uni.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) { const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5; e5(r2({ errMsg: "chooseVideo:ok", tempFilePaths: [n4], tempFiles: [{ name: t5.tempFile && t5.tempFile.name || "", path: n4, size: i4, type: t5.tempFile && t5.tempFile.type || "", width: a3, height: o3, duration: s3, fileType: "video", cloudPath: "" }] }, "video")); }, fail(e6) { c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) }); } }); }); }(t3), t3) : i2(e3, function(e4) { const { count: t4, extension: n3 } = e4; return new Promise((e5, i3) => { let o2 = uni.chooseFile; if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o2 = wx.chooseMessageFile), "function" != typeof o2) return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" }); o2({ type: "all", count: t4, extension: n3, success(t5) { e5(r2(t5)); }, fail(e6) { i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) }); } }); }); }(t3), t3); }; }; }), sr = t$1(nr); const rr = "manual"; function ir(e2) { return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {}, mixinDatacomError: null }), created() { this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => { var e3 = []; return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => { e3.push(this[t2]); }), e3; }, (e3, t2) => { if (this.loadtime === rr) return; let n2 = false; const s2 = []; for (let r2 = 2; r2 < e3.length; r2++) e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true); e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2); }); }, methods: { onMixinDatacomPropsChange(e3, t2) { }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) { this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomError = null, this.mixinDatacomGet().then((n3) => { this.mixinDatacomLoading = false; const { data: s2, count: r2 } = n3.result; this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize; const i2 = e3 ? s2.length ? s2[0] : void 0 : s2; this.mixinDatacomResData = i2, t2 && t2(i2); }).catch((e4) => { this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, this.mixinDatacomError = e4, n2 && n2(e4); })); }, mixinDatacomGet(t2 = {}) { let n2; t2 = t2 || {}, n2 = "undefined" != typeof __uniX && __uniX ? e2.databaseForJQL(this.spaceInfo) : e2.database(this.spaceInfo); const s2 = t2.action || this.action; s2 && (n2 = n2.action(s2)); const r2 = t2.collection || this.collection; n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2); const i2 = t2.where || this.where; i2 && Object.keys(i2).length && (n2 = n2.where(i2)); const o2 = t2.field || this.field; o2 && (n2 = n2.field(o2)); const a2 = t2.foreignKey || this.foreignKey; a2 && (n2 = n2.foreignKey(a2)); const c2 = t2.groupby || this.groupby; c2 && (n2 = n2.groupBy(c2)); const u2 = t2.groupField || this.groupField; u2 && (n2 = n2.groupField(u2)); true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct()); const l2 = t2.orderby || this.orderby; l2 && (n2 = n2.orderBy(l2)); const h2 = void 0 !== t2.pageCurrent ? t2.pageCurrent : this.mixinDatacomPage.current, d2 = void 0 !== t2.pageSize ? t2.pageSize : this.mixinDatacomPage.size, p2 = void 0 !== t2.getcount ? t2.getcount : this.getcount, f2 = void 0 !== t2.gettree ? t2.gettree : this.gettree, g2 = void 0 !== t2.gettreepath ? t2.gettreepath : this.gettreepath, m2 = { getCount: p2 }, y2 = { limitLevel: void 0 !== t2.limitlevel ? t2.limitlevel : this.limitlevel, startWith: void 0 !== t2.startwith ? t2.startwith : this.startwith }; return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (h2 - 1)).limit(d2).get(m2), n2; } } }; } function or(e2) { return function(t2, n2 = {}) { n2 = function(e3, t3 = {}) { return e3.customUI = t3.customUI || e3.customUI, e3.parseSystemError = t3.parseSystemError || e3.parseSystemError, Object.assign(e3.loadingOptions, t3.loadingOptions), Object.assign(e3.errorOptions, t3.errorOptions), "object" == typeof t3.secretMethods && (e3.secretMethods = t3.secretMethods), e3; }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2); const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2; return new Proxy({}, { get(s3, c2) { switch (c2) { case "toString": return "[object UniCloudObject]"; case "toJSON": return {}; } return function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) { return async function(...s4) { const r3 = n3 ? n3({ params: s4 }) : {}; let i3, o3; try { return await F(K(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await F(K(t3, "success"), { ...r3, result: i3 }), i3; } catch (e4) { throw o3 = e4, await F(K(t3, "fail"), { ...r3, error: o3 }), o3; } finally { await F(K(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 }); } }; }({ fn: async function s4(...l2) { let h2; a2 && uni.showLoading({ title: r2.title, mask: r2.mask }); const d2 = { name: t2, type: u, data: { method: c2, params: l2 } }; "object" == typeof n2.secretMethods && function(e3, t3) { const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"]; r3 && (t3.secretType = r3); }(n2, d2); let p2 = false; try { h2 = await e2.callFunction(d2); } catch (e3) { p2 = true, h2 = { result: new re(e3) }; } const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = h2.result || {}; if (a2 && uni.hideLoading(), y2 && y2.token && y2.tokenExpired && (ce(y2), Z(H, { ...y2 })), g2) { let e3 = m2; if (p2 && o2) { e3 = (await o2({ objectName: t2, methodName: c2, params: l2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2; } if (a2) if ("toast" === i2.type) uni.showToast({ title: e3, icon: "none" }); else { if ("modal" !== i2.type) throw new Error(`Invalid errorOptions.type: ${i2.type}`); { const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) { return new Promise((i3, o3) => { uni.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) { i3(e5); }, fail() { i3({ confirm: false, cancel: true }); } }); }); }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" }); if (i2.retry && t3) return s4(...l2); } } const n3 = new re({ subject: f2, code: g2, message: m2, requestId: h2.requestId }); throw n3.detail = h2.result, Z(B, { type: G, content: n3 }), n3; } return Z(B, { type: G, content: h2.result }), h2.result; }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) { return { objectName: t2, methodName: c2, params: e3 }; } }); } }); }; } function ar(e2) { return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId)); } async function cr({ openid: e2, callLoginByWeixin: t2 = false } = {}) { ar(this); throw new Error(`[SecureNetwork] API \`initSecureNetworkByWeixin\` is not supported on platform \`${T}\``); } async function ur(e2) { const t2 = ar(this); return t2.initPromise || (t2.initPromise = cr.call(this, e2).then((e3) => e3).catch((e3) => { throw delete t2.initPromise, e3; })), t2.initPromise; } function lr(e2) { return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) { return ur.call(e2, { openid: t2, callLoginByWeixin: n2 }); }; } function hr(e2) { !function(e3) { pe = e3; }(e2); } function dr(e2) { const n2 = { getAppBaseInfo: uni.getSystemInfo, getPushClientId: uni.getPushClientId }; return function(s2) { return new Promise((r2, i2) => { n2[e2]({ ...s2, success(e3) { r2(e3); }, fail(e3) { i2(e3); } }); }); }; } class pr extends class { constructor() { this._callback = {}; } addListener(e2, t2) { this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2); } on(e2, t2) { return this.addListener(e2, t2); } removeListener(e2, t2) { if (!t2) throw new Error('The "listener" argument must be of type function. Received undefined'); const n2 = this._callback[e2]; if (!n2) return; const s2 = function(e3, t3) { for (let n3 = e3.length - 1; n3 >= 0; n3--) if (e3[n3] === t3) return n3; return -1; }(n2, t2); n2.splice(s2, 1); } off(e2, t2) { return this.removeListener(e2, t2); } removeAllListener(e2) { delete this._callback[e2]; } emit(e2, ...t2) { const n2 = this._callback[e2]; if (n2) for (let e3 = 0; e3 < n2.length; e3++) n2[e3](...t2); } } { constructor() { super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = []; } init() { return Promise.all([dr("getAppBaseInfo")(), dr("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => { if (!e2) throw new Error("Invalid appId, please check the manifest.json file"); if (!t2) throw new Error("Invalid push client id"); this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener(); }, (e2) => { throw this.emit("error", e2), this.close(), e2; }); } async open() { return this.init(); } _isUniCloudSSE(e2) { if ("receive" !== e2.type) return false; const t2 = e2 && e2.data && e2.data.payload; return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId); } _receivePushMessage(e2) { if (!this._isUniCloudSSE(e2)) return; const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2; this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage(); } _consumMessage() { for (; ; ) { const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1); if (!e2) break; this._currentMessageId++, this._parseMessagePayload(e2); } } _parseMessagePayload(e2) { const { action: t2, messageId: n2, message: s2 } = e2; "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 }); } _appendMessage({ messageId: e2, message: t2 } = {}) { this.emit("message", t2); } _end({ messageId: e2, message: t2 } = {}) { this.emit("end", t2), this.close(); } _initMessageListener() { uni.onPushMessage(this._uniPushMessageCallback); } _destroy() { uni.offPushMessage(this._uniPushMessageCallback); } toJSON() { return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId }; } close() { this._destroy(), this.emit("close"); } } async function fr(e2) { { const { osName: e3, osVersion: t3 } = he(); "ios" === e3 && function(e4) { if (!e4 || "string" != typeof e4) return 0; const t4 = e4.match(/^(\d+)./); return t4 && t4[1] ? parseInt(t4[1]) : 0; }(t3) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发期间需要,发行后不需要)"); } const t2 = e2.__dev__; if (!t2.debugInfo) return; const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await Lt(n2, s2); if (r2) return t2.localAddress = r2, void (t2.localPort = s2); const i2 = console["error"]; let o2 = ""; if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === T.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote) throw new Error(o2); i2(o2); } function gr(e2) { e2._initPromiseHub || (e2._initPromiseHub = new v({ createPromise: function() { let t2 = Promise.resolve(); var n2; n2 = 1, t2 = new Promise((e3) => { setTimeout(() => { e3(); }, n2); }); const s2 = e2.auth(); return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously()); } })); } const mr = { tcb: Et, tencent: Et, aliyun: ye, private: Nt, dcloud: Nt, alipay: Jt }; let yr = new class { init(e2) { let t2 = {}; const n2 = mr[e2.provider]; if (!n2) throw new Error("未提供正确的provider参数"); t2 = n2.init(e2), function(e3) { const t3 = {}; e3.__dev__ = t3, t3.debugLog = "app" === T; const n3 = C; n3 && !n3.code && (t3.debugInfo = n3); const s2 = new v({ createPromise: function() { return fr(e3); } }); t3.initLocalNetwork = function() { return s2.exec(); }; }(t2), gr(t2), ls(t2), function(e3) { const t3 = e3.uploadFile; e3.uploadFile = function(e4) { return t3.call(this, e4); }; }(t2), function(e3) { e3.database = function(t3) { if (t3 && Object.keys(t3).length > 0) return e3.init(t3).database(); if (this._database) return this._database; const n3 = Is(Ss, { uniClient: e3 }); return this._database = n3, n3; }, e3.databaseForJQL = function(t3) { if (t3 && Object.keys(t3).length > 0) return e3.init(t3).databaseForJQL(); if (this._databaseForJQL) return this._databaseForJQL; const n3 = Is(Ss, { uniClient: e3, isJQL: true }); return this._databaseForJQL = n3, n3; }; }(t2), function(e3) { e3.getCurrentUserInfo = tr, e3.chooseAndUploadFile = sr.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() { return ir(e3); } }), e3.SSEChannel = pr, e3.initSecureNetworkByWeixin = lr(e3), e3.setCustomClientInfo = hr, e3.importObject = or(e3); }(t2); return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => { if (!t2[e3]) return; const n3 = t2[e3]; t2[e3] = function() { return n3.apply(t2, Array.from(arguments)); }, t2[e3] = (/* @__PURE__ */ function(e4, t3) { return function(n4) { let s2 = false; if ("callFunction" === t3) { const e5 = n4 && n4.type || c; s2 = e5 !== c; } const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec(); n4 = n4 || {}; const { success: o2, fail: a2, complete: u2 } = se(n4), l2 = i2.then(() => s2 ? Promise.resolve() : F(K(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : F(K(t3, "success"), e5).then(() => F(K(t3, "complete"), e5)).then(() => (r2 && Z(B, { type: V, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : F(K(t3, "fail"), e5).then(() => F(K(t3, "complete"), e5)).then(() => (Z(B, { type: V, content: e5 }), Promise.reject(e5)))); if (!(o2 || a2 || u2)) return l2; l2.then((e5) => { o2 && o2(e5), u2 && u2(e5), r2 && Z(B, { type: V, content: e5 }); }, (e5) => { a2 && a2(e5), u2 && u2(e5), r2 && Z(B, { type: V, content: e5 }); }); }; }(t2[e3], e3)).bind(t2); }), t2.init = this.init, t2; } }(); (() => { const e2 = Array.isArray(P) ? P.length : 0, t2 = function() { const e3 = Xt(), t3 = en(); return t3 && t3.enable && g(t3.space) ? t3.space : e3; }(); if (1 === e2) yr = yr.init(t2), yr._isDefault = true; else { const t3 = ["database", "getCurrentUserInfo", "importObject"]; let n2; n2 = e2 > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", [...["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile"], ...t3].forEach((e3) => { yr[e3] = function() { if (console.error(n2), -1 === t3.indexOf(e3)) return Promise.reject(new re({ code: "SYS_ERR", message: n2 })); console.error(n2); }; }); } if (Object.assign(yr, { get mixinDatacom() { return ir(yr); } }), Ys(yr), yr.addInterceptor = M, yr.removeInterceptor = q, yr.interceptObject = j, uni.__uniCloud = yr, "app" === T) { const e3 = R(); e3.uniCloud = yr, e3.UniCloudError = re; } !function() { const { failoverEndpoint: e3 } = Xt(); if (!e3) return; sn().catch((e4) => { console.error("请求故障切换配置失败:", e4); }); const t3 = { fail() { const e4 = en(); nn(e4 && e4.interval || 0) && sn().catch((e5) => { console.error("请求故障切换配置失败:", e5); }); } }; M("callFunction", t3), M("database", t3), M("uploadFile", t3); }(); })(); var _r = yr; const _sfc_main$I = { name: "loading1", data() { return {}; } }; function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "container loading1" }, [ vue.createElementVNode("view", { class: "shape shape1" }), vue.createElementVNode("view", { class: "shape shape2" }), vue.createElementVNode("view", { class: "shape shape3" }), vue.createElementVNode("view", { class: "shape shape4" }) ]); } const Loading1 = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$H], ["__scopeId", "data-v-0e645258"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-loading/loading1.vue"]]); const _sfc_main$H = { name: "loading2", data() { return {}; } }; function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "container loading2" }, [ vue.createElementVNode("view", { class: "shape shape1" }), vue.createElementVNode("view", { class: "shape shape2" }), vue.createElementVNode("view", { class: "shape shape3" }), vue.createElementVNode("view", { class: "shape shape4" }) ]); } const Loading2 = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$G], ["__scopeId", "data-v-3df48dc2"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-loading/loading2.vue"]]); const _sfc_main$G = { name: "loading3", data() { return {}; } }; function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "container loading3" }, [ vue.createElementVNode("view", { class: "shape shape1" }), vue.createElementVNode("view", { class: "shape shape2" }), vue.createElementVNode("view", { class: "shape shape3" }), vue.createElementVNode("view", { class: "shape shape4" }) ]); } const Loading3 = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$F], ["__scopeId", "data-v-27a8293c"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-loading/loading3.vue"]]); const _sfc_main$F = { name: "loading5", data() { return {}; } }; function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "container loading5" }, [ vue.createElementVNode("view", { class: "shape shape1" }), vue.createElementVNode("view", { class: "shape shape2" }), vue.createElementVNode("view", { class: "shape shape3" }), vue.createElementVNode("view", { class: "shape shape4" }) ]); } const Loading4 = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$E], ["__scopeId", "data-v-2e7deb83"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-loading/loading4.vue"]]); const _sfc_main$E = { name: "loading6", data() { return {}; } }; function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "container loading6" }, [ vue.createElementVNode("view", { class: "shape shape1" }), vue.createElementVNode("view", { class: "shape shape2" }), vue.createElementVNode("view", { class: "shape shape3" }), vue.createElementVNode("view", { class: "shape shape4" }) ]); } const Loading5 = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$D], ["__scopeId", "data-v-ef674bbb"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-loading/loading5.vue"]]); const _sfc_main$D = { components: { Loading1, Loading2, Loading3, Loading4, Loading5 }, name: "qiun-loading", props: { loadingType: { type: Number, default: 2 } }, data() { return {}; } }; function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) { const _component_Loading1 = vue.resolveComponent("Loading1"); const _component_Loading2 = vue.resolveComponent("Loading2"); const _component_Loading3 = vue.resolveComponent("Loading3"); const _component_Loading4 = vue.resolveComponent("Loading4"); const _component_Loading5 = vue.resolveComponent("Loading5"); return vue.openBlock(), vue.createElementBlock("view", null, [ $props.loadingType == 1 ? (vue.openBlock(), vue.createBlock(_component_Loading1, { key: 0 })) : vue.createCommentVNode("v-if", true), $props.loadingType == 2 ? (vue.openBlock(), vue.createBlock(_component_Loading2, { key: 1 })) : vue.createCommentVNode("v-if", true), $props.loadingType == 3 ? (vue.openBlock(), vue.createBlock(_component_Loading3, { key: 2 })) : vue.createCommentVNode("v-if", true), $props.loadingType == 4 ? (vue.openBlock(), vue.createBlock(_component_Loading4, { key: 3 })) : vue.createCommentVNode("v-if", true), $props.loadingType == 5 ? (vue.openBlock(), vue.createBlock(_component_Loading5, { key: 4 })) : vue.createCommentVNode("v-if", true) ]); } const __easycom_0$4 = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$C], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-loading/qiun-loading.vue"]]); const _sfc_main$C = { name: "qiun-error", props: { errorMessage: { type: String, default: null } }, data() { return {}; } }; function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "chartsview" }, [ vue.createElementVNode("view", { class: "charts-error" }), vue.createElementVNode( "view", { class: "charts-font" }, vue.toDisplayString($props.errorMessage == null ? "请点击重试" : $props.errorMessage), 1 /* TEXT */ ) ]); } const __easycom_1$3 = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$B], ["__scopeId", "data-v-a99d579b"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-error/qiun-error.vue"]]); const color$1 = ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"]; const formatDateTime = (timeStamp, returnType) => { var date2 = /* @__PURE__ */ new Date(); date2.setTime(timeStamp * 1e3); var y2 = date2.getFullYear(); var m2 = date2.getMonth() + 1; m2 = m2 < 10 ? "0" + m2 : m2; var d2 = date2.getDate(); d2 = d2 < 10 ? "0" + d2 : d2; var h2 = date2.getHours(); h2 = h2 < 10 ? "0" + h2 : h2; var minute = date2.getMinutes(); var second = date2.getSeconds(); minute = minute < 10 ? "0" + minute : minute; second = second < 10 ? "0" + second : second; if (returnType == "full") { return y2 + "-" + m2 + "-" + d2 + " " + h2 + ":" + minute + ":" + second; } if (returnType == "y-m-d") { return y2 + "-" + m2 + "-" + d2; } if (returnType == "h:m") { return h2 + ":" + minute; } if (returnType == "h:m:s") { return h2 + ":" + minute + ":" + second; } return [y2, m2, d2, h2, minute, second]; }; const cfu = { //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可 "type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "mount", "bar", "area", "radar", "gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"], "range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "山峰图", "条状图", "区域图", "雷达图", "仪表盘", "K线图", "混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"], //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype" //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories "categories": ["line", "column", "mount", "bar", "area", "radar", "gauge", "candle", "mix", "demotype"], //instance为实例变量承载属性,不要删除 "instance": {}, //option为opts及eopts承载属性,不要删除 "option": {}, //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 "formatter": { "yAxisDemo1": function(val, index, opts) { return val + "元"; }, "yAxisDemo2": function(val, index, opts) { return val.toFixed(2); }, "xAxisDemo1": function(val, index, opts) { return val + "年"; }, "xAxisDemo2": function(val, index, opts) { return formatDateTime(val, "h:m"); }, "seriesDemo1": function(val, index, series, opts) { return val + "元"; }, "tooltipDemo1": function(item, category, index, opts) { if (index == 0) { return "随便用" + item.data + "年"; } else { return "其他我没改" + item.data + "天"; } }, "formatXLabel": function(val, index, opts) { return val; }, "formatDataLabel": function(val, index, opts) { if (index == 2) { return `${val}人次`; } else { return `${val}台套`; } }, "pieDemo": function(val, index, series, opts) { if (index !== void 0) { return series[index].name + ":" + series[index].data + "元"; } } }, //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。 "demotype": { //我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置 "type": "line", "color": color$1, "padding": [15, 10, 0, 15], "xAxis": { "disableGrid": true }, "yAxis": { "gridType": "dash", "dashLength": 2 }, "legend": {}, "extra": { "line": { "type": "curve", "width": 2 } } }, //下面是自定义配置,请添加项目所需的通用配置 "pie": { "type": "pie", "color": color$1, "padding": [5, 5, 5, 5], "extra": { "pie": { "activeOpacity": 0.5, "activeRadius": 10, "offsetAngle": 0, "labelWidth": 15, "border": true, "borderWidth": 3, "borderColor": "#FFFFFF" } } }, "ring": { "type": "ring", "color": color$1, "padding": [5, 5, 5, 5], "rotate": false, "dataLabel": true, "legend": { "show": true, "position": "right", "lineHeight": 25 }, "title": { "name": "收益率", "fontSize": 15, "color": "#666666" }, "subtitle": { "name": "70%", "fontSize": 25, "color": "#7cb5ec" }, "extra": { "ring": { "ringWidth": 30, "activeOpacity": 0.5, "activeRadius": 10, "offsetAngle": 0, "labelWidth": 15, "border": true, "borderWidth": 3, "borderColor": "#FFFFFF" } } }, "rose": { "type": "rose", "color": color$1, "padding": [5, 5, 5, 5], "legend": { "show": true, "position": "left", "lineHeight": 25 }, "extra": { "rose": { "type": "area", "minRadius": 50, "activeOpacity": 0.5, "activeRadius": 10, "offsetAngle": 0, "labelWidth": 15, "border": false, "borderWidth": 2, "borderColor": "#FFFFFF" } } }, "word": { "type": "word", "color": color$1, "extra": { "word": { "type": "normal", "autoColors": false } } }, "funnel": { "type": "funnel", "color": color$1, "padding": [15, 15, 0, 15], "extra": { "funnel": { "activeOpacity": 0.3, "activeWidth": 10, "border": true, "borderWidth": 2, "borderColor": "#FFFFFF", "fillOpacity": 1, "labelAlign": "right" } } }, "map": { "type": "map", "color": color$1, "padding": [0, 0, 0, 0], "dataLabel": true, "extra": { "map": { "border": true, "borderWidth": 1, "borderColor": "#666666", "fillOpacity": 0.6, "activeBorderColor": "#F04864", "activeFillColor": "#FACC14", "activeFillOpacity": 1 } } }, "arcbar": { "type": "arcbar", "color": color$1, "title": { "name": "百分比", "fontSize": 25, "color": "#00FF00" }, "subtitle": { "name": "默认标题", "fontSize": 15, "color": "#666666" }, "extra": { "arcbar": { "type": "default", "width": 12, "backgroundColor": "#E9E9E9", "startAngle": 0.75, "endAngle": 0.25, "gap": 2 } } }, "line": { "type": "line", "color": color$1, "padding": [15, 10, 0, 15], "xAxis": { "disableGrid": true }, "yAxis": { "gridType": "dash", "dashLength": 2 }, "legend": {}, "extra": { "line": { "type": "straight", "width": 2, "activeType": "hollow" } } }, "tline": { "type": "line", "color": color$1, "padding": [15, 10, 0, 15], "xAxis": { "disableGrid": false, "boundaryGap": "justify" }, "yAxis": { "gridType": "dash", "dashLength": 2, "data": [ { "min": 0, "max": 80 } ] }, "legend": {}, "extra": { "line": { "type": "curve", "width": 2, "activeType": "hollow" } } }, "tarea": { "type": "area", "color": color$1, "padding": [15, 10, 0, 15], "xAxis": { "disableGrid": true, "boundaryGap": "justify" }, "yAxis": { "gridType": "dash", "dashLength": 2, "data": [ { "min": 0, "max": 80 } ] }, "legend": {}, "extra": { "area": { "type": "curve", "opacity": 0.2, "addLine": true, "width": 2, "gradient": true, "activeType": "hollow" } } }, "column": { "type": "column", "color": color$1, "padding": [15, 15, 0, 5], "xAxis": { "disableGrid": true }, "yAxis": { "data": [{ "min": 0 }] }, "legend": {}, "extra": { "column": { "type": "group", "width": 30, "activeBgColor": "#000000", "activeBgOpacity": 0.08 } } }, "mount": { "type": "mount", "color": color$1, "padding": [15, 15, 0, 5], "xAxis": { "disableGrid": true }, "yAxis": { "data": [{ "min": 0 }] }, "legend": {}, "extra": { "mount": { "type": "mount", "widthRatio": 1.5 } } }, "bar": { "type": "bar", "color": color$1, "padding": [15, 30, 0, 5], "xAxis": { "boundaryGap": "justify", "disableGrid": false, "min": 0, "axisLine": false }, "yAxis": {}, "legend": {}, "extra": { "bar": { "type": "group", "width": 30, "meterBorde": 1, "meterFillColor": "#FFFFFF", "activeBgColor": "#000000", "activeBgOpacity": 0.08 } } }, "area": { "type": "area", "color": color$1, "padding": [15, 15, 0, 15], "xAxis": { "disableGrid": true }, "yAxis": { "gridType": "dash", "dashLength": 2 }, "legend": {}, "extra": { "area": { "type": "straight", "opacity": 0.2, "addLine": true, "width": 2, "gradient": false, "activeType": "hollow" } } }, "radar": { "type": "radar", "color": color$1, "padding": [5, 5, 5, 5], "dataLabel": false, "legend": { "show": true, "position": "right", "lineHeight": 25 }, "extra": { "radar": { "gridType": "radar", "gridColor": "#CCCCCC", "gridCount": 3, "opacity": 0.2, "max": 200, "labelShow": true } } }, "gauge": { "type": "gauge", "color": color$1, "title": { "name": "66Km/H", "fontSize": 25, "color": "#2fc25b", "offsetY": 50 }, "subtitle": { "name": "实时速度", "fontSize": 15, "color": "#1890ff", "offsetY": -50 }, "extra": { "gauge": { "type": "default", "width": 30, "labelColor": "#666666", "startAngle": 0.75, "endAngle": 0.25, "startNumber": 0, "endNumber": 100, "labelFormat": "", "splitLine": { "fixRadius": 0, "splitNumber": 10, "width": 30, "color": "#FFFFFF", "childNumber": 5, "childWidth": 12 }, "pointer": { "width": 24, "color": "auto" } } } }, "candle": { "type": "candle", "color": color$1, "padding": [15, 15, 0, 15], "enableScroll": true, "enableMarkLine": true, "dataLabel": false, "xAxis": { "labelCount": 4, "itemCount": 40, "disableGrid": true, "gridColor": "#CCCCCC", "gridType": "solid", "dashLength": 4, "scrollShow": true, "scrollAlign": "left", "scrollColor": "#A6A6A6", "scrollBackgroundColor": "#EFEBEF" }, "yAxis": {}, "legend": {}, "extra": { "candle": { "color": { "upLine": "#f04864", "upFill": "#f04864", "downLine": "#2fc25b", "downFill": "#2fc25b" }, "average": { "show": true, "name": ["MA5", "MA10", "MA30"], "day": [5, 10, 20], "color": ["#1890ff", "#2fc25b", "#facc14"] } }, "markLine": { "type": "dash", "dashLength": 5, "data": [ { "value": 2150, "lineColor": "#f04864", "showLabel": true }, { "value": 2350, "lineColor": "#f04864", "showLabel": true } ] } } }, "mix": { "type": "mix", "color": color$1, "padding": [15, 15, 0, 15], "xAxis": { "disableGrid": true }, "yAxis": { "disabled": false, "disableGrid": false, "splitNumber": 5, "gridType": "dash", "dashLength": 4, "gridColor": "#CCCCCC", "padding": 10, "showTitle": true, "data": [] }, "legend": {}, "extra": { "mix": { "column": { "width": 20 } } } }, "scatter": { "type": "scatter", "color": color$1, "padding": [15, 15, 0, 15], "dataLabel": false, "xAxis": { "disableGrid": false, "gridType": "dash", "splitNumber": 5, "boundaryGap": "justify", "min": 0 }, "yAxis": { "disableGrid": false, "gridType": "dash" }, "legend": {}, "extra": { "scatter": {} } }, "bubble": { "type": "bubble", "color": color$1, "padding": [15, 15, 0, 15], "xAxis": { "disableGrid": false, "gridType": "dash", "splitNumber": 5, "boundaryGap": "justify", "min": 0, "max": 250 }, "yAxis": { "disableGrid": false, "gridType": "dash", "data": [{ "min": 0, "max": 150 }] }, "legend": {}, "extra": { "bubble": { "border": 2, "opacity": 0.5 } } } }; const color = ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"]; const cfe = { //demotype为自定义图表类型 "type": ["pie", "ring", "rose", "funnel", "line", "column", "area", "radar", "gauge", "candle", "demotype"], //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型例如最后的"demotype" "categories": ["line", "column", "area", "radar", "gauge", "candle", "demotype"], //instance为实例变量承载属性,option为eopts承载属性,不要删除 "instance": {}, "option": {}, //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 "formatter": { "tooltipDemo1": function(res) { let result = ""; for (let i2 in res) { if (i2 == 0) { result += res[i2].axisValueLabel + "年销售额"; } let value = "--"; if (res[i2].data !== null) { value = res[i2].data; } result += "
" + res[i2].marker + res[i2].seriesName + ":" + value + " 万元"; } return result; }, legendFormat: function(name) { return "自定义图例+" + name; }, yAxisFormatDemo: function(value, index) { return value + "元"; }, seriesFormatDemo: function(res) { return res.name + "年" + res.value + "元"; } }, //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在eopts参数,会将demotype与eopts中option合并后渲染图表。 "demotype": { "color": color //在这里填写echarts的option即可 }, //下面是自定义配置,请添加项目所需的通用配置 "column": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "axis" }, "grid": { "top": 30, "bottom": 50, "right": 15, "left": 40 }, "legend": { "bottom": "left" }, "toolbox": { "show": false }, "xAxis": { "type": "category", "axisLabel": { "color": "#666666" }, "axisLine": { "lineStyle": { "color": "#CCCCCC" } }, "boundaryGap": true, "data": [] }, "yAxis": { "type": "value", "axisTick": { "show": false }, "axisLabel": { "color": "#666666" }, "axisLine": { "lineStyle": { "color": "#CCCCCC" } } }, "seriesTemplate": { "name": "", "type": "bar", "data": [], "barwidth": 20, "label": { "show": true, "color": "#666666", "position": "top" } } }, "line": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "axis" }, "grid": { "top": 30, "bottom": 50, "right": 15, "left": 40 }, "legend": { "bottom": "left" }, "toolbox": { "show": false }, "xAxis": { "type": "category", "axisLabel": { "color": "#666666" }, "axisLine": { "lineStyle": { "color": "#CCCCCC" } }, "boundaryGap": true, "data": [] }, "yAxis": { "type": "value", "axisTick": { "show": false }, "axisLabel": { "color": "#666666" }, "axisLine": { "lineStyle": { "color": "#CCCCCC" } } }, "seriesTemplate": { "name": "", "type": "line", "data": [], "barwidth": 20, "label": { "show": true, "color": "#666666", "position": "top" } } }, "area": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "axis" }, "grid": { "top": 30, "bottom": 50, "right": 15, "left": 40 }, "legend": { "bottom": "left" }, "toolbox": { "show": false }, "xAxis": { "type": "category", "axisLabel": { "color": "#666666" }, "axisLine": { "lineStyle": { "color": "#CCCCCC" } }, "boundaryGap": true, "data": [] }, "yAxis": { "type": "value", "axisTick": { "show": false }, "axisLabel": { "color": "#666666" }, "axisLine": { "lineStyle": { "color": "#CCCCCC" } } }, "seriesTemplate": { "name": "", "type": "line", "data": [], "areaStyle": {}, "label": { "show": true, "color": "#666666", "position": "top" } } }, "pie": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "item" }, "grid": { "top": 40, "bottom": 30, "right": 15, "left": 15 }, "legend": { "bottom": "left" }, "seriesTemplate": { "name": "", "type": "pie", "data": [], "radius": "50%", "label": { "show": true, "color": "#666666", "position": "top" } } }, "ring": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "item" }, "grid": { "top": 40, "bottom": 30, "right": 15, "left": 15 }, "legend": { "bottom": "left" }, "seriesTemplate": { "name": "", "type": "pie", "data": [], "radius": ["40%", "70%"], "avoidLabelOverlap": false, "label": { "show": true, "color": "#666666", "position": "top" }, "labelLine": { "show": true } } }, "rose": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "item" }, "legend": { "top": "bottom" }, "seriesTemplate": { "name": "", "type": "pie", "data": [], "radius": "55%", "center": ["50%", "50%"], "roseType": "area" } }, "funnel": { "color": color, "title": { "text": "" }, "tooltip": { "trigger": "item", "formatter": "{b} : {c}%" }, "legend": { "top": "bottom" }, "seriesTemplate": { "name": "", "type": "funnel", "left": "10%", "top": 60, "bottom": 60, "width": "80%", "min": 0, "max": 100, "minSize": "0%", "maxSize": "100%", "sort": "descending", "gap": 2, "label": { "show": true, "position": "inside" }, "labelLine": { "length": 10, "lineStyle": { "width": 1, "type": "solid" } }, "itemStyle": { "bordercolor": "#fff", "borderwidth": 1 }, "emphasis": { "label": { "fontSize": 20 } }, "data": [] } }, "gauge": { "color": color, "tooltip": { "formatter": "{a}
{b} : {c}%" }, "seriesTemplate": { "name": "业务指标", "type": "gauge", "detail": { "formatter": "{value}%" }, "data": [{ "value": 50, "name": "完成率" }] } }, "candle": { "xAxis": { "data": [] }, "yAxis": {}, "color": color, "title": { "text": "" }, "dataZoom": [ { "type": "inside", "xAxisIndex": [0, 1], "start": 10, "end": 100 }, { "show": true, "xAxisIndex": [0, 1], "type": "slider", "bottom": 10, "start": 10, "end": 100 } ], "seriesTemplate": { "name": "", "type": "k", "data": [] } } }; const block0 = (Comp) => { (Comp.$renderjs || (Comp.$renderjs = [])).push("rdcharts"); (Comp.$renderjsModules || (Comp.$renderjsModules = {}))["rdcharts"] = "f9cb76fc"; }; function deepCloneAssign(origin = {}, ...args) { for (let i2 in args) { for (let key in args[i2]) { if (args[i2].hasOwnProperty(key)) { origin[key] = args[i2][key] && typeof args[i2][key] === "object" ? deepCloneAssign(Array.isArray(args[i2][key]) ? [] : {}, origin[key], args[i2][key]) : args[i2][key]; } } } return origin; } function formatterAssign(args, formatter) { for (let key in args) { if (args.hasOwnProperty(key) && args[key] !== null && typeof args[key] === "object") { formatterAssign(args[key], formatter); } else if (key === "format" && typeof args[key] === "string") { args["formatter"] = formatter[args[key]] ? formatter[args[key]] : void 0; } } return args; } function getFormatDate(date2) { var seperator = "-"; var year = date2.getFullYear(); var month = date2.getMonth() + 1; var strDate = date2.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = year + seperator + month + seperator + strDate; return currentdate; } const _sfc_main$B = { name: "qiun-data-charts", mixins: [_r.mixinDatacom], props: { type: { type: String, default: null }, canvasId: { type: String, default: "uchartsid" }, canvas2d: { type: Boolean, default: false }, background: { type: String, default: "rgba(0,0,0,0)" }, animation: { type: Boolean, default: true }, chartData: { type: Object, default() { return { categories: [], series: [] }; } }, opts: { type: Object, default() { return {}; } }, eopts: { type: Object, default() { return {}; } }, loadingType: { type: Number, default: 2 }, errorShow: { type: Boolean, default: true }, errorReload: { type: Boolean, default: true }, errorMessage: { type: String, default: null }, inScrollView: { type: Boolean, default: false }, reshow: { type: Boolean, default: false }, reload: { type: Boolean, default: false }, disableScroll: { type: Boolean, default: false }, optsWatch: { type: Boolean, default: true }, onzoom: { type: Boolean, default: false }, ontap: { type: Boolean, default: true }, ontouch: { type: Boolean, default: false }, onmouse: { type: Boolean, default: true }, onmovetip: { type: Boolean, default: false }, echartsH5: { type: Boolean, default: false }, echartsApp: { type: Boolean, default: false }, tooltipShow: { type: Boolean, default: true }, tooltipFormat: { type: String, default: void 0 }, tooltipCustom: { type: Object, default: void 0 }, startDate: { type: String, default: void 0 }, endDate: { type: String, default: void 0 }, textEnum: { type: Array, default() { return []; } }, groupEnum: { type: Array, default() { return []; } }, pageScrollTop: { type: Number, default: 0 }, directory: { type: String, default: "/" }, tapLegend: { type: Boolean, default: true }, menus: { type: Array, default() { return []; } } }, data() { return { cid: "uchartsid", inWx: false, inAli: false, inTt: false, inBd: false, inH5: false, inApp: false, inWin: false, type2d: true, disScroll: false, openmouse: false, pixel: 1, cWidth: 375, cHeight: 250, showchart: false, echarts: false, echartsResize: { state: false }, uchartsOpts: {}, echartsOpts: {}, drawData: {}, lastDrawTime: null }; }, created() { this.cid = this.canvasId; if (this.canvasId == "uchartsid" || this.canvasId == "") { let t2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; let len = t2.length; let id = ""; for (let i2 = 0; i2 < 32; i2++) { id += t2.charAt(Math.floor(Math.random() * len)); } this.cid = id; } const systemInfo = uni.getSystemInfoSync(); if (systemInfo.platform === "windows" || systemInfo.platform === "mac") { this.inWin = true; } this.type2d = false; this.disScroll = this.disableScroll; }, mounted() { this.inApp = true; if (this.echartsApp === true) { this.echarts = true; this.openmouse = false; } this.$nextTick(() => { this.beforeInit(); }); }, destroyed() { if (this.echarts === true) { delete cfe.option[this.cid]; delete cfe.instance[this.cid]; } else { delete cfu.option[this.cid]; delete cfu.instance[this.cid]; } uni.offWindowResize(() => { }); }, watch: { chartDataProps: { handler(val, oldval) { if (typeof val === "object") { if (JSON.stringify(val) !== JSON.stringify(oldval)) { this._clearChart(); if (val.series && val.series.length > 0) { this.beforeInit(); } else { this.mixinDatacomLoading = true; this.showchart = false; this.mixinDatacomErrorMessage = null; } } } else { this.mixinDatacomLoading = false; this._clearChart(); this.showchart = false; this.mixinDatacomErrorMessage = "参数错误:chartData数据类型错误"; } }, immediate: false, deep: true }, localdata: { handler(val, oldval) { if (JSON.stringify(val) !== JSON.stringify(oldval)) { if (val.length > 0) { this.beforeInit(); } else { this.mixinDatacomLoading = true; this._clearChart(); this.showchart = false; this.mixinDatacomErrorMessage = null; } } }, immediate: false, deep: true }, optsProps: { handler(val, oldval) { if (typeof val === "object") { if (JSON.stringify(val) !== JSON.stringify(oldval) && this.echarts === false && this.optsWatch == true) { this.checkData(this.drawData); } } else { this.mixinDatacomLoading = false; this._clearChart(); this.showchart = false; this.mixinDatacomErrorMessage = "参数错误:opts数据类型错误"; } }, immediate: false, deep: true }, eoptsProps: { handler(val, oldval) { if (typeof val === "object") { if (JSON.stringify(val) !== JSON.stringify(oldval) && this.echarts === true) { this.checkData(this.drawData); } } else { this.mixinDatacomLoading = false; this.showchart = false; this.mixinDatacomErrorMessage = "参数错误:eopts数据类型错误"; } }, immediate: false, deep: true }, reshow(val, oldval) { if (val === true && this.mixinDatacomLoading === false) { setTimeout(() => { this.mixinDatacomErrorMessage = null; this.echartsResize.state = !this.echartsResize.state; this.checkData(this.drawData); }, 200); } }, reload(val, oldval) { if (val === true) { this.showchart = false; this.mixinDatacomErrorMessage = null; this.reloading(); } }, mixinDatacomErrorMessage(val, oldval) { if (val) { this.emitMsg({ name: "error", params: { type: "error", errorShow: this.errorShow, msg: val, id: this.cid } }); if (this.errorShow) { formatAppLog("log", "at uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue:611", "[秋云图表组件]" + val); } } }, errorMessage(val, oldval) { if (val && this.errorShow && val !== null && val !== "null" && val !== "") { this.showchart = false; this.mixinDatacomLoading = false; this.mixinDatacomErrorMessage = val; } else { this.showchart = false; this.mixinDatacomErrorMessage = null; this.reloading(); } } }, computed: { optsProps() { return JSON.parse(JSON.stringify(this.opts)); }, eoptsProps() { return JSON.parse(JSON.stringify(this.eopts)); }, chartDataProps() { return JSON.parse(JSON.stringify(this.chartData)); } }, methods: { beforeInit() { this.mixinDatacomErrorMessage = null; if (typeof this.chartData === "object" && this.chartData != null && this.chartData.series !== void 0 && this.chartData.series.length > 0) { this.drawData = deepCloneAssign({}, this.chartData); this.mixinDatacomLoading = false; this.showchart = true; this.checkData(this.chartData); } else if (this.localdata.length > 0) { this.mixinDatacomLoading = false; this.showchart = true; this.localdataInit(this.localdata); } else if (this.collection !== "") { this.mixinDatacomLoading = false; this.getCloudData(); } else { this.mixinDatacomLoading = true; } }, localdataInit(resdata) { if (this.groupEnum.length > 0) { for (let i2 = 0; i2 < resdata.length; i2++) { for (let j2 = 0; j2 < this.groupEnum.length; j2++) { if (resdata[i2].group === this.groupEnum[j2].value) { resdata[i2].group = this.groupEnum[j2].text; } } } } if (this.textEnum.length > 0) { for (let i2 = 0; i2 < resdata.length; i2++) { for (let j2 = 0; j2 < this.textEnum.length; j2++) { if (resdata[i2].text === this.textEnum[j2].value) { resdata[i2].text = this.textEnum[j2].text; } } } } let needCategories = false; let tmpData = { categories: [], series: [] }; let tmpcategories = []; let tmpseries = []; if (this.echarts === true) { needCategories = cfe.categories.includes(this.type); } else { needCategories = cfu.categories.includes(this.type); } if (needCategories === true) { if (this.chartData && this.chartData.categories && this.chartData.categories.length > 0) { tmpcategories = this.chartData.categories; } else { if (this.startDate && this.endDate) { let idate = new Date(this.startDate); let edate = new Date(this.endDate); while (idate <= edate) { tmpcategories.push(getFormatDate(idate)); idate = idate.setDate(idate.getDate() + 1); idate = new Date(idate); } } else { let tempckey = {}; resdata.map(function(item, index) { if (item.text != void 0 && !tempckey[item.text]) { tmpcategories.push(item.text); tempckey[item.text] = true; } }); } } tmpData.categories = tmpcategories; } let tempskey = {}; resdata.map(function(item, index) { if (item.group != void 0 && !tempskey[item.group]) { tmpseries.push({ name: item.group, data: [] }); tempskey[item.group] = true; } }); if (tmpseries.length == 0) { tmpseries = [{ name: "默认分组", data: [] }]; if (needCategories === true) { for (let j2 = 0; j2 < tmpcategories.length; j2++) { let seriesdata = 0; for (let i2 = 0; i2 < resdata.length; i2++) { if (resdata[i2].text == tmpcategories[j2]) { seriesdata = resdata[i2].value; } } tmpseries[0].data.push(seriesdata); } } else { for (let i2 = 0; i2 < resdata.length; i2++) { tmpseries[0].data.push({ "name": resdata[i2].text, "value": resdata[i2].value }); } } } else { for (let k = 0; k < tmpseries.length; k++) { if (tmpcategories.length > 0) { for (let j2 = 0; j2 < tmpcategories.length; j2++) { let seriesdata = 0; for (let i2 = 0; i2 < resdata.length; i2++) { if (tmpseries[k].name == resdata[i2].group && resdata[i2].text == tmpcategories[j2]) { seriesdata = resdata[i2].value; } } tmpseries[k].data.push(seriesdata); } } else { for (let i2 = 0; i2 < resdata.length; i2++) { if (tmpseries[k].name == resdata[i2].group) { tmpseries[k].data.push(resdata[i2].value); } } } } } tmpData.series = tmpseries; this.drawData = deepCloneAssign({}, tmpData); this.checkData(tmpData); }, reloading() { if (this.errorReload === false) { return; } this.showchart = false; this.mixinDatacomErrorMessage = null; if (this.collection !== "") { this.mixinDatacomLoading = false; this.onMixinDatacomPropsChange(true); } else { this.beforeInit(); } }, checkData(anyData) { let cid = this.cid; if (this.echarts === true) { cfe.option[cid] = deepCloneAssign({}, this.eopts); cfe.option[cid].id = cid; cfe.option[cid].type = this.type; } else { if (this.type && cfu.type.includes(this.type)) { cfu.option[cid] = deepCloneAssign({}, cfu[this.type], this.opts); cfu.option[cid].canvasId = cid; } else { this.mixinDatacomLoading = false; this.showchart = false; this.mixinDatacomErrorMessage = "参数错误:props参数中type类型不正确"; } } let newData = deepCloneAssign({}, anyData); if (newData.series !== void 0 && newData.series.length > 0) { this.mixinDatacomErrorMessage = null; if (this.echarts === true) { cfe.option[cid].chartData = newData; this.$nextTick(() => { this.init(); }); } else { cfu.option[cid].categories = newData.categories; cfu.option[cid].series = newData.series; this.$nextTick(() => { this.init(); }); } } }, resizeHandler() { let currTime = Date.now(); let lastDrawTime = this.lastDrawTime ? this.lastDrawTime : currTime - 3e3; let duration = currTime - lastDrawTime; if (duration < 1e3) return; uni.createSelectorQuery().in(this).select("#ChartBoxId" + this.cid).boundingClientRect((data) => { this.showchart = true; if (data.width > 0 && data.height > 0) { if (data.width !== this.cWidth || data.height !== this.cHeight) { this.checkData(this.drawData); } } }).exec(); }, getCloudData() { if (this.mixinDatacomLoading == true) { return; } this.mixinDatacomLoading = true; this.mixinDatacomGet().then((res) => { this.mixinDatacomResData = res.result.data; this.localdataInit(this.mixinDatacomResData); }).catch((err) => { this.mixinDatacomLoading = false; this.showchart = false; this.mixinDatacomErrorMessage = "请求错误:" + err; }); }, onMixinDatacomPropsChange(needReset, changed) { if (needReset == true && this.collection !== "") { this.showchart = false; this.mixinDatacomErrorMessage = null; this._clearChart(); this.getCloudData(); } }, _clearChart() { let cid = this.cid; if (this.echarts !== true && cfu.option[cid] && cfu.option[cid].context) { const ctx = cfu.option[cid].context; if (typeof ctx === "object" && !!!cfu.option[cid].update) { ctx.clearRect(0, 0, this.cWidth * this.pixel, this.cHeight * this.pixel); ctx.draw(); } } }, init() { let cid = this.cid; uni.createSelectorQuery().in(this).select("#ChartBoxId" + cid).boundingClientRect((data) => { if (data.width > 0 && data.height > 0) { this.mixinDatacomLoading = false; this.showchart = true; this.lastDrawTime = Date.now(); this.cWidth = data.width; this.cHeight = data.height; if (this.echarts !== true) { cfu.option[cid].background = this.background == "rgba(0,0,0,0)" ? "#FFFFFF" : this.background; cfu.option[cid].canvas2d = this.type2d; cfu.option[cid].pixelRatio = this.pixel; cfu.option[cid].animation = this.animation; cfu.option[cid].width = data.width * this.pixel; cfu.option[cid].height = data.height * this.pixel; cfu.option[cid].onzoom = this.onzoom; cfu.option[cid].ontap = this.ontap; cfu.option[cid].ontouch = this.ontouch; cfu.option[cid].onmouse = this.openmouse; cfu.option[cid].onmovetip = this.onmovetip; cfu.option[cid].tooltipShow = this.tooltipShow; cfu.option[cid].tooltipFormat = this.tooltipFormat; cfu.option[cid].tooltipCustom = this.tooltipCustom; cfu.option[cid].inScrollView = this.inScrollView; cfu.option[cid].lastDrawTime = this.lastDrawTime; cfu.option[cid].tapLegend = this.tapLegend; } if (this.inH5 || this.inApp) { if (this.echarts == true) { cfe.option[cid].ontap = this.ontap; cfe.option[cid].onmouse = this.openmouse; cfe.option[cid].tooltipShow = this.tooltipShow; cfe.option[cid].tooltipFormat = this.tooltipFormat; cfe.option[cid].tooltipCustom = this.tooltipCustom; cfe.option[cid].lastDrawTime = this.lastDrawTime; this.echartsOpts = deepCloneAssign({}, cfe.option[cid]); } else { cfu.option[cid].rotateLock = cfu.option[cid].rotate; this.uchartsOpts = deepCloneAssign({}, cfu.option[cid]); } } else { cfu.option[cid] = formatterAssign(cfu.option[cid], cfu.formatter); this.mixinDatacomErrorMessage = null; this.mixinDatacomLoading = false; this.showchart = true; this.$nextTick(() => { if (this.type2d === true) { const query = uni.createSelectorQuery().in(this); query.select("#" + cid).fields({ node: true, size: true }).exec((res) => { if (res[0]) { const canvas = res[0].node; const ctx = canvas.getContext("2d"); cfu.option[cid].context = ctx; cfu.option[cid].rotateLock = cfu.option[cid].rotate; if (cfu.instance[cid] && cfu.option[cid] && cfu.option[cid].update === true) { this._updataUChart(cid); } else { canvas.width = data.width * this.pixel; canvas.height = data.height * this.pixel; canvas._width = data.width * this.pixel; canvas._height = data.height * this.pixel; setTimeout(() => { cfu.option[cid].context.restore(); cfu.option[cid].context.save(); this._newChart(cid); }, 100); } } else { this.showchart = false; this.mixinDatacomErrorMessage = "参数错误:开启2d模式后,未获取到dom节点,canvas-id:" + cid; } }); } else { if (this.inAli) { cfu.option[cid].rotateLock = cfu.option[cid].rotate; } cfu.option[cid].context = uni.createCanvasContext(cid, this); if (cfu.instance[cid] && cfu.option[cid] && cfu.option[cid].update === true) { this._updataUChart(cid); } else { setTimeout(() => { cfu.option[cid].context.restore(); cfu.option[cid].context.save(); this._newChart(cid); }, 100); } } }); } } else { this.mixinDatacomLoading = false; this.showchart = false; if (this.reshow == true) { this.mixinDatacomErrorMessage = "布局错误:未获取到父元素宽高尺寸!canvas-id:" + cid; } } }).exec(); }, saveImage() { uni.canvasToTempFilePath({ canvasId: this.cid, success: (res) => { uni.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success: function() { uni.showToast({ title: "保存成功", duration: 2e3 }); } }); } }, this); }, getImage() { if (this.type2d == false) { uni.canvasToTempFilePath({ canvasId: this.cid, success: (res) => { this.emitMsg({ name: "getImage", params: { type: "getImage", base64: res.tempFilePath } }); } }, this); } else { const query = uni.createSelectorQuery().in(this); query.select("#" + this.cid).fields({ node: true, size: true }).exec((res) => { if (res[0]) { const canvas = res[0].node; this.emitMsg({ name: "getImage", params: { type: "getImage", base64: canvas.toDataURL("image/png") } }); } }); } }, _error(e2) { this.mixinDatacomErrorMessage = e2.detail.errMsg; }, emitMsg(msg) { this.$emit(msg.name, msg.params); }, getRenderType() { if (this.echarts === true && this.mixinDatacomLoading === false) { this.beforeInit(); } }, toJSON() { return this; } } }; function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_loading = resolveEasycom(vue.resolveDynamicComponent("qiun-loading"), __easycom_0$4); const _component_qiun_error = resolveEasycom(vue.resolveDynamicComponent("qiun-error"), __easycom_1$3); return vue.openBlock(), vue.createElementBlock("view", { class: "chartsview", id: "ChartBoxId" + $data.cid }, [ _ctx.mixinDatacomLoading ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [ vue.createVNode(_component_qiun_loading, { loadingType: $props.loadingType }, null, 8, ["loadingType"]) ])) : vue.createCommentVNode("v-if", true), _ctx.mixinDatacomErrorMessage && $props.errorShow ? (vue.openBlock(), vue.createElementBlock("view", { key: 1, onClick: _cache[0] || (_cache[0] = (...args) => $options.reloading && $options.reloading(...args)) }, [ vue.createVNode(_component_qiun_error, { errorMessage: $props.errorMessage }, null, 8, ["errorMessage"]) ])) : vue.createCommentVNode("v-if", true), $data.echarts ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", { key: 2, style: vue.normalizeStyle([{ background: $props.background }, { "width": "100%", "height": "100%" }]), "data-directory": $props.directory, id: "EC" + $data.cid, prop: vue.wp($data.echartsOpts), "change:prop": _ctx.rdcharts.ecinit, resize: vue.wp($data.echartsResize), "change:resize": _ctx.rdcharts.ecresize }, null, 12, ["data-directory", "id", "prop", "change:prop", "resize", "change:resize"])), [ [vue.vShow, $data.showchart] ]) : (vue.openBlock(), vue.createElementBlock("view", { key: 3, onClick: _cache[2] || (_cache[2] = (...args) => _ctx.rdcharts.tap && _ctx.rdcharts.tap(...args)), onMousemove: _cache[3] || (_cache[3] = (...args) => _ctx.rdcharts.mouseMove && _ctx.rdcharts.mouseMove(...args)), onMousedown: _cache[4] || (_cache[4] = (...args) => _ctx.rdcharts.mouseDown && _ctx.rdcharts.mouseDown(...args)), onMouseup: _cache[5] || (_cache[5] = (...args) => _ctx.rdcharts.mouseUp && _ctx.rdcharts.mouseUp(...args)), onTouchstart: _cache[6] || (_cache[6] = (...args) => _ctx.rdcharts.touchStart && _ctx.rdcharts.touchStart(...args)), onTouchmove: _cache[7] || (_cache[7] = (...args) => _ctx.rdcharts.touchMove && _ctx.rdcharts.touchMove(...args)), onTouchend: _cache[8] || (_cache[8] = (...args) => _ctx.rdcharts.touchEnd && _ctx.rdcharts.touchEnd(...args)), id: "UC" + $data.cid, prop: vue.wp($data.uchartsOpts), "change:prop": _ctx.rdcharts.ucinit }, [ vue.withDirectives(vue.createElementVNode("canvas", { id: $data.cid, canvasId: $data.cid, style: vue.normalizeStyle({ width: $data.cWidth + "px", height: $data.cHeight + "px", background: $props.background }), "disable-scroll": $props.disableScroll, onError: _cache[1] || (_cache[1] = (...args) => $options._error && $options._error(...args)) }, null, 44, ["id", "canvasId", "disable-scroll"]), [ [vue.vShow, $data.showchart] ]) ], 40, ["id", "prop", "change:prop"])) ], 8, ["id"]); } if (typeof block0 === "function") block0(_sfc_main$B); const __easycom_0$3 = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$A], ["__scopeId", "data-v-0ca34aee"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue"]]); const _sfc_main$A = { __name: "educationCard", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 15], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true, rotateLabel: true, rotateAngle: -30, fontSize: 10 }, yAxis: { gridType: "dash", dashLength: 2 }, extra: { tooltip: { showBox: false }, area: { type: "curve", opacity: 0.2, addLine: true, width: 2, gradient: true, activeType: "hollow" } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/safe/educationCard.vue:52", e2); }; onReady(() => { let res = { categories: ["专项培训", "特种作业\n培训", "三级安全\n教育培训", "安全技术\n交底"], series: [{ data: [302265, 70770, 399175, 14851] }] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "教育培训" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "charts-box" }, [ vue.createVNode(_component_qiun_data_charts, { type: "area", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const EducationCard = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$z], ["__scopeId", "data-v-a6a882bc"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/educationCard.vue"]]); const SubsectionProps = { ...baseProps, /** tab的数据 */ list: { type: Array, default: () => [] }, /** 当前活动的tab的index */ current: { type: [Number, String], default: 0 }, /** 激活的颜色 */ activeColor: { type: String, default: "var(--u-main-color)" }, /** 未激活的颜色 */ inactiveColor: { type: String, default: "var(--u-content-color)" }, /** 模式选择,mode=button为按钮形式,mode=subsection时为分段模式 */ mode: { type: String, default: "button" }, /** 字体大小,单位rpx */ fontSize: { type: [Number, String], default: 28 }, /** 是否开启动画效果 */ animation: { type: Boolean, default: true }, /** 组件的高度,单位rpx */ height: { type: [Number, String], default: 70 }, /** 激活tab的字体是否加粗 */ bold: { type: Boolean, default: true }, /** mode=button时,组件背景颜色 */ bgColor: { type: String, default: "var(--u-divider-color)" }, /** mode = button时,滑块背景颜色 */ buttonColor: { type: String, default: "var(--u-bg-white)" }, /** 在切换分段器的时候,是否让设备震一下 */ vibrateShort: { type: Boolean, default: false } }; const __default__$8 = { name: "u-subsection", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({ ...__default__$8, props: SubsectionProps, emits: ["change"], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const props = __props; const emit = __emit; const listInfo = vue.ref([]); const itemBgStyle = vue.ref({ width: 0, left: 0, backgroundColor: "var(--u-bg-white)", height: "100%", transition: "" }); const currentIndex = vue.ref(Number(props.current)); const buttonPadding = 3; const borderRadius = 5; const firstTimeVibrateShort = vue.ref(true); const instanceId = $u.guid(); const instance = vue.getCurrentInstance(); vue.watch( () => props.current, (nVal) => { currentIndex.value = Number(nVal); changeSectionStatus(currentIndex.value); }, { immediate: true } ); vue.watch( () => props.list, () => { if (!props.list || !props.list.length) return; initListInfo(); vue.nextTick(() => { setTimeout(() => { getTabsInfo(); }, 10); }); }, { deep: true, immediate: true } ); vue.watch( () => props.mode, () => { vue.nextTick(() => { setTimeout(() => { getTabsInfo(); }, 10); }); } ); function initListInfo() { listInfo.value = props.list.map((val) => { if (typeof val !== "object") { return { width: 0, name: val }; } else { return { ...val, width: 0 }; } }); } const noBorderRight = vue.computed(() => { return (index) => { if (props.mode !== "subsection") return ""; let classs = ""; if (index < props.list.length - 1) classs += " u-none-border-right"; if (index === 0) classs += " u-item-first"; if (index === props.list.length - 1) classs += " u-item-last"; return classs; }; }); const textStyle = vue.computed(() => { return (index) => { const style = {}; if (props.mode === "subsection") { style.color = index === currentIndex.value ? "var(--u-white-color)" : props.activeColor; } else { style.color = index === currentIndex.value ? props.activeColor : props.inactiveColor; } if (index === currentIndex.value && props.bold) style.fontWeight = "bold"; style.fontSize = props.fontSize + "rpx"; return style; }; }); const itemStyle = vue.computed(() => { return (index) => { const style = {}; if (props.mode === "subsection") { style.borderColor = props.activeColor; style.borderWidth = "1px"; style.borderStyle = "solid"; } return style; }; }); const subsectionStyle = vue.computed(() => { const style = {}; style.height = uni.upx2px(Number(props.height)) + "px"; if (props.mode === "button") { style.backgroundColor = props.bgColor; style.padding = `${buttonPadding}px`; style.borderRadius = `${borderRadius}px`; } return style; }); const itemBarStyle = vue.computed(() => { const style = {}; style.backgroundColor = props.activeColor; style.zIndex = 1; if (props.mode === "button") { style.backgroundColor = props.buttonColor; style.borderRadius = `${borderRadius}px`; style.bottom = `${buttonPadding}px`; style.height = uni.upx2px(Number(props.height)) - buttonPadding * 2 + "px"; style.zIndex = 0; } return Object.assign({}, itemBgStyle.value, style); }); function changeSectionStatus(nVal) { if (props.mode === "subsection") { if (nVal === props.list.length - 1) { itemBgStyle.value.borderRadius = `0 ${buttonPadding}px ${buttonPadding}px 0`; } if (nVal === 0) { itemBgStyle.value.borderRadius = `${buttonPadding}px 0 0 ${buttonPadding}px`; } if (nVal > 0 && nVal < props.list.length - 1) { itemBgStyle.value.borderRadius = "0"; } } setTimeout(() => { itemBgLeft(); }, 10); if (props.vibrateShort && !firstTimeVibrateShort.value) { uni.vibrateShort(); } firstTimeVibrateShort.value = false; } function click(index) { if (index === currentIndex.value) return; currentIndex.value = index; changeSectionStatus(index); emit("change", index); } function getTabsInfo() { const view = uni.createSelectorQuery().in(instance == null ? void 0 : instance.proxy); for (let i2 = 0; i2 < props.list.length; i2++) { view.select(`#${instanceId} .u-item-${i2}`).boundingClientRect(); } view.exec((res) => { var _a2; if (!res.length) { setTimeout(() => { getTabsInfo(); return; }, 10); } res.map((val, index) => { listInfo.value[index].width = val.width; }); if (props.mode === "subsection" || props.mode === "button") { itemBgStyle.value.width = ((_a2 = listInfo.value[0]) == null ? void 0 : _a2.width) + "px"; } itemBgLeft(); }); } function itemBgLeft() { if (props.animation) { itemBgStyle.value.transition = "all 0.35s"; } else { itemBgStyle.value.transition = "all 0s"; } let left = 0; listInfo.value.forEach((val, index) => { if (index < currentIndex.value) left += val.width ?? 0; }); if (props.mode === "subsection") { itemBgStyle.value.left = left + "px"; } else if (props.mode === "button") { itemBgStyle.value.left = left + buttonPadding + "px"; } } const __returned__ = { props, emit, listInfo, itemBgStyle, currentIndex, buttonPadding, borderRadius, firstTimeVibrateShort, instanceId, instance, initListInfo, noBorderRight, textStyle, itemStyle, subsectionStyle, itemBarStyle, changeSectionStatus, click, getTabsInfo, itemBgLeft, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { id: $setup.instanceId, class: vue.normalizeClass(["u-subsection", _ctx.customClass]), style: vue.normalizeStyle($setup.$u.toStyle($setup.subsectionStyle, _ctx.customStyle)) }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.listInfo, (item, index) => { return vue.openBlock(), vue.createElementBlock("view", { class: vue.normalizeClass(["u-item u-line-1", [$setup.noBorderRight(index), `u-item-${index}`]]), style: vue.normalizeStyle($setup.itemStyle(index)), onClick: ($event) => $setup.click(index), key: index }, [ vue.createElementVNode( "view", { style: vue.normalizeStyle($setup.textStyle(index)), class: "u-item-text u-line-1" }, vue.toDisplayString(item.name), 5 /* TEXT, STYLE */ ) ], 14, ["onClick"]); }), 128 /* KEYED_FRAGMENT */ )), vue.createElementVNode( "view", { class: "u-item-bg", style: vue.normalizeStyle($setup.itemBarStyle) }, null, 4 /* STYLE */ ) ], 14, ["id"]); } const __easycom_0$2 = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$y], ["__scopeId", "data-v-28418ae2"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-subsection/u-subsection.vue"]]); const _sfc_main$y = { __name: "defectTreatmentCard", setup(__props, { expose: __expose }) { __expose(); const current = vue.ref(0); const list = vue.ref([ { name: "集团级" }, { name: "公司级" }, { name: "项目级" }, { name: "分支机构" } ]); const handleChange = () => { }; const __returned__ = { current, list, handleChange, ChartCard: CardModule, ref: vue.ref, watch: vue.watch }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_subsection = resolveEasycom(vue.resolveDynamicComponent("u-subsection"), __easycom_0$2); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "安全隐患排查治理" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "defect" }, [ vue.createVNode(_component_u_subsection, { list: $setup.list, current: $setup.current, onChange: $setup.handleChange }, null, 8, ["list", "current"]), vue.createElementVNode("view", { class: "defect-main u-flex u-row-between u-margin-top-20" }, [ vue.createElementVNode("view", { class: "defect-box gb-all" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "安全隐患"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "4567") ]), vue.createElementVNode("view", { class: "defect-box gb-rectified" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "整改闭环"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "20") ]), vue.createElementVNode("view", { class: "defect-box gb-not-rectified" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "未整改"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "6") ]), vue.createElementVNode("view", { class: "defect-box gb-rectified-rate" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "整改率"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "99.99%") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const DefectTreatmentCard = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$x], ["__scopeId", "data-v-e3917daa"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/defectTreatmentCard.vue"]]); const _sfc_main$x = { __name: "costCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "安全费用" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "cost u-flex" }, [ vue.createElementVNode("view", { class: "cost-box" }, [ vue.createElementVNode("view", { class: "cost-box-lab" }, "费用提取(亿元)"), vue.createElementVNode("view", { class: "cost-box-num u-margin-top-20" }, "800") ]), vue.createElementVNode("view", { class: "cost-box" }, [ vue.createElementVNode("view", { class: "cost-box-lab" }, "费用使用(亿元)"), vue.createElementVNode("view", { class: "cost-box-num u-margin-top-20" }, "800") ]) ]) ]), _: 1 /* STABLE */ }); } const CostCard = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$w], ["__scopeId", "data-v-566fc965"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/costCard.vue"]]); const _sfc_main$w = { __name: "specialEquipCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "施工机具设备" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "special-equip u-flex" }, [ vue.createElementVNode("view", { class: "special-equip-box u-flex u-row-center" }, [ vue.createElementVNode("view", { class: "special-equip-box-icon" }, [ vue.createVNode(_component_u_icon, { name: "ziyuanshiyongtongji", color: "#e28ea3", "custom-prefix": "custom-icon", size: "60" }) ]), vue.createElementVNode("view", { class: "special-equip-box-row u-padding-left-20" }, [ vue.createElementVNode("text", { class: "special-equip-box-row-num" }, "9000个"), vue.createElementVNode("text", { class: "special-equip-box-row-lab" }, "在用个数") ]) ]), vue.createElementVNode("view", { class: "special-equip-box u-flex u-row-center" }, [ vue.createElementVNode("view", { class: "special-equip-box-icon" }, [ vue.createVNode(_component_u_icon, { name: "tezhongshebei", color: "#3bdae2", "custom-prefix": "custom-icon", size: "60" }) ]), vue.createElementVNode("view", { class: "special-equip-box-row u-padding-left-20" }, [ vue.createElementVNode("text", { class: "special-equip-box-row-num" }, "9000个"), vue.createElementVNode("text", { class: "special-equip-box-row-lab" }, "特种设备") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const SpecialEquipCard = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$v], ["__scopeId", "data-v-65b1088b"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/specialEquipCard.vue"]]); const _sfc_main$v = { __name: "bigCrisisCard", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 5], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true }, yAxis: { data: [{ min: 0 }] }, extra: { column: { type: "group", width: 20, activeBgColor: "#000000", activeBgOpacity: 0.08 } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/safe/bigCrisisCard.vue:45", e2); }; onReady(() => { let res = { categories: ["未开始", "进行中", "已完成", "培训人次", "作业人次"], series: [{ data: [35, 36, 31, 33, 13] }] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "危大工程管控数据" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "big-crisis" }, [ vue.createVNode(_component_qiun_data_charts, { type: "column", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const BigCrisisCard = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$u], ["__scopeId", "data-v-57832b90"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/bigCrisisCard.vue"]]); const _sfc_main$u = { __name: "riskRankingCard", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ color: ["#EE6666", "#EF893B", "#EFCB3B", "#3B8CEF"], padding: [5, 5, 5, 5], enableScroll: false, legend: { lineHeight: 20, fontSize: 10, itemGap: 20 }, extra: { pie: { activeOpacity: 0.5, activeRadius: 10, offsetAngle: 0, labelWidth: 15, border: true, borderWidth: 3, borderColor: "#FFFFFF" } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/safe/riskRankingCard.vue:43", e2); }; onReady(() => { let res = { series: [{ data: [{ "name": "重大风险", "value": 50, "labelText": "重大风险:50" }, { "name": "较大风险", "value": 30, "labelText": "较大风险:30" }, { "name": "一般风险", "value": 20, "labelText": "一般风险:20" }, { "name": "低风险", "value": 8, "labelText": "低风险:8" }] }] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; }, get onShow() { return onShow; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "风险分级管控" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "rish-ranking" }, [ vue.createVNode(_component_qiun_data_charts, { type: "pie", opts: $setup.opts, chartData: $setup.chartData }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const RiskRankingCard = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t], ["__scopeId", "data-v-4fef74c9"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/riskRankingCard.vue"]]); const _sfc_main$t = { __name: "workCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "高风险作业许可" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "work u-flex" }, [ vue.createElementVNode("view", { class: "work-box u-flex u-row-center" }, [ vue.createElementVNode("view", { class: "work-box-icon" }, [ vue.createVNode(_component_u_icon, { name: "xukezheng", color: "#8CEEFF", "custom-prefix": "custom-icon", size: "60" }) ]), vue.createElementVNode("view", { class: "work-box-row u-padding-left-20" }, [ vue.createElementVNode("text", { class: "work-box-row-num" }, "9000个"), vue.createElementVNode("text", { class: "work-box-row-lab" }, "许可") ]) ]), vue.createElementVNode("view", { class: "work-box u-flex u-row-center" }, [ vue.createElementVNode("view", { class: "work-box-icon" }, [ vue.createVNode(_component_u_icon, { name: "guanbi", color: "#FFEB3B", "custom-prefix": "custom-icon", size: "60" }) ]), vue.createElementVNode("view", { class: "work-box-row u-padding-left-20" }, [ vue.createElementVNode("text", { class: "work-box-row-num" }, "9000个"), vue.createElementVNode("text", { class: "work-box-row-lab" }, "关闭") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const WorkCard = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s], ["__scopeId", "data-v-6bbf9eb3"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/workCard.vue"]]); const _sfc_main$s = { __name: "emergencyCard", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 5], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true, rotateLabel: true, fontSize: 10, rotateAngle: -30 }, yAxis: { data: [{ min: 0 }] }, extra: { column: { type: "group", width: 20, activeBgColor: "#000000", activeBgOpacity: 0.08 } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/safe/emergencyCard.vue:46", e2); }; onReady(() => { let res = { categories: ["应急预案", "专项预案", "现场处置\n预案", "演练次数", "参演人数"], series: [{ data: [35, 36, 31, 33, 13], color: "#eef82f" }], formatter: function(value, index, series, opts2) { formatAppLog("log", "at pages/index/board/safe/emergencyCard.vue:58", value); formatAppLog("log", "at pages/index/board/safe/emergencyCard.vue:59", index); formatAppLog("log", "at pages/index/board/safe/emergencyCard.vue:60", series); formatAppLog("log", "at pages/index/board/safe/emergencyCard.vue:61", opts2); } }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "0 0 30rpx 0", title: "应急管理数据" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "emergencyCard" }, [ vue.createVNode(_component_qiun_data_charts, { type: "column", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const EmergencyCard = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r], ["__scopeId", "data-v-5048bcdb"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/safe/emergencyCard.vue"]]); const _sfc_main$r = { __name: "orgPersonCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "组织机构人员" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "org-person" }, [ vue.createElementVNode("view", { class: "org-person-row" }, [ vue.createElementVNode("view", { class: "org-person-row_lab" }, " 集团总数 "), vue.createElementVNode("view", { class: "org-person-row_num" }, "9521") ]), vue.createElementVNode("view", { class: "u-flex" }, [ vue.createElementVNode("view", { class: "org-person-row" }, [ vue.createElementVNode("view", { class: "org-person-row_lab" }, " 所企业总部人数 "), vue.createElementVNode("view", { class: "org-person-row_num" }, "9521") ]), vue.createElementVNode("view", { class: "org-person-row" }, [ vue.createElementVNode("view", { class: "org-person-row_lab" }, " 分支机构人数 "), vue.createElementVNode("view", { class: "org-person-row_num" }, "9521") ]) ]), vue.createElementVNode("view", { class: "u-flex" }, [ vue.createElementVNode("view", { class: "org-person-row" }, [ vue.createElementVNode("view", { class: "org-person-row_lab" }, " 质量管理人数 "), vue.createElementVNode("view", { class: "org-person-row_num" }, "9521") ]), vue.createElementVNode("view", { class: "org-person-row" }, [ vue.createElementVNode("view", { class: "org-person-row_lab" }, " 特种设备质保体系 "), vue.createElementVNode("view", { class: "org-person-row_num" }, "9521") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const OrgPersonCard = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q], ["__scopeId", "data-v-2b88b180"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/orgPersonCard.vue"]]); const _sfc_main$q = { __name: "starLevelCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "星级标准化工地建设" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "star-level" }, [ vue.createElementVNode("view", { class: "star-level-box u-flex" }, [ vue.createElementVNode("view", { class: "star-level-tit" }, "五星"), vue.createElementVNode("view", { class: "u-flex star-level-box_inner", style: { "width": "calc(100% - 48rpx)" } }, [ vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 创建数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]), vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 企业自评价达标数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]), vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 集团验收达标数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]) ]) ]), vue.createElementVNode("view", { class: "star-level-box u-flex u-margin-top-30 u-margin-bottom-30" }, [ vue.createElementVNode("view", { class: "star-level-tit" }, "四星"), vue.createElementVNode("view", { class: "u-flex star-level-box_inner", style: { "width": "calc(100% - 48rpx)" } }, [ vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 创建数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]), vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 企业自评价达标数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]), vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 集团验收达标数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]) ]) ]), vue.createElementVNode("view", { class: "star-level-box u-flex" }, [ vue.createElementVNode("view", { class: "star-level-tit" }, "三星"), vue.createElementVNode("view", { class: "u-flex star-level-box_inner", style: { "width": "calc(100% - 48rpx)" } }, [ vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 创建数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]), vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 企业自评价达标数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]), vue.createElementVNode("view", { class: "star-level-row" }, [ vue.createElementVNode("view", { class: "star-level_lab" }, " 集团验收达标数 "), vue.createElementVNode("view", { class: "star-level_num" }, " 59 ") ]) ]) ]) ]) ]), _: 1 /* STABLE */ }); } const StarLevelCard = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p], ["__scopeId", "data-v-2c6840f6"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/starLevelCard.vue"]]); const _sfc_main$p = { __name: "educationCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "教育培训" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "education u-flex" }, [ vue.createElementVNode("view", { class: "education-box" }, [ vue.createElementVNode("view", { class: "education-box-lab" }, "质量培训(人次)"), vue.createElementVNode("view", { class: "education-box-num u-margin-top-20" }, "800") ]), vue.createElementVNode("view", { class: "education-box" }, [ vue.createElementVNode("view", { class: "education-box-lab" }, "技术质量交底(人次)"), vue.createElementVNode("view", { class: "education-box-num u-margin-top-20" }, "800") ]) ]) ]), _: 1 /* STABLE */ }); } const EducationCard1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-d56b7742"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/educationCard.vue"]]); const _sfc_main$o = { __name: "measuringCard", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "计量器具数据" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "measuring u-flex" }, [ vue.createElementVNode("view", { class: "measuring-box u-flex u-row-center" }, [ vue.createElementVNode("view", { class: "measuring-box-icon" }, [ vue.createVNode(_component_u_icon, { name: "jiliangqijujianguan", color: "#e28ea3", "custom-prefix": "custom-icon", size: "60" }) ]), vue.createElementVNode("view", { class: "measuring-box-row u-padding-left-20" }, [ vue.createElementVNode("text", { class: "measuring-box-row-num" }, "900台"), vue.createElementVNode("text", { class: "measuring-box-row-lab" }, "计量器具") ]) ]), vue.createElementVNode("view", { class: "measuring-box u-flex u-row-center" }, [ vue.createElementVNode("view", { class: "measuring-box-icon" }, [ vue.createVNode(_component_u_icon, { name: "hege", color: "#3bdae2", "custom-prefix": "custom-icon", size: "60" }) ]), vue.createElementVNode("view", { class: "measuring-box-row u-padding-left-20" }, [ vue.createElementVNode("text", { class: "measuring-box-row-num" }, "9000台"), vue.createElementVNode("text", { class: "measuring-box-row-lab" }, "检验合格") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const MeasuringCard = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-911d8482"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/measuringCard.vue"]]); const _sfc_main$n = { __name: "inspectionRecord", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 15], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true }, yAxis: { disabled: false, disableGrid: false, splitNumber: 5, gridType: "dash", dashLength: 4, gridColor: "#CCCCCC", padding: 10, showTitle: true, data: [ { position: "left", title: "", textAlign: "left" }, { position: "right", min: 0, max: 100, title: "单位: %" } ] }, extra: { mix: { column: { width: 20 } } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/qms/inspectionRecord.vue:61", e2); }; onReady(() => { let res = { categories: ["设材报验数", "机具报验数", "人员报验数"], series: [ { name: "", index: 1, type: "line", color: "#5cffc9", data: [70, 50, 85] }, { name: "", type: "column", style: "curve", color: "#fff705", disableLegend: true, data: [56872, 4027, 8452], format: "formatDataLabel" } ] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "报验记录" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "inspection" }, [ vue.createVNode(_component_qiun_data_charts, { type: "mix", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const InspectionRecord = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m], ["__scopeId", "data-v-885e0717"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/inspectionRecord.vue"]]); const _sfc_main$m = { __name: "projectItemCard", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 5], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true }, yAxis: { showTitle: true, data: [{ title: "单位:个" }] }, extra: { column: { type: "group", width: 30, activeBgColor: "#000000", activeBgOpacity: 0.08 } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/qms/projectItemCard.vue:44", e2); }; onReady(() => { let res = { categories: ["单位工程数", "分部工程数", "分项工程数"], series: [ { name: "", data: [1e4, 5428, 6852] } ] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "工程划分" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "inspection" }, [ vue.createVNode(_component_qiun_data_charts, { type: "column", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const ProjectItem = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-3894200b"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/projectItemCard.vue"]]); const _sfc_main$l = { __name: "highQuality", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 5], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true, rotateLabel: true, rotateAngle: -30 }, yAxis: { showTitle: true, data: [{ title: "单位:项" }] }, extra: { column: { type: "group", width: 30, activeBgColor: "#000000", activeBgOpacity: 0.08 } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/qms/highQuality.vue:47", e2); }; onReady(() => { let res = { categories: ["国家级鲁\n班奖", "国家级国\n优奖", "省部级奖\n项", "市级奖项"], series: [ { color: "#91CB74", name: "", data: [100, 542, 685, 254] } ] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "优质工程" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "inspection" }, [ vue.createVNode(_component_qiun_data_charts, { type: "column", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const HighQuality = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-1e1c2b72"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/highQuality.vue"]]); const _sfc_main$k = { __name: "QCActivity", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 5], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true }, yAxis: { showTitle: true, data: [{ title: "单位:项" }] }, extra: { column: { type: "group", width: 30, activeBgColor: "#000000", activeBgOpacity: 0.08 } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/qms/QCActivity.vue:45", e2); }; onReady(() => { let res = { categories: ["省部级奖\n项", "集团级奖\n项", "企业级奖\n项"], series: [ { color: "#27c9cb", name: "", data: [100, 542, 685] } ] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "QC活动" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "inspection" }, [ vue.createVNode(_component_qiun_data_charts, { type: "column", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const QCActivity = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j], ["__scopeId", "data-v-96c387c0"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/QCActivity.vue"]]); const _sfc_main$j = { __name: "constructionScheme", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ padding: [15, 15, 0, 5], enableScroll: false, legend: { show: false }, xAxis: { disableGrid: true }, yAxis: { showTitle: true, data: [{ title: "单位:个" }] }, extra: { column: { type: "group", width: 30, activeBgColor: "#000000", activeBgOpacity: 0.08 } } }); const chartData = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/qms/constructionScheme.vue:46", e2); }; onReady(() => { let res = { categories: ["总数", "项目审批数", "企业审批数"], series: [ { color: "#5c7fcb", name: "", data: [100, 542, 685] } ] }; chartData.value = JSON.parse(JSON.stringify(res)); }); const __returned__ = { opts, chartData, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "施工方案" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "inspection" }, [ vue.createVNode(_component_qiun_data_charts, { type: "column", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const ConstructionScheme = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i], ["__scopeId", "data-v-5be3af42"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/constructionScheme.vue"]]); const _sfc_main$i = { __name: "reviewAndBriefing", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "图纸会审/技术交底" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "education u-flex" }, [ vue.createElementVNode("view", { class: "education-box" }, [ vue.createElementVNode("view", { class: "education-box-lab" }, "图纸会审(次)"), vue.createElementVNode("view", { class: "education-box-num u-margin-top-20" }, "800") ]), vue.createElementVNode("view", { class: "education-box" }, [ vue.createElementVNode("view", { class: "education-box-lab" }, "设计交底(次)"), vue.createElementVNode("view", { class: "education-box-num u-margin-top-20" }, "800") ]) ]) ]), _: 1 /* STABLE */ }); } const ReviewAndBriefing = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h], ["__scopeId", "data-v-077e4da0"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/reviewAndBriefing.vue"]]); const _sfc_main$h = { __name: "qmsInspect", setup(__props, { expose: __expose }) { __expose(); const current = vue.ref(0); const list = vue.ref([ { name: "集团级" }, { name: "企业级" }, { name: "分支机构" }, { name: "项目级" } ]); const handleChange = () => { }; const __returned__ = { current, list, handleChange, ChartCard: CardModule, ref: vue.ref, watch: vue.watch }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_subsection = resolveEasycom(vue.resolveDynamicComponent("u-subsection"), __easycom_0$2); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "安全隐患排查治理" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "defect" }, [ vue.createVNode(_component_u_subsection, { list: $setup.list, current: $setup.current, onChange: $setup.handleChange }, null, 8, ["list", "current"]), vue.createElementVNode("view", { class: "defect-main u-flex u-row-between u-margin-top-20" }, [ vue.createElementVNode("view", { class: "defect-box gb-all" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "质量问题"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "4567项") ]), vue.createElementVNode("view", { class: "defect-box gb-rectified" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "整改完成"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "20项") ]), vue.createElementVNode("view", { class: "defect-box gb-not-rectified" }, [ vue.createElementVNode("text", { class: "defect-box-lab" }, "未整改"), vue.createElementVNode("text", { class: "defect-box-num u-margin-top-20" }, "6项") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const QmsInspect = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g], ["__scopeId", "data-v-c60b6f79"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/qmsInspect.vue"]]); const _sfc_main$g = { __name: "acceptanceData", setup(__props, { expose: __expose }) { __expose(); const opts = vue.ref({ color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"], padding: [15, 15, 0, 15], enableScroll: false, legend: { fontSize: 10 }, xAxis: { disableGrid: true }, yAxis: { disabled: false, disableGrid: false, splitNumber: 5, gridType: "dash", dashLength: 4, gridColor: "#CCCCCC", padding: 10, showTitle: true, data: [ { position: "right", min: 0, max: 100, title: "百分比" }, { position: "left", title: "数量", textAlign: "left" } ] }, extra: { mix: { column: { width: 20, seriesGap: 8 } } } }); const chartData = vue.ref({}); const chartData1 = vue.ref({}); const handleTap = (e2) => { formatAppLog("log", "at pages/index/board/qms/acceptanceData.vue:64", e2); }; onReady(() => { let res = { categories: ["关键工序验收", "特殊工程验收", "隐藏工程验收"], series: [ { name: "合格率", type: "line", style: "curve", color: "#ffe200", disableLegend: true, data: [70, 50, 85] }, { name: "验收数", index: 1, type: "column", data: [40, 55, 110] }, { name: "合格数", index: 1, type: "column", data: [50, 20, 75] } ] }; chartData.value = JSON.parse(JSON.stringify(res)); let res1 = { categories: ["单位工程", "分部工程", "分项工程"], series: [ { name: "合格率", type: "line", style: "curve", color: "#ffe200", disableLegend: true, data: [70, 50, 85] }, { name: "验收数", index: 1, type: "column", data: [40, 55, 110] }, { name: "合格数", index: 1, type: "column", data: [50, 20, 75] } ] }; chartData1.value = JSON.parse(JSON.stringify(res1)); }); const __returned__ = { opts, chartData, chartData1, handleTap, ChartCard: CardModule, ref: vue.ref, get onReady() { return onReady; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) { const _component_qiun_data_charts = resolveEasycom(vue.resolveDynamicComponent("qiun-data-charts"), __easycom_0$3); return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "质量验收数据" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "ys" }, [ vue.createVNode(_component_qiun_data_charts, { type: "mix", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]), vue.createElementVNode("view", { class: "ys u-margin-top-30" }, [ vue.createVNode(_component_qiun_data_charts, { type: "mix", opts: $setup.opts, chartData: $setup.chartData, onGetIndex: $setup.handleTap }, null, 8, ["opts", "chartData"]) ]) ]), _: 1 /* STABLE */ }); } const AcceptanceData = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f], ["__scopeId", "data-v-d3e96106"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/acceptanceData.vue"]]); const _sfc_main$f = { __name: "weldingData", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { ChartCard: CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createBlock($setup["ChartCard"], { margin: "30rpx 0 0 0", title: "焊接数据" }, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "weld" }, [ vue.createElementVNode("view", { class: "weld-row u-padding-20" }, [ vue.createElementVNode("view", { class: "weld-row-col u-flex" }, [ vue.createElementVNode("view", { class: "weld-row-col_lab" }, " 焊工总数 "), vue.createElementVNode("view", { class: "weld-row-col_num u-padding-left-18" }, " 945281 ") ]) ]), vue.createElementVNode("view", { class: "weld-row1 u-margin-top-20" }, [ vue.createElementVNode("view", { class: "weld-row1-col1 u-flex-col" }, [ vue.createElementVNode("view", { class: "weld-row1-col1_lab" }, " 总达因数 "), vue.createElementVNode("view", { class: "weld-row1-col1_num" }, " 945281 ") ]), vue.createElementVNode("view", { class: "weld-row1-col1 u-flex-col" }, [ vue.createElementVNode("view", { class: "weld-row1-col1_lab" }, " 完成达因数 "), vue.createElementVNode("view", { class: "weld-row1-col1_num" }, " 945281 ") ]), vue.createElementVNode("view", { class: "weld-row1-col1 u-flex-col" }, [ vue.createElementVNode("view", { class: "weld-row1-col1_lab" }, " 总片数 "), vue.createElementVNode("view", { class: "weld-row1-col1_num" }, " 945281 ") ]) ]), vue.createElementVNode("view", { class: "weld-row2 u-margin-top-20" }, [ vue.createElementVNode("view", { class: "weld-row1-col1 u-flex-col" }, [ vue.createElementVNode("view", { class: "weld-row1-col1_lab" }, " 合格片数 "), vue.createElementVNode("view", { class: "weld-row1-col1_num" }, " 945281 ") ]), vue.createElementVNode("view", { class: "weld-row1-col1 u-flex-col" }, [ vue.createElementVNode("view", { class: "weld-row1-col1_lab" }, " 一次合格率 "), vue.createElementVNode("view", { class: "weld-row1-col1_num" }, " 33.00% ") ]) ]) ]) ]), _: 1 /* STABLE */ }); } const WeldingData = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e], ["__scopeId", "data-v-5be1e34d"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/qms/weldingData.vue"]]); const _sfc_main$e = { __name: "index", setup(__props, { expose: __expose }) { __expose(); const safeComponent = vue.ref([2, 1, 3, 4, 5, 6, 7, 8, 9, 10]); const tabIndx = vue.ref(0); const handleChangeTab = (idx) => { tabIndx.value = idx; }; const __returned__ = { safeComponent, tabIndx, handleChangeTab, defineAsyncComponent: vue.defineAsyncComponent, ref: vue.ref, ProjectCard, SafeHoursCard, OrganizerCard, EducationCard, DefectTreatmentCard, CostCard, SpecialEquipCard, BigCrisisCard, RiskRankingCard, WorkCard, EmergencyCard, OrgPersonCard, StarLevelCard, EducationCard1, MeasuringCard, InspectionRecord, ProjectItem, HighQuality, QCActivity, ConstructionScheme, ReviewAndBriefing, QmsInspect, AcceptanceData, WeldingData }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_0$7); return vue.openBlock(), vue.createElementBlock("view", { class: "custom-wrap u-padding-30" }, [ vue.createElementVNode("view", { class: "custom-tabs u-flex box-shadow" }, [ vue.createElementVNode( "view", { class: vue.normalizeClass(["custom-tabs-tab", $setup.tabIndx ? "" : "custom-tabs-tab_active"]), onClick: _cache[0] || (_cache[0] = ($event) => $setup.handleChangeTab(0)) }, [ vue.createVNode(_component_u_icon, { name: "anquan", "custom-prefix": "custom-icon", size: "80" }), vue.createElementVNode("text", { class: "u-margin-top-20" }, "安全生产数据") ], 2 /* CLASS */ ), vue.createElementVNode( "view", { class: vue.normalizeClass(["custom-tabs-tab", $setup.tabIndx ? "custom-tabs-tab_active" : ""]), onClick: _cache[1] || (_cache[1] = ($event) => $setup.handleChangeTab(1)) }, [ vue.createVNode(_component_u_icon, { name: "zhiliang", "custom-prefix": "custom-icon", size: "80" }), vue.createElementVNode("text", { class: "u-margin-top-20" }, "质量焊接数据") ], 2 /* CLASS */ ) ]), vue.createVNode(_component_u_transition, { show: $setup.tabIndx === 0, name: "slide-right" }, { default: vue.withCtx(() => [ $setup.tabIndx == 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [ vue.createVNode($setup["ProjectCard"]), vue.createElementVNode("view", { style: { "margin-top": "-60rpx", "padding": "0 20rpx 40rpx" } }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.safeComponent, (i2, idx) => { return vue.openBlock(), vue.createElementBlock( vue.Fragment, null, [ i2 === 1 ? (vue.openBlock(), vue.createBlock($setup["SafeHoursCard"], { key: 0 })) : vue.createCommentVNode("v-if", true), i2 === 2 ? (vue.openBlock(), vue.createBlock($setup["OrganizerCard"], { key: 1 })) : vue.createCommentVNode("v-if", true), i2 === 3 ? (vue.openBlock(), vue.createBlock($setup["EducationCard"], { key: 2 })) : vue.createCommentVNode("v-if", true), i2 === 4 ? (vue.openBlock(), vue.createBlock($setup["DefectTreatmentCard"], { key: 3 })) : vue.createCommentVNode("v-if", true), i2 === 5 ? (vue.openBlock(), vue.createBlock($setup["CostCard"], { key: 4 })) : vue.createCommentVNode("v-if", true), i2 === 6 ? (vue.openBlock(), vue.createBlock($setup["SpecialEquipCard"], { key: 5 })) : vue.createCommentVNode("v-if", true), i2 === 7 ? (vue.openBlock(), vue.createBlock($setup["BigCrisisCard"], { key: 6 })) : vue.createCommentVNode("v-if", true), i2 === 8 ? (vue.openBlock(), vue.createBlock($setup["RiskRankingCard"], { key: 7 })) : vue.createCommentVNode("v-if", true), i2 === 9 ? (vue.openBlock(), vue.createBlock($setup["WorkCard"], { key: 8 })) : vue.createCommentVNode("v-if", true), i2 === 10 ? (vue.openBlock(), vue.createBlock($setup["EmergencyCard"], { key: 9 })) : vue.createCommentVNode("v-if", true) ], 64 /* STABLE_FRAGMENT */ ); }), 256 /* UNKEYED_FRAGMENT */ )) ]) ])) : vue.createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }, 8, ["show"]), vue.createVNode(_component_u_transition, { show: $setup.tabIndx === 1, name: "slide-right" }, { default: vue.withCtx(() => [ $setup.tabIndx == 1 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [ vue.createVNode($setup["OrgPersonCard"]), vue.createVNode($setup["StarLevelCard"]), vue.createVNode($setup["EducationCard1"]), vue.createVNode($setup["MeasuringCard"]), vue.createVNode($setup["InspectionRecord"]), vue.createVNode($setup["ProjectItem"]), vue.createVNode($setup["HighQuality"]), vue.createVNode($setup["QCActivity"]), vue.createVNode($setup["ConstructionScheme"]), vue.createVNode($setup["ReviewAndBriefing"]), vue.createVNode($setup["QmsInspect"]), vue.createVNode($setup["AcceptanceData"]), vue.createVNode($setup["WeldingData"]) ])) : vue.createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }, 8, ["show"]) ]); } const Board = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/board/index.vue"]]); const ImageProps = { ...baseProps, /** 图片地址 */ src: { type: String, default: "" }, /** 裁剪模式 */ mode: { type: String, default: "aspectFill" }, /** 宽度,单位任意,如果为数值,则为rpx单位(默认100%) */ width: { type: [String, Number], default: "100%" }, /** 高度,单位任意,如果为数值,则为rpx单位(默认 auto) */ height: { type: [String, Number], default: "auto" }, /** 图片形状,circle-圆形,square-方形(默认square) */ shape: { type: String, default: "square" }, /** 圆角值,单位任意,如果为数值,则为rpx单位(默认 0) */ borderRadius: { type: [String, Number], default: 0 }, /** 是否懒加载,仅微信小程序、App、百度小程序、字节跳动小程序有效(默认 true) */ lazyLoad: { type: Boolean, default: true }, /** 是否开启长按图片显示识别小程序码菜单,仅微信小程序有效(默认 true) */ showMenuByLongpress: { type: Boolean, default: true }, /** 加载中的图标,或者小图片(默认 photo) */ loadingIcon: { type: String, default: "photo" }, /** 加载失败的图标,或者小图片(默认 error-circle) */ errorIcon: { type: String, default: "error-circle" }, /** 是否显示加载中的图标或者自定义的slot(默认 true) */ showLoading: { type: Boolean, default: true }, /** 是否显示加载错误的图标或者自定义的slot(默认 true) */ showError: { type: Boolean, default: true }, /** 是否需要淡入效果(默认 true) */ fade: { type: Boolean, default: true }, /** 只支持网络资源,只对微信小程序有效(默认 false) */ webp: { type: Boolean, default: false }, /** 搭配fade参数的过渡时间,单位ms(默认 500) */ duration: { type: [String, Number], default: 500 }, /** 背景颜色,用于深色页面加载图片时,为了和背景色融合(默认 var(--u-bg-color)) */ bgColor: { type: String, default: "var(--u-bg-color)" }, /** 使用插槽名称对象,用于自定义插槽,默认 undefined,当动态切换slot隐藏时,需要使用useSlots使用,兼容头条小程序 */ useSlots: { type: Object, default: void 0 } }; const __default__$7 = { name: "u-image", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({ ...__default__$7, props: ImageProps, emits: ["click", "error", "load"], setup(__props, { expose: __expose, emit: __emit }) { const emit = __emit; const props = __props; const isError = vue.ref(false); const loading = vue.ref(true); const opacity = vue.ref(1); const durationTime = vue.ref(props.duration); const backgroundStyle = vue.ref({}); vue.watch( () => props.src, (n2) => { if (!n2) { isError.value = true; loading.value = false; } else { isError.value = false; loading.value = true; } }, { immediate: true } ); const wrapStyle = vue.computed(() => { let style = {}; style.width = $u.addUnit(props.width); style.height = $u.addUnit(props.height); style.borderRadius = props.shape === "circle" ? "50%" : $u.addUnit(props.borderRadius); style.overflow = Number(props.borderRadius) > 0 ? "hidden" : "visible"; if (props.fade) { style.opacity = opacity.value; style.transition = `opacity ${Number(durationTime.value) / 1e3}s ease-in-out`; } return style; }); function onClick() { emit("click"); } function onErrorHandler(err) { loading.value = false; isError.value = true; emit("error", err); } function onLoadHandler() { loading.value = false; isError.value = false; emit("load"); if (!props.fade) return removeBgColor(); opacity.value = 0; durationTime.value = 0; setTimeout(() => { durationTime.value = props.duration; opacity.value = 1; setTimeout(() => { removeBgColor(); }, Number(durationTime.value)); }, 50); } function removeBgColor() { backgroundStyle.value = { backgroundColor: "transparent" }; } function changeStatus(status) { if (status === "loading") { loading.value = true; isError.value = false; } else if (status === "error") { loading.value = false; isError.value = true; } else { loading.value = false; isError.value = false; } } const $slots = vue.useSlots(); function hasSlot(name) { return props.useSlots ? !!$slots[name] && props.useSlots[name] : !!$slots[name]; } __expose({ changeStatus }); const __returned__ = { emit, props, isError, loading, opacity, durationTime, backgroundStyle, wrapStyle, onClick, onErrorHandler, onLoadHandler, removeBgColor, changeStatus, $slots, hasSlot, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); return vue.openBlock(), vue.createElementBlock( "view", { class: vue.normalizeClass(["u-image", _ctx.customClass]), onClick: $setup.onClick, style: vue.normalizeStyle($setup.$u.toStyle($setup.wrapStyle, $setup.backgroundStyle, _ctx.customStyle)) }, [ !$setup.isError ? (vue.openBlock(), vue.createElementBlock("image", { key: 0, src: _ctx.src, mode: _ctx.mode, onError: $setup.onErrorHandler, onLoad: $setup.onLoadHandler, "lazy-load": _ctx.lazyLoad, class: "u-image__image", "show-menu-by-longpress": _ctx.showMenuByLongpress, style: vue.normalizeStyle({ borderRadius: _ctx.shape === "circle" ? "50%" : $setup.$u.addUnit(_ctx.borderRadius) }) }, null, 44, ["src", "mode", "lazy-load", "show-menu-by-longpress"])) : vue.createCommentVNode("v-if", true), _ctx.showLoading && $setup.loading ? (vue.openBlock(), vue.createElementBlock( "view", { key: 1, class: "u-image__loading", style: vue.normalizeStyle({ borderRadius: _ctx.shape === "circle" ? "50%" : $setup.$u.addUnit(_ctx.borderRadius), backgroundColor: _ctx.bgColor }) }, [ $setup.hasSlot("loading") ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createBlock(_component_u_icon, { key: 1, name: _ctx.loadingIcon, width: _ctx.width, height: _ctx.height }, null, 8, ["name", "width", "height"])) ], 4 /* STYLE */ )) : vue.createCommentVNode("v-if", true), _ctx.showError && $setup.isError && !$setup.loading ? (vue.openBlock(), vue.createElementBlock( "view", { key: 2, class: "u-image__error", style: vue.normalizeStyle({ borderRadius: _ctx.shape === "circle" ? "50%" : $setup.$u.addUnit(_ctx.borderRadius) }) }, [ $setup.hasSlot("error") ? vue.renderSlot(_ctx.$slots, "error", { key: 0 }, void 0, true) : (vue.openBlock(), vue.createBlock(_component_u_icon, { key: 1, name: _ctx.errorIcon, width: _ctx.width, height: _ctx.height }, null, 8, ["name", "width", "height"])) ], 4 /* STYLE */ )) : vue.createCommentVNode("v-if", true) ], 6 /* CLASS, STYLE */ ); } const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c], ["__scopeId", "data-v-c4bf84b3"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-image/u-image.vue"]]); const CellItemProps = { ...baseProps, /** 左侧图标名称(只能uView内置图标),或者图标src */ icon: { type: String, default: "" }, /** 左侧标题 */ title: { type: [String, Number], default: "" }, /** 右侧内容 */ value: { type: [String, Number], default: "" }, /** 标题下方的描述信息 */ label: { type: [String, Number], default: "" }, /** 是否显示下边框 */ borderBottom: { type: Boolean, default: true }, /** 是否显示上边框 */ borderTop: { type: Boolean, default: false }, /** 是否开启点击反馈,即点击时cell背景为灰色,none为无效果 */ hoverClass: { type: String, default: "u-cell-hover" }, /** 是否显示右侧箭头 */ arrow: { type: Boolean, default: true }, /** 内容是否垂直居中 */ center: { type: Boolean, default: false }, /** 是否显示左边表示必填的星号 */ required: { type: Boolean, default: false }, /** 标题的宽度,单位rpx */ titleWidth: { type: [Number, String], default: "" }, /** 右侧箭头方向,可选值:right|up|down,默认为right */ arrowDirection: { type: String, default: "right" }, /** 控制标题的样式 */ titleStyle: { type: Object, default: () => ({}) }, /** 右侧显示内容的样式 */ valueStyle: { type: Object, default: () => ({}) }, /** 描述信息的样式 */ labelStyle: { type: Object, default: () => ({}) }, /** 背景颜色 */ bgColor: { type: String, default: "transparent" }, /** 用于识别被点击的是第几个cell */ index: { type: [String, Number], default: "" }, /** 是否使用label插槽 */ useLabelSlot: { type: Boolean, default: false }, /** 左边图标的大小,单位rpx,只对传入icon字段时有效 */ iconSize: { type: [Number, String], default: 34 }, /** 左边图标的样式,对象形式 */ iconStyle: { type: Object, default: () => ({}) } }; const __default__$6 = { name: "u-cell-item", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({ ...__default__$6, props: CellItemProps, emits: ["click"], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const emit = __emit; const props = __props; const $slots = vue.useSlots(); const arrowStyle = vue.computed(() => { let style = {}; if (props.arrowDirection === "up") style.transform = "rotate(-90deg)"; else if (props.arrowDirection === "down") style.transform = "rotate(90deg)"; else style.transform = "rotate(0deg)"; return style; }); function onClick() { emit("click", props.index); } const __returned__ = { emit, props, $slots, arrowStyle, onClick, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); return vue.openBlock(), vue.createElementBlock("view", { onClick: $setup.onClick, class: vue.normalizeClass(["u-cell", [ { "u-border-bottom": _ctx.borderBottom, "u-border-top": _ctx.borderTop, "u-col-center": _ctx.center, "u-cell--required": _ctx.required }, _ctx.customClass ]]), "hover-stay-time": "150", "hover-class": _ctx.hoverClass, style: vue.normalizeStyle($setup.$u.toStyle({ backgroundColor: _ctx.bgColor }, _ctx.customStyle)) }, [ _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", { key: 0, class: "u-cell__left-icon-wrap" }, [ vue.createVNode(_component_u_icon, { size: _ctx.iconSize, name: _ctx.icon, "custom-style": _ctx.iconStyle }, null, 8, ["size", "name", "custom-style"]) ])) : (vue.openBlock(), vue.createElementBlock("view", { key: 1, class: "u-flex" }, [ vue.renderSlot(_ctx.$slots, "icon", {}, void 0, true) ])), vue.createElementVNode( "view", { class: "u-cell_title", style: vue.normalizeStyle([{ width: _ctx.titleWidth ? _ctx.titleWidth + "rpx" : "auto" }, _ctx.titleStyle]) }, [ _ctx.title !== "" ? (vue.openBlock(), vue.createElementBlock( vue.Fragment, { key: 0 }, [ vue.createTextVNode( vue.toDisplayString(_ctx.title), 1 /* TEXT */ ) ], 64 /* STABLE_FRAGMENT */ )) : vue.renderSlot(_ctx.$slots, "title", { key: 1 }, void 0, true), _ctx.label || $setup.$slots.label ? (vue.openBlock(), vue.createElementBlock( "view", { key: 2, class: "u-cell__label", style: vue.normalizeStyle([_ctx.labelStyle]) }, [ _ctx.label !== "" ? (vue.openBlock(), vue.createElementBlock( vue.Fragment, { key: 0 }, [ vue.createTextVNode( vue.toDisplayString(_ctx.label), 1 /* TEXT */ ) ], 64 /* STABLE_FRAGMENT */ )) : vue.renderSlot(_ctx.$slots, "label", { key: 1 }, void 0, true) ], 4 /* STYLE */ )) : vue.createCommentVNode("v-if", true) ], 4 /* STYLE */ ), vue.createElementVNode( "view", { class: "u-cell__value", style: vue.normalizeStyle([_ctx.valueStyle]) }, [ _ctx.value !== "" ? (vue.openBlock(), vue.createElementBlock( vue.Fragment, { key: 0 }, [ vue.createTextVNode( vue.toDisplayString(_ctx.value), 1 /* TEXT */ ) ], 64 /* STABLE_FRAGMENT */ )) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true) ], 4 /* STYLE */ ), $setup.$slots["right-icon"] ? (vue.openBlock(), vue.createElementBlock("view", { key: 2, class: "u-flex u-cell_right" }, [ vue.renderSlot(_ctx.$slots, "right-icon", {}, void 0, true) ])) : vue.createCommentVNode("v-if", true), _ctx.arrow ? (vue.openBlock(), vue.createElementBlock("view", { key: 3, class: "u-icon-wrap u-cell__right-icon-wrap" }, [ vue.createVNode(_component_u_icon, { name: "arrow-right", style: vue.normalizeStyle([$setup.arrowStyle]) }, null, 8, ["style"]) ])) : vue.createCommentVNode("v-if", true) ], 14, ["hover-class"]); } const __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b], ["__scopeId", "data-v-78f27ce9"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-cell-item/u-cell-item.vue"]]); const CellGroupProps = { ...baseProps, /** 分组标题 */ title: { type: String, default: "" }, /** 是否显示分组list上下边框 */ border: { type: Boolean, default: true }, /** 分组标题的样式,对象形式,注意驼峰属性写法 */ titleStyle: { type: Object, default: () => ({}) } }; const __default__$5 = { name: "u-cell-group", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({ ...__default__$5, props: CellGroupProps, setup(__props, { expose: __expose }) { __expose(); const __returned__ = { get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock( "view", { class: vue.normalizeClass(["u-cell-box", _ctx.customClass]), style: vue.normalizeStyle($setup.$u.toStyle(_ctx.customStyle)) }, [ _ctx.title ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: "u-cell-title", style: vue.normalizeStyle([_ctx.titleStyle]) }, vue.toDisplayString(_ctx.title), 5 /* TEXT, STYLE */ )) : vue.createCommentVNode("v-if", true), vue.createElementVNode( "view", { class: vue.normalizeClass(["u-cell-item-box", { "u-border-bottom u-border-top": _ctx.border }]) }, [ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 2 /* CLASS */ ) ], 6 /* CLASS, STYLE */ ); } const __easycom_2$1 = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a], ["__scopeId", "data-v-07db21ed"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-cell-group/u-cell-group.vue"]]); const ButtonProps = { ...baseProps, /** 按钮文本 */ text: { type: String, default: "" }, /** 是否细边框 */ hairLine: { type: Boolean, default: true }, /** 按钮的预置样式,default,primary,error,warning,success */ type: { type: String, default: "default" }, /** 按钮尺寸,default,medium,mini */ size: { type: String, default: "default" }, /** 按钮形状,circle(两边为半圆),square(带圆角) */ shape: { type: String, default: "square" }, /** 按钮是否镂空 */ plain: { type: Boolean, default: false }, /** 是否禁止状态 */ disabled: { type: Boolean, default: false }, /** 是否加载中 */ loading: { type: Boolean, default: false }, /** 支付宝小程序,当 open-type 为 getAuthorize 时有效 */ scope: { type: String, default: "" }, /** 开放能力,具体请看uniapp稳定关于button组件部分说明 */ openType: { type: String, default: "" }, /** 用于
组件,点击分别会触发 组件的 submit/reset 事件 */ formType: { type: String, default: "" }, /** 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 */ appParameter: { type: String, default: "" }, /** 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 */ hoverStopPropagation: { type: Boolean, default: false }, /** 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效 */ lang: { type: String, default: "en" }, /** 会话来源,open-type="contact"时有效。只微信小程序有效 */ sessionFrom: { type: String, default: "" }, /** 会话内消息卡片标题,open-type="contact"时有效 */ sendMessageTitle: { type: String, default: "" }, /** 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 */ sendMessagePath: { type: String, default: "" }, /** 会话内消息卡片图片,open-type="contact"时有效 */ sendMessageImg: { type: String, default: "" }, /** 是否显示会话内消息卡片,open-type="contact"时有效 */ showMessageCard: { type: Boolean, default: false }, /** 手指按(触摸)按钮时按钮时的背景颜色 */ hoverBgColor: { type: String, default: "" }, /** 水波纹的背景颜色 */ rippleBgColor: { type: String, default: "" }, /** 是否开启水波纹效果 */ ripple: { type: Boolean, default: false }, /** 按下的类名 */ hoverClass: { type: String, default: "" }, /** 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 */ dataName: { type: String, default: "" }, /** 节流,一定时间内只能触发一次 */ throttleTime: { type: [String, Number], default: 0 }, /** 按住后多久出现点击态,单位毫秒 */ hoverStartTime: { type: [String, Number], default: 20 }, /** 手指松开后点击态保留时间,单位毫秒 */ hoverStayTime: { type: [String, Number], default: 150 } }; const __default__$4 = { name: "u-button", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({ ...__default__$4, props: ButtonProps, emits: [ "click", "getuserinfo", "contact", "getphonenumber", "error", "launchapp", "opensetting", "chooseavatar", "agreeprivacyauthorization" ], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const emit = __emit; const props = __props; const rippleTop = vue.ref(0); const rippleLeft = vue.ref(0); const fields = vue.ref({}); const waveActive = vue.ref(false); const getHoverClass = vue.computed(() => { if (props.loading || props.disabled || props.ripple) return ""; if (props.hoverClass) return props.hoverClass; let hoverClass = ""; hoverClass = props.plain ? "u-" + props.type + "-plain-hover" : "u-" + props.type + "-hover"; return hoverClass; }); const showHairLineBorder = vue.computed(() => { if (["primary", "success", "error", "warning"].indexOf(props.type) >= 0 && !props.plain) { return ""; } else { return "u-hairline-border"; } }); function click(e2) { if (Number(props.throttleTime)) { $u.throttle(() => { clickAction(e2); }, Number(props.throttleTime)); } else { clickAction(e2); } } function clickAction(e2) { if (props.loading === true || props.disabled === true) return; if (props.ripple) { waveActive.value = false; vue.nextTick(() => { getWaveQuery(e2); }); } emit("click", e2); } function getWaveQuery(e2) { getElQuery().then((res) => { let data = res[0]; if (!data.width || !data.width) return; data.targetWidth = data.height > data.width ? data.height : data.width; if (!data.targetWidth) return; fields.value = data; let touchesX = "", touchesY = ""; touchesX = e2.touches[0].clientX; touchesY = e2.touches[0].clientY; rippleTop.value = Number(touchesY) - data.top - data.targetWidth / 2; rippleLeft.value = Number(touchesX) - data.left - data.targetWidth / 2; vue.nextTick(() => { waveActive.value = true; }); }); } function getElQuery() { return new Promise((resolve) => { let queryInfo = ""; queryInfo = uni.createSelectorQuery().in(null); queryInfo.select(".u-btn").boundingClientRect(); queryInfo.exec((data) => { resolve(data); }); }); } function getphonenumber(event) { emit("getphonenumber", event); } function getuserinfo(event) { emit("getuserinfo", event); } function error(event) { emit("error", event); } function opensetting(event) { emit("opensetting", event); } function launchapp(event) { emit("launchapp", event); } function getAuthorize(event) { if (props.scope === "phoneNumber") { getphonenumber(event); } else if (props.scope === "userInfo") { getuserinfo(event); } } function contact(event) { emit("contact", event); } function chooseavatar(event) { emit("chooseavatar", event); } function agreeprivacyauthorization(event) { emit("agreeprivacyauthorization", event); } const __returned__ = { emit, props, rippleTop, rippleLeft, fields, waveActive, getHoverClass, showHairLineBorder, click, clickAction, getWaveQuery, getElQuery, getphonenumber, getuserinfo, error, opensetting, launchapp, getAuthorize, contact, chooseavatar, agreeprivacyauthorization, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("button", { id: "u-wave-btn", class: vue.normalizeClass(["u-btn u-line-1 u-fix-ios-appearance", [ "u-size-" + _ctx.size, _ctx.plain ? "u-btn--" + _ctx.type + "--plain" : "", _ctx.loading ? "u-loading" : "", _ctx.shape === "circle" ? "u-round-circle" : "", _ctx.hairLine ? $setup.showHairLineBorder : "u-btn--bold-border", "u-btn--" + _ctx.type, _ctx.disabled ? `u-btn--${_ctx.type}--disabled` : "", _ctx.customClass ]]), "hover-start-time": Number(_ctx.hoverStartTime), "hover-stay-time": Number(_ctx.hoverStayTime), disabled: _ctx.disabled, "form-type": _ctx.formType, "open-type": _ctx.disabled || _ctx.loading ? void 0 : _ctx.openType, "app-parameter": _ctx.appParameter, "hover-stop-propagation": _ctx.hoverStopPropagation, "send-message-title": _ctx.sendMessageTitle, "send-message-path": _ctx.sendMessagePath, lang: _ctx.lang, "data-name": _ctx.dataName, "session-from": _ctx.sessionFrom, "send-message-img": _ctx.sendMessageImg, "show-message-card": _ctx.showMessageCard, "on:getAuthorize": $setup.getAuthorize, onGetuserinfo: $setup.getuserinfo, onContact: $setup.contact, onGetphonenumber: $setup.getphonenumber, onError: $setup.error, onLaunchapp: $setup.launchapp, onOpensetting: $setup.opensetting, onChooseavatar: $setup.chooseavatar, onAgreeprivacyauthorization: $setup.agreeprivacyauthorization, style: vue.normalizeStyle( $setup.$u.toStyle( { overflow: _ctx.ripple ? "hidden" : "visible" }, _ctx.customStyle ) ), onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $setup.click($event), ["stop"])), "hover-class": $setup.getHoverClass, loading: _ctx.loading }, [ vue.renderSlot(_ctx.$slots, "default", {}, () => [ vue.createTextVNode( vue.toDisplayString($setup.props.text), 1 /* TEXT */ ) ], true), _ctx.ripple ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: vue.normalizeClass(["u-wave-ripple", [$setup.waveActive ? "u-wave-active" : ""]]), style: vue.normalizeStyle({ top: $setup.rippleTop + "px", left: $setup.rippleLeft + "px", width: $setup.fields.targetWidth + "px", height: $setup.fields.targetWidth + "px", "background-color": _ctx.rippleBgColor || "rgba(0, 0, 0, 0.15)" }) }, null, 6 /* CLASS, STYLE */ )) : vue.createCommentVNode("v-if", true) ], 46, ["hover-start-time", "hover-stay-time", "disabled", "form-type", "open-type", "app-parameter", "hover-stop-propagation", "send-message-title", "send-message-path", "lang", "data-name", "session-from", "send-message-img", "show-message-card", "hover-class", "loading"]); } const __easycom_3 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__scopeId", "data-v-a44cf897"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-button/u-button.vue"]]); const _sfc_main$9 = { __name: "index", setup(__props, { expose: __expose }) { __expose(); const src = vue.ref("https://ik.imagekit.io/anyup/uview-pro/logo/default.png"); const __returned__ = { src, ref: vue.ref }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_image = resolveEasycom(vue.resolveDynamicComponent("u-image"), __easycom_0$1); const _component_u_cell_item = resolveEasycom(vue.resolveDynamicComponent("u-cell-item"), __easycom_1$2); const _component_u_cell_group = resolveEasycom(vue.resolveDynamicComponent("u-cell-group"), __easycom_2$1); const _component_u_button = resolveEasycom(vue.resolveDynamicComponent("u-button"), __easycom_3); return vue.openBlock(), vue.createElementBlock("view", { class: "u-wrap u-padding-bottom-70" }, [ vue.createElementVNode("view", { class: "photo u-flex u-row-center u-padding-40" }, [ vue.createVNode(_component_u_image, { width: "300rpx", height: "300rpx", shape: "circle", "bg-color": "var(--u-bg-color)", src: $setup.src }, null, 8, ["src"]) ]), vue.createVNode(_component_u_cell_group, null, { default: vue.withCtx(() => [ vue.createVNode(_component_u_cell_item, { title: "姓名", value: "张三", arrow: false }), vue.createVNode(_component_u_cell_item, { title: "联系方式", value: "13395515136", arrow: false }), vue.createVNode(_component_u_cell_item, { title: "所属单位", value: "xxxxxxxxxxxxxx单位", arrow: false }) ]), _: 1 /* STABLE */ }), vue.createElementVNode("view", { class: "fab" }, [ vue.createVNode(_component_u_button, { type: "primary" }, { default: vue.withCtx(() => [ vue.createTextVNode("退出") ]), _: 1 /* STABLE */ }) ]) ]); } const About = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-1606b1e3"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/about/index.vue"]]); const GridItemProps = { ...baseProps, /** 背景颜色 */ bgColor: { type: String, default: "var(--u-bg-white)" }, /** 点击时返回的index */ index: { type: [Number, String], default: "" } }; const __default__$3 = { name: "u-grid-item", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({ ...__default__$3, props: GridItemProps, emits: ["click"], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const { parentExposed } = useChildren("u-grid-item", "u-grid"); const emit = __emit; const hoverClass = vue.computed(() => { var _a2, _b2; return ((_b2 = (_a2 = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a2.props) == null ? void 0 : _b2.hoverClass) ?? ""; }); const border = vue.computed(() => { var _a2, _b2; return ((_b2 = (_a2 = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a2.props) == null ? void 0 : _b2.border) ?? true; }); const col = vue.computed(() => { var _a2, _b2; return ((_b2 = (_a2 = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a2.props) == null ? void 0 : _b2.col) ?? 3; }); const width = vue.computed(() => 100 / Number(col.value) + "%"); function click() { var _a2; emit("click", props.index); (_a2 = parentExposed == null ? void 0 : parentExposed.value) == null ? void 0 : _a2.click(props.index); } __expose({ click }); const __returned__ = { props, parentExposed, emit, hoverClass, border, col, width, click, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: vue.normalizeClass(["u-grid-item", _ctx.customClass]), "hover-class": $setup.hoverClass, "hover-stay-time": 200, onClick: $setup.click, style: vue.normalizeStyle( $setup.$u.toStyle( { background: _ctx.bgColor, width: $setup.width }, _ctx.customStyle ) ) }, [ vue.createElementVNode( "view", { class: vue.normalizeClass(["u-grid-item-box", [$setup.border ? "u-border-right u-border-bottom" : ""]]), style: vue.normalizeStyle([_ctx.customStyle]) }, [ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 6 /* CLASS, STYLE */ ) ], 14, ["hover-class"]); } const __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__scopeId", "data-v-55059f9a"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-grid-item/u-grid-item.vue"]]); const GridProps = { ...baseProps, /** 分成几列 */ col: { type: [Number, String], default: 3 }, /** 是否显示边框 */ border: { type: Boolean, default: true }, /** 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右 */ align: { type: String, default: "left" }, /** 宫格按压时的样式类,"none"为无效果 */ hoverClass: { type: String, default: "u-hover-class" } }; const __default__$2 = { name: "u-grid", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({ ...__default__$2, props: GridProps, emits: ["click"], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const emit = __emit; useParent("u-grid"); const gridStyle = vue.computed(() => { const style = {}; switch (props.align) { case "left": style.justifyContent = "flex-start"; break; case "center": style.justifyContent = "center"; break; case "right": style.justifyContent = "flex-end"; break; default: style.justifyContent = "flex-start"; } return style; }); function click(index) { emit("click", index); } __expose({ click, props }); const __returned__ = { props, emit, gridStyle, click, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock( "view", { class: vue.normalizeClass(["u-grid", { "u-border-top u-border-left": _ctx.border, customClass: _ctx.customClass }]), style: vue.normalizeStyle($setup.$u.toStyle($setup.gridStyle, _ctx.customStyle)) }, [ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 6 /* CLASS, STYLE */ ); } const __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-a828b844"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-grid/u-grid.vue"]]); const _sfc_main$6 = { __name: "index", setup(__props, { expose: __expose }) { __expose(); const __returned__ = { CardModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); const _component_u_grid_item = resolveEasycom(vue.resolveDynamicComponent("u-grid-item"), __easycom_1$1); const _component_u_grid = resolveEasycom(vue.resolveDynamicComponent("u-grid"), __easycom_2); return vue.openBlock(), vue.createElementBlock("view", { class: "u-wrap u-padding-30" }, [ vue.createVNode($setup["CardModule"], { title: "督查检查", "show-tit-line": true, margin: " 0 0 30rpx 0" }, { default: vue.withCtx(() => [ vue.createVNode(_component_u_grid, { col: 4, border: false }, { default: vue.withCtx(() => [ vue.createVNode(_component_u_grid_item, null, { default: vue.withCtx(() => [ vue.createVNode(_component_u_icon, { name: "photo", size: 46 }), vue.createElementVNode("view", { class: "grid-text" }, "图片") ]), _: 1 /* STABLE */ }), vue.createVNode(_component_u_grid_item, null, { default: vue.withCtx(() => [ vue.createVNode(_component_u_icon, { name: "lock", size: 46 }), vue.createElementVNode("view", { class: "grid-text" }, "锁头") ]), _: 1 /* STABLE */ }), vue.createVNode(_component_u_grid_item, null, { default: vue.withCtx(() => [ vue.createVNode(_component_u_icon, { name: "hourglass", size: 46 }), vue.createElementVNode("view", { class: "grid-text" }, "沙漏") ]), _: 1 /* STABLE */ }), vue.createVNode(_component_u_grid_item, null, { default: vue.withCtx(() => [ vue.createVNode(_component_u_icon, { name: "lock", size: 46 }), vue.createElementVNode("view", { class: "grid-text" }, "锁头") ]), _: 1 /* STABLE */ }), vue.createVNode(_component_u_grid_item, null, { default: vue.withCtx(() => [ vue.createVNode(_component_u_icon, { name: "hourglass", size: 46 }), vue.createElementVNode("view", { class: "grid-text" }, "沙漏") ]), _: 1 /* STABLE */ }) ]), _: 1 /* STABLE */ }) ]), _: 1 /* STABLE */ }) ]); } const FunModule = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__scopeId", "data-v-d3afc24d"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/fun/index.vue"]]); const _sfc_main$5 = { __name: "index", setup(__props, { expose: __expose }) { __expose(); const list = vue.ref([ { iconPath: "home", selectedIconPath: "home-fill", text: "首页", isDot: false, customIcon: false }, { iconPath: "grid", selectedIconPath: "grid-fill", text: "功能", midButton: true, customIcon: false }, { iconPath: "account", selectedIconPath: "account-fill", text: "我的", isDot: false, customIcon: false } ]); const current = vue.ref(2); vue.watch(current, (val) => { switch (val) { case 0: uni.setNavigationBarTitle({ title: "首页" }); break; case 1: uni.setNavigationBarTitle({ title: "功能" }); break; case 2: uni.setNavigationBarTitle({ title: "我的" }); break; } }); const __returned__ = { list, current, ref: vue.ref, watch: vue.watch, Board, About, FunModule }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_transition = resolveEasycom(vue.resolveDynamicComponent("u-transition"), __easycom_0$7); const _component_u_tabbar = resolveEasycom(vue.resolveDynamicComponent("u-tabbar"), __easycom_1$4); return vue.openBlock(), vue.createElementBlock("view", { class: "custom-wrap" }, [ vue.createVNode(_component_u_transition, { show: $setup.current === 0, name: "slide-right" }, { default: vue.withCtx(() => [ $setup.current === 0 ? (vue.openBlock(), vue.createBlock($setup["Board"], { key: 0 })) : vue.createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }, 8, ["show"]), vue.createVNode(_component_u_transition, { show: $setup.current === 1, name: "slide-right" }, { default: vue.withCtx(() => [ $setup.current === 1 ? (vue.openBlock(), vue.createBlock($setup["FunModule"], { key: 0 })) : vue.createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }, 8, ["show"]), vue.createVNode(_component_u_transition, { show: $setup.current === 2, name: "slide-right" }, { default: vue.withCtx(() => [ $setup.current === 2 ? (vue.openBlock(), vue.createBlock($setup["About"], { key: 0 })) : vue.createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }, 8, ["show"]), vue.createVNode(_component_u_tabbar, { hideTabBar: false, modelValue: $setup.current, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.current = $event), "active-color": "var(--u-type-primary)", "mid-button-size": "60", list: $setup.list, "mid-button": false }, null, 8, ["modelValue", "list"]) ]); } const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/index/index.vue"]]); const { t } = useLocale(); const SearchProps = { ...baseProps, /** 搜索框形状,round-圆形,square-方形 */ shape: { type: String, default: "round" }, /** 搜索框背景色,默认值var(--u-bg-gray-light) */ bgColor: { type: String, default: "var(--u-bg-gray-light)" }, /** 占位提示文字 */ placeholder: { type: String, default: () => t("uSearch.placeholder") }, /** 是否启用清除控件 */ clearabled: { type: Boolean, default: true }, /** 是否自动聚焦 */ focus: { type: Boolean, default: false }, /** 是否在搜索框右侧显示取消按钮 */ showAction: { type: Boolean, default: true }, /** 右边控件的样式 */ actionStyle: { type: Object, default: () => ({}) }, /** 取消按钮文字 */ actionText: { type: String, default: () => t("uSearch.actionText") }, /** 输入框内容对齐方式,可选值为 left|center|right */ inputAlign: { type: String, default: "left" }, /** 是否启用输入框 */ disabled: { type: Boolean, default: false }, /** 开启showAction时,是否在input获取焦点时才显示 */ animation: { type: Boolean, default: false }, /** 边框颜色,只要配置了颜色,才会有边框 */ borderColor: { type: String, default: "none" }, /** 输入框的初始化内容 */ modelValue: { type: String, default: "" }, /** 搜索框高度,单位rpx */ height: { type: [Number, String], default: 64 }, /** input输入框的样式,可以定义文字颜色,大小等,对象形式 */ inputStyle: { type: Object, default: () => ({}) }, /** 输入框最大能输入的长度,-1为不限制长度(来自uniapp文档) */ maxlength: { type: [Number, String], default: "-1" }, /** 搜索图标的颜色,默认同输入框字体颜色 */ searchIconColor: { type: String, default: "" }, /** 输入框字体颜色 */ color: { type: String, default: "var(--u-content-color)" }, /** placeholder的颜色 */ placeholderColor: { type: String, default: "var(--u-tips-color)" }, /** 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30rpx"、"30rpx 20rpx"等写法 */ margin: { type: String, default: "0" }, /** 左边输入框的图标,可以为uView图标名称或图片路径 */ searchIcon: { type: String, default: "search" }, /** 弹出键盘时是否自动调节高度,uni-app默认值是true */ adjustPosition: { type: Boolean, default: true } }; const __default__$1 = { name: "u-search", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({ ...__default__$1, props: SearchProps, emits: [ "update:modelValue", "input", "change", "search", "custom", "clear", "focus", "blur", "click" ], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const props = __props; const emit = __emit; const keyword = vue.ref(props.modelValue); const showClear = vue.ref(false); const show = vue.ref(false); const focused = vue.ref(props.focus); vue.watch( () => props.modelValue, (nVal) => { keyword.value = nVal; } ); vue.watch(keyword, (nVal) => { emit("update:modelValue", nVal); emit("input", nVal); emit("change", nVal); }); const showActionBtn = vue.computed(() => { if (!props.animation && props.showAction) return true; else return false; }); const borderStyle = vue.computed(() => { if (props.borderColor) return `1px solid ${props.borderColor}`; else return "none"; }); function inputChange(e2) { keyword.value = e2.detail.value; } function clear() { keyword.value = ""; vue.nextTick(() => { emit("clear"); }); } function search(e2) { emit("search", e2.detail.value); } function custom() { emit("custom", keyword.value); } function getFocus() { focused.value = true; if (props.animation && props.showAction) show.value = true; emit("focus", keyword.value); } function blur() { setTimeout(() => { focused.value = false; }, 100); show.value = false; emit("blur", keyword.value); } function clickHandler() { if (props.disabled) emit("click"); } const __returned__ = { props, emit, keyword, showClear, show, focused, showActionBtn, borderStyle, inputChange, clear, search, custom, getFocus, blur, clickHandler, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_icon = resolveEasycom(vue.resolveDynamicComponent("u-icon"), __easycom_0$6); return vue.openBlock(), vue.createElementBlock( "view", { class: vue.normalizeClass(["u-search", _ctx.customClass]), onClick: $setup.clickHandler, style: vue.normalizeStyle($setup.$u.toStyle({ margin: _ctx.margin }, _ctx.customStyle)) }, [ vue.createElementVNode( "view", { class: "u-content", style: vue.normalizeStyle({ backgroundColor: _ctx.bgColor, borderRadius: _ctx.shape == "round" ? "100rpx" : "10rpx", border: $setup.borderStyle, height: _ctx.height + "rpx" }) }, [ vue.createElementVNode("view", { class: "u-icon-wrap" }, [ vue.createVNode(_component_u_icon, { class: "u-clear-icon", size: 30, name: _ctx.searchIcon, color: _ctx.searchIconColor ? _ctx.searchIconColor : _ctx.color }, null, 8, ["name", "color"]) ]), vue.createElementVNode("input", { "confirm-type": "search", onBlur: $setup.blur, value: _ctx.modelValue, onConfirm: $setup.search, onInput: $setup.inputChange, onFocus: $setup.getFocus, focus: _ctx.focus, maxlength: Number(_ctx.maxlength), "placeholder-class": "u-placeholder-class", placeholder: _ctx.placeholder, "placeholder-style": `color: ${_ctx.placeholderColor}`, "adjust-position": _ctx.adjustPosition, class: "u-input", type: "text", style: vue.normalizeStyle([ { textAlign: _ctx.inputAlign, color: _ctx.color, backgroundColor: _ctx.bgColor, pointerEvents: _ctx.disabled ? "none" : "auto" }, _ctx.inputStyle ]) }, null, 44, ["value", "focus", "maxlength", "placeholder", "placeholder-style", "adjust-position"]), $setup.keyword && _ctx.clearabled && $setup.focused ? (vue.openBlock(), vue.createElementBlock("view", { key: 0, class: "u-close-wrap", onClick: $setup.clear }, [ vue.createVNode(_component_u_icon, { class: "u-clear-icon", name: "close-circle-fill", size: "34", color: "var(--u-light-color)" }) ])) : vue.createCommentVNode("v-if", true) ], 4 /* STYLE */ ), vue.createElementVNode( "view", { style: vue.normalizeStyle([_ctx.actionStyle]), class: vue.normalizeClass(["u-action", [$setup.showActionBtn || $setup.show ? "u-action-active" : ""]]), onClick: vue.withModifiers($setup.custom, ["stop", "prevent"]) }, vue.toDisplayString(_ctx.actionText), 7 /* TEXT, CLASS, STYLE */ ) ], 6 /* CLASS, STYLE */ ); } const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-f0201178"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-search/u-search.vue"]]); const StickyProps = { ...baseProps, /** 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px */ offsetTop: { type: [Number, String], default: 0 }, /** 列表中的索引值 */ index: { type: [Number, String], default: "" }, /** 是否开启吸顶功能 */ enable: { type: Boolean, default: true }, /** h5顶部导航栏的高度 */ h5NavHeight: { type: [Number, String], default: 44 }, /** 吸顶区域的背景颜色 */ bgColor: { type: String, default: "var(--u-bg-white)" }, /** z-index值 */ zIndex: { type: [Number, String], default: zIndex.sticky } }; const __default__ = { name: "u-sticky", options: { addGlobalClass: true, virtualHost: true, styleIsolation: "shared" } }; const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: StickyProps, emits: ["fixed", "unfixed"], setup(__props, { expose: __expose, emit: __emit }) { __expose(); const props = __props; const emit = __emit; const instance = vue.getCurrentInstance(); const fixed = vue.ref(false); const height = vue.ref("auto"); const stickyTop = vue.ref(0); const elClass = vue.ref(""); const left = vue.ref(0); const width = vue.ref("auto"); let contentObserver = null; elClass.value = $u.guid(); const uZIndex = vue.computed(() => { var _a2; return props.zIndex ? props.zIndex : ((_a2 = $u == null ? void 0 : $u.zIndex) == null ? void 0 : _a2.sticky) ?? 970; }); vue.watch( () => props.offsetTop, () => { initObserver(); } ); vue.watch( () => props.enable, (val) => { if (val == false) { fixed.value = false; disconnectObserver("contentObserver"); } else { initObserver(); } } ); vue.onMounted(() => { initObserver(); }); vue.onBeforeUnmount(() => { disconnectObserver("contentObserver"); }); function initObserver() { if (!props.enable) return; stickyTop.value = Number(props.offsetTop) !== 0 ? uni.upx2px(Number(props.offsetTop)) : 0; disconnectObserver("contentObserver"); $u.getRect("." + elClass.value, instance).then((res) => { height.value = res.height; left.value = res.left; width.value = res.width; vue.nextTick(() => { observeContent(); }); }); } function observeContent() { disconnectObserver("contentObserver"); contentObserver = uni.createIntersectionObserver(instance == null ? void 0 : instance.proxy, { thresholds: [0.95, 0.98, 1] }); contentObserver.relativeToViewport({ top: -stickyTop.value }); contentObserver.observe("." + elClass.value, (res) => { if (!props.enable) return; setFixed(res.boundingClientRect.top); }); } function setFixed(top) { const isFixed = top < stickyTop.value; if (isFixed) emit("fixed", props.index); else if (fixed.value) emit("unfixed", props.index); fixed.value = isFixed; } function disconnectObserver(observerName) { if (observerName === "contentObserver" && contentObserver) { contentObserver.disconnect(); contentObserver = null; } } const __returned__ = { props, emit, instance, fixed, height, stickyTop, elClass, left, width, get contentObserver() { return contentObserver; }, set contentObserver(v2) { contentObserver = v2; }, uZIndex, initObserver, observeContent, setFixed, disconnectObserver, get $u() { return $u; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }); function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", null, [ vue.createElementVNode( "view", { class: vue.normalizeClass(["u-sticky-wrap", [$setup.elClass, _ctx.customClass]]), style: vue.normalizeStyle( $setup.$u.toStyle( { height: $setup.fixed ? $setup.height + "px" : "auto", backgroundColor: _ctx.bgColor }, _ctx.customStyle ) ) }, [ vue.createElementVNode( "view", { class: "u-sticky", style: vue.normalizeStyle({ position: $setup.fixed ? "fixed" : "static", top: $setup.stickyTop + "px", left: $setup.left + "px", width: $setup.width == "auto" ? "auto" : $setup.width + "px", zIndex: $setup.uZIndex }) }, [ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 4 /* STYLE */ ) ], 6 /* CLASS, STYLE */ ) ]); } const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-7f30e390"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/uni_modules/uview-pro/components/u-sticky/u-sticky.vue"]]); const _sfc_main$2 = { __name: "ListCol", props: { labelWidth: { type: Number, default: 200 }, data: { type: Object, require: true }, column: { type: Array, require: true } }, setup(__props, { expose: __expose }) { __expose(); const props = __props; const __returned__ = { props }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "col u-margin-30 u-padding-20 box-shadow" }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.props.column, (col, idx) => { return vue.openBlock(), vue.createElementBlock("view", { class: "row u-flex" }, [ vue.createElementVNode( "view", { class: "row-left", style: vue.normalizeStyle({ width: `${$setup.props.labelWidth}rpx` }) }, vue.toDisplayString(col.name), 5 /* TEXT, STYLE */ ), vue.createElementVNode( "view", { class: "row-right", style: vue.normalizeStyle({ width: `calc(100% - ${$setup.props.labelWidth}rpx)` }) }, vue.toDisplayString($setup.props.data[col.value]), 5 /* TEXT, STYLE */ ) ]); }), 256 /* UNKEYED_FRAGMENT */ )) ]); } const ListCol = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-444f8533"], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/components/ListCol.vue"]]); const _sfc_main$1 = { __name: "project", setup(__props, { expose: __expose }) { __expose(); const keyword = vue.ref(""); const column = vue.ref([{ name: "单位名称", value: "unitName", type: "string" }, { name: "在建项目数", value: "inProject", type: "string" }, { name: "停工项目数", value: "stopProject", type: "string" }]); const list = vue.ref([{ unitName: "天辰", inProject: 20, stopProject: 5 }, { unitName: "赛鼎", inProject: 20, stopProject: 5 }]); const __returned__ = { keyword, column, list, ref: vue.ref, ListCol }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_u_search = resolveEasycom(vue.resolveDynamicComponent("u-search"), __easycom_0); const _component_u_sticky = resolveEasycom(vue.resolveDynamicComponent("u-sticky"), __easycom_1); return vue.openBlock(), vue.createElementBlock("view", { class: "u-wrap" }, [ vue.createVNode(_component_u_sticky, null, { default: vue.withCtx(() => [ vue.createElementVNode("view", { class: "sticky" }, [ vue.createVNode(_component_u_search, { modelValue: $setup.keyword, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.keyword = $event), placeholder: "请输入单位名称", "show-action": false }, null, 8, ["modelValue"]) ]) ]), _: 1 /* STABLE */ }), (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.list, (item, idx) => { return vue.openBlock(), vue.createBlock($setup["ListCol"], { data: item, column: $setup.column, "label-width": "160" }, null, 8, ["data", "column"]); }), 256 /* UNKEYED_FRAGMENT */ )) ]); } const PagesPenetrateProject = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/pages/penetrate/project.vue"]]); __definePage("pages/index/index", PagesIndexIndex); __definePage("pages/penetrate/project", PagesPenetrateProject); const _sfc_main = { onLaunch: function() { formatAppLog("log", "at App.vue:4", "App Launch"); }, onShow: function() { formatAppLog("log", "at App.vue:7", "App Show"); }, onHide: function() { formatAppLog("log", "at App.vue:10", "App Hide"); } }; const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/COMPANYPROJECT/APP/CNCEC_APP/App.vue"]]); function createApp() { const app = vue.createVueApp(App); app.use(uViewPro); return { app }; } const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp(); uni.Vuex = __Vuex__; uni.Pinia = __Pinia__; __app__.provide("__globalStyles", __uniConfig.styles); __app__._component.mpType = "app"; __app__._component.render = () => { }; __app__.mount("#app"); })(Vue);