UNPKG

egova-admin-web

Version:

新版统一用户中心前端项目

1,501 lines 1.9 MB
var ud = Object.defineProperty; var dd = (e, t, n) => t in e ? ud(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var ua = (e, t, n) => (dd(e, typeof t != "symbol" ? t + "" : t, n), n); import cd from "axios"; import { Modal as ya, message as Tt, Image as pd, Form as za, Tooltip as fl, Select as mr, RangePicker as fd, DatePicker as vd, Input as $l, Textarea as md, Table as Vi } from "ant-design-vue"; import { random as Gl, cloneDeep as Hn, isObjectLike as hd, isNil as Ge, merge as Qn, isUndefined as Ns, isPlainObject as hr, isEqual as ll, xor as yd, set as Ml, forOwn as Wi, isObject as Zi, has as gd, debounce as yr, isEmpty as _d, throttle as bd, isNumber as wd, differenceBy as kd, intersection as Id, intersectionBy as Td, isNull as Cd, uniqBy as xd, assign as gr, isFunction as Yi } from "lodash-es"; import { toRaw as Kl, ref as d, computed as le, nextTick as Pa, defineComponent as oe, watch as me, openBlock as u, createElementBlock as M, createElementVNode as c, Fragment as be, renderList as tt, createBlock as E, normalizeStyle as ea, withCtx as a, normalizeClass as Xe, createTextVNode as S, toDisplayString as Q, createCommentVNode as Z, renderSlot as Yt, unref as C, isRef as st, useSlots as Pd, createSlots as Ln, mergeProps as $t, createVNode as s, defineAsyncComponent as ss, watchEffect as ms, resolveComponent as Rn, resolveDynamicComponent as _r, reactive as ca, onMounted as Rt, pushScopeId as Kt, popScopeId as jt, onActivated as Zo, withModifiers as yt, useAttrs as Sd, normalizeProps as Sa, guardReactiveProps as Ma, onBeforeUnmount as Ud, withDirectives as Ta, vShow as wo, toRefs as ko, resolveDirective as hs, inject as br, onUnmounted as no, TransitionGroup as wr, provide as kr, h as Xi, onDeactivated as Rd } from "vue"; import { sm4 as jl, sm2 as Ir } from "sm-crypto"; import rs from "crypto-js"; import { defineStore as ai } from "pinia"; import Hl from "qs"; import { Button as Je, InputSearch as uo, Tooltip as fn, Input as Tn, FormItem as Nn, Textarea as co, Form as mn, Col as Io, Row as To, DescriptionsItem as oi, Descriptions as si, Popover as Ld, ListItem as Ad, List as zd, Select as vn, Space as kt, Drawer as Qt, TabPane as Ha, Tabs as Fa, Divider as Do, Modal as bt, Tag as Ra, message as wt, Table as hn, Image as Tr, MenuItem as _a, Menu as ba, Dropdown as po, Cascader as Nd, Upload as Cr, UploadDragger as Hs, Spin as pa, Tree as Bo, Empty as li, Checkbox as jn, Popconfirm as ta, SelectOption as Fs, DatePicker as Os, CheckboxGroup as Yo, RadioGroup as na, Radio as fo, Pagination as vo, Avatar as xr, RadioButton as Xo, AutoComplete as Pr, Switch as ys, CollapsePanel as Ed, Collapse as Dd, RangePicker as kl, Progress as Bd, Badge as gs, TreeSelect as Il, InputPassword as Md } from "ant-design-vue/es"; import { useRouter as Co, useRoute as Sr } from "vue-router"; import { useIntervalFn as ii, useVModel as St, useClipboard as Tl, useDebounceFn as Xa, onClickOutside as ri, useEventBus as Ca, useVirtualList as Ur } from "@vueuse/core"; import Ls from "validator"; import { EllipsisOutlined as Hd, PlusOutlined as Fd, DownOutlined as Od } from "@ant-design/icons-vue"; import en from "dayjs"; import Ji from "qrcode"; /*! egova-admin-web v2.4.12-r210.4 */ var ql; ((e) => { function t(l) { let r = 0; if (document.selection) { l.focus(); const i = document.selection.createRange(); i.moveStart("character", -l.value.length), r = i.text.length; } else (l.selectionStart || l.selectionStart == "0") && (r = l.selectionEnd); return r; } e.getCursorPos = t; function n(l, r) { if (l.setSelectionRange) l.setSelectionRange(r, r); else if (l.createTextRange) { const i = l.createTextRange(); i.collapse(!0), i.moveEnd("character", r), i.moveStart("character", r), i.select(); } } e.setCursorPos = n; function o(l, r, i) { let f = t(l); const p = l.value; l.value = p.replace(r, i); const b = l.getAttribute && l.getAttribute("maxlength") ? parseInt(l.getAttribute("maxlength")) : 0; if (b && l.value.length > b) { const h = l.value.substring(0, f - 1), _ = l.value.substring(f, b + 1); l.value = h + _; } f = f - (p.length - l.value.length), n(l, f); } e.replaceAndSetPos = o; })(ql || (ql = {})); const Vl = (e, t) => { const n = new Event(t, { bubbles: !0 }); e.dispatchEvent(n); }, $d = { mounted(e) { e.$handler = function(t, n) { const o = n || /[^a-zA-Z0-9\u4e00-\u9fa5]/; let l = t; if (t.tagName === "INPUT") l = t; else if (t.children.length > 0) { for (let r = 0; r < t.children.length; r++) if (t.children[r].tagName === "INPUT") { l = t.children[r]; break; } } ql.replaceAndSetPos(l, o, ""), Vl(l, "input"); }, e.$handler(e); }, updated(e, t) { e.$handler && e.$handler(e, t.value); } }, Gd = { mounted(e) { e.$handler = (t) => { if (t.tagName === "INPUT") { if (t.value === void 0 || t.value === null) return; t.value = t.value.toUpperCase(), Vl(t, "input"); } else if (t.children.length > 0) { for (let n = 0; n < t.children.length; n++) if (t.children[n].tagName === "INPUT") { if (t.children[n].value === void 0 || t.children[n].value === null) return; t.children[n].value = t.children[n].value.toUpperCase(), Vl(t.children[n], "input"); break; } } }, e.$handler(e); }, updated(e) { e.$handler && e.$handler(e); } }, Kd = { mounted(e) { const t = (o) => { const l = o.target, r = l.value, i = r.replace(/\s/g, ""); i !== r && (l.value = i, l.dispatchEvent(new Event("input"))); }, n = (o) => { var r; o.preventDefault(); const l = ((r = o.clipboardData) == null ? void 0 : r.getData("text/plain").replace(/\s/g, "")) || ""; document.execCommand("insertText", !1, l); }; e._noSpaceHandler = t, e.addEventListener("input", t), e.addEventListener("paste", n); }, unmounted(e) { e._noSpaceHandler && e.removeEventListener("input", e._noSpaceHandler); } }, Qi = { emoji: $d, upper: Gd, noSpace: Kd }, jd = { install: (e) => { Object.keys(Qi).forEach((t) => { e.directive(t, Qi[t]); }); } }; /*! js-cookie v3.0.5 | MIT */ function il(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var o in n) e[o] = n[o]; } return e; } var qd = { read: function(e) { return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); }, write: function(e) { return encodeURIComponent(e).replace( /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent ); } }; function Wl(e, t) { function n(l, r, i) { if (!(typeof document > "u")) { i = il({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires && (i.expires = i.expires.toUTCString()), l = encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); var f = ""; for (var p in i) i[p] && (f += "; " + p, i[p] !== !0 && (f += "=" + i[p].split(";")[0])); return document.cookie = l + "=" + e.write(r, l) + f; } } function o(l) { if (!(typeof document > "u" || arguments.length && !l)) { for (var r = document.cookie ? document.cookie.split("; ") : [], i = {}, f = 0; f < r.length; f++) { var p = r[f].split("="), b = p.slice(1).join("="); try { var h = decodeURIComponent(p[0]); if (i[h] = e.read(b, h), l === h) break; } catch { } } return l ? i[l] : i; } } return Object.create( { set: n, get: o, remove: function(l, r) { n( l, "", il({}, r, { expires: -1 }) ); }, withAttributes: function(l) { return Wl(this.converter, il({}, this.attributes, l)); }, withConverter: function(l) { return Wl(il({}, this.converter, l), this.attributes); } }, { attributes: { value: Object.freeze(t) }, converter: { value: Object.freeze(e) } } ); } var rl = Wl(qd, { path: "/" }); const Vd = "0123456789abcdeffedcba9876543210"; class Rr { constructor(t) { ua(this, "key"); this.key = t; } /** * 加密数据 * @param inArray - 加密数据 * @param mode - 加密模式 * @returns 加密结果 */ encrypt(t, n) { return jl.encrypt(t, this.key, n); } /** * 解密数据 * @param inArray - 解密数据 * @param mode - 解密模式 * @returns 解密结果 */ decrypt(t, n) { return jl.decrypt(t, this.key, n); } /** * sm2 加密数据 (登录时对密码的加密) * @param msg * @param publicKey * @returns */ async sm2Encrypt(t, n) { try { if (n || (n = await vl.get("auth-public-key") || ""), !n) return Promise.reject(new Error("无法获取加密密钥")); const o = Ir.doEncrypt(t, n, 1); return Promise.resolve(o); } catch (o) { return Promise.reject(o); } } // 随机生成x位数,默认6位数 generateRandomString(t = 6) { return Gl(!0).toString(36).substring(2, 2 + t); } /** * 生成随机数字符串,返回16进制字符串 * @param nBytes - 字节数 * @returns */ cryptRandom(t) { const n = rs.lib.WordArray.random(t); return rs.enc.Hex.stringify(n); } } const Ea = new Rr(Vd); var qo; ((e) => { function t(p) { return p.startsWith("http") || (p = n(p, window.location.origin)), p; } e.absoluteUrl = t; function n(p, b = window.location.origin) { try { const { href: h } = new URL(p, b); return o(h); } catch { return p; } } e.formatUrl = n; function o(p) { return p.replace(/([^:]|^)\/{2,}/g, "$1/"); } e.cleanUrl = o; function l() { return n(window.location.pathname.replace(/\w*\.html$/g, ""), window.location.origin); } e.getPrefixUrl = l; function r(p, b = !1, h = "/") { let _; b ? _ = n(h, window.location.origin) : _ = l(); let x = p ?? ""; return x.startsWith("http") ? x = n(x) : b ? x = n("api", window.location.origin) : x ? x = n(x, window.location.origin) : x = `${_}`, { assetUrl: _, serverUrl: x }; } e.formatSettingUrl = r; function i(p) { const b = new RegExp("(^|&)" + p + "=([^&]*)(&|$)", "i"), _ = (window.location.search.substr(1) || window.location.hash.split("?")[1] || "").match(b); return _ != null ? unescape(_[2]) : null; } e.getQueryString = i; function f(p, b) { const h = new URL(p), _ = h.searchParams; _.delete(b); let x = h.hash; if (x.includes("?")) { const [T, I] = x.split("?"), g = new URLSearchParams(I); g.delete(b), x = T + (g.toString() ? "?" + g.toString() : ""); } return h.hash = x, h.search = _.toString(), h.toString(); } e.removeQueryString = f; })(qo || (qo = {})); const Wd = import("localforage").then(async (e) => (typeof window == "object" && await e.default.ready(), e.default)); class Zd { constructor() { /** * 存储引擎 */ ua(this, "localStorage", Wd); /** * 默认过期时间 */ ua(this, "initExpires", 1e3 * 60 * 60 * 24); ua(this, "prefixUrl", ""); this.prefixUrl = qo.getPrefixUrl(); } /** * 获取存储键 * @param key - 存储键 * @returns 存储键 */ getKey(t) { return `${this.prefixUrl || ""}${t}`; } /** * 解密 * @param value - 存储值 * @param isObject - 是否为对象 * @returns 解密值 */ decryptString(t, n) { t = Ea.decrypt(t); try { typeof t == "string" && n && (t = JSON.parse(t)); } catch { } return t; } /** * 加密 * @param value - 存储值 * @param isObject - 是否为对象 * @returns 加密值 */ encryptString(t, n) { let o = t; if (n) try { o = Ea.encrypt(JSON.stringify(t)); } catch { } else typeof t == "string" && (o = Ea.encrypt(t)); return o; } /** * 获取数据 * @param key - 存储键 * @returns * @public */ async get(t) { try { const o = await (await this.localStorage).getItem(this.getKey(t)); if (o) { const { value: l, expire: r, isCrypto: i, isObject: f } = o; if (r > 0 && Date.now() > Number(r)) console.error(`该 ${t} 的 storage 已经过期!`), await this.remove(t); else { let p = l; return i && (p = this.decryptString(p, f)), Promise.resolve(p); } } return Promise.resolve(void 0); } catch (n) { Promise.reject(n); } } /** * 保存数据 * @param key - 存储键 * @param value - 存储值 * @param option - 参数 * @returns * @public */ async set(t, n, o) { const l = await this.localStorage; let r = Hn(Kl(n)); const i = hd(r); let f = (o == null ? void 0 : o.expire) ?? 0; f > 0 && (f = Date.now() + f * this.initExpires); const p = (o == null ? void 0 : o.isCrypto) ?? !1; return p && (r = this.encryptString(r, i)), l.setItem(this.getKey(t), { value: r, expire: f, isObject: i, isCrypto: p }); } /** * 删除数据 * @param key - 存储键 * @returns * @public */ async remove(t) { try { return (await this.localStorage).removeItem(this.getKey(t)); } catch (n) { Promise.reject(n); } } /** * 清空数据 * @returns * @public */ async clear() { try { const t = await this.localStorage, n = await t.keys(); if (!n || n.length === 0) return; await Promise.all( n.map(async (o) => { o.startsWith(this.prefixUrl) && await t.removeItem(o); }) ), Promise.resolve(); return; } catch (t) { Promise.reject(t); } } } const vl = new Zd(), ga = ai("user", () => { const e = d(), t = d(!1); function n(l) { e.value = l, t.value = !0; } function o() { t.value = !1, e.value = {}; } return { humanInfo: e, updateInfo: n, clear: o, hasLoad: t }; }), Zl = ai("tabNav", () => { const e = d(), t = d(/* @__PURE__ */ new Map()), n = d(), o = le(() => { var g; return ((g = e.value) == null ? void 0 : g.get(n.value)) || []; }), l = le(() => { var g; return ((g = t.value) == null ? void 0 : g.get(n.value)) || ""; }), r = d(Date.now().toString()); function i(g) { n.value = g; } function f(g) { var m; t.value.set(n.value, g.fullPath); const k = (m = e.value) == null ? void 0 : m.get(n.value); if (k) k.findIndex((y) => _(y, g)) === -1 && (g.meta.timestamp = (/* @__PURE__ */ new Date()).getTime(), k.push(g)); else { const w = /* @__PURE__ */ new Map(); g.meta.timestamp = (/* @__PURE__ */ new Date()).getTime(), w.set(n.value, [g]), e.value = w; } } function p(g, k) { var w; const m = (w = e.value) == null ? void 0 : w.get(n.value); if (m) { const y = m.findIndex((v) => v.fullPath === g); if (y !== -1 && m.splice(y, 1), g === l.value) { let v = null; m.length && (v = m[m.length - 1]), v && k.push(v); } } } function b(g, k) { var w; const m = (w = e.value) == null ? void 0 : w.get(n.value); if (m) { const y = m.find((v) => v.fullPath === g); if (y) { const v = y.meta.compare, F = y.meta.save; if (v && F) if (v()) { const P = y.meta.confirmMessage ?? "当前内容未保存,是否保存当前内容?"; ya.confirm({ title: "提示", content: P, okText: "保存", cancelText: "不保存", onOk: async () => { await F() && p(g, k); }, onCancel: () => { p(g, k); }, closable: !0 }); return; } else { p(g, k); return; } } } p(g, k); } function h(g, k, m, w, y) { var F; const v = (F = e.value) == null ? void 0 : F.get(n.value); if (v) { const D = v.find((P) => P.fullPath === g); D && (D.meta.compare = w, D.meta.save = m, D.meta.confirmMessage = y); } } function _(g, k) { return g.fullPath === k.fullPath; } function x() { r.value = Date.now().toString(); } function T(g, k) { var w; const m = (w = e.value) == null ? void 0 : w.get(n.value); if (m) { const y = m.find((v) => v.fullPath === g); y && (y.meta.title = k); } } function I() { var g; (g = e.value) == null || g.clear(), t.value.clear(); } return { activeTabs: o, // 当前的tabs页签 activeTabKey: l, // 当前激活的tab key currentTopMenuName: n, // 当前的顶部菜单名称 viewId: r, updateTopMenuName: i, // method:更新顶部菜单 addTabRoute: f, // method:将打开的路由加入tabs中 removeTabRoute: b, clear: I, reload: x, updateTitle: T, useSave: h }; }); function Lr(e, t) { if (!(!t || !t.length)) return t.forEach((n) => { const o = n.key; Ge(o) || e.set(o, n), Lr(e, n.children); }); } function _s(e, t) { const n = []; for (const o of t) { const l = e.get(o); l != null && l.children && l.children.length > 0 && (n.push(...l.children), n.push(..._s(e, ha(l.children)))); } return n; } function Ua(e, t) { const n = []; for (const o of t) { const l = e.get(o), r = e.get(l == null ? void 0 : l.parentKey); r && (n.push(r), n.push(...Ua(e, [r.key]))); } return n; } function ha(e) { const t = /* @__PURE__ */ new Set(); for (const n of e) !Ge(n.key) && !t.has(n.key) && t.add(n.key); return Array.from(t); } function Zt(e) { const { treeNodes: t, allNodes: n, parentKey: o, handleNodeData: l, emptyChildrenSetUndefined: r = !0 } = e; if (!t || !t.length) return []; const i = r ? void 0 : []; return t.map((f) => { var k; const { key: p, id: b, title: h, text: _ } = f, x = p ?? b, T = Qn( { parentKey: o, key: x, title: h ?? _ }, l == null ? void 0 : l(f) ), { children: I } = f; Ns((k = f == null ? void 0 : f.data) == null ? void 0 : k.subAble) || (T.isLeaf = !f.data.subAble); const g = { ...f, ...T, children: I != null && I.length ? Zt({ treeNodes: I, allNodes: n, parentKey: x, handleNodeData: l }) : i }; return n == null || n.set(x, g), g; }); } function Es(e) { const { allNodes: t, expandedKeys: n, selectedKeys: o } = e; if (o.value.length > 0) { const l = Ua(t, o.value), r = new Set(n.value); for (const i of l) !Ge(i.key) && !r.has(i.key) && r.add(i.key); n.value = Array.from(r); } } function Yd(e, t = "id", n = "parentId") { const o = []; for (let l = 0; l < e.length; l++) { const r = e[l], i = e.findIndex((f) => f[t] === r[n]); i === -1 ? o.push(r) : (e[i].children || (e[i].children = []), e[i].children.push(r)); } return o; } function No(e) { const { treeDomId: t } = e || {}; Pa(() => { let n; Ge(t) ? n = document.querySelector(".ant-tree-treenode-selected") : n = document.querySelector(`#${t} .ant-tree-treenode-selected`), n == null || n.scrollIntoView({ behavior: "smooth" }); }); } const Ds = ai("permission", () => { const e = d(), t = d(), n = d(!1), o = d(!1), l = d(!1), r = d(), i = d(!1); function f(x) { e.value = x, n.value = !0; } function p(x) { t.value = x, o.value = !0; } function b(x) { r.value = x, l.value = !0; } function h() { if (!n.value) return []; const x = []; for (const I of e.value || []) try { const g = JSON.parse(I.detail || "{}"); if (g && g.custom) { const k = `/manager/custom/${I.code}`; x.push({ name: "custom_" + I.code, path: k, id: I.id, seniorId: I.seniorId, meta: { custom: !0, // 是否自定义菜单 displayOrder: I.displayOrder, //排序 newWindow: g.newWindow ?? !1, // 是否新开窗口 title: I.name, link: g.link, // 链接地址 id: I.id, seniorId: I.seniorId, icon: g.icon || "zt-iconfont zt-icon-document" }, component: () => import("./index-7ed091b1.mjs") }); } } catch (g) { console.error(g); } return i.value = !0, x.sort((I, g) => { var k, m; return (Number((k = I.meta) == null ? void 0 : k.displayOrder) || 0) - (Number((m = g.meta) == null ? void 0 : m.displayOrder) || 0); }), Yd(x, "id", "seniorId"); } function _() { n.value = !1, o.value = !1, l.value = !1, e.value = [], t.value = [], r.value = []; } return { permissionList: e, permissionBtnList: t, permissionCustomizeList: r, hasLoad: n, hasBtnLoad: o, hasCustomizeLoad: l, updatePermissionList: f, updatePermissionListBtn: p, updatePermissionCustomizeList: b, hasInitCustomRouter: i, getCustomPermissionMenus: h, clear: _ }; }); function us(e) { if (Ge(e)) return e; if (hr(e)) { const t = {}; for (const n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = de.isEmptyText(e[n]) ? void 0 : us(e[n])); return t; } return Array.isArray(e) ? e.map((t) => us(t)) : e; } var de; ((e) => { function t(p) { return Ge(p) || p === "null" || p === "undefined" || p === ""; } e.isEmptyText = t; function n(p) { return hr(p) && Reflect.ownKeys(p).length === 0; } e.isEmptyObject = n; function o(p, b = "-") { const h = b; return n(p) || t(p) ? h : p; } e.textHandler = o; function l(p) { return typeof p == "number" ? p.toString() : p; } e.numberHandler = l; function r(p, b, h = !1) { const _ = us(p), x = us(b); return h ? ll(yd(_, x), []) : ll(_, x); } e.isEqual = r; function i(p, b, h) { if (!p || !b) return !1; const _ = h || [], x = Object.keys(p).filter((k) => !_.includes(k)), T = Object.keys(b).filter((k) => !_.includes(k)); if (x.length !== T.length) return !1; const I = us(p), g = us(b); for (const k of x) if (!ll(I[k], g[k])) return !1; return !0; } e.isEqualExceptKeys = i; function f(p, b) { const h = {}; function _(x, T, I = []) { if (Ge(x) || Ge(T)) { Ml(h, I, { oldValue: x, newValue: T }); return; } Wi(x, (g, k) => { const m = [...I, k]; Zi(g) && Zi(T[k]) ? _(g, T[k], m) : ll(g, T[k]) || Ml(h, m, { oldValue: g, newValue: T[k] }); }), Wi(T, (g, k) => { const m = [...I, k]; gd(x, k) || Ml(h, m, { oldValue: void 0, newValue: g }); }); } return _(p, b), h; } e.getObjectDifferences = f; })(de || (de = {})); const Xd = "auth-public-key", cs = "admin_sso_token", Ar = "admin_sso_refresh_token", Na = [ "linear-gradient(115deg, #00C1FF 0%, #009FFF 100%)", // 蓝 "linear-gradient(134deg, #48EC8A 0%, #20C8A3 100%)", // 绿 "linear-gradient(139deg, #F8AC50 0%, #F07027 100%)", // 黄 "linear-gradient(134deg, #FFB8A5 0%, #F0543B 100%)", // 红 "linear-gradient(146deg, #C7B0FF 0%, #9D76FF 100%)" // 紫 ]; var Fe = /* @__PURE__ */ ((e) => (e[e.add = 0] = "add", e[e.edit = 1] = "edit", e[e.edit_table = 2] = "edit_table", e[e.edit_basic = 3] = "edit_basic", e[e.edit_security = 4] = "edit_security", e[e.edit_private = 5] = "edit_private", e[e.edit_extend = 6] = "edit_extend", e))(Fe || {}), Y = /* @__PURE__ */ ((e) => (e[e.tenant = 0] = "tenant", e[e.unit = 1] = "unit", e[e.role = 2] = "role", e[e.roletag = 3] = "roletag", e[e.allperson = 4] = "allperson", e[e.allrole = 5] = "allrole", e[e.application = 6] = "application", e[e.person = 7] = "person", e[e.sync = 8] = "sync", e[e.log = 9] = "log", e))(Y || {}); const $s = "eventbus.refresh.person.table", Cl = "eventbus.refresh.role.table", zr = "eventbus.refresh.unittree", ui = "eventbus.refresh.menu.count"; var zs = /* @__PURE__ */ ((e) => (e.degree1 = "1", e.degree2 = "2", e.degree3 = "3", e))(zs || {}); const Yl = { empty: "sm2WithSalt", // 为空的算法 sm2: "sm2", // 不为空的算法 rsa: "rsa" }, ro = [ { value: 0, label: "用户中心", id: "0" }, { value: 1, label: "灵珑", id: "1" }, { value: 2, label: "全行业一体化", id: "2" } ]; var Ro = /* @__PURE__ */ ((e) => (e[e.navigation = 1] = "navigation", e[e.lanmu = 2] = "lanmu", e[e.menu = 3] = "menu", e[e.customize = 4] = "customize", e[e.workbench = 5] = "workbench", e[e.phylayer = 6] = "phylayer", e[e.buttons = 7] = "buttons", e))(Ro || {}), Wa = /* @__PURE__ */ ((e) => (e.Permission = "Permission", e.PermissionGroup = "PermissionGroup", e))(Wa || {}), xa = /* @__PURE__ */ ((e) => (e[e.forever = 0] = "forever", e[e.temp = 1] = "temp", e))(xa || {}), Vo = /* @__PURE__ */ ((e) => (e[e.disable = 0] = "disable", e[e.enable = 1] = "enable", e))(Vo || {}), to = /* @__PURE__ */ ((e) => (e[e.ALL = -1] = "ALL", e[e.UPDATED = 0] = "UPDATED", e[e.NOT_UPDATED = 1] = "NOT_UPDATED", e))(to || {}), Eo = /* @__PURE__ */ ((e) => (e[e.number_zero = 0] = "number_zero", e.string_zero = "0", e))(Eo || {}), Wo = /* @__PURE__ */ ((e) => (e[e.man = 1] = "man", e[e.woman = 2] = "woman", e))(Wo || {}), Le = /* @__PURE__ */ ((e) => (e.unit_add = "usercenter_btn_unit_add", e.unit_edit = "usercenter_btn_unit_edit", e.unit_delete = "usercenter_btn_unit_delete", e.human_add = "usercenter_btn_human_add", e.human_edit = "usercenter_btn_human_edit", e.human_register_audit = "usercenter_human_register_audit", e.human_changeunit = "usercenter_btn_human_changeunit", e.human_delete = "usercenter_btn_human_delete", e.human_updatepermission = "usercenter_btn_human_updatepermission", e.human_edit_phone = "usercenter_btn_humanphone_edit", e.hunan_edit_name = "usercenter_btn_humanname_edit", e.hunan_edit_duty = "usercenter_input_humanduty_edit", e.hunan_edit_desc = "usercenter_input_humandescription_edit", e.human_attach_edit = "usercenter_input_humanattach_edit", e.human_password_manager = "usercenter_btn_human_passwordmanager", e.human_password_edit = "usercenter_modify_others_cryptogram", e.human_batch_edit = "usercenter_btn_human_batch_edit", e.role_add = "usercenter_btn_role_add", e.role_edit = "usercenter_btn_role_edit", e.role_updatepermission = "usercenter_btn_role_updatepermission", e.role_delete = "usercenter_btn_role_delete", e.NO_PERMISSION = "NO_PERMISSION", e.usercenter_btn_log_delete = "usercenter_btn_log_delete", e.tenant_add = "usercenter_btn_tenant_add", e.tenant_edit = "usercenter_btn_tenant_edit", e.tenant_delete = "usercenter_btn_tenant_delete", e.usergroup_add = "usercenter_btn_usergroup_add", e.usergroup_edit = "usercenter_btn_usergroup_edit", e.usergroup_delete = "usercenter_btn_usergroup_delete", e.usergroup_grant = "usercenter_btn_usergroup_grant", e.usercenter_app_create = "usercenter_btn_app_create", e.usercenter_app_update = "usercenter_btn_app_update", e.usercenter_app_delete = "usercenter_btn_app_delete", e.usercenter_btn_res_create = "usercenter_btn_res_create", e.usercenter_btn_res_update = "usercenter_btn_res_update", e.usercenter_btn_res_delete = "usercenter_btn_res_delete", e.usercenter_btn_permission_manage = "usercenter_btn_permission_manage", e.usercenter_btn_permission_create = "usercenter_btn_permission_create", e.usercenter_btn_permission_update = "usercenter_btn_permission_update", e.usercenter_btn_permission_delete = "usercenter_btn_permission_delete", e.usercenter_btn_permission_sort = "usercenter_btn_permission_sort", e.usercenter_datamask_phone = "usercenter_datamask_phone", e.usercenter_datamask_phone_view = "usercenter_datamask_phone_view", e.usercenter_btn_human_field_settings = "usercenter_btn_human_field_settings", e.usercenter_btn_human_change_displayorder = "usercenter_btn_human_change_displayorder", e.usercenter_btn_human_reset_cryptogram = "usercenter_btn_human_reset_cryptogram", e.usercenter_export_register_code = "usercenter_export_register_code", e.usercenter_human_third_party_binding = "usercenter_human_third_party_binding", e))(Le || {}), Ba = /* @__PURE__ */ ((e) => (e[e.EQ = 0] = "EQ", e[e.IN = 1] = "IN", e[e.GT = 2] = "GT", e[e.LT = 3] = "LT", e[e.NOT_IN = 4] = "NOT_IN", e))(Ba || {}); const Nr = [ { label: "等于", value: 0 }, { label: "介于", value: 1 }, { label: "大于", value: 2 }, { label: "小于", value: 3 }, { label: "不等于", value: 4 } ]; var _o = /* @__PURE__ */ ((e) => (e[e.CONTAINS = 0] = "CONTAINS", e[e.NOT_CONTAINS = 1] = "NOT_CONTAINS", e[e.EQ = 2] = "EQ", e[e.NOT_EQ = 3] = "NOT_EQ", e))(_o || {}); const ml = [ { label: "包含", value: 0 }, { label: "不包含", value: 1 }, { label: "等于", value: 2 }, { label: "不等于", value: 3 } ], Er = [ { label: "绑定临时岗位", value: 0 }, { label: "临时拥有岗位", value: 1 }, { label: "绑定永久岗位", value: 2 }, { label: "仅直连权限", value: 3 } ]; var Uo = /* @__PURE__ */ ((e) => (e[e.OR = 0] = "OR", e[e.AND = 1] = "AND", e))(Uo || {}), xl = /* @__PURE__ */ ((e) => (e.tiling = "0", e.grouping = "1", e))(xl || {}), go = /* @__PURE__ */ ((e) => (e.Chinese = "0", e.English = "1", e.Number = "2", e.SpecialCharacters = "3", e))(go || {}); const Dr = [ { value: "tiling", label: "平铺模式" }, { value: "grouping", label: "分组模式" } ]; var is = /* @__PURE__ */ ((e) => (e.TENANT = "0", e.APPLICATION = "1", e.UNIT = "2", e.BATCH_DELETE_USER = "3", e.BATCH_DELETE_ROLE = "4", e))(is || {}), Br = /* @__PURE__ */ ((e) => (e.STANDARDIZE_LOGOUT_ALL = "0", e.SAME_DOMAIN_LOGOUT_SINGLE = "1", e))(Br || {}), hl = /* @__PURE__ */ ((e) => (e.ENABLE = "1", e.DISABLE = "0", e))(hl || {}); class Jd { constructor() { // 路由 ua(this, "_router"); } setRouter(t) { this._router = t; } // 使用浏览器返回键进入login界面时清理缓存 async clearCache() { await vl.clear(), ga().clear(), Zl().clear(), Ds().clear(); } async logout() { await vl.clear(), ga().clear(), Zl().clear(), Ds().clear(), this.clearToken(), this.toLoginPage(); } // 是否有token hasToken() { const t = Me.getCookie(cs); return !de.isEmptyText(t); } // 读取token值 getToken() { return Me.getCookie(cs) ?? ""; } // 清除token值 clearToken() { Me.removeCookie(cs), Me.removeCookie(Ar); } // 跳转到首页 toHome(t, n) { var o; t ? t({ name: "root" }) : n ? n.push({ name: "root" }) : (o = this._router) == null || o.push({ name: "root" }); } // 跳转到登录页面 toLoginPage(t, n) { var l; this.toConfigLogin() || (t ? t({ name: "login" }) : n ? n.push({ name: "login" }) : (l = this._router) == null || l.push({ name: "login" })); } // 是否为全局登出 isGlobalLogout() { return Me.getSetting("MULTI_DEVICE_LOGOUT_ENABLED") === Br.STANDARDIZE_LOGOUT_ALL; } // 是否有配置的注销页面 toConfigLogin() { const t = Me.getSetting("FRONTEND_LOGOUT_ADDRESS"); if (t) { let n = ""; if (t.startsWith("http://") || t.startsWith("https://") ? n = t : n = `${window.location.origin}${t}`, window.location.href.indexOf("?") !== -1) { let o = window.location.href.substring(window.location.href.indexOf("?"), window.location.href.length); o.endsWith("#/login") && (o = o.substring(0, o.length - 7)), n.indexOf("?") !== -1 && (n = n.substring(0, n.indexOf("?"))), n = `${n}${encodeURI(o)}`; } return window.location.href = n, !0; } return !1; } } const yl = new Jd(); function Ko(e) { return e instanceof Element ? "element" : Object.prototype.toString.call(e).replace(/\[object\s(.+)\]/, "$1").toLowerCase(); } class Qd { /** * 等价于Math.random() * @returns */ random() { return window.crypto.getRandomValues(new Uint8Array(1))[0] * 1e-3; } /** * 随机生成len长度的字符串,比如生成16位随机字符串:randomStr(16) 得到"bb2a6d2fe39bb7ee" * @param len */ randomStr(t) { const n = Math.ceil(t / 2), o = new Uint8Array(n); return window.crypto.getRandomValues(o), Array.from(o).map((i) => i.toString(16).padStart(2, "0")).join("").substr(0, t); } /** * 随机生成len长度的纯数字字符串,比如randomNumberStr(16)得到 "1842442170233672" * @param len */ randomNumberStr(t) { const n = Math.ceil(t / 2), o = new Uint8Array(n); window.crypto.getRandomValues(o); let l = ""; for (let r = 0; r < n; r++) l += o[r].toString().padStart(2, "0"); return l.slice(0, t); } /** * 随机生成一个密码,同时包含大写字母,小写字母,数字和特殊符号 * @param len */ getRandomPassword(t) { const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", o = "abcdefghijklmnopqrstuvwxyz", l = "0123456789", r = ".~!@#$%^&*)(_+}{|:?><", i = n + o + l + r; let f = ""; f += this.getRandomChar(n), f += this.getRandomChar(o), f += this.getRandomChar(l), f += this.getRandomChar(r); for (let p = f.length; p < t; p++) f += this.getRandomChar(i); return f = f.split("").sort(() => Gl(!0) - 0.5).join(""), f; } getRandomChar(t) { const n = Math.floor(Gl(!0) * t.length); return t[n]; } } const gl = new Qd(); class Mr { constructor(t) { /** * 应用标识 */ ua(this, "appIdCode"); /** * 随机数前缀 */ ua(this, "noncePrefix"); this.appIdCode = t, this.noncePrefix = this.generateRandomString(); } /** * 生成随机数 * @returns */ generateRandomString() { return gl.randomStr(8); } /** * 生成签名参数 * @returns */ generateSignatureOption() { return { nonce: `${this.noncePrefix}_${this.generateRandomString()}`, timestamp: Date.now().toString().substring(0, 10) }; } stringToUTF8ByteSize(t) { return new TextEncoder().encode(t).length; } isStringOverKB(t, n) { return this.stringToUTF8ByteSize(t) > n * 1024; } /** * 去除空参数 * @param param - 参数 * @returns */ removeNilValue(t) { if (Ko(t) === "object") { for (const n in t) if (Object.prototype.hasOwnProperty.call(t, n)) { const o = t[n], l = Ko(o); l === "object" ? this.removeNilValue(o) : (l === "null" || l === "undefined" || l === "function") && delete t[n]; } } } /** * 格式化 url value * @param value - 值 * @returns */ formatEncodeValue(t) { const n = Ko(t); return encodeURIComponent(n === "undefined" || n === "function" ? "" : t).replace(/%00/g, "\0").replace(/%2B/g, "+").replace(/%20/g, "+").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/'/g, "%27").replace(/!/g, "%21").replace(/~/g, "%7E"); } /** * 格式化 url params * @param params - 参数列表 * @param key - 参数键 * @param param - 参数 * @returns */ formatEncodeParam(t, n, o) { const l = Ko(o); if (l === "object") { const r = Object.keys(o).sort((i, f) => i.localeCompare(f)); r.length === 0 ? t.push(`${n}={}`) : r.forEach((i) => { this.formatEncodeParam(t, n === "" ? `${i}` : `${n}[${i}]`, o[i]); }); } else l === "array" ? o.length === 0 ? t.push(`${n}=[]`) : o.forEach((r) => { this.formatEncodeParam(t, `${n}[]`, r); }) : t.push(`${n}=${this.formatEncodeValue(o)}`); } /** * 参数排序 * @param param - 参数 * @returns */ sortParamByKey(t = {}) { const n = []; return this.formatEncodeParam(n, "", t), n.join("&"); } /** * 签名加密 * @param url - 请求地址 * @returns */ cryptoHash(t) { return Me.getSetting("signatureEncodeType") === "Base64" ? rs.HmacSHA1(t, this.appIdCode.code).toString(rs.enc.Base64) : rs.HmacSHA1(t, this.appIdCode.code).toString(rs.enc.Hex).toUpperCase(); } /** * 获取 url 参数 * @param url - 请求地址 * @returns */ urlSearchParams(t) { return t && t.indexOf("?") > -1 ? Hl.parse(t.split("?").pop() ?? "") : {}; } /** * 获取签名 url * @param href - 请求地址 * @returns 签名 url * @public */ signatureHref(t) { try { const { pathname: n } = new URL(t, window.location.origin), o = this.urlSearchParams(t), l = this.generateSignatureOption(); Qn(o, l); const r = this.sortParamByKey(o), f = `${qo.cleanUrl(`/${n}`)}?${r}`, p = this.cryptoHash(f); t = `${f}&signature=${p}`; } catch { console.error("签名失败,请使用有效的链接", t); } return t; } /** * 获取签名参数 * @param config - Axios 请求配置 * @returns 签名参数 * @public */ signatureConfig(t) { var n, o, l, r; try { const f = ((n = t.method) == null ? void 0 : n.toUpperCase()) === "GET", p = Kl(t.data), b = p !== null && typeof p == "object", h = ((l = (o = t.headers) == null ? void 0 : o["Content-Type"]) == null ? void 0 : l.toString()) || "", _ = h.includes("multipart/form-data"); let x = h.includes("application/json"); !f && !h && b && (x = !0), Qn(t, { headers: { "App-Id": this.appIdCode.id } }); const T = {}, I = this.urlSearchParams(t.url); if (Qn(T, I), !Ge(t.params)) { const F = Kl(t.params); this.removeNilValue(F), t.params = F, Qn(T, Hl.parse(Hl.stringify(F))); } !Ge(p) && b && !_ && !x && Qn(T, p); const g = this.generateSignatureOption(); Qn(T, g); let k = this.sortParamByKey(T); if (x) { const F = JSON.stringify(p); this.isStringOverKB(F, 128) || (b ? k += this.formatEncodeValue(F) : k += this.formatEncodeValue(p)); } let m = ""; (r = t.url) != null && r.startsWith("http") ? m = t.url : m = `${t.baseURL}/${t.url || ""}`; const { pathname: w } = new URL(m, window.location.origin), v = `${qo.cleanUrl(`/${w}`)}?${k}`; g.signature = this.cryptoHash(v), t.params = Qn({}, t.params, g); } catch (i) { console.error("签名失败", i); } } } const ec = { id: "mis", code: "c9d8e36df18ef01ff0da74e0bb13151c" }, tc = { id: "mis", code: "c9d8e36df18ef01ff0da74e0bb13151c" }, Mo = new Mr(ec); new Mr(tc); class nc { constructor() { /** * 加密配置 */ ua(this, "_encrypt"); } /** * 更新加密配置 * @param encrypt 加密配置 * @returns */ setEncrypt(t) { this._encrypt = t; } configAxios(t) { let n = !1, o = []; t.interceptors.request.use( async (l) => { var r, i; return oc(l), (r = this._encrypt) != null && r.enable && ((i = this._encrypt) != null && i.customEncrypt) && !l.ignoreEncrypt && this._encrypt.customEncrypt(l, this._encrypt), sc(l), l; }, (l) => Promise.reject(l) ), t.interceptors.response.use( (l) => l, async (l) => { if (l.code === "ECONNABORTED") return Tt.error({ content: "网络或后台服务异常", key: l.code }), Promise.reject(l); if (l.response && l.response.data) { const r = l.response.data; if (r.error === "invalid_grant") Tt.error(r.error_description); else if (r.error === "invalid_token" || l.response.status === 401) try { const i = Hn(l.config); if (n) return new Promise((p) => { o.push({ resolve: p, config: i }); }); if (n = !0, await ac(t, l.config)) { const p = await t(i); return o.forEach(({ resolve: b, config: h }) => { b(t(h)); }), n = !1, o = [], p; } else return Promise.reject(l); } catch (i) { console.log(i), await yl.logout(), n = !1, o = []; return; } } return Promise.reject(l); } ); } } async function ac(e, t) { var l, r, i; const n = rl.get(Ar), o = Qn({}, t, { headers: { "X-Authorization": "" } }); if (!de.isEmptyText(n)) { const f = await e.post( "/oauth/extras/token/refresh", { refresh_token: n }, o ); if ((l = f == null ? void 0 : f.data) != null && l.access_token) { const p = new Date((/* @__PURE__ */ new Date()).getTime() + (((r = f == null ? void 0 : f.data) == null ? void 0 : r.expires_in) || 0) * 1e3); return Me.saveCookie(cs, (i = f == null ? void 0 : f.data) == null ? void 0 : i.access_token, { expires: p }), Promise.resolve(f); } else return Promise.reject(new Error("当前登录会话已失效,请重新登录")); } return Promise.reject(new Error("当前登录会话已失效,请重新登录")); } function oc(e) { const t = /^\/?(oauth|free)\//; if (e.url && !t.test(e.url)) { const n = yl.getToken(); n && Qn(e, { headers: { "X-Authorization": `bearer ${n}` } }); } } function sc(e) { Mo.signatureConfig(e); } function lc(e, t) { var r, i, f, p, b, h; const n = e, { changeContentTypeEnabled: o } = t || {}, l = { type: Me.getSetting("HTTP_REQUEST_ENCRYPT_ALG"), publicKey: Me.getSetting("HTTP_REQUEST_ENCRYPT_PUB_KEY") }; try { const _ = (r = n.method) == null ? void 0 : r.toLowerCase(); if (_ !== "post" && _ !== "put") return n; const x = n.data; if (Ge(x)) return n; let I = x !== null && typeof x == "object" && Object.prototype.toString.call(x) === "[object FormData]" || ((f = (i = n.headers) == null ? void 0 : i["Content-Type"]) == null ? void 0 : f.includes("multipart/form-data")); if (I || (I = x instanceof FormData || typeof (x == null ? void 0 : x.append) == "function" && typeof (x == null ? void 0 : x.entries) == "function"), I || ((b = (p = n.headers) == null ? void 0 : p["Content-Type"]) == null ? void 0 : b.includes("application/x-www-form-urlencoded"))) return n; const k = l.type; if (k && k === "sm2WithSalt") { n.headers = { ...n.headers }; const m = rc(JSON.stringify(x), { bodyEncryptOption: l }); n.data = m.data ?? x; const w = ((h = n.headers["Content-Type"]) == null ? void 0 : h.toString()) || "application/json;charset=utf-8"; o ? (n.headers["Content-Type"] = "application/json;charset=utf-8", n.headers["X-Api-Content-Type"] = w) : n.headers["Content-Type"] = w; } } catch (_) { console.error("请求参数加密失败", _); } return n; } const ic = [ { type: "sm2WithSalt", encrypt: (e, t) => { const { type: n, publicKey: o } = t || {}; if (!n || !o) return; let l = er.get(n); de.isEmptyText(l) && (l = Ea.cryptRandom(16), er.set(n, l)); const r = Ea.cryptRandom(16), i = Ea.cryptRandom(3), f = Ir.doEncrypt(i + l, o, 1), p = jl.encrypt(e, l, { iv: r, mode: "cbc" }); if (f && p) { const b = f, h = r + p; return { data: b + h }; } } } ], er = /* @__PURE__ */ new Map(); function rc(e, t = {}) { var l, r; const { bodyEncryptOption: n } = t, { type: o } = n || {}; return ((r = (l = ic.find((i) => i.type === o)) == null ? void 0 : l.encrypt) == null ? void 0 : r.call(l, e, n)) || { data: void 0 }; } class uc { constructor() { ua(this, "axiosInstance"); ua(this, "isLib", !1); ua(this, "hasLoadFreeSetting", !1); ua(this, "hasLoadFrontSetting", !1); ua(this, "adminAppCNTitle", d("")); ua(this, "axiosConfig"); this.axiosInstance = cd.create({ baseURL: this.getBaseUrl(), timeout: 6e4 }), this.axiosConfig = new nc(); } // 获取后台服务接口地址 getBaseUrl() { return (this.getSetting("baseUrl") || this.getSetting("serverUrl") || "").replace(/\/$/, ""); } // 应用标识 getAppId() { return this.getSetting("ADMIN_APP_ID", "usercenter"); } // 获取多媒体接口地址 getMediaUrl() { return this.isLib ? this.getSetting("ADMIN_BASE_SERVICE_MEDIA_BACKEND") : this.getSetting("BASE_SERVICE_MEDIA_BACKEND"); } // 人员模块自定义字段、 getPersonCustomFields(t) { if (!t) return ""; const n = t.trim(); return this.getSetting("personFields") ? this.getSetting("personFields")[n] : ""; } // 租户模块自定义字段 getTenantCustomFields(t) { if (!t) return ""; const n = t.trim(); return this.getSetting("tenantFields") ? this.getSetting("tenantFields")[n] : ""; } url(t) { return this.getBaseUrl().replace(/\/$/, "") + "/" + t.replace(/^\//, ""); } setIsLib(t) { this.isLib = t; } getIsLib() { return this.isLib; } setHasLoadFreeSetting(t) { this.hasLoadFreeSetting = t; } getHasLoadFreeSetting() { return this.hasLoadFreeSetting; } setHasLoadFrontSetting(t) { this.hasLoadFrontSetting = t; } getHasLoadFrontSetting() { return this.hasLoadFrontSetting; } setAxiosInstance(t) { t && (this.axiosInstance = t); } getAxiosInstance() { return this.axiosInstance; } configAxiosInstance() { this.axiosConfig.configAxios(this.axiosInstance); } initAxiosEncrypt() { this.getSetting("GLOBAL_REQUEST_NOT_ENCRYPT_ALLOWED") !== "1" && this.axiosConfig.setEncrypt({ enable: !0, customEncrypt: lc }); } // 获取系统配置项 getSetting(t, n = "") { return window.commonSetting[t] || n; } saveCookie(t, n, o = {}) { t && n && rl.set(t, n, o); } getCookie(t) { return rl.get(t) || ""; } removeCookie(t) { rl.remove(t); } /** * key值是否为true * @param key * @returns */ canShowField(t) { if (!t) return !1; const n = t.trim(); return this.getSetting(n) && (this.getSetting(n) === "true" || this.getSetting(n) === "1"); } parseLoginType(t) { if (typeof t != "string") return !1; try { const n = JSON.parse(t); return { authType: n.authType ?? hl.DISABLE, authFactors: n.authFactors ?? [[], []] }; } catch (n) { console.log("parseValueError: ", n); } } // 仿照use-login组件里面的获取标题的方法,进行功能替代 getAdminAppCNTitle() { const t = this.getSetting("ADMIN_APP_CN_TITLE", "统一用户中心"); return de.isEmptyText(t) || (this.adminAppCNTitle.value = t), t; } } const Me = new uc(); const dc = oe({ name: "OperateView" }), cc = /* @__PURE__ */ oe({ ...dc, props: { buttons: { type: Array, default() { return []; } }, showSearch: { type: Boolean, default() { return !0; } }, showSearchOuter: { type: Boolean, default() { return !1; } }, searchTip: { type: String, default() { return "请输入关键字检索"; } }, tooltip: { type: String, default() { return ""; } }, toolWidth: { type: Number, default() { return 0; } }, searchWidth: { type: Number, default() { return 0; } }, btnWidth: { type: Number, default() { return 0; } } }, emits: ["search", "change"], setup(e, { expose: t, emit: n }) { const o = e, l = d(), r = d(null), i = d(null), f = d(null), p = d(null), b = d(0); function h() { n("search", l.value); } const _ = yr((x) => { x === "" && n("search", ""); }, 300); return me( () => i.value, (x) => { x && Pa(() => { var T; x && f.value && (b.value = (x == null ? void 0 : x.offsetWidth) - ((T = f.value) == null ? void 0 : T.offsetWidth) - o.toolWidth - o.searchWidth, n("change", b.value)); }); } ), t({ emptyWidth: b }), (x, T) => { const I = Je, g = uo, k = fn; return u(), M("div", { class: "v-operate-view", ref_key: "dom", ref: r }, [ c("div", { ref_key: "btnView", ref: p }, [ (u(!0), M(be, null, tt(e.buttons, (m) => (u(), M(be, null, [ m.hidden ? Z("", !0) : (u(), E(I, { key: m.title, type: m.type, ghost: "", disabled: m.disabled, shape: "round", style: ea(m.style), onClick: (w) => m.clickBack && m.clickBack() }, { icon: a(() => [ c("i", { class: Xe(["zt-iconfont", m.icon]) }, null, 2) ]), default: a(() => [ S(" " + Q(m.title), 1) ]), _: 2 }, 1032, ["type", "disabled", "style", "onClick"])) ], 64))), 256)) ], 512), Yt(x.$slots, "btn-extra", {}, void 0, !0), e.showSearch || e.showSearchOuter ? (u(), M("div", { key: 0, class: "operate-extra", ref_key: "searchView", ref: i }, [ c("div", { ref_key: "searchWrap", ref: f }, [ e.tooltip ? (u(), E(k, { key: 0, title: e.tooltip }, { default: a(() => [ e.showSearch ? (u(), E(g, { key: 0, class: "input-search", value: l.value, "onUpdate:value": T[0] || (T[0] = (m) => l.value = m), valueModifiers: { trim: !0 }, placeholder: e.searchTip, "allow-clear": "", round: "", onSearch: h, onChange: T[1] || (T[1] = (m) => { var w; return C(_)((w = m.target.value) == null ? void 0 : w.trim()); }) }, null, 8, ["value", "placeholder"])) : Z("", !0) ]), _: 1 }, 8, ["title"])) : (u(), M(be, { key: 1 }, [ e.showSearch ? (u(), E(g, { key: 0, class: "input-search", value: l.value, "onUpdate:value": T[2] || (T[2] = (m) => l.value = m), valueModifiers: { trim: !0 }, placeholder: e.searchTip, "allow-clear": "", round: "", onSearch: h, onChange: T[3] || (T[3] = (m) => { var w; return C(_)((w = m.target.value) == null ? void 0 : w.trim()); }) }, null, 8, ["value", "placeholder"])) : Z("", !0) ], 64)) ], 512), e.showSearch ? Yt(x.$slots, "search-extra", { key: 0 }, void 0, !0) : Z("", !0), e.showSearch ? Yt(x.$slots, "right-extra", { key: 1 }, void 0, !0) : Z("", !0), e.showSearchOuter ? Yt(x.$slots, "outer-right-extra", { key: 2 }, void 0, !0) : Z("", !0) ], 512)) : Z("", !0) ], 512); }; } }); const at = (e, t) => { const