var te = Object.defineProperty;
var se = (a, s, i) => s in a ? te(a, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[s] = i;
var D = (a, s, i) => (se(a, typeof s != "symbol" ? s + "" : s, i), i);
import { EditFormModel as ae, AppEntityModel as W } from "@ibiz-template/model";
import { useNamespace as x, useControlController as re, usePropsWatch as oe, getDatePickerProps as ie, getEditorEmits as ne } from "@ibiz-template/vue-util";
import { defineComponent as Y, getCurrentInstance as ce, ref as b, watch as z, h as e, onMounted as le } from "vue";
import { createUUID as X } from "qx-util";
import { ViewMode as q, PluginStaticResource as de, UIActionHandler as ue, FrontUIActionHandler as me, OpenAppViewCommand as pe } from "@ibiz-template/runtime";
import { EditFormController as he, DatePickerEditorController as fe, UploadEditorController as ge } from "@ibiz-template/controller";
import { ControlVO as ve, calcResPath as J } from "@ibiz-template/service";
import U from "dayjs";
import { StringUtil as ye } from "@ibiz-template/core";
class Ee extends he {
  constructor() {
    super(...arguments);
    /**
     *   基础数据
     *
     * @author fangZhiHao
     * @date 2024-04-26 17:04:49
     * @type {IData}
     */
    D(this, "baseResData", []);
    /**
     *   对比数据
     *
     * @author fangZhiHao
     * @date 2024-04-26 17:04:49
     * @type {IData}
     */
    D(this, "compareResData", []);
    /**
     * 表单旧数据
     *
     * @author zk
     * @date 2023-12-20 11:12:43
     * @protected
     * @type {IData}
     * @memberof FormController
     */
    D(this, "oldData", new ve());
    /**
     * version数据
     *
     * @author fangZhiHao
     * @date 2024-04-26 16:04:37
     * @type {IData[]}
     */
    D(this, "versionData", []);
    /**
     *  对比数据
     *
     * @author fangZhiHao
     * @date 2024-04-26 16:04:37
     * @type {IData[]}
     */
    D(this, "comparisonArr", {});
    /**
     *  基础表格数据
     *
     * @author fangZhiHao
     * @date 2024-05-06 11:05:57
     * @type {IData[]}
     */
    D(this, "gridData", []);
    /**
     *  展示完全数据
     *
     * @author fangZhiHao
     * @date 2024-05-06 11:05:04
     * @type {IData[]}
     */
    D(this, "AllGridData", []);
    /**
     *  去除相同数据
     *
     * @author fangZhiHao
     * @date 2024-05-06 11:05:15
     * @type {IData[]}
     */
    D(this, "removeSameGridData", []);
    /**
     *  关系界面数据
     *
     * @author fangZhiHao
     * @date 2024-04-30 10:04:33
     * @type {IData}
     */
    D(this, "AlldruipartData", /* @__PURE__ */ new Map());
    /**
     *  关系界面数据长度
     *
     * @author fangZhiHao
     * @date 2024-05-06 11:05:56
     * @type {number}
     */
    D(this, "druipartDataSize", 0);
    /**
     *   关系界面实际数据
     *
     * @author fangZhiHao
     * @date 2024-05-06 11:05:13
     * @type {IData}
     */
    D(this, "newDruipartData", {});
  }
  /**
   * 加载数据
   *
   * @return {*}  {Promise<ControlVO>}
   * @memberof FormDataComparisonController
   */
  async loadGridData() {
    await this.startLoading();
    const i = this.model.source.M.getPSControlParam.ctrlParams, { BASEENTITY: o, COMPAREENTITY: d } = i, f = await ibiz.entityService.getService(o), p = await ibiz.entityService.getService(d), v = Object.assign({}, this.context.clone(), {
      [o.toLowerCase()]: this.params.base_version
    }), c = Object.assign({}, this.context.clone(), {
      [d.toLowerCase()]: this.params.compare_version
    }), y = await f.exec("Get", v, this.params), E = await p.exec(
      "Get",
      c,
      this.params
    );
    return this.isLoaded = !0, {
      baseData: y.data.data,
      compareData: E.data.data
    };
  }
  /**
   * 判断值是否为空
   *
   * @param {(string | IData[] | null | undefined)} value
   * @return {*}
   * @memberof FormDataComparisonController
   */
  isFalseyButNotEmpty(i) {
    return i == null || typeof i == "string" && i === "" || Array.isArray(i) && i.length === 0 || typeof i == "object" && Object.keys(i).length === 0;
  }
  /**
   * 比较两个值
   *
   * @param {IData} objA
   * @param {IData} objB
   * @return {*}
   * @memberof FormDataComparisonController
   */
  compareObjectValues(i, o) {
    return JSON.stringify(i) !== JSON.stringify(o);
  }
}
const De = Y({
  name: "IBizFormDataComparison",
  props: {
    modelData: {
      type: ae,
      required: !0
    },
    context: {
      type: Object,
      required: !0
    },
    params: {
      type: Object,
      default: () => ({})
    },
    enableAutoSave: {
      type: Boolean,
      required: !1
    }
  },
  setup(a) {
    const s = x("form-data-comparison"), {
      proxy: i
    } = ce(), o = re(i, () => {
      const t = new Ee(a.modelData, a.context, a.params);
      return oe(i, "enableAutoSave", t.setEnableAutoSave.bind(t)), t;
    }), d = b(!0), f = b(!1), p = b({}), v = b({}), c = b([]), y = [], E = b([]), l = b([]), u = b([]), n = /* @__PURE__ */ new Map(), g = b(0), m = (t) => {
      const r = [];
      if (r.push(t), t && t.children) {
        const h = [];
        t.children.forEach((P) => {
          const I = m(P);
          h.push(...I);
        }), r.push(...h);
      }
      return r;
    }, C = m(a.modelData);
    y.push(...C);
    const w = (t) => {
      const r = o.details[t.source.name], h = e("not-supported-editor", {
        attrs: {
          modelData: t.editor
        }
      });
      return e("div", {
        class: [s.e("form-grid-item"), s.is("add", E.value.includes(t.source.name)), s.is("update", u.value.includes(t.source.name)), s.is("delete", l.value.includes(t.source.name))]
      }, [e("div", {
        class: s.em("form-grid-item", "name")
      }, [t.source.caption]), e("div", {
        class: s.em("form-grid-item", "left")
      }, [r.editorProvider ? e(r.editorProvider.formEditor, {
        props: {
          value: v.value[t.source.name],
          data: r.data,
          controller: r.editor,
          disabled: r.disabled,
          readonly: !0
        }
      }) : h]), e("div", {
        class: s.em("form-grid-item", "right")
      }, [r.editorProvider ? e(r.editorProvider.formEditor, {
        props: {
          value: p.value[t.source.name],
          data: r.data,
          controller: r.editor,
          disabled: r.disabled,
          readonly: !0
        }
      }) : h])]);
    }, A = (t, r) => {
      n.set(t.source.id, r), r.evt.on("mounted", () => {
        d.value && o.startLoading(), g.value += 1, r.call.refresh();
      }), r.evt.on("refreshed", () => {
        g.value -= 1, setTimeout(() => {
          d.value && o.endLoading();
        }, 500);
      });
    }, L = (t) => {
      const r = y.find((M) => M.id === `${t.source.id}_srfcopy`), h = t.embedView.source.modelPath, P = r == null ? void 0 : r.embedView.source.modelPath, I = o.context.clone(), F = {
        base_version: a.params.base_version
      }, T = o.context.clone();
      Object.assign(T, {
        gysrlzy_info: a.params.compare_version,
        compare_version: a.params.compare_version
      });
      const R = {
        compare_version: a.params.compare_version
      }, N = p.value[t.source.userTag], O = v.value[r == null ? void 0 : r.source.userTag];
      let _ = !1, B = !1, j = !1;
      if (t.source.userTag2) {
        const M = JSON.parse(t.source.userTag2), {
          comparekey: G,
          comparelist: ee
        } = M;
        N && O && Array.isArray(N) && Array.isArray(O) && (N.length === 0 && O.length !== 0 ? j = !0 : N.length !== 0 && O.length === 0 ? _ = !0 : N.length !== 0 && O.length !== 0 && (N.length !== O.length ? B = !0 : N.some((K) => {
          const H = O.find((S) => K[G] === S[G]);
          return H ? ee.some((S) => K[S] !== H[S] ? (B = !0, !0) : !1) : (B = !0, !0);
        })));
      }
      return e("div", {
        class: [s.e("druipart"), s.is("add", _), s.is("update", B), s.is("delete", j)]
      }, [e("div", {
        class: s.em("druipart", "caption")
      }, [t.source.caption]), e("div", {
        class: s.em("druipart", "left")
      }, [P && e("ViewShell", {
        attrs: {
          context: T,
          params: R,
          modal: {
            mode: q.EMBED
          },
          modelPath: P,
          noLoadDefault: !0,
          name: r == null ? void 0 : r.source.id
        },
        key: X(),
        on: {
          neuronInit: (M) => A(r, M)
        }
      })]), e("div", {
        class: s.em("druipart", "right")
      }, [h && e("ViewShell", {
        attrs: {
          context: I,
          params: F,
          modal: {
            mode: q.EMBED
          },
          modelPath: h,
          noLoadDefault: !0,
          name: t.source.id
        },
        key: X(),
        on: {
          neuronInit: (M) => A(t, M)
        }
      })])]);
    }, V = (t) => {
      const r = {
        modelData: t,
        controller: o.details[t.source.name]
      }, h = o.providers[t.source.name], P = e(h.component, {
        props: {
          ...r
        },
        key: t.id
      }), I = e(h.component, {
        props: {
          ...r
        },
        key: `compare_${t.id}`
      });
      return e("div", {
        class: s.e("mdctrl")
      }, [e("div", {
        class: s.em("mdctrl", "caption")
      }, [t.source.caption]), e("div", {
        class: s.em("mdctrl", "left")
      }, [P]), e("div", {
        class: s.em("mdctrl", "right")
      }, [I])]);
    }, k = (t) => {
      d.value = !1;
      const r = c.value.findIndex((h) => h === t.source.name);
      r > -1 ? c.value.splice(r, 1) : c.value.push(t.source.name);
    }, $ = (t) => {
      if (!t.source.hidden) {
        if (t.source.detailType === "FORMPAGE")
          return e("div", {
            class: s.e("form-page")
          }, [t.children.map((r) => $(r))]);
        if (t.source.detailType === "FORMITEM") {
          const r = E.value.includes(t.source.name), h = l.value.includes(t.source.name), P = u.value.includes(t.source.name);
          return f.value && !r && !h && !P ? null : w(t);
        }
        if (t.source.detailType === "GROUPPANEL") {
          const r = c.value.includes(t.source.name);
          return e("div", {
            class: s.b("group")
          }, [e("div", {
            class: [s.be("group", "header"), s.is("hide-caption", !t.source.showCaption)]
          }, [e("div", {
            class: s.bem("group", "header", "name")
          }, [r ? e("i-icon", {
            class: s.bem("group", "header", "icon"),
            attrs: {
              type: "ios-arrow-forward",
              title: "展开"
            },
            on: {
              click: () => k(t)
            }
          }) : e("i-icon", {
            class: s.bem("group", "header", "icon"),
            attrs: {
              type: "ios-arrow-down",
              title: "收缩"
            },
            on: {
              click: () => k(t)
            }
          }), e("span", {
            class: s.bem("group", "header", "name-text")
          }, [t.source.caption || t.source.title])]), e("div", ["---"]), e("div", ["---"])]), e("div", {
            class: [s.be("group", "content"), s.is("collapse", r)]
          }, [t.children.map((h) => $(h))])]);
        }
        return t.source.detailType === "DRUIPART" && !t.source.name.endsWith("_srfcopy") ? L(t) : t.source.detailType === "MDCTRL" ? V(t) : null;
      }
    }, Q = (t, r) => {
      const h = [], P = [], I = [];
      return Object.keys(r).forEach((F) => {
        const T = t[F], R = r[F];
        o.isFalseyButNotEmpty(T) && !o.isFalseyButNotEmpty(R) && h.push(F), !o.isFalseyButNotEmpty(T) && !o.isFalseyButNotEmpty(R) && o.compareObjectValues(T, R) && P.push(F);
      }), Object.keys(t).forEach((F) => {
        if (!Object.prototype.hasOwnProperty.call(r, F) || o.isFalseyButNotEmpty(r[F])) {
          const T = t[F];
          o.isFalseyButNotEmpty(T) || I.push(F);
        }
      }), {
        added: h,
        modified: P,
        deleted: I
      };
    };
    return z(() => a.params, async () => {
      const t = await o.loadGridData();
      p.value = t.baseData, v.value = t.compareData;
      const {
        added: r,
        modified: h,
        deleted: P
      } = Q(v.value, p.value);
      E.value = r, u.value = h, l.value = P;
    }, {
      immediate: !0
    }), {
      ns: s,
      c: o,
      switchValue: f,
      druipartNum: g,
      renderEditor: w,
      renderByDetailType: $
    };
  },
  render() {
    return this.c.complete ? e("control-layout", {
      attrs: {
        modelData: this.c.model
      }
    }, [e("div", {
      class: this.ns.b()
    }, [e("div", {
      class: this.ns.e("top")
    }, [e("div", {
      class: this.ns.e("top-hidesame-content")
    }, [e("div", {
      class: this.ns.e("top-hidesame-content-left")
    }, ["隐藏相同项 ", e("i-switch", {
      model: {
        value: this.switchValue,
        callback: (a) => {
          this.switchValue = a;
        }
      }
    })]), e("div", {
      class: this.ns.e("top-hidesame-content-right")
    }, [e("div", {
      class: this.ns.e("top-hidesame-content-right-item")
    }, ["新增", e("div", {
      class: this.ns.e("top-hidesame-content-right-item-add")
    })]), e("div", {
      class: this.ns.e("top-hidesame-content-right-item")
    }, ["修改", e("div", {
      class: this.ns.e("top-hidesame-content-right-item-change")
    })]), e("div", {
      class: this.ns.e("top-hidesame-content-right-item")
    }, ["删除", e("div", {
      class: this.ns.e("top-hidesame-content-right-item-delete")
    })])])]), e("div", {
      class: this.ns.e("top-content")
    }, [e("div", {
      class: this.ns.em("top-content", "attr")
    }, ["信息项"]), e("div", {
      class: [this.ns.em("top-content", "left")]
    }, ["更新前内容"]), e("div", {
      class: [this.ns.em("top-content", "right")]
    }, ["更新后内容"])])]), e("div", {
      class: this.ns.e("content")
    }, [this.modelData.children.map((a) => this.renderByDetailType(a))])])]) : null;
  }
});
const be = Y({
  name: "CustomDataImport",
  props: {
    templateUrl: {
      type: String,
      required: !0
    },
    importUrl: {
      type: String,
      required: !0
    },
    dismiss: {
      type: Function
    }
  },
  setup(a, {
    emit: s
  }) {
    const i = x("data-import"), o = b(), d = b({
      state: "ready",
      message: "",
      rowError: []
    }), f = b(""), p = async (l) => {
      const u = new FormData(), n = U(f.value).format("YYYY-MM");
      u.append("file", l), u.append("ny", n);
      try {
        const g = await ibiz.net.request(a.importUrl, {
          method: "post",
          data: u,
          headers: {
            "Content-Type": "multipart/form-data"
          }
        });
        d.value.state = "success", d.value.message = "导入成功";
        const {
          errorinfo: m,
          success: C,
          total: w
        } = g.data, A = w ? Number(w) : 0, L = C ? Number(C) : 0, V = w - C;
        d.value.message = `共计导入数据 ${A} 条，错误[${V}]，成功[${L}]`, m && Object.keys(m).length > 0 && (d.value.rowError = [], Object.keys(m).forEach((k) => {
          d.value.rowError.push({
            index: Number(k) + 1,
            info: m[k].errorInfo
          });
        }));
      } catch (g) {
        d.value.state = "fail", d.value.message = `导入失败！${g.message}`;
      }
    }, v = (l) => {
      const u = l.target;
      if (!u.files)
        return;
      const n = u.files[0];
      u.value = null, p(n);
    }, c = async () => {
      var u;
      const l = await ibiz.net.request(a.templateUrl, {
        responseType: "blob"
      });
      if (l.status === 200) {
        let n = ((u = l.headers["content-disposition"].split(";").find((C) => C.indexOf("filename=") !== -1)) == null ? void 0 : u.slice(9)) || "";
        n = decodeURIComponent(n);
        const g = new Blob([l.data], {
          type: "application/vnd.ms-excel"
        }), m = document.createElement("a");
        m.download = n, m.style.display = "none", m.href = URL.createObjectURL(g), document.body.appendChild(m), m.click(), URL.revokeObjectURL(m.href), document.body.removeChild(m);
      }
    }, y = () => {
      o.value.click();
    }, E = () => {
      var l;
      s("close", {
        ok: !1,
        data: {}
      }), (l = a.dismiss) == null || l.call(a, {
        ok: !1,
        data: {}
      });
    };
    return le(() => {
      f.value = U().format("YYYY年MM月");
    }), {
      ns: i,
      curDate: f,
      onLinkClick: c,
      selectFile: y,
      onCancelButtonClick: E,
      onFileChange: v,
      inputUpLoad: o,
      message: d
    };
  },
  render() {
    return e("div", {
      class: [this.ns.b(), this.ns.is("custom", !0)]
    }, [e("input", {
      ref: "inputUpLoad",
      attrs: {
        type: "file",
        accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
      },
      style: "display: none",
      on: {
        change: this.onFileChange
      }
    }), e("div", {
      class: this.ns.e("caption")
    }, ["导入数据"]), e("div", {
      class: this.ns.e("date")
    }, [e("span", ["导入数据所属月份"]), e("i-datePicker", {
      attrs: {
        format: "yyyy年MM月",
        type: "month",
        clearable: !1
      },
      model: {
        value: this.curDate,
        callback: (a) => {
          this.curDate = a;
        }
      }
    })]), this.message.state === "ready" ? e("div", {
      class: this.ns.b("upload"),
      on: {
        click: this.selectFile
      }
    }, [e("img", {
      class: this.ns.be("upload", "img"),
      attrs: {
        src: "./assets/img/icon-import.svg"
      }
    }), e("span", {
      class: this.ns.be("upload", "text")
    }, ["单击此区域进行上传"])]) : e("div", {
      class: this.ns.b("message")
    }, [e("div", {
      class: this.ns.be("message", "title")
    }, ["导入结果"]), e("div", {
      class: this.ns.be("message", "content")
    }, [this.message.message]), this.message.rowError.length > 0 && [e("div", {
      class: this.ns.be("message", "title")
    }, ["错误信息"]), e("div", {
      class: this.ns.be("message", "content")
    }, [this.message.rowError.map((a) => e("div", [`第 ${a.index} 行：${a.info}`]))])]]), e("div", {
      class: this.ns.e("template-container")
    }, [e("div", {
      class: this.ns.e("template-description")
    }, ["下载导入模版，并按要求填写："]), e("div", {
      class: this.ns.e("template-link"),
      on: {
        click: this.onLinkClick
      }
    }, [e("i-icon", {
      attrs: {
        type: "ios-link"
      }
    }), "数据导入模板文件"])]), e("div", {
      class: this.ns.e("button-bar")
    }, [this.message.state !== "ready" && e("i-button", {
      on: {
        click: this.selectFile
      }
    }, ["重新上传"])])]);
  }
});
const Ce = Y({
  name: "YearMonthPicker",
  props: ie(),
  emits: ne(),
  setup(a, {
    emit: s
  }) {
    const i = x("date-picker"), o = a.controller, d = o.model, f = b("date"), p = b("yyyy-MM-dd"), v = b(!1);
    switch (d.editorType) {
      case "DATEPICKEREX":
      case "DATEPICKEREX_NOTIME":
        f.value = "date";
        break;
      case "DATEPICKEREX_NODAY":
      case "DATEPICKEREX_NODAY_NOSECOND":
        v.value = !0, f.value = "time";
        break;
      case "DATEPICKEREX_HOUR":
      case "DATEPICKEREX_MINUTE":
      case "DATEPICKEREX_SECOND":
      case "DATEPICKEREX_NOSECOND":
      case "DATEPICKER":
      default:
        f.value = "datetime";
    }
    const c = o.valueFormat;
    if (c) {
      c === "YYYY-MM" ? f.value = "month" : c === "YYYY" && (f.value = "year");
      const n = c.replace("YYYY", "yyyy").replace("DD", "dd");
      p.value = n;
    }
    d.editorParams.formatText && (p.value = d.editorParams.formatText.replace("YYYY", "yyyy").replace("DD", "dd"));
    const y = b();
    z(() => a.value, (n, g) => {
      n && n !== g && (y.value = U(n).format(c));
    }, {
      immediate: !0
    });
    const E = (n, g) => {
      if (n) {
        const m = U(n.replace(/[年月]/g, "-")).format(c);
        s("change", m);
      } else
        s("change", n);
    }, l = (n) => {
      s("operate", n);
    }, u = b();
    return a.autoFocus && z(u, (n) => {
      n && n.$el.getElementsByTagName("input")[0].click();
    }), {
      ns: i,
      c: o,
      editorModel: d,
      type: f,
      format: p,
      formatValue: y,
      handleChange: E,
      onOpenChange: l,
      inputRef: u,
      isTimePicker: v
    };
  },
  render(a) {
    return a("div", {
      class: [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
    }, [[this.readonly && this.formatValue, !this.readonly && this.isTimePicker && a("ITimePicker", {
      ref: "inputRef",
      props: {
        ...this.c.customProps,
        value: this.value,
        type: this.type,
        format: this.format,
        placeholder: this.c.placeHolder,
        disabled: this.disabled,
        transfer: !0
      },
      on: {
        "on-change": this.handleChange,
        "on-open-change": this.onOpenChange
      }
    }), !this.readonly && !this.isTimePicker && a("ICalendarPicker", {
      ref: "inputRef",
      props: {
        ...this.c.customProps,
        value: this.value,
        type: this.type,
        format: this.format,
        placeholder: this.c.placeHolder,
        disabled: this.disabled,
        transfer: !0
      },
      on: {
        "on-change": this.handleChange,
        "on-open-change": this.onOpenChange
      }
    })]]);
  }
});
const Z = new de(import.meta.url), Pe = Y({
  name: "DownLoadSafeFile",
  props: {},
  setup() {
    const a = x("download-safe-file"), s = Z.dir("/assets/doc/safe-file.doc");
    return {
      ns: a,
      url: s
    };
  },
  render() {
    return e("div", {
      class: this.ns.b()
    }, [e("a", {
      attrs: {
        download: "网络信息安全承诺书.doc",
        href: this.url
      }
    }, ["网络信息安全承诺书.doc"])]);
  }
});
class we {
  constructor() {
    D(this, "component", "IBizFormDataComparison");
  }
}
class Fe extends ue {
  async execAction(s, i, o, d) {
    const f = {}, p = s.getPSAppDataEntity();
    if (p) {
      p.isFill === !1 && await p.fill(!0);
      const v = new W(p);
      await v.init();
      const { resultContext: c } = await this.handleParams(
        s,
        i,
        o,
        d
      ), y = ibiz.resourcePathUtil.calcPaths(
        c,
        v.codeName
      ), E = J(c, y);
      let l = `${E}/${v.deNamePlural}/importtemplate`, u = `${E}/${v.deNamePlural}/importdata2`;
      const n = s.getPSAppDEDataImport();
      n && (l += `?srfimporttag=${n.codeName}`, u += `?srfimporttag=${n.codeName}`);
      const g = ibiz.overlay.createModal(
        "CustomDataImport",
        {
          templateUrl: l,
          importUrl: u,
          dismiss: (m) => {
            g.dismiss(m);
          }
        },
        {
          width: "auto",
          placement: "center"
        }
      );
      return g.present(), await g.onWillDismiss(), {
        refresh: !0
      };
    }
    return f;
  }
}
class Ae {
  constructor() {
    D(this, "handler");
  }
  async getHandler() {
    return this.handler || (this.handler = new Fe()), this.handler;
  }
}
class Ie {
  constructor() {
    D(this, "gridEditor", "YearMonthPicker");
    D(this, "formEditor", "YearMonthPicker");
  }
  async createController(s, i) {
    const o = new fe(s, i);
    return await o.init(), o;
  }
}
class Te {
  constructor() {
    D(this, "formEditor", "DownLoadSafeFile");
    D(this, "gridEditor", "DownLoadSafeFile");
  }
  async createController(s, i) {
    const o = new ge(s, i);
    return await o.init(), o;
  }
}
class Ne extends me {
  async execAction(s, i, o, d, f) {
    const p = {}, { frontProcessType: v } = s;
    if (v === "OPENHTMLPAGE") {
      const c = ye.fill(s.htmlPageUrl, i, o == null ? void 0 : o[0]);
      window.open(c, "_blank");
    }
    if (v === "DATAIMP") {
      const c = s.getPSAppDataEntity();
      if (c) {
        c.isFill === !1 && await c.fill(!0);
        const y = new W(c);
        await y.init();
        const { resultContext: E } = await this.handleParams(
          s,
          i,
          o,
          d
        ), l = ibiz.resourcePathUtil.calcPaths(
          E,
          y.codeName
        ), u = J(E, l);
        let n = `${u}/${y.deNamePlural}/importtemplate`, g = `${u}/${y.deNamePlural}/importdata2`;
        const m = s.getPSAppDEDataImport();
        m && (n += `?srfimporttag=${m.codeName}`, g += `?srfimporttag=${m.codeName}`);
        const C = ibiz.overlay.createModal(
          "DataImport",
          {
            templateUrl: n,
            importUrl: g,
            dismiss: (w) => {
              C.dismiss(w);
            }
          },
          {
            width: "auto",
            placement: "center"
          }
        );
        return C.present(), await C.onWillDismiss(), {
          refresh: !0
        };
      }
    }
    if (["TOP", "WIZARD"].includes(v)) {
      const c = s.getFrontPSAppView();
      if (!c)
        throw new Error("未配置打开视图");
      await c.fill(!0);
      const { resultContext: y, resultParams: E } = await this.handleParams(
        s,
        i,
        o,
        d
      ), l = await ibiz.commands.execute(
        pe.TAG,
        c,
        y,
        E,
        f
      );
      (l == null ? void 0 : l.ok) === !1 && (p.closeView = !1, p.refresh = !1, p.cancel = !0), l != null && l.ok && l.data && (p.data = l.data);
    } else if (f) {
      const { neuron: c } = f, E = c.call.getFormController().call.getFormController(), { druipart1: l, druipart2: u, druipart3: n } = E.details;
      [
        {
          message: "服务履历为空",
          neuron: l
        },
        {
          message: "教育经验为空",
          neuron: u
        },
        {
          message: "项目经验为空",
          neuron: n
        }
      ].some((C) => {
        const w = C.neuron.neuron.call.getGridController();
        if (w) {
          const A = w.call.getGridController();
          if (A && A.items && A.items.length > 0)
            return !1;
        }
        return ibiz.message.error(`${C.message}`, 1.5, !0), !0;
      }) || await c.call.wfStart();
    }
    return p;
  }
}
class Oe {
  constructor() {
    D(this, "handler");
  }
  async getHandler() {
    return this.handler || (this.handler = new Ne()), this.handler;
  }
}
const $e = {
  mateUrl: import.meta.url,
  install(a) {
    Z.loadStyle(["/style.css"]), a.component("IBizFormDataComparison", De), a.component("CustomDataImport", be), a.component("YearMonthPicker", Ce), a.component("DownLoadSafeFile", Pe), ibiz.register.control.register(
      "EDITFORM_RENDER_FORM_DATA_COMPARISON",
      new we()
    ), ibiz.register.uiAction.register(
      "DEUIACTION_CUSTOM_IMPORT",
      new Ae()
    ), ibiz.register.editor.register(
      "DATEPICKEREX_NOTIME_YEAR_MONTH_PICKER",
      new Ie()
    ), ibiz.register.editor.register(
      "FILEUPLOADER_ONE_DOWNLOAD_FILE",
      new Te()
    ), ibiz.register.uiAction.register(
      "DEUIACTION_JUDEG_ENABLE_UPDATE",
      new Oe()
    );
  }
};
export {
  $e as default
};
