var Z = Object.defineProperty;
var ee = (t, a, s) => a in t ? Z(t, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[a] = s;
var w = (t, a, s) => (ee(t, typeof a != "symbol" ? a + "" : a, s), s);
import { PluginStaticResource as te, ViewMode as se, AppFuncCommand as ae } from "@ibiz-template/runtime";
import { ref as C, watch as _, defineComponent as D, getCurrentInstance as j, computed as R, onMounted as L, h as i, toRefs as ie, reactive as re, nextTick as K, toRef as ne, onActivated as oe } from "vue";
import { useRouter as G, useRoute as B, useIndexViewController as le, useNamespace as S, useControlController as ce, usePropsWatch as de, useListController as ue, useListExpViewController as he, useRouteKey as pe, getUploadProps as me, getEditorEmits as fe, useMPickupViewController as ge, useTreeController as ve, useViewController as ye } from "@ibiz-template/vue-util";
import { createUUID as we, notNilEmpty as be } from "qx-util";
import { IndexViewModel as Ce, PortletPartModel as xe, ViewPortletModel as ke, ListModel as H, TreeModel as Pe, getControl as $, GridModel as U } from "@ibiz-template/model";
import A from "dayjs";
import { CustomPortletController as qe, ViewPortletController as De, EditFormController as Se, ListController as _e, UploadEditorController as Me, FormMDCtrlController as Ee, GridViewNerve as Te, GridViewController as je } from "@ibiz-template/controller";
import { mergeDeepRight as Ie } from "ramda";
import { init as Ve, registerMap as ze } from "echarts";
import { Treeselect as Ae } from "@riophae/vue-treeselect";
import { convertNavData as Oe } from "@ibiz-template/service";
const M = new te(import.meta.url);
class Ne {
  constructor() {
    w(this, "component", "UserIndexView");
  }
}
const Re = (t) => {
  const { view2: a, params2: s, params1: e } = t.params;
  if (!a)
    return "";
  let r = s.replace(
    new RegExp(";srfnav=[^;=]*$|(?<=;)srfnav=[^;=]*;|^srfnav=[^;=]*;|^srfnav=[^;=]*$", "g"),
    ""
  );
  return r = r || ibiz.env.routePlaceholder, `/${e}/${a}/${r}`;
}, Le = (t) => {
  const { view1: a, appContext: s } = t.params;
  return `/${s}/${a}/${ibiz.env.routePlaceholder}`;
};
function Fe(t, a) {
  const s = G(t), e = C(""), r = C(""), n = C([]), d = C([]), f = (l) => {
    l.forEach((h) => {
      const b = n.value.indexOf(h);
      b !== -1 && n.value.splice(b, 1);
      const k = d.value.findIndex((y) => y.key === h);
      k !== -1 && d.value.splice(k, 1);
    });
  };
  _(
    () => t.$route.path,
    (l, h) => {
      if (l !== h) {
        const b = B(t);
        e.value = Re(b), r.value = Le(b);
        const k = d.value.find(
          (y) => y.key === e.value
        );
        if (k)
          b.matched.length === 2 ? s.push(k.fullPath) : k.fullPath = b.fullPath;
        else {
          if (l === r.value)
            return;
          d.value.push({
            key: e.value,
            fullPath: b.fullPath,
            modelPath: "",
            caption: ""
          });
        }
      }
    },
    { deep: !0, immediate: !0 }
  ), _(
    e,
    (l, h) => {
      if (l !== h && l) {
        const b = n.value.indexOf(l);
        b === -1 || n.value.splice(b, 1), n.value.unshift(l);
      }
    },
    { immediate: !0 }
  );
  const o = async (l, h) => {
    const b = d.value.find((k) => k.key === e.value);
    b && (h.caption && (b.caption = h.caption), h.modelPath && (b.modelPath = h.modelPath));
  }, p = (l = e.value) => {
    f([l]);
    const h = n.value[0];
    if (!h)
      a.model.source.blankMode ? window.close() : (e.value = "", s.push(r.value));
    else {
      const b = d.value.find((k) => k.key === h);
      s.push(b.fullPath);
    }
  }, g = (l) => {
    const h = d.value[l];
    h && s.push(h.fullPath);
  }, v = () => {
    const h = B(t).fullPath;
    let b = h.indexOf("/");
    for (let y = 0; y < 2; y++)
      b = h.indexOf("/", b + 1);
    const k = `${h.substring(0, b)}/-`;
    s.push(k);
  }, u = () => {
    if (n.value.length > 0) {
      const l = d.value.find(
        (h) => h.key === n.value[0]
      );
      l && s.push(l.fullPath);
    } else
      v();
  };
  return {
    currentKey: e,
    keyHistory: n,
    routeMsgs: d,
    updateRouteMsg: o,
    closeView: p,
    deleteRouteCache: f,
    handleTabClick: g,
    handleTabDelete: (l) => {
      const h = d.value[l];
      h && (f([h.key]), u());
    },
    handleCloseAll: () => {
      if (d.value.length > 0) {
        const l = [];
        d.value.forEach((h) => {
          l.push(h.key);
        }), f(l), u();
      }
    },
    handleCloseOther: () => {
      if (d.value.length > 0) {
        const l = [];
        d.value.forEach((h) => {
          h.key !== e.value && l.push(h.key);
        }), f(l), u();
      }
    }
  };
}
const Ke = /* @__PURE__ */ D({
  __name: "index-view",
  props: {
    context: null,
    params: { default: () => ({}) },
    modelPath: null
  },
  setup(t) {
    const a = t, { proxy: s } = j(), e = le(s, a.modelPath), r = !0;
    let n = null, d = null, f = () => {
    }, o = null, p = null, g = null, v = null, u = null, c, m, x, l;
    const h = C(we());
    {
      const {
        currentKey: k,
        keyHistory: y,
        routeMsgs: q,
        updateRouteMsg: P,
        closeView: z,
        deleteRouteCache: O,
        handleTabClick: I,
        handleTabDelete: V,
        handleCloseAll: T,
        handleCloseOther: J
      } = Fe(s, e);
      m = k, x = y, l = q, o = O, p = I, g = V, v = T, u = J, n = (E) => {
        const N = m.value;
        E.evt.on("closeView", () => {
          z(N);
        }), E.evt.on("setTitle", (X) => {
          P(N, { caption: X });
        });
      }, d = (E) => {
        P(m.value, E);
      }, window.onpopstate = () => {
        o([x.value[1]]);
      }, c = R(() => {
        const E = l.value.find(
          (N) => N.key === m.value
        );
        return (E == null ? void 0 : E.modelPath) || "";
      });
    }
    return L(() => {
      setTimeout(() => {
        const k = document.querySelector(".app-loading-x");
        k && (k.style.display = "none");
      }, 300);
    }), { __sfc: !0, props: a, proxy: s, c: e, isShowTabPageExp: r, onCreated: n, onViewFound: d, onMenuRouteChange: f, deleteRouteCache: o, handleTabClick: p, handleTabDelete: g, handleCloseAll: v, handleCloseOther: u, currentPath: c, currentKey: m, keyHistory: x, routeMsgs: l, appKeepAliveKey: h, collapseChange: (k) => {
      e.collapseChange = k;
    } };
  }
});
function Be(t, a, s, e, r, n, d, f) {
  var o = typeof t == "function" ? t.options : t;
  a && (o.render = a, o.staticRenderFns = s, o._compiled = !0), e && (o.functional = !0), n && (o._scopeId = "data-v-" + n);
  var p;
  if (d ? (p = function(u) {
    u = u || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !u && typeof __VUE_SSR_CONTEXT__ < "u" && (u = __VUE_SSR_CONTEXT__), r && r.call(this, u), u && u._registeredComponents && u._registeredComponents.add(d);
  }, o._ssrRegister = p) : r && (p = f ? function() {
    r.call(
      this,
      (o.functional ? this.parent : this).$root.$options.shadowRoot
    );
  } : r), p)
    if (o.functional) {
      o._injectStyles = p;
      var g = o.render;
      o.render = function(c, m) {
        return p.call(m), g(c, m);
      };
    } else {
      var v = o.beforeCreate;
      o.beforeCreate = v ? [].concat(v, p) : [p];
    }
  return {
    exports: t,
    options: o
  };
}
var $e = function() {
  var a = this, s = a._self._c, e = a._self._setupProxy;
  return s("UserAppLayout", { attrs: { "is-complete": e.c.complete, model: e.c.model, "is-show-tab-page-exp": e.isShowTabPageExp }, on: { onCollapseChange: e.collapseChange } }, [e.c.complete ? [e.c.complete ? s("app-menu", { attrs: { slot: "menu", "current-path": e.currentPath, "model-data": e.c.model.appMenu, context: e.c.context, "collapse-change": e.c.collapseChange }, on: { menuRouteChange: e.onMenuRouteChange }, slot: "menu" }) : a._e(), e.isShowTabPageExp ? s("user-tab-page-exp", { attrs: { slot: "tabPageExp", "route-msgs": e.routeMsgs, "current-key": e.currentKey }, on: { "tab-click": e.handleTabClick, "tab-delete": e.handleTabDelete, "close-all": e.handleCloseAll, "close-other": e.handleCloseOther }, slot: "tabPageExp" }) : a._e(), e.isShowTabPageExp ? s("AppKeepAlive", { attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1) : s("AppKeepAlive", { key: e.appKeepAliveKey, attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1)] : a._e()], 2);
}, Ue = [], Ge = /* @__PURE__ */ Be(
  Ke,
  $e,
  Ue,
  !1,
  null,
  null,
  null,
  null
);
const He = Ge.exports;
const Y = D({
  name: "ChangePassword",
  props: {
    isShowModal: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: a
  }) {
    const s = S("change-password"), e = C(null), r = C({
      oldPwd: "",
      newPwd: "",
      newPwd2: ""
    }), n = C(!1), d = {
      oldPwd: [{
        required: !0,
        message: "\u8BF7\u8F93\u5165\u539F\u5BC6\u7801",
        trigger: "blur"
      }],
      newPwd: [{
        required: !0,
        trigger: "blur",
        min: 8,
        max: 20,
        pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+~`/*-])[A-Za-z\d!@#$%^&*()_+~`/*-]{8,20}$/,
        message: "\u5BC6\u7801\u81F3\u5C11\u5305\u542B\u516B\u4E2A\u5B57\u7B26\uFF0C\u81F3\u591A\u4E8C\u5341\u4E2A\u5B57\u7B26\uFF0C\u5305\u62EC\u81F3\u5C11\u4E00\u4E2A\u6570\u5B57\uFF0C\u5E76\u4E14\u540C\u65F6\u5305\u542B\u5927\u5C0F\u5199\u5B57\u6BCD\u548C\u7279\u6B8A\u5B57\u7B26"
      }],
      newPwd2: [{
        required: !0,
        trigger: "blur",
        validator(o, p, g) {
          p !== r.value.newPwd ? g(new Error("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u68C0\u67E5")) : g();
        }
      }]
    }, f = () => {
      e.value.validate(async (o) => {
        var p, g, v;
        if (o)
          try {
            n.value = !0;
            const u = await ibiz.net.post("/v7/changepwd ", {
              oldPwd: r.value.oldPwd,
              newPwd: r.value.newPwd
            });
            if (u.ok) {
              ibiz.notification.success({
                title: "\u4FEE\u6539\u5BC6\u7801\u6210\u529F\uFF01"
              }), n.value = !1, a("change-success");
              return;
            }
            ibiz.notification.error({
              title: ((p = u.data) == null ? void 0 : p.message) || "\u4FEE\u6539\u5BC6\u7801\u5931\u8D25\uFF01"
            }), n.value = !1;
          } catch (u) {
            ibiz.notification.error({
              title: ((v = (g = u.response) == null ? void 0 : g.data) == null ? void 0 : v.message) || "\u4FEE\u6539\u5BC6\u7801\u5931\u8D25\uFF01"
            }), n.value = !1;
          }
      });
    };
    return _(() => t.isShowModal, (o) => {
      o === !0 && e.value && e.value.resetFields();
    }), {
      ns: s,
      formData: r,
      rules: d,
      loading: n,
      formRef: e,
      handleSubmit: f
    };
  },
  render(t) {
    return t("i-form", {
      class: this.ns.b(),
      ref: "formRef",
      attrs: {
        model: this.formData,
        rules: this.rules
      }
    }, [t("i-form-item", {
      attrs: {
        prop: "oldPwd",
        "label-position": "top",
        label: "\u539F\u5BC6\u7801"
      }
    }, [t("i-input", {
      attrs: {
        type: "password",
        password: !0,
        placeholder: "\u8BF7\u8F93\u5165\u539F\u5BC6\u7801",
        size: "large"
      },
      model: {
        value: this.formData.oldPwd,
        callback: (a) => {
          this.$set(this.formData, "oldPwd", a);
        }
      }
    })]), t("i-form-item", {
      attrs: {
        prop: "newPwd",
        "label-position": "top",
        label: "\u65B0\u5BC6\u7801"
      }
    }, [t("i-input", {
      attrs: {
        type: "password",
        password: !0,
        placeholder: "\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801",
        size: "large"
      },
      model: {
        value: this.formData.newPwd,
        callback: (a) => {
          this.$set(this.formData, "newPwd", a);
        }
      }
    })]), t("i-form-item", {
      attrs: {
        prop: "newPwd2",
        "label-position": "top",
        label: "\u786E\u8BA4\u5BC6\u7801"
      }
    }, [t("i-input", {
      attrs: {
        type: "password",
        password: !0,
        placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
        size: "large"
      },
      model: {
        value: this.formData.newPwd2,
        callback: (a) => {
          this.$set(this.formData, "newPwd2", a);
        }
      }
    })]), t("i-form-item", [t("i-button", {
      class: this.ns.b("submit"),
      on: {
        click: this.handleSubmit
      },
      attrs: {
        loading: this.loading,
        size: "large"
      }
    }, ["\u786E\u8BA4\u4FEE\u6539"])])]);
  }
});
function Ye(t, a) {
  return i("div", {
    class: t.e("logo")
  }, [i("img", {
    class: t.e("logo-img"),
    attrs: {
      src: M.dir("/assets/img/jh-800.png")
    }
  }), i("div", {
    class: t.e("logo-caption")
  }, [a.caption])]);
}
const Qe = D({
  name: "UserAppLayout",
  props: {
    model: {
      type: Ce,
      required: !0
    },
    isComplete: {
      type: Boolean,
      default: !1
    },
    isShowTabPageExp: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: a,
    slots: s
  }) {
    var y;
    const e = S("layout"), r = C(!1), n = () => {
      r.value = !r.value, a("onCollapseChange", r.value);
    }, d = R(() => t.model.source.blankMode === !0), f = async (q) => {
      var z;
      const P = (z = s.menu) == null ? void 0 : z.call(s)[0].componentInstance;
      P && P.c && await P.c.onClickMenuItem(q);
    }, {
      srfusername: o = "\u6E38\u5BA2",
      srforgsectorname: p,
      srffirstlogin: g
    } = ((y = ibiz.appData) == null ? void 0 : y.context) || {}, {
      proxy: v
    } = j(), u = G(v), c = async () => {
      (await ibiz.auth.v7logout()).ok ? (ibiz.message.success("\u767B\u51FA\u6210\u529F"), u.push(`/login?ru=${encodeURIComponent(window.location.hash.replace("#/", "/"))}`)) : ibiz.message.error("\u767B\u51FA\u5931\u8D25");
    }, m = C(!0), x = () => {
      m.value = !m.value;
    }, l = C(!1), h = C(!0);
    return g === 1 && (l.value = !0, h.value = !1), {
      ns: e,
      collapseChange: r,
      isBlank: d,
      collapseMenus: n,
      openView: f,
      srfusername: o,
      srforgsectorname: p,
      clickOut: c,
      isShowOpt: m,
      isShowModal: l,
      isModalClosable: h,
      changeShowOpt: x,
      showChangePassword: () => {
        l.value = !0;
      },
      hideChangePassword: () => {
        l.value = !1, h.value = !0;
      }
    };
  },
  render() {
    return this.isComplete ? i("i-layout", {
      class: [this.ns.b(), this.isBlank ? this.ns.m("blank") : "", this.ns.is("collapse", this.collapseChange), this.ns.is("tab", this.isShowTabPageExp)]
    }, [i("i-sider", {
      attrs: {
        "hide-trigger": !0,
        value: this.collapseChange
      },
      class: [this.ns.b("nav"), this.ns.is("collapse", this.collapseChange)]
    }, [Ye(this.ns, this.model), i("div", {
      class: this.ns.b("option")
    }, [i("i-poptip", {
      attrs: {
        trigger: "click",
        transfer: !0,
        "popper-class": "opt-box",
        placement: "bottom-end"
      },
      scopedSlots: {
        default: () => i("div", {
          class: this.ns.be("option", "top")
        }, [i("img", {
          class: "head",
          attrs: {
            src: M.dir("/assets/img/head.svg")
          }
        }), i("div", {
          class: "user"
        }, [i("div", {
          class: "username"
        }, [this.srfusername]), i("div", {
          class: "orgname"
        }, [this.srforgsectorname])]), i("img", {
          class: "down",
          attrs: {
            src: M.dir("/assets/img/down.svg")
          }
        })]),
        content: () => i("div", {
          class: "opts"
        }, [i("div", {
          on: {
            click: this.showChangePassword
          }
        }, [i("img", {
          class: "lr",
          attrs: {
            src: M.dir("/assets/img/lr.svg")
          }
        }), "\u4FEE\u6539\u5BC6\u7801"]), i("div", {
          class: "logout",
          on: {
            click: this.clickOut
          }
        }, [i("i", {
          class: "ivu-icon ivu-icon-ios-log-out"
        }), "\u9000\u51FA\u767B\u5F55"])])
      }
    }), i("div", {
      class: [this.ns.be("option", "content")]
    }, [i("div", {
      class: this.ns.e("download"),
      on: {
        click: () => this.openView("menuitem62")
      }
    }, [i("img", {
      class: "gj",
      attrs: {
        src: M.dir("/assets/img/download.svg")
      }
    }), i("div", {
      class: this.ns.em("download", "text")
    }, ["\u6587\u4EF6\u4E0B\u8F7D"])])]), i("div", {
      class: [this.ns.be("option", "bottom")]
    }, [i("i-tooltip", {
      attrs: {
        content: "\u8BBE\u5907\u79BB\u7EBF\u544A\u8B66",
        placement: "right",
        theme: "light"
      }
    }, [i("img", {
      class: "gj",
      attrs: {
        src: M.dir("/assets/img/gj.svg")
      },
      on: {
        click: () => this.openView("menuitem46")
      }
    })])])]), this.$slots.menu, i("div", {
      class: this.ns.be("slider", "collapse-icon")
    }, [this.collapseChange ? i("ion-icon", {
      attrs: {
        src: "./assets/img/menu-unfold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    }) : i("ion-icon", {
      attrs: {
        src: "./assets/img/menu-fold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    })])]), i("i-layout", {
      class: [this.ns.b("content")]
    }, [i("i-content", {
      class: this.ns.be("content", "main")
    }, [this.$slots.tabPageExp, this.$slots.default]), i("i-modal", {
      attrs: {
        title: "\u4FEE\u6539\u5BC6\u7801",
        "class-name": "change-password-modal",
        "mask-closable": this.isModalClosable,
        closable: this.isModalClosable,
        "footer-hide": !0
      },
      model: {
        value: this.isShowModal,
        callback: (t) => {
          this.isShowModal = t;
        }
      }
    }, [i(Y, {
      attrs: {
        isShowModal: this.isShowModal
      },
      on: {
        "change-success": this.hideChangePassword
      }
    })])])]) : null;
  }
});
class Q extends qe {
  constructor() {
    super(...arguments);
    w(this, "options", []);
    w(this, "kqrq", "");
    w(this, "rylx", "");
  }
  async onInit() {
    await super.onInit(), this.options = await ibiz.codeListService.get(
      "UsrCodeList0402031972",
      this.context,
      this.params
    ), this.context.srforgcode && (this.params.orgcode = this.context.srforgcode), this.kqrq = A().subtract(1, "day").startOf("day").format("YYYY-MM-DD"), this.rylx = this.options.map((s) => s.value).join(","), this.changeViewParams();
  }
  changeViewParams() {
    this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        kqrq: this.kqrq || null,
        rylx: this.rylx || null
      },
      !0
    );
  }
}
const We = D({
  name: "PortletSearchHeader",
  props: {
    modelData: {
      type: xe,
      required: !0
    },
    controller: {
      type: Q,
      required: !0
    }
  },
  setup(t) {
    const a = S("portal-search-header"), s = C([]), e = C(new Date()), r = (o) => {
      s.value = o, t.controller.rylx = o.join(","), t.controller.changeViewParams();
    }, n = (o) => {
      e.value = o, t.controller.kqrq = o ? A(o).format("YYYY-MM-DD") : "", t.controller.changeViewParams();
    };
    e.value = new Date(t.controller.kqrq), s.value = t.controller.rylx.split(",");
    const d = A();
    return {
      ns: a,
      selectArray: s,
      selectDate: e,
      options: {
        disabledDate: (o) => {
          const p = A(o);
          return d.isSame(p, "day") || d.isBefore(p, "day");
        }
      },
      onSelectArrayChange: r,
      onDateChange: n
    };
  },
  render() {
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return i("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [i("i-checkbox-group", {
      class: this.ns.e("rylx-checkbox"),
      attrs: {
        value: this.selectArray
      },
      on: {
        "on-change": this.onSelectArrayChange
      }
    }, [this.controller.options.map((a) => i("i-checkbox", {
      attrs: {
        label: a.value
      }
    }, [a.text]))]), i("i-CalendarPicker", {
      class: this.ns.e("date-picker"),
      attrs: {
        type: "date",
        value: this.selectDate,
        clearable: !1,
        placement: "bottom-end",
        options: this.options
      },
      on: {
        "on-change": this.onDateChange
      }
    })]);
  }
});
class Je {
  constructor() {
    w(this, "component", We);
  }
  async createController(a, s, e) {
    const r = new Q(
      a,
      s,
      e
    );
    return await r.init(), r;
  }
}
class W extends De {
  constructor() {
    super(...arguments);
    w(this, "data", {});
    w(this, "mapData", []);
    w(this, "pointData", []);
    w(this, "form");
    w(this, "hasLoad", !1);
    w(this, "isloading", !1);
    w(this, "entityService");
    w(this, "pointClicked", !1);
  }
  async onInit() {
    await super.onInit(), await this.model.embedView.init();
    const s = this.model.embedView.form;
    this.entityService = await ibiz.entityService.getService(
      s.appEntity.codeName,
      this.context
    ), this.form = new Se(s, this.context, {
      ...this.params
    }), await this.form.init(), this.dashboard.nerve.self.evt.on("mounted", () => {
      this.load();
    });
  }
  calcPercent(s, e, r = 1) {
    return s ? parseFloat((s * 100 / e).toFixed(r)) : 0;
  }
  calcViewParams() {
    super.calcViewParams(), this.dashboard.complete && (this.form.setContextOrParams(void 0, this.params, !0), this.load());
  }
  async load() {
    this.isloading = !0, this.data = await this.form.load(), this.data.zcrs = this.data.zcrs || 0, this.data.ycrs = this.data.ycrs || 0, this.data.qjrs = this.data.qjrs || 0, this.data.xjrs = this.data.xjrs || 0, this.data.zcl = this.calcPercent(this.data.zcrs, this.data.yzrs), this.data.ycl = this.calcPercent(this.data.ycrs, this.data.yzrs), this.data.qjl = this.calcPercent(this.data.qjrs, this.data.yzrs), this.data.xjl = this.calcPercent(this.data.xjrs, this.data.yzrs), await this.loadMapData(), this.hasLoad = !0, this.isloading = !1;
  }
  async loadMapData() {
    const e = (await this.entityService.exec(
      "FetchMapData",
      this.context,
      this.params
    )).data.map((n) => ({
      name: n.orgcode,
      value: this.calcPercent(Number(n.zcl), 1, 2),
      title: n.orgname,
      zcl: `${this.calcPercent(Number(n.zcl), 1, 2)}%`,
      zcrs: n.zcrs,
      yzrs: n.yzrs != null ? n.yzrs : "",
      zgrs: n.zgrs != null ? n.zgrs : "",
      jd: n.jd,
      wd: n.wd
    })), r = e.findIndex(
      (n) => n.name === this.params.orgcode
    );
    r !== -1 && (this.pointData = e.splice(r, 1)), this.mapData = e.length === 0 ? this.pointData : e;
  }
  onMapChange(s) {
    const e = `${s}`;
    this.mapData = [], this.pointData = [], this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        orgcode: e,
        tjfw: void 0
      },
      !0
    );
  }
  onPointClick(s) {
    console.log("pointClick"), this.pointClicked = !0, this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        tjfw: "20"
      },
      !0
    );
  }
  goBackFrominstitution() {
    this.pointClicked = !1, this.dashboard.setContextOrParams(
      void 0,
      {
        ...this.params,
        tjfw: void 0
      },
      !0
    );
  }
}
const Xe = ["#FF0700", "#FFF400", "#73A0FA"], Ze = {
  strMapCode: !0,
  visualMap: {
    text: ["\u9AD8", "\u4F4E"],
    min: 0,
    max: 100,
    rangeColor: Xe
  },
  pointSymbol: "pin"
}, et = "/assets/json/map/jiangsu/{id}.json";
async function tt(t) {
  return (await ibiz.net.axios({
    url: M.dir(et.replace("{id}", t))
  })).data;
}
function st(t, a) {
  const s = /* @__PURE__ */ new Map(), e = C(""), r = C([]);
  let n;
  const d = C(), f = (c) => {
    const m = {
      cityNames: {},
      noChild: c.features.length === 1
    };
    return c.features.forEach((x) => {
      const { adcode: l, name: h } = x.properties;
      m.cityNames[l] = h;
    }), m;
  }, o = async (c) => {
    if (s.has(c))
      return;
    const m = await tt(c);
    s.set(c, f(m)), ze(c, m);
  }, p = (c) => {
    const m = s.get(e.value);
    if (m)
      return m.cityNames[c];
  }, g = () => {
    const c = t(e.value);
    n.setOption(c), n.resize();
  }, v = async (c, m = !1) => {
    m || a("mapChange", { name: c }), s.has(c) || await o(c), e.value = c, r.value.push(c), g();
  }, u = () => {
    if (r.value.length > 1) {
      r.value.pop();
      const c = r.value.pop();
      v(c);
    }
  };
  return L(() => {
    n = Ve(d.value), window.addEventListener("resize", () => {
      n == null || n.resize();
    }), n.on("click", (c) => {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        a("pointClick", c.data);
        return;
      }
      c.name !== e.value && v(c.name);
    }), n.on("mouseover", function(c) {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        const m = c.dataIndex, x = n.getOption(), l = x.series[c.seriesIndex].data, h = x.series[c.seriesIndex].symbolSize;
        l[m].symbolSize = h + 10, n.setOption(x);
      }
    }), n.on("mouseout", function(c) {
      if (c.componentType === "series" && c.seriesType === "scatter") {
        const m = c.dataIndex, x = n.getOption(), l = x.series[c.seriesIndex].data;
        delete l[m].symbolSize, n.setOption(x);
      }
    });
  }), {
    chartRef: d,
    historyNames: r,
    currenName: e,
    changeMap: v,
    getCityName: p,
    goBack: u,
    refresh: g
  };
}
const at = D({
  name: "MapChart",
  props: {
    mapData: {
      type: Array,
      required: !0
    },
    pointData: {
      type: Array
    },
    options: {
      type: Object,
      default: () => ({})
    },
    defaultMapName: {
      type: String,
      required: !0
    }
  },
  setup(t, {
    emit: a
  }) {
    const s = S("map-chart"), e = R(() => Ie(Ze, t.options)), {
      chartRef: r,
      historyNames: n,
      changeMap: d,
      getCityName: f,
      goBack: o,
      refresh: p
    } = st((u) => {
      const {
        visualMap: c,
        pointSymbol: m
      } = e.value, x = {
        geo: {
          map: u
        },
        tooltip: {
          trigger: "item",
          textStyle: {
            color: "#fff",
            fontSize: 12
          },
          backgroundColor: "rgba(0, 0, 0, 0.47)",
          borderWidth: 0,
          extraCssText: "backdrop-filter: blur(3px);"
        },
        visualMap: {
          min: c.min,
          max: c.max,
          text: c.text,
          realtime: !1,
          hoverLink: !1,
          inRange: {
            color: c.rangeColor
          }
        },
        series: [
          {
            type: "map",
            map: u,
            nameProperty: e.value.strMapCode ? "adcodeStr" : "adcode",
            tooltip: {
              formatter: (l) => {
                const h = f(l.name), b = t.mapData.find((k) => k.name == l.name);
                if (!!b)
                  return `
                      <div style='display:flex;justify-content: center;'>
                        <span>${h}</span>
                      </div>
                      <div style='display:flex;justify-content: space-between;'>
                        <span style='margin-right: 16px;'>\u5728\u5C97\u4EBA\u6570/\u603B\u4EBA\u6570</span>
                        <span>${b.zgrs}/${b.yzrs}</span>
                      </div>
                    `;
              }
            },
            label: {
              show: !0,
              color: "#000000",
              fontSize: 11,
              formatter: (l) => f(l.name)
            },
            select: {
              disabled: !0
            },
            data: t.mapData.map((l) => ({
              name: l.name,
              value: l.value
            }))
          }
        ]
      };
      return t.pointData && x.series.push({
        type: "scatter",
        coordinateSystem: "geo",
        symbol: m,
        symbolSize: 20,
        visualMap: !1,
        itemStyle: {
          color: "#FF1D00"
        },
        label: {
          show: !0,
          color: "#000000",
          fontSize: 10,
          textShadowBlur: 0,
          formatter: (l) => l.data.title,
          position: "left",
          offset: [10, -15]
        },
        tooltip: {
          formatter: (l) => {
            const h = l.data;
            return `
                    <div style='display:flex;justify-content: center;'>
                      <span>${h.title}</span>
                    </div>
                    <div style='display:flex;justify-content: space-between;'>
                      <span style='margin-right: 16px;'>\u5728\u5C97\u4EBA\u6570/\u603B\u4EBA\u6570</span>
                      <span>${h.zgrs}/${h.yzrs}</span>
                    </div>
                  `;
          }
        },
        data: t.pointData.map((l) => ({
          ...l,
          value: [Number(l.jd), Number(l.wd)],
          visualMap: !1
        }))
      }), x;
    }, (u, c) => {
      u === "mapChange" ? a("mapChange", c.name) : a(u, c);
    });
    L(() => {
      d(t.defaultMapName, !0);
    });
    const {
      mapData: g,
      pointData: v
    } = ie(t);
    return _([g, v], () => {
      p();
    }), {
      ns: s,
      chartRef: r,
      historyNames: n,
      goBack: o
    };
  },
  render() {
    return i("div", {
      class: this.ns.b()
    }, [i("div", {
      class: this.ns.e("chart"),
      ref: "chartRef"
    }), this.historyNames.length > 1 && i("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.goBack();
        }
      }
    }, ["\u8FD4\u56DE"])]);
  }
}), it = `image://${M.dir("/assets/img/fiveStars.png")}`, rt = D({
  name: "PortalMapArea",
  props: {
    modelData: {
      type: ke,
      required: !0
    },
    controller: {
      type: W,
      required: !0
    }
  },
  setup(t) {
    const a = re(t.controller), s = S("portal-map-area");
    return {
      c: a,
      ns: s
    };
  },
  render() {
    if (!this.c.hasLoad)
      return;
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return i("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [this.c.isloading ? i("i-spin", {
      attrs: {
        size: "large",
        fix: !0
      }
    }) : null, i("div", {
      class: this.ns.e("left")
    }), i("div", {
      class: this.ns.e("center")
    }, [i("div", {
      class: this.ns.e("title")
    }, [`${this.c.data.orgname} \u2014 ${this.c.data.yzrs}\u4EBA`]), i(at, {
      class: this.ns.e("map"),
      attrs: {
        mapData: this.c.mapData,
        pointData: this.c.pointData,
        defaultMapName: this.c.params.orgcode,
        options: {
          pointSymbol: it
        }
      },
      on: {
        mapChange: (a) => {
          this.c.onMapChange(a);
        },
        pointClick: (a) => {
          this.c.onPointClick(a);
        }
      }
    }), this.c.pointClicked && i("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.c.goBackFrominstitution();
        }
      }
    }, ["\u8FD4\u56DE"])]), i("div", {
      class: this.ns.e("right")
    })]);
  }
});
class nt {
  constructor() {
    w(this, "component", rt);
  }
  async createController(a, s, e) {
    const r = new W(
      a,
      s,
      e
    );
    return await r.init(), r;
  }
}
class ot extends _e {
  constructor() {
    super(...arguments);
    w(this, "unit", "");
    w(this, "isPercent", !1);
    w(this, "maxNum", 0);
  }
  async onInit() {
    var s;
    await super.onInit(), (s = this.model.source.getPSDEListDataItems()) == null || s.forEach((e) => {
      e.name === "unit" && (this.unit = e.format), e.name === "percent" && (this.isPercent = !0);
    });
  }
  async afterLoad(s) {
    return super.afterLoad(s), this.maxNum = 0, this.items.forEach((e) => {
      this.isPercent ? (e.num = (parseFloat(e.num) * 100).toFixed(2), e.num === "0.00" && (e.num = "0"), e.percent = Number(e.num)) : e.num > this.maxNum && (this.maxNum = e.num);
    }), this.isPercent || this.items.forEach((e) => {
      e.percent = this.maxNum ? e.num * 100 / this.maxNum : 0;
    }), s;
  }
}
function lt(t, a, s, e = {}) {
  return ce(t, () => {
    const r = new ot(a, s, e);
    return de(t, "mdCtrlActiveMode", r.setMdCtrlActiveMode.bind(r)), r;
  });
}
function ct(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((n) => e.srfkey === n.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const n = t.selectedData;
      r === -1 ? n.push(e) : n.splice(r, 1), t.onSelectionChange(n);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const dt = D({
  name: "KqqkListControl",
  props: {
    modelData: {
      type: H,
      required: !0
    },
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object,
      default: () => ({})
    },
    mdCtrlActiveMode: {
      type: Number,
      default: 2
    },
    isSelectFirstDefault: {
      type: Boolean,
      required: !1
    },
    defaultSelectKeys: {
      type: Array,
      required: !1
    }
  },
  setup(t) {
    const {
      proxy: a
    } = j(), s = S("kqqk-list"), e = lt(a, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: n
    } = ct(e), d = (o, p) => {
      const g = e.selectedData.findIndex((u) => u.srfkey === o.srfkey), v = [s.b("item"), s.is("active", g !== -1)];
      return i("div", {
        class: v,
        key: o.srfkey + p,
        on: {
          click: () => r(o),
          dblclick: () => n(o)
        }
      }, [i("span", {
        class: s.be("item", "title")
      }, [o.title]), i("div", {
        class: s.be("item", "progress")
      }, [i("span", {
        style: `width:${o.percent}%;`,
        class: s.be("item", "progress-bar")
      }), i("span", {
        class: s.be("item", "progress-text")
      }, [o.num, e.unit])])]);
    };
    return {
      c: e,
      ns: s,
      renderListContent: () => e.items.map((o, p) => d(o, p))
    };
  },
  render() {
    return i("control-layout", {
      class: this.ns.b(),
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderListContent()]]);
  }
});
class ut {
  constructor() {
    w(this, "component", dt);
  }
}
function ht(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((n) => e.srfkey === n.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const n = t.selectedData;
      r === -1 ? n.push(e) : n.splice(r, 1), t.onSelectionChange(n);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const F = D({
  name: "ListExpControl",
  props: {
    modelData: {
      type: H,
      required: !0
    },
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object,
      default: () => ({})
    },
    mdCtrlActiveMode: {
      type: Number,
      default: 2
    },
    isSelectFirstDefault: {
      type: Boolean,
      required: !0
    },
    defaultSelectKeys: {
      type: Array,
      required: !1
    },
    isExpView: {
      type: Boolean,
      required: !1
    }
  },
  setup(t) {
    const {
      proxy: a
    } = j(), s = S("control-list"), e = ue(a, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: n
    } = ht(e);
    let d = !0;
    L(() => {
      _(() => e, (u, c) => {
        if (t.isExpView && u && u !== c) {
          let m = e.items[0];
          if (t.defaultSelectKeys && t.defaultSelectKeys.length > 0) {
            const x = e.items.find((l) => l.srfkey === t.defaultSelectKeys[0]);
            x && (m = x);
          }
          m && e.onSelectionChange([m]);
        }
      }, {
        immediate: !0
      }), _(() => e.items.length, (u) => {
        t.isExpView && u && e.onSelectionChange([e.items[0]]);
      }, {
        immediate: !0,
        deep: !0
      });
    });
    const f = (u) => {
      e.selectedData.length === 0 && (e.selectedData = [{
        srfkey: e.items[0].srfkey
      }]);
      const c = e.selectedData.findIndex((l) => l.srfkey === u.srfkey), m = () => {
        d = !1, delete e.context.n_orgid_eq, e.context.calendarcaption = u.deptname, r(u);
      }, x = [s.b("item"), s.is("active", c !== -1 && d === !1)];
      return i("div", {
        class: x,
        on: {
          click: () => m(),
          dblclick: () => n(u)
        }
      }, [e.layoutPanelProvider ? i(e.layoutPanelProvider.component, {
        props: {
          modelData: e.model,
          context: e.context,
          params: e.params,
          inputData: u
        }
      }) : `${u.deptname}`]);
    }, o = () => e.model.source.enableGroup ? i("el-collapse") : e.items.map((u) => f(u)), p = () => Object.is(e.total, e.items.length) ? null : i("div", {
      class: s.e("no-data")
    }, [i("div", ["\u6682\u65E0\u6570\u636E"])]), g = (u) => {
      d = !0, Object.assign(e.context, {
        n_orgid_eq: e.params.n_orgid_eq
      }), e.context.calendarcaption = u.deptname, r(u);
    }, v = () => {
      const u = [s.b("item"), s.is("active", d === !0)];
      return e.items.length > 0 ? i("div", {
        class: u,
        on: {
          click: () => g({
            deptid: e.params.n_orgid_eq,
            orgid: e.params.n_orgid_eq,
            srfkey: e.params.n_orgid_eq,
            deptname: e.context.selectedDeptName,
            sysdepartment: void 0
          })
        }
      }, ["\u5168\u90E8"]) : null;
    };
    return K(() => {
      d && (g({
        deptid: e.params.n_orgid_eq,
        orgid: e.params.n_orgid_eq,
        srfkey: e.params.n_orgid_eq,
        deptname: e.context.selectedDeptName,
        sysdepartment: void 0
      }), e.selectedData.length = 0);
    }), _(() => e.items, () => {
      K(() => {
        d = !0, Object.assign(e.context, {
          n_orgid_eq: e.params.n_orgid_eq
        }), g({
          deptid: e.params.n_orgid_eq,
          orgid: e.params.n_orgid_eq,
          srfkey: e.params.n_orgid_eq,
          deptname: e.context.selectedDeptName,
          sysdepartment: void 0
        }), e.selectedData.length = 0;
      });
    }, {
      immediate: !0,
      deep: !0
    }), {
      c: e,
      ns: s,
      renderListContent: o,
      renderLoadMore: p,
      renderAll: v,
      renderAllClick: g,
      isSelectAll: d
    };
  },
  render() {
    return i("control-layout", {
      class: [this.ns.b()],
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderAll(), this.renderListContent(), this.renderLoadMore()]]);
  }
});
const pt = D({
  name: "ListExpSelectTreeView",
  components: {
    Treeselect: Ae,
    ListExpControl: F
  },
  props: {
    context: Object,
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: a
    } = j(), s = he(a, t.modelPath), e = C(""), r = C([]), n = S("list-exp-select-tree");
    s.context.isRouter === !0 && s.nerve.self.evt.on("created", () => {
      t.srfnav && (s.navItem.key = t.srfnav, r.value = [t.srfnav]), pe(ne(s.navItem, "key"), a, e);
    });
    const d = [`${s.context.srforgid}`];
    s.context.srforgid && (s.context.selectedDeptName = s.context.srforgname, Object.assign(s.params, {
      n_orgid_eq: s.context.srforgid
    }));
    const f = (v) => ({
      id: v.id,
      label: v.text,
      children: v.children
    }), o = (v) => {
      s.context.selectedDeptName = v.text, Object.assign(s.params, {
        n_orgid_eq: v.value
      }), s.nerve.list.call.load();
    }, p = C(!1);
    return {
      c: s,
      defaultSelectKeys: r,
      routeViewKey: e,
      normalizer: f,
      select: o,
      dataItems: [],
      isLoadCodeList: p,
      value: d,
      ns: n
    };
  },
  render() {
    if (this.c.complete) {
      const t = this.c.context.isRouter === !0, {
        listExpBar: a
      } = this.c.model, {
        list: s
      } = a, e = this.c.model.codeName;
      if (this.dataItems.length === 0 && e === "SysDepartmentKqAYTJListExp1View") {
        const {
          codeName: r
        } = this.c.model.source.getQuickGroupPSCodeList();
        (async (d) => {
          this.dataItems = await ibiz.codeListService.get(d, this.c.context, {
            size: 1e3
          }), this.isLoadCodeList = !0;
        })(r);
      }
      return i("exp-view-base", {
        class: [this.ns.b()],
        attrs: {
          controller: this.c,
          expBarModel: this.c.model.listExpBar
        },
        scopedSlots: {
          default: () => i(F, {
            attrs: {
              modelData: s,
              context: this.c.context,
              params: this.c.params,
              isExpView: !0,
              isSelectFirstDefault: !1,
              mdCtrlActiveMode: 1,
              defaultSelectKeys: this.defaultSelectKeys
            },
            on: {
              neuronInit: this.c.nerve.onNeuronInit(s.name)
            }
          }),
          searchForm: () => this.isLoadCodeList && e === "SysDepartmentKqAYTJListExp1View" ? i("div", {
            class: "ibiz-selectTree"
          }, [i("treeselect", {
            attrs: {
              value: this.value,
              options: this.dataItems,
              normalizer: this.normalizer,
              clearable: !1,
              "default-expand-level": 1
            },
            on: {
              select: this.select
            }
          })]) : e === "SysDepartmentkqBmtjListExpView" ? i("div", {
            class: "ibiz-bmtj"
          }, [i("div", {
            class: "ibiz-bmyj-content"
          }, [this.c.context.srforgname])]) : null,
          expView: () => s.navView ? t ? this.routeViewKey ? i("router-view", {
            key: this.routeViewKey
          }) : null : i("ViewShell", {
            attrs: {
              context: this.c.navItem.context,
              params: this.c.navItem.params,
              modal: {
                mode: se.EMBED
              },
              modelPath: s.navView.source.modelPath
            },
            key: this.c.navItem.key
          }) : null
        }
      });
    }
    return null;
  }
});
class mt {
  constructor() {
    w(this, "component", "ListExpSelectTreeView");
  }
}
class ft {
  constructor() {
    w(this, "component", "BYQKEditView");
  }
}
class gt {
  constructor() {
    w(this, "formEditor", "KqBase64ImageUpload");
    w(this, "gridEditor", "IBizGridFileUpload");
  }
  async createController(a, s) {
    const e = new Me(a, s);
    return await e.init(), e;
  }
}
const vt = D({
  name: "KqBase64ImageUpload",
  props: me(),
  emits: fe(),
  setup(t) {
    var n, d, f;
    const a = S("kq-base64-image-upload"), s = ((n = t.controller.model) == null ? void 0 : n.width) || "auto", e = ((d = t.controller.model) == null ? void 0 : d.height) || "150px", r = ((f = t.controller.editorParams) == null ? void 0 : f["justify-content"]) || "center";
    return () => i("div", {
      class: a.b(),
      style: {
        width: s,
        height: e,
        justifyContent: r
      }
    }, [i("img", {
      attrs: {
        src: t.value
      },
      class: a.e("image")
    })]);
  }
});
class yt {
  constructor() {
    w(this, "component", "KqdwCustomPickupTreeView");
  }
}
const wt = D({
  name: "KqdwCustomPickupTreeView",
  props: {
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const a = S("kqdw-custom-pickup-tree-view"), {
      proxy: s
    } = j(), e = ge(s, t.modelPath), r = C(null);
    let n = null;
    const d = C([]), f = C({}), o = C([]), p = C([]), g = C(""), v = C([]), u = async (y) => {
      await n.loadNodes(y), f.value = y, o.value.push(y);
    };
    return _(() => e.complete, async (y, q) => {
      var P;
      if (y !== q && y) {
        await e.model.pickupViewPanel.embedView.init();
        const O = (P = e.model.pickupViewPanel.embedView.source.getPSControls()) == null ? void 0 : P.find((V) => V.controlType === "TREEVIEW");
        O || console.warn("\u672A\u627E\u5230[\u6811(tree)]\u90E8\u4EF6"), r.value = new Pe(O), await r.value.init(), n = ve(s, r.value, t.context, t.params), await n.init();
        const I = await n.load();
        if (I.length > 0 && (d.value = I, f.value.children = I, o.value.push({
          text: "\u5F53\u524D\u9662",
          children: I
        })), e.params.selectedData) {
          const V = JSON.parse(e.params.selectedData);
          V.length > 0 && (p.value = V.map((T) => ({
            srfkey: T.srfkey,
            srfmajortext: T.srfmajortext,
            value: T.srfkey,
            text: T.srfmajortext,
            dxlx: T.dxlx
          })));
        }
      }
    }), {
      ns: a,
      c: e,
      treeDatas: d,
      currentTreeNode: f,
      clickTreeNode: u,
      treeHistory: o,
      isChecked: (y) => p.value.findIndex((P) => P.value === y.value) !== -1,
      selectTreeNodes: p,
      handleSelect: (y) => {
        const q = p.value.findIndex((P) => P.value === y.value);
        q === -1 ? p.value.push(y) : p.value.splice(q, 1);
      },
      clickHistory: (y) => {
        const q = o.value.findIndex((P) => P.value === y.value);
        o.value = o.value.slice(0, q + 1), f.value = y;
      },
      clearAll: () => {
        p.value = [];
      },
      onOkButtonClick: () => {
        const y = p.value.map((q) => {
          var P;
          return {
            srfkey: q.value,
            srfmajortext: q.text,
            dxlx: (P = q.deData) == null ? void 0 : P.dxlx
          };
        });
        e.closeView({
          ok: !0,
          data: y
        });
      },
      query: g,
      queryChange: (y) => {
        y.target && (g.value = y.target.value, Object.assign(e.params, {
          query: g.value
        }));
      },
      search: async () => {
        const y = await (n == null ? void 0 : n.load());
        y && (v.value = y);
      },
      queryTreeNodeList: v
    };
  },
  render() {
    return i("div", {
      class: this.ns.b()
    }, [i("div", {
      class: "top"
    }, [i("div", {
      class: "left"
    }, [i("div", {
      class: "title"
    }, ["\u672A\u9009\u62E9\u7528\u6237"]), i("div", {
      class: "search"
    }, [i("i-input", {
      attrs: {
        value: this.query,
        search: !0,
        placeholder: "\u8BF7\u8F93\u5165"
      },
      on: {
        "on-change": this.queryChange,
        "on-enter": this.search,
        "on-search": this.search
      }
    })]), i("div", {
      class: "cascader"
    }, [i("div", {
      class: "history"
    }, [!this.query && this.treeHistory.length > 0 && this.treeHistory.map((t, a) => i("span", {
      class: "content"
    }, [i("span", {
      on: {
        click: () => this.clickHistory(t)
      }
    }, [t.text]), a < this.treeHistory.length - 1 && i("span", {
      class: "icon"
    }, [">"])]))]), i("div", {
      class: "children"
    }, [this.query ? this.queryTreeNodeList.map((t) => i("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? i("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : i("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), i("span", {
      class: "text"
    }, [t.text])])) : this.currentTreeNode && this.currentTreeNode.children && this.currentTreeNode.children.map((t) => i("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? i("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : i("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), i("span", {
      class: "text",
      on: {
        click: () => this.clickTreeNode(t)
      }
    }, [t.text])]))])])]), i("div", {
      class: "right"
    }, [i("div", {
      class: "title"
    }, [i("span", [" \u5DF2\u9009\u62E9\u7528\u6237"]), " ", i("span", {
      class: "clear",
      on: {
        click: () => this.clearAll()
      }
    }, ["\u5168\u90E8\u6E05\u9664"])]), i("div", {
      class: "list"
    }, [this.selectTreeNodes.map((t) => i("div", {
      class: "node"
    }, [i("span", [t.text]), " ", i("span", {
      class: "remove",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["x"])]))])])]), i("div", {
      class: "bottom"
    }, [i("i-button", {
      on: {
        click: () => {
          this.onOkButtonClick();
        }
      }
    }, ["\u786E\u5B9A"]), i("i-button", {
      on: {
        click: () => {
          this.c.onCancelButtonClick();
        }
      }
    }, ["\u53D6\u6D88"])])]);
  }
});
class bt {
  constructor() {
    w(this, "component", "KqbcFormMDCtrl");
  }
  async createController(a, s, e) {
    const r = new Ee(a, s, e);
    return await r.init(), r;
  }
}
const Ct = D({
  name: "UserTabPageExp",
  props: {
    routeMsgs: {
      type: Array,
      required: !0
    },
    currentKey: {
      type: String,
      required: !0
    }
  },
  emits: ["tab-delete", "tab-click", "close-all", "close-other"],
  setup(t, {
    emit: a
  }) {
    const s = S("user-tab-page-exp"), e = C("0"), r = [{
      text: "\u5173\u95ED\u6240\u6709",
      value: "closeAll"
    }, {
      text: "\u5173\u95ED\u5176\u4ED6",
      value: "closeOther"
    }];
    return _(() => t.currentKey, (o, p) => {
      const g = t.routeMsgs.findIndex((v) => v.key === o);
      g !== -1 && (e.value = `${g}`);
    }), {
      ns: s,
      tabsValue: e,
      actions: r,
      changePage: (o) => {
        e.value = o, a("tab-click", +o);
      },
      onClose: (o) => {
        a("tab-delete", +o);
      },
      handleCommand: (o) => {
        o === "closeAll" ? a("close-all") : o === "closeOther" && a("close-other");
      }
    };
  },
  render() {
    var t;
    return i("div", {
      class: this.ns.b()
    }, [i("div", {
      class: this.ns.e("left")
    }, [i("i-tabs", {
      attrs: {
        type: "card",
        closable: !0
      },
      on: {
        "on-click": this.changePage,
        "on-tab-remove": this.onClose
      },
      model: {
        value: this.tabsValue,
        callback: (a) => {
          this.tabsValue = a;
        }
      }
    }, [(t = this.routeMsgs) == null ? void 0 : t.map((a, s) => i("i-tab-pane", {
      key: a.key,
      attrs: {
        name: `${s}`,
        label: a.caption
      }
    }))])])]);
  }
});
class xt {
  constructor() {
    w(this, "component", "QytjGridView");
  }
}
class kt extends Te {
  constructor() {
    super(...arguments);
    w(this, "qjgrid");
    w(this, "ycgrid");
  }
  inclusive(s) {
    return s === "ycgrid" || s === "qjgrid" || super.inclusive(s);
  }
  connect(s, e) {
    super.connect(s, e), s === "qjgrid" && (this.qjgrid = e), s === "ycgrid" && (this.ycgrid = e);
  }
}
class Pt extends je {
  constructor() {
    super(...arguments);
    w(this, "activeRadio", "qyry");
    w(this, "selectTimeFrame", A().format("YYYY-MM"));
    w(this, "activeGrid", !0);
  }
  createNerve() {
    return new kt(this);
  }
  async onInit() {
    await super.onInit();
    const s = $(this.model.source, "BytjYcry");
    this.ycgrid = new U(s), await this.ycgrid.init();
    const e = $(this.model.source, "BytjQjry");
    this.qjgrid = new U(e), await this.qjgrid.init();
  }
  load() {
    return this.params.n_kqny_eq || this.setTimeFrameParams(), this.activeRadio === "ycry" ? this.nerve.ycgrid.call.load() : this.activeRadio === "qjry" ? this.nerve.qjgrid.call.load() : this.nerve.grid.call.load();
  }
  setSort() {
    let s = null;
    if (this.activeRadio === "ycry")
      s = this.ycgrid.source.getPSControlParam();
    else if (this.activeRadio === "qjry")
      s = this.qjgrid.source.getPSControlParam();
    else {
      const e = this.model.source.getPSAppViewNavParams();
      let r = {};
      be(e) && (r = Oe(e, this.context, this.params)), Object.assign(this.params, r);
    }
    s && s.ctrlParams.SORT && (this.params.sort = s.ctrlParams.SORT);
  }
  setActiveRadio(s) {
    this.activeRadio = s, this.setTimeFrameParams(), this.load();
  }
  setSelectTimeFrame(s) {
    this.selectTimeFrame = s, this.setTimeFrameParams(), this.load();
  }
  setTimeFrameParams() {
    this.params.n_kqny_eq = this.selectTimeFrame, this.setSort();
  }
  async exportData(s) {
    if (this.activeRadio === "ycry") {
      const { ycgrid: e } = this.nerve;
      await e.call.exportData(s);
    } else if (this.activeRadio === "qjry") {
      const { qjgrid: e } = this.nerve;
      await e.call.exportData(s);
    } else {
      const { grid: e } = this.nerve;
      await e.call.exportData(s);
    }
  }
}
function qt(t, a) {
  return ye(
    t,
    (s, e) => new Pt(a, s, e)
  );
}
const Dt = D({
  name: "QytjGridView",
  props: {
    context: Object,
    params: {
      type: Object,
      default: () => ({})
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: a
    } = j(), s = S("qytj-grid-view"), e = qt(a, t.modelPath);
    oe(() => e.refresh());
    const r = R(() => e.activeRadio);
    return _(() => t.context, () => {
      const n = e.context.n_orgid_eq;
      n ? Object.assign(e.params, {
        n_orgid_eq: n
      }) : e.params.n_orgid_eq && delete e.params.n_orgid_eq;
    }, {
      deep: !0,
      immediate: !0
    }), {
      c: e,
      ns: s,
      activeRadio: r
    };
  },
  render(t) {
    let a = null, s = null, e = null;
    if (this.c.complete) {
      const {
        grid: r
      } = this.c.model;
      if (this.c.providers[r.name] && (a = t(this.c.providers[r.name].component, {
        key: "grid",
        class: [this.ns.e("grid"), this.ns.is("active", this.activeRadio === "qyry")],
        props: {
          modelData: r,
          context: this.c.context,
          params: this.c.params
        },
        on: {
          neuronInit: this.c.nerve.onNeuronInit(r.name)
        }
      })), this.activeRadio === "ycry" || this.c.activeGrid) {
        const {
          ycgrid: n
        } = this.c;
        this.c.providers.grid && (s = t(this.c.providers.grid.component, {
          key: "ycgrid",
          class: [this.ns.e("grid"), this.ns.is("active", this.activeRadio === "ycry")],
          props: {
            modelData: n,
            context: this.c.context,
            params: this.c.params,
            "grid-row-active-mode": this.c.model.gridRowActiveMode
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(n.name)
          }
        }));
      }
      if (this.activeRadio === "qjry" || this.c.activeGrid) {
        const {
          qjgrid: n
        } = this.c;
        this.c.providers.grid && (e = t(this.c.providers.grid.component, {
          key: "qjgrid",
          class: [this.ns.e("grid"), this.ns.is("active", this.activeRadio === "qjry")],
          props: {
            modelData: n,
            context: this.c.context,
            params: this.c.params,
            "grid-row-active-mode": this.c.model.gridRowActiveMode
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(n.name)
          }
        }));
      }
    }
    return t("view-base", {
      class: [this.ns.b()],
      attrs: {
        controller: this.c
      },
      scopedSlots: {
        caption: () => {
          const r = `${this.c.context.calendarcaption || this.c.context.srfpersonname}\u7EDF\u8BA1`;
          return t("div", {
            class: this.ns.b("caption")
          }, [t("span", {
            class: this.ns.be("caption", "text"),
            attrs: {
              title: r
            }
          }, [r])]);
        },
        toolbar: () => [t("div", {
          class: [this.ns.b("exp")]
        }, [t("i-radio-group", {
          attrs: {
            value: this.activeRadio,
            type: "button"
          },
          on: {
            "on-change": (r) => {
              this.c.setActiveRadio(r);
            }
          }
        }, [t("i-radio", {
          attrs: {
            label: "qyry"
          }
        }, ["\u5168\u9662\u4EBA\u5458"]), t("i-radio", {
          attrs: {
            label: "ycry"
          }
        }, ["\u5F02\u5E38\u4EBA\u5458"]), t("i-radio", {
          attrs: {
            label: "qjry"
          }
        }, ["\u8BF7\u5047\u4EBA\u5458"])])])],
        quickSearch: () => [this.c.model.toolbar && t("view-toolbar", {
          attrs: {
            modelData: this.c.model.toolbar,
            toolbarState: this.c.toolbarState,
            viewMode: this.c.modal.mode
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(this.c.model.toolbar.source.name)
          }
        }), t("div", {
          class: [this.ns.b("search")]
        }, [t("div", {
          class: [this.ns.be("search", "time-frame")]
        }, [t("i-CalendarPicker", {
          attrs: {
            value: this.c.selectTimeFrame,
            clearable: !1,
            type: "month",
            format: "yyyy-MM",
            placeholder: "\u8BF7\u9009\u62E9"
          },
          on: {
            "on-change": (r) => {
              this.c.setSelectTimeFrame(r);
            }
          },
          style: "width: 110px;"
        })])])]
      }
    }, [a, s, e]);
  }
});
class St extends ae {
  custom(a, s, e) {
    if (a.id === "performanceappraisal") {
      const r = { userid: s == null ? void 0 : s.srfjxuserid }, n = window.Environment, d = JSON.stringify(r), f = window.btoa(d), o = `${n.jxkhUrl}param=${f}`;
      window.open(o, "_blank");
    } else
      throw ibiz.log.warn("custom", a, s, e), new Error("\u672A\u5B9E\u73B0");
  }
}
const Lt = {
  mateUrl: import.meta.url,
  install(t) {
    new St(), t.component("UserTabPageExp", Ct), t.component("UserIndexView", He), t.component("UserAppLayout", Qe), t.component("ListExpSelectTreeView", pt), t.component("ListExpControl", F), t.component("ChangePassword", Y), t.component(
      "BYQKEditView",
      () => import("./byqk-edit-view.fea98c06.js")
    ), t.component(
      "KqbcFormMDCtrl",
      () => import("./kqbc-form-mdctrl.b92c2279.js")
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_JskqIndexView",
      new Ne()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ListExpSelectTreeView",
      new mt()
    ), M.loadStyle(["/style.css"]), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_JskqWebPortalSearchHeader",
      new Je()
    ), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_jskqWebPortalMapArea",
      new nt()
    ), ibiz.register.control.register(
      "LIST_RENDER_JskqWebKqqkList",
      new ut()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ByqkCustomEditView",
      new ft()
    ), t.component("KqBase64ImageUpload", vt), ibiz.register.editor.register(
      "PICTURE_ONE_Base64ImageUpload",
      new gt()
    ), t.component("KqdwCustomPickupTreeView", wt), ibiz.register.view.register(
      "VIEW_CUSTOM_KqdwCustomPickupTreeView",
      new yt()
    ), t.component("QytjGridView", Dt), ibiz.register.view.register(
      "VIEW_CUSTOM_QytjGridView",
      new xt()
    ), ibiz.register.formDetail.register("MDCTRL", new bt());
  }
};
export {
  Lt as default
};
