var W = Object.defineProperty;
var Y = (t, n, s) => n in t ? W(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s;
var g = (t, n, s) => (Y(t, typeof n != "symbol" ? n + "" : n, s), s);
import { PluginStaticResource as J, ViewMode as G } from "@ibiz-template/runtime";
import { ref as C, watch as P, defineComponent as q, getCurrentInstance as M, onMounted as V, computed as N, h as a, toRefs as R, reactive as Q, nextTick as O, toRef as X } from "vue";
import { useRouter as Z, useRoute as ee, useIndexViewController as te, useNamespace as D, useControlController as se, usePropsWatch as ae, useListController as ne, useListExpViewController as re, useRouteKey as ie, getUploadProps as oe, getEditorEmits as le, useMPickupViewController as ce, useTreeController as de } from "@ibiz-template/vue-util";
import { createUUID as K } from "qx-util";
import { IndexViewModel as ue, PortletPartModel as pe, ViewPortletModel as he, ListModel as B, TreeModel as me } from "@ibiz-template/model";
import T from "dayjs";
import { CustomPortletController as fe, ViewPortletController as ve, EditFormController as ye, ListController as ge, UploadEditorController as xe } from "@ibiz-template/controller";
import { init as U, registerMap as Ce } from "echarts";
import { mergeDeepLeft as ke } from "ramda";
import { Treeselect as we } from "@riophae/vue-treeselect";
const _ = new J(import.meta.url);
class be {
  constructor() {
    g(this, "component", "UserIndexView");
  }
}
const qe = (t) => {
  const { view2: n, params2: s, params1: e } = t.params;
  if (!n)
    return "";
  let r = s.replace(
    new RegExp(";srfnav=[^;=]*$|(?<=;)srfnav=[^;=]*;|^srfnav=[^;=]*;|^srfnav=[^;=]*$", "g"),
    ""
  );
  return r = r || ibiz.env.routePlaceholder, `/${e}/${n}/${r}`;
}, De = (t) => {
  const { view1: n, appContext: s } = t.params;
  return `/${s}/${n}/${ibiz.env.routePlaceholder}`;
};
function Pe(t, n) {
  const s = Z(t), e = C(""), r = C(""), i = C([]), d = C([]), m = (h) => {
    h.forEach((p) => {
      const l = i.value.indexOf(p);
      if (l !== -1) {
        i.value.splice(l, 1);
        const c = d.value.findIndex((f) => f.key === p);
        d.value.splice(c, 1);
      }
    });
  };
  return P(
    () => t.$route.path,
    (h, p) => {
      if (h !== p) {
        const l = ee(t);
        e.value = qe(l), r.value = De(l);
        const c = d.value.find(
          (f) => f.key === e.value
        );
        if (c)
          c.fullPath = l.fullPath;
        else {
          if (h === r.value)
            return;
          d.value.push({
            key: e.value,
            fullPath: l.fullPath,
            modelPath: "",
            caption: ""
          });
        }
      }
    },
    { deep: !0, immediate: !0 }
  ), P(
    e,
    (h, p) => {
      if (h !== p && h) {
        const l = i.value.indexOf(h);
        l === -1 || i.value.splice(l, 1), i.value.unshift(h);
      }
    },
    { immediate: !0 }
  ), {
    currentKey: e,
    keyHistory: i,
    routeMsgs: d,
    updateRouteMsg: (h, p) => {
      const l = d.value.find((c) => c.key === e.value);
      l && (p.caption && (l.caption = p.caption), p.modelPath && (l.modelPath = p.modelPath));
    },
    closeView: (h = e.value) => {
      m([h]);
      const p = i.value[0];
      if (!p)
        n.model.source.blankMode ? (window.callback && window.callback(), window.close()) : (e.value = "", s.push(r.value));
      else {
        const l = d.value.find((c) => c.key === p);
        s.push(l.fullPath);
      }
    },
    deleteRouteCache: m
  };
}
const Se = /* @__PURE__ */ q({
  __name: "index-view",
  props: {
    context: null,
    params: { default: () => ({}) },
    modelPath: null
  },
  setup(t) {
    const n = t, { proxy: s } = M(), e = te(s, n.modelPath), {
      currentKey: r,
      keyHistory: i,
      routeMsgs: d,
      updateRouteMsg: m,
      closeView: o,
      deleteRouteCache: u
    } = Pe(s, e), h = C(K()), p = (v) => {
      const k = r.value;
      v.evt.on("closeView", () => {
        o(k);
      }), v.evt.on("setTitle", (I) => {
        m(k, { caption: I });
      });
    };
    V(() => {
      setTimeout(() => {
        const v = document.querySelector(".app-loading-x");
        v && (v.style.display = "none");
      }, 300);
    });
    const l = (v) => {
      m(r.value, v);
    }, c = (v) => {
      e.collapseChange = v;
    }, f = () => {
      u(i.value.slice(0)), h.value = K();
    };
    window.onpopstate = () => {
      u([i.value[1]]);
    };
    const y = N(() => {
      const v = d.value.find((k) => k.key === r.value);
      return (v == null ? void 0 : v.modelPath) || "";
    });
    return { __sfc: !0, props: n, proxy: s, c: e, currentKey: r, keyHistory: i, routeMsgs: d, updateRouteMsg: m, closeView: o, deleteRouteCache: u, appKeepAliveKey: h, onCreated: p, onViewFound: l, collapseChange: c, onMenuRouteChange: f, currentPath: y };
  }
});
function _e(t, n, s, e, r, i, d, m) {
  var o = typeof t == "function" ? t.options : t;
  n && (o.render = n, o.staticRenderFns = s, o._compiled = !0), e && (o.functional = !0), i && (o._scopeId = "data-v-" + i);
  var u;
  if (d ? (u = function(l) {
    l = l || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !l && typeof __VUE_SSR_CONTEXT__ < "u" && (l = __VUE_SSR_CONTEXT__), r && r.call(this, l), l && l._registeredComponents && l._registeredComponents.add(d);
  }, o._ssrRegister = u) : r && (u = m ? function() {
    r.call(
      this,
      (o.functional ? this.parent : this).$root.$options.shadowRoot
    );
  } : r), u)
    if (o.functional) {
      o._injectStyles = u;
      var h = o.render;
      o.render = function(c, f) {
        return u.call(f), h(c, f);
      };
    } else {
      var p = o.beforeCreate;
      o.beforeCreate = p ? [].concat(p, u) : [u];
    }
  return {
    exports: t,
    options: o
  };
}
var Me = function() {
  var n = this, s = n._self._c, e = n._self._setupProxy;
  return s("UserAppLayout", { attrs: { "is-complete": e.c.complete, model: e.c.model }, on: { onCollapseChange: e.collapseChange } }, [e.c.complete ? [e.c.complete ? s("AppMenu", { 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" }) : n._e(), s("AppKeepAlive", { key: e.appKeepAliveKey, attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1)] : n._e()], 2);
}, Ve = [], Ie = /* @__PURE__ */ _e(
  Se,
  Me,
  Ve,
  !1,
  null,
  null,
  null,
  null
);
const Ee = Ie.exports;
function $(t, n) {
  return a("div", {
    class: t.e("logo")
  }, [a("img", {
    class: t.e("logo-img"),
    attrs: {
      src: _.dir("/assets/img/jh.png")
    }
  }), a("div", {
    class: t.e("logo-caption")
  }, [n.caption])]);
}
const Le = q({
  name: "UserAppLayout",
  props: {
    model: {
      type: ue,
      required: !0
    },
    isComplete: {
      type: Boolean,
      default: !1
    }
  },
  setup(t, {
    emit: n,
    slots: s
  }) {
    const e = D("layout"), r = C(!1), i = () => {
      r.value = !r.value, n("onCollapseChange", r.value);
    }, d = N(() => t.model.source.blankMode === !0);
    return {
      ns: e,
      collapseChange: r,
      isBlank: d,
      collapseMenus: i,
      openView: async () => {
        var u;
        const o = (u = s.menu) == null ? void 0 : u.call(s)[0].componentInstance;
        o && o.c && await o.c.onClickMenuItem("menuitem46");
      }
    };
  },
  render() {
    return this.isComplete ? a("i-layout", {
      class: [this.ns.b(), this.isBlank ? this.ns.m("blank") : "", this.ns.is("collapse", this.collapseChange)]
    }, [a("i-sider", {
      attrs: {
        "hide-trigger": !0,
        value: this.collapseChange
      },
      class: [this.ns.b("nav"), this.ns.is("collapse", this.collapseChange)]
    }, [$(this.ns, this.model), this.$slots.menu, a("div", {
      class: this.ns.be("slider", "collapse-icon")
    }, [this.collapseChange ? a("ion-icon", {
      attrs: {
        src: "./assets/img/menu-unfold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    }) : a("ion-icon", {
      attrs: {
        src: "./assets/img/menu-fold.svg"
      },
      on: {
        click: () => this.collapseMenus()
      }
    })])]), a("i-layout", {
      class: [this.ns.b("content")]
    }, [a("i-header", {
      class: this.ns.b("header")
    }, [a("div", {
      class: this.ns.be("header", "left")
    }, [$(this.ns, this.model), this.model.source.mainMenuAlign === "TOP" ? a("i-menu", {
      class: this.ns.be("header", "menu"),
      attrs: {
        mode: "horizontal",
        "active-name": "1"
      }
    }) : null]), a("div", {
      class: this.ns.be("header", "right")
    }, [a("ion-icon", {
      class: this.ns.e("warning"),
      attrs: {
        name: "warning"
      },
      on: {
        click: () => this.openView()
      }
    }), a("app-user"), a("img", {
      class: this.ns.e("xs"),
      attrs: {
        src: _.dir("/assets/img/xs.svg")
      }
    }), a("img", {
      class: this.ns.e("sz"),
      attrs: {
        src: _.dir("/assets/img/sz.svg")
      }
    })])]), a("i-content", {
      class: this.ns.be("content", "main")
    }, [this.$slots.default])])]) : null;
  }
});
class F extends fe {
  constructor() {
    super(...arguments);
    g(this, "options", []);
    g(this, "kqrq", "");
    g(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 = T().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 ze = q({
  name: "PortletSearchHeader",
  props: {
    modelData: {
      type: pe,
      required: !0
    },
    controller: {
      type: F,
      required: !0
    }
  },
  setup(t) {
    const n = D("portal-search-header"), s = C([]), e = C(new Date()), r = (o) => {
      s.value = o, t.controller.rylx = o.join(","), t.controller.changeViewParams();
    }, i = (o) => {
      e.value = o, t.controller.kqrq = o ? T(o).format("YYYY-MM-DD") : "", t.controller.changeViewParams();
    };
    e.value = new Date(t.controller.kqrq), s.value = t.controller.rylx.split(",");
    const d = T();
    return {
      ns: n,
      selectArray: s,
      selectDate: e,
      options: {
        disabledDate: (o) => {
          const u = T(o);
          return d.isSame(u, "day") || d.isBefore(u, "day");
        }
      },
      onSelectArrayChange: r,
      onDateChange: i
    };
  },
  render() {
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return a("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [a("i-checkbox-group", {
      class: this.ns.e("rylx-checkbox"),
      attrs: {
        value: this.selectArray
      },
      on: {
        "on-change": this.onSelectArrayChange
      }
    }, [this.controller.options.map((n) => a("i-checkbox", {
      attrs: {
        label: n.value
      }
    }, [n.text]))]), a("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 Te {
  constructor() {
    g(this, "component", ze);
  }
  async createController(n, s, e) {
    const r = new F(
      n,
      s,
      e
    );
    return await r.init(), r;
  }
}
class H extends ve {
  constructor() {
    super(...arguments);
    g(this, "data", {});
    g(this, "mapData", []);
    g(this, "pointData", []);
    g(this, "form");
    g(this, "hasLoad", !1);
    g(this, "isloading", !1);
    g(this, "entityService");
  }
  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 ye(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((i) => ({
      name: i.orgcode,
      value: this.calcPercent(Number(i.zcl), 1, 2),
      title: i.orgname,
      zcl: `${this.calcPercent(Number(i.zcl), 1, 2)}%`,
      zcrs: i.zcrs,
      jd: i.jd,
      wd: i.wd
    })), r = e.findIndex(
      (i) => i.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
      },
      !0
    );
  }
}
const z = q({
  name: "RingChart",
  props: {
    percent: {
      type: Number,
      required: !0
    },
    text: {
      type: String,
      required: !0
    },
    colors: {
      type: Array,
      default: () => ["#ff0700", "#ff5900", "#ff8300", "#ffa700", "#ffc800", "#ffc02f", "#ffb946", "#ffb358", "#ff9482", "#ff87ba", "#d391e9", "#73a0fa"]
    }
  },
  setup(t) {
    const n = D("ring-chart"), s = C();
    let e;
    const r = N(() => {
      const u = 100 / t.colors.length, h = Math.round(t.percent / u);
      return t.colors[h];
    }), i = () => ({
      tooltip: {
        trigger: "item"
      },
      series: [{
        name: "Access From",
        type: "pie",
        radius: ["56%", "70%"],
        center: ["50%", "70%"],
        startAngle: 180,
        avoidLabelOverlap: !1,
        hoverAnimation: !1,
        selectedOffset: 0,
        tooltip: {
          show: !1
        },
        emphasis: {
          disabled: !0
        },
        label: {
          show: !1,
          position: "center",
          formatter(u) {
            return [`{a|${`${u.percent * 2}%`}}`, `{b|${t.text}}`].join(`
`);
          },
          rich: {
            a: {
              color: "#333333",
              fontWeight: "bold",
              fontSize: 24
            },
            b: {
              color: "#666666",
              fontSize: 14,
              padding: [16, 0, 3, 0]
            }
          }
        },
        data: [{
          value: t.percent,
          itemStyle: {
            color: r.value
          },
          label: {
            show: !0
          }
        }, {
          value: 100 - t.percent,
          itemStyle: {
            color: "#EBF4FF"
          }
        }, {
          value: 100,
          itemStyle: {
            color: "none"
          }
        }]
      }]
    });
    V(() => {
      e = U(s.value), e.setOption(i());
    });
    const {
      percent: d,
      colors: m,
      text: o
    } = R(t);
    return P([d, m, o], () => {
      e && (e.setOption(i()), e.resize());
    }), window.addEventListener("resize", () => {
      e == null || e.resize();
    }), {
      ns: n,
      chartRef: s
    };
  },
  render() {
    return a("div", {
      class: this.ns.b(),
      ref: "chartRef"
    });
  }
}), Ne = ["#FF0700", "#FFF400", "#73A0FA"], je = {
  strMapCode: !0,
  visualMap: {
    text: ["\u9AD8", "\u4F4E"],
    min: 0,
    max: 100,
    rangeColor: Ne
  }
}, Ae = "/assets/json/map/jiangsu/{id}.json";
async function Oe(t) {
  return (await ibiz.net.axios({
    url: _.dir(Ae.replace("{id}", t))
  })).data;
}
function Ke(t, n) {
  const s = /* @__PURE__ */ new Map(), e = C(""), r = C([]);
  let i;
  const d = C(), m = (c) => {
    const f = {
      cityNames: {},
      noChild: c.features.length === 1
    };
    return c.features.forEach((y) => {
      const { adcode: v, name: k } = y.properties;
      f.cityNames[v] = k;
    }), f;
  }, o = async (c) => {
    if (s.has(c))
      return;
    const f = await Oe(c);
    s.set(c, m(f)), Ce(c, f);
  }, u = (c) => {
    const f = s.get(e.value);
    if (f)
      return f.cityNames[c];
  }, h = () => {
    const c = t(e.value);
    i.setOption(c), i.resize();
  }, p = async (c, f = !1) => {
    f || n("mapChange", { name: c }), s.has(c) || await o(c), e.value = c, r.value.push(c), h();
  }, l = () => {
    if (r.value.length > 1) {
      r.value.pop();
      const c = r.value.pop();
      p(c);
    }
  };
  return V(() => {
    i = U(d.value), window.addEventListener("resize", () => {
      i == null || i.resize();
    }), i.on("click", (c) => {
      c.name !== e.value && p(c.name);
    });
  }), {
    chartRef: d,
    historyNames: r,
    currenName: e,
    changeMap: p,
    getCityName: u,
    goBack: l,
    refresh: h
  };
}
const $e = q({
  name: "MapChart",
  props: {
    mapData: {
      type: Array,
      required: !0
    },
    pointData: {
      type: Array
    },
    options: {
      type: Object,
      default: () => ({})
    },
    defaultMapName: {
      type: String,
      required: !0
    }
  },
  setup(t, {
    emit: n
  }) {
    const s = D("map-chart"), e = N(() => ke(je, t.options)), {
      chartRef: r,
      historyNames: i,
      changeMap: d,
      getCityName: m,
      goBack: o,
      refresh: u
    } = Ke((l) => {
      const {
        visualMap: c
      } = e.value, f = {
        geo: {
          map: l
        },
        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: l,
            nameProperty: e.value.strMapCode ? "adcodeStr" : "adcode",
            tooltip: {
              formatter: (y) => {
                const v = m(y.name), k = t.mapData.find((I) => I.name == y.name);
                if (!!k)
                  return `
                      <div style='display:flex;justify-content: space-between;'>
                        <span>${v}</span>
                        <span>${k.zcrs}</span>
                      </div>
                      <div style='display:flex;justify-content: space-between;'>
                        <span>\u6B63\u5E38\u7387\uFF1A</span>
                        <span>${k.zcl}</span>
                      </div>
                    `;
              }
            },
            label: {
              show: !0,
              color: "#000000",
              fontSize: 11,
              formatter: (y) => m(y.name)
            },
            select: {
              disabled: !0
            },
            data: t.mapData.map((y) => ({
              name: y.name,
              value: y.value
            }))
          }
        ]
      };
      return t.pointData && f.series.push({
        type: "scatter",
        coordinateSystem: "geo",
        symbol: "pin",
        symbolSize: 10,
        visualMap: !1,
        itemStyle: {
          color: "#FF1D00"
        },
        label: {
          show: !0,
          color: "#000000",
          fontSize: 10,
          textShadowBlur: 0,
          formatter: (y) => y.data.title,
          position: "left",
          offset: [10, -15]
        },
        tooltip: {
          formatter: (y) => {
            const v = y.data;
            return `
                    <div style='display:flex;justify-content: space-between;'>
                      <span>${v.title}</span>
                      <span>${v.zcrs}</span>
                    </div>
                    <div style='display:flex;justify-content: space-between;'>
                      <span>\u6B63\u5E38\u7387\uFF1A</span>
                      <span>${v.zcl}</span>
                    </div>
                  `;
          }
        },
        data: t.pointData.map((y) => ({
          ...y,
          value: [Number(y.jd), Number(y.wd)],
          visualMap: !1
        }))
      }), f;
    }, (l, c) => {
      l === "mapChange" && n("mapChange", c.name);
    });
    V(() => {
      d(t.defaultMapName, !0);
    });
    const {
      mapData: h,
      pointData: p
    } = R(t);
    return P([h, p], () => {
      u();
    }), {
      ns: s,
      chartRef: r,
      historyNames: i,
      goBack: o
    };
  },
  render() {
    return a("div", {
      class: this.ns.b()
    }, [a("div", {
      class: this.ns.e("chart"),
      ref: "chartRef"
    }), this.historyNames.length > 1 && a("div", {
      class: this.ns.e("goback"),
      on: {
        click: () => {
          this.goBack();
        }
      }
    }, ["\u8FD4\u56DE"])]);
  }
}), Re = q({
  name: "PortalMapArea",
  props: {
    modelData: {
      type: he,
      required: !0
    },
    controller: {
      type: H,
      required: !0
    }
  },
  setup(t) {
    const n = Q(t.controller), s = D("portal-map-area");
    return {
      c: n,
      ns: s
    };
  },
  render() {
    if (!this.c.hasLoad)
      return;
    const t = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
    return a("portlet-layout", {
      attrs: {
        controller: this.controller
      },
      class: t
    }, [this.c.isloading ? a("i-spin", {
      attrs: {
        size: "large",
        fix: !0
      }
    }) : null, a("div", {
      class: this.ns.e("left")
    }, [a(z, {
      attrs: {
        percent: this.c.data.zcl,
        text: `\u6B63\u5E38\u6570 ${this.c.data.zcrs}`
      }
    }), a(z, {
      attrs: {
        percent: this.c.data.ycl,
        text: `\u5F02\u5E38\u6570 ${this.c.data.ycrs}`
      }
    })]), a("div", {
      class: this.ns.e("center")
    }, [a("div", {
      class: this.ns.e("title")
    }, [`${this.c.data.orgname} \u2014 ${this.c.data.yzrs}\u4EBA`]), a($e, {
      class: this.ns.e("map"),
      attrs: {
        mapData: this.c.mapData,
        pointData: this.c.pointData,
        defaultMapName: this.c.params.orgcode
      },
      on: {
        mapChange: (n) => {
          this.c.onMapChange(n);
        }
      }
    })]), a("div", {
      class: this.ns.e("right")
    }, [a(z, {
      attrs: {
        percent: this.c.data.qjl,
        text: `\u8BF7\u5047\u4EBA\u6570 ${this.c.data.qjrs}`
      }
    }), a(z, {
      attrs: {
        percent: this.c.data.xjl,
        text: `\u4F11\u5047\u4EBA\u6570 ${this.c.data.xjrs}`
      }
    })])]);
  }
});
class Be {
  constructor() {
    g(this, "component", Re);
  }
  async createController(n, s, e) {
    const r = new H(
      n,
      s,
      e
    );
    return await r.init(), r;
  }
}
class Ue extends ge {
  constructor() {
    super(...arguments);
    g(this, "unit", "");
    g(this, "isPercent", !1);
    g(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 Fe(t, n, s, e = {}) {
  return se(t, () => {
    const r = new Ue(n, s, e);
    return ae(t, "mdCtrlActiveMode", r.setMdCtrlActiveMode.bind(r)), r;
  });
}
function He(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((i) => e.srfkey === i.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const i = t.selectedData;
      r === -1 ? i.push(e) : i.splice(r, 1), t.onSelectionChange(i);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const We = q({
  name: "KqqkListControl",
  props: {
    modelData: {
      type: B,
      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: n
    } = M(), s = D("kqqk-list"), e = Fe(n, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: i
    } = He(e), d = (o, u) => {
      const h = e.selectedData.findIndex((l) => l.srfkey === o.srfkey), p = [s.b("item"), s.is("active", h !== -1)];
      return a("div", {
        class: p,
        key: o.srfkey + u,
        on: {
          click: () => r(o),
          dblclick: () => i(o)
        }
      }, [a("span", {
        class: s.be("item", "title")
      }, [o.title]), a("div", {
        class: s.be("item", "progress")
      }, [a("span", {
        style: `width:${o.percent}%;`,
        class: s.be("item", "progress-bar")
      }), a("span", {
        class: s.be("item", "progress-text")
      }, [o.num, e.unit])])]);
    };
    return {
      c: e,
      ns: s,
      renderListContent: () => e.items.map((o, u) => d(o, u))
    };
  },
  render() {
    return a("control-layout", {
      class: this.ns.b(),
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderListContent()]]);
  }
});
class Ye {
  constructor() {
    g(this, "component", We);
  }
}
function Je(t) {
  return { handleClick: (e) => {
    const r = t.selectedData.findIndex((i) => e.srfkey === i.srfkey);
    if (t.singleSelect)
      r === -1 ? t.onSelectionChange([e]) : t.onSelectionChange([]);
    else {
      const i = t.selectedData;
      r === -1 ? i.push(e) : i.splice(r, 1), t.onSelectionChange(i);
    }
    t.handleClick(e);
  }, handleDblClick: (e) => {
    t.handleDblClick(e);
  } };
}
const j = q({
  name: "ListExpControl",
  props: {
    modelData: {
      type: B,
      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: n
    } = M(), s = D("control-list"), e = ne(n, t.modelData, t.context, t.params), {
      handleClick: r,
      handleDblClick: i
    } = Je(e);
    let d = !0;
    V(() => {
      P(() => e, (l, c) => {
        if (t.isExpView && l && l !== c) {
          let f = e.items[0];
          if (t.defaultSelectKeys && t.defaultSelectKeys.length > 0) {
            const y = e.items.find((v) => v.srfkey === t.defaultSelectKeys[0]);
            y && (f = y);
          }
          f && e.onSelectionChange([f]);
        }
      }, {
        immediate: !0
      }), P(() => e.items.length, (l) => {
        t.isExpView && l && e.onSelectionChange([e.items[0]]);
      }, {
        immediate: !0,
        deep: !0
      });
    });
    const m = (l) => {
      e.selectedData.length === 0 && (e.selectedData = [{
        srfkey: e.items[0].srfkey
      }]);
      const c = e.selectedData.findIndex((v) => v.srfkey === l.srfkey), f = () => {
        d = !1, delete e.context.n_orgid_eq, e.context.calendarcaption = l.deptname, r(l);
      }, y = [s.b("item"), s.is("active", c !== -1 && d === !1)];
      return a("div", {
        class: y,
        on: {
          click: () => f(),
          dblclick: () => i(l)
        }
      }, [e.layoutPanelProvider ? a(e.layoutPanelProvider.component, {
        props: {
          modelData: e.model,
          context: e.context,
          params: e.params,
          inputData: l
        }
      }) : `${l.deptname}`]);
    }, o = () => e.model.source.enableGroup ? a("el-collapse") : e.items.map((l) => m(l)), u = () => Object.is(e.total, e.items.length) ? null : a("div", {
      class: s.e("no-data")
    }, [a("div", ["\u6682\u65E0\u6570\u636E"])]), h = (l) => {
      d = !0, Object.assign(e.context, {
        n_orgid_eq: e.params.n_orgid_eq
      }), e.context.calendarcaption = l.deptname, r(l);
    }, p = () => {
      const l = [s.b("item"), s.is("active", d === !0)];
      return e.items.length > 0 ? a("div", {
        class: l,
        on: {
          click: () => h({
            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 O(() => {
      d && (h({
        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);
    }), P(() => e.items, () => {
      O(() => {
        d = !0, Object.assign(e.context, {
          n_orgid_eq: e.params.n_orgid_eq
        }), h({
          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: u,
      renderAll: p,
      renderAllClick: h,
      isSelectAll: d
    };
  },
  render() {
    return a("control-layout", {
      class: [this.ns.b()],
      attrs: {
        modelData: this.c.model
      }
    }, [this.c.complete && [this.renderAll(), this.renderListContent(), this.renderLoadMore()]]);
  }
});
const Ge = q({
  name: "ListExpSelectTreeView",
  components: {
    Treeselect: we,
    ListExpControl: j
  },
  props: {
    context: Object,
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const {
      proxy: n
    } = M(), s = re(n, t.modelPath), e = C(""), r = C([]), i = D("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]), ie(X(s.navItem, "key"), n, 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 m = (p) => ({
      id: p.id,
      label: p.text,
      children: p.children
    }), o = (p) => {
      s.context.selectedDeptName = p.text, Object.assign(s.params, {
        n_orgid_eq: p.value
      }), s.nerve.list.call.load();
    }, u = C(!1);
    return {
      c: s,
      defaultSelectKeys: r,
      routeViewKey: e,
      normalizer: m,
      select: o,
      dataItems: [],
      isLoadCodeList: u,
      value: d,
      ns: i
    };
  },
  render() {
    if (this.c.complete) {
      const t = this.c.context.isRouter === !0, {
        listExpBar: n
      } = this.c.model, {
        list: s
      } = n, 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 a("exp-view-base", {
        class: [this.ns.b()],
        attrs: {
          controller: this.c,
          expBarModel: this.c.model.listExpBar
        },
        scopedSlots: {
          default: () => a(j, {
            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" ? a("div", {
            class: "ibiz-selectTree"
          }, [a("treeselect", {
            attrs: {
              value: this.value,
              options: this.dataItems,
              normalizer: this.normalizer,
              clearable: !1,
              "default-expand-level": 1
            },
            on: {
              select: this.select
            }
          })]) : e === "SysDepartmentkqBmtjListExpView" ? a("div", {
            class: "ibiz-bmtj"
          }, [a("div", {
            class: "ibiz-bmyj-content"
          }, [this.c.context.srforgname])]) : null,
          expView: () => s.navView ? t ? this.routeViewKey ? a("router-view", {
            key: this.routeViewKey
          }) : null : a("ViewShell", {
            props: {
              context: this.c.navItem.context,
              params: this.c.navItem.params,
              modal: {
                mode: G.EMBED
              },
              modelPath: s.navView.source.modelPath
            },
            key: this.c.navItem.key
          }) : null
        }
      });
    }
    return null;
  }
});
class Qe {
  constructor() {
    g(this, "component", "ListExpSelectTreeView");
  }
}
class Xe {
  constructor() {
    g(this, "component", "BYQKEditView");
  }
}
class Ze {
  constructor() {
    g(this, "formEditor", "KqBase64ImageUpload");
    g(this, "gridEditor", "IBizGridFileUpload");
  }
  async createController(n, s) {
    const e = new xe(n, s);
    return await e.init(), e;
  }
}
const et = q({
  name: "KqBase64ImageUpload",
  props: oe(),
  emits: le(),
  setup(t) {
    var i, d, m;
    const n = D("kq-base64-image-upload"), s = ((i = t.controller.model) == null ? void 0 : i.width) || "auto", e = ((d = t.controller.model) == null ? void 0 : d.height) || "150px", r = ((m = t.controller.editorParams) == null ? void 0 : m["justify-content"]) || "center";
    return () => a("div", {
      class: n.b(),
      style: {
        width: s,
        height: e,
        justifyContent: r
      }
    }, [a("img", {
      attrs: {
        src: t.value
      },
      class: n.e("image")
    })]);
  }
});
class tt {
  constructor() {
    g(this, "component", "KqdwCustomPickupTreeView");
  }
}
const st = q({
  name: "KqdwCustomPickupTreeView",
  props: {
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object
    },
    srfnav: String,
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(t) {
    const n = D("kqdw-custom-pickup-tree-view"), {
      proxy: s
    } = M(), e = ce(s, t.modelPath), r = C(null);
    let i = null;
    const d = C([]), m = C({}), o = C([]), u = C([]), h = C(""), p = C([]), l = async (x) => {
      await i.loadNodes(x), m.value = x, o.value.push(x);
    };
    return P(() => e.complete, async (x, w) => {
      var b;
      if (x !== w && x) {
        await e.model.pickupViewPanel.embedView.init();
        const A = (b = e.model.pickupViewPanel.embedView.source.getPSControls()) == null ? void 0 : b.find((L) => L.controlType === "TREEVIEW");
        A || console.warn("\u672A\u627E\u5230[\u6811(tree)]\u90E8\u4EF6"), r.value = new me(A), await r.value.init(), i = de(s, r.value, t.context, t.params), await i.init();
        const E = await i.load();
        if (E.length > 0 && (d.value = E, m.value.children = E, o.value.push({
          text: "\u5F53\u524D\u9662",
          children: E
        })), e.params.selectedData) {
          const L = JSON.parse(e.params.selectedData);
          L.length > 0 && (u.value = L.map((S) => ({
            srfkey: S.srfkey,
            srfmajortext: S.srfmajortext,
            value: S.srfkey,
            text: S.srfmajortext,
            dxlx: S.dxlx
          })));
        }
      }
    }), {
      ns: n,
      c: e,
      treeDatas: d,
      currentTreeNode: m,
      clickTreeNode: l,
      treeHistory: o,
      isChecked: (x) => u.value.findIndex((b) => b.value === x.value) !== -1,
      selectTreeNodes: u,
      handleSelect: (x) => {
        const w = u.value.findIndex((b) => b.value === x.value);
        w === -1 ? u.value.push(x) : u.value.splice(w, 1);
      },
      clickHistory: (x) => {
        const w = o.value.findIndex((b) => b.value === x.value);
        o.value = o.value.slice(0, w + 1), m.value = x;
      },
      clearAll: () => {
        u.value = [];
      },
      onOkButtonClick: () => {
        const x = u.value.map((w) => {
          var b;
          return {
            srfkey: w.value,
            srfmajortext: w.text,
            dxlx: (b = w.deData) == null ? void 0 : b.dxlx
          };
        });
        e.closeView({
          ok: !0,
          data: x
        });
      },
      query: h,
      queryChange: (x) => {
        x.target && (h.value = x.target.value, Object.assign(e.params, {
          query: h.value
        }));
      },
      search: async () => {
        const x = await (i == null ? void 0 : i.load());
        x && (p.value = x);
      },
      queryTreeNodeList: p
    };
  },
  render() {
    return a("div", {
      class: this.ns.b()
    }, [a("div", {
      class: "top"
    }, [a("div", {
      class: "left"
    }, [a("div", {
      class: "title"
    }, ["\u672A\u9009\u62E9\u7528\u6237"]), a("div", {
      class: "search"
    }, [a("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
      }
    })]), a("div", {
      class: "cascader"
    }, [a("div", {
      class: "history"
    }, [!this.query && this.treeHistory.length > 0 && this.treeHistory.map((t, n) => a("span", {
      class: "content"
    }, [a("span", {
      on: {
        click: () => this.clickHistory(t)
      }
    }, [t.text]), n < this.treeHistory.length - 1 && a("span", {
      class: "icon"
    }, [">"])]))]), a("div", {
      class: "children"
    }, [this.query ? this.queryTreeNodeList.map((t) => a("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? a("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : a("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), a("span", {
      class: "text"
    }, [t.text])])) : this.currentTreeNode && this.currentTreeNode.children && this.currentTreeNode.children.map((t) => a("div", {
      class: "child",
      key: t.id
    }, [this.isChecked(t) ? a("span", {
      class: "checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["\u221A"]) : a("span", {
      class: "no-checked",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }), a("span", {
      class: "text",
      on: {
        click: () => this.clickTreeNode(t)
      }
    }, [t.text])]))])])]), a("div", {
      class: "right"
    }, [a("div", {
      class: "title"
    }, [a("span", [" \u5DF2\u9009\u62E9\u7528\u6237"]), " ", a("span", {
      class: "clear",
      on: {
        click: () => this.clearAll()
      }
    }, ["\u5168\u90E8\u6E05\u9664"])]), a("div", {
      class: "list"
    }, [this.selectTreeNodes.map((t) => a("div", {
      class: "node"
    }, [a("span", [t.text]), " ", a("span", {
      class: "remove",
      on: {
        click: () => {
          this.handleSelect(t);
        }
      }
    }, ["x"])]))])])]), a("div", {
      class: "bottom"
    }, [a("i-button", {
      on: {
        click: () => {
          this.onOkButtonClick();
        }
      }
    }, ["\u786E\u5B9A"]), a("i-button", {
      on: {
        click: () => {
          this.c.onCancelButtonClick();
        }
      }
    }, ["\u53D6\u6D88"])])]);
  }
}), vt = {
  mateUrl: import.meta.url,
  install(t) {
    t.component("UserIndexView", Ee), t.component("UserAppLayout", Le), t.component("ListExpSelectTreeView", Ge), t.component("ListExpControl", j), t.component(
      "BYQKEditView",
      () => import("./byqk-edit-view.fea98c06.js")
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_JskqIndexView",
      new be()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ListExpSelectTreeView",
      new Qe()
    ), _.loadStyle(["/style.css"]), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_JskqWebPortalSearchHeader",
      new Te()
    ), ibiz.register.portletPart.register(
      "PORTLET_CUSTOM_jskqWebPortalMapArea",
      new Be()
    ), ibiz.register.control.register(
      "LIST_RENDER_JskqWebKqqkList",
      new Ye()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_ByqkCustomEditView",
      new Xe()
    ), t.component("KqBase64ImageUpload", et), ibiz.register.editor.register(
      "PICTURE_ONE_Base64ImageUpload",
      new Ze()
    ), t.component("KqdwCustomPickupTreeView", st), ibiz.register.view.register(
      "VIEW_CUSTOM_KqdwCustomPickupTreeView",
      new tt()
    );
  }
};
export {
  vt as default
};
