var Q = Object.defineProperty;
var X = (e, t, s) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
var k = (e, t, s) => (X(e, typeof t != "symbol" ? t + "" : t, s), s);
import { GridFieldColumnController as V, GridRowController as Z, WFStepTraceViewController as ee, UploadEditorController as M } from "@ibiz-template/controller";
import { defineComponent as U, computed as G, h as c, getCurrentInstance as N, ref as m, watch as T, toRefs as _ } from "vue";
import { useNamespace as S, useViewController as te, usePropsWatch as z, getUploadProps as se, getEditorEmits as oe, getGridUploadProps as A, useClickOutside as ie, useEventListener as re, useWFStepTraceViewController as ne, useWFDynaEditView3Controller as ae, useEditView3Controller as le } from "@ibiz-template/vue-util";
import { colorBlend as ce, IBizContext as de, HttpError as j, isImage as ue, uploadFile as me, RuntimeError as pe } from "@ibiz-template/core";
import { getCookie as he } from "qx-util";
import { ViewMode as R } from "@ibiz-template/runtime";
import { ViewType as fe } from "@ibiz-template/model";
const be = U({
  name: "CodeListGridColumn",
  props: {
    controller: {
      type: V,
      required: !0
    },
    row: {
      type: Z,
      required: !0
    }
  },
  setup(e) {
    const t = S("grid-field-column"), s = G(() => {
      var l;
      if (e.controller.model.source.cLConvertMode !== "FRONT")
        return [];
      const n = e.row.data[e.controller.model.codeName];
      return ((l = e.controller.codeListItems) == null ? void 0 : l.length) && n ? n.split(",").map((y) => {
        const f = e.controller.codeListItems.find((v) => v.value === y);
        if (f) {
          const v = f.color || "#515a6e";
          return {
            text: f.text,
            colorStyle: t.cssVarBlock({
              color: v,
              "border-color": v,
              "bg-color": ce(v, "#fff")
            })
          };
        }
      }).filter(Boolean) : [];
    }), o = (n) => {
      e.controller.isLinkColumn && e.controller.openLinkView(e.row, n);
    }, i = G(() => {
      let n = "";
      switch (e.controller.model.align) {
        case "LEFT":
          n = "flex-start";
          break;
        case "RIGHT":
          n = "flex-end";
          break;
        default:
          n = "center";
          break;
      }
      return t.cssVarBlock({
        "justify-content": n
      });
    });
    return {
      ns: t,
      alignStyle: i,
      selectedItems: s,
      onCellClick: o
    };
  },
  render() {
    const e = this.controller, t = this.row.data[e.model.codeName];
    return c("div", {
      class: [this.ns.b(), e.isLinkColumn && this.ns.m("link-column")],
      style: this.alignStyle,
      on: {
        click: this.onCellClick
      }
    }, [this.selectedItems.length > 0 ? this.selectedItems.map((s) => c("span", {
      class: this.ns.e("code-list-item"),
      style: s.colorStyle
    }, [s.text])) : c("span", {
      class: this.ns.e("text")
    }, [t])]);
  }
});
class ve extends ee {
  constructor() {
    super(...arguments);
    k(this, "imgSrc");
  }
  async getUIData() {
    const s = new de(this.params, this.context), o = await this.entityService.wf.getWFProcessDiagram(s), i = new Blob([o.data]);
    this.imgSrc = URL.createObjectURL(i);
  }
}
const we = U({
  name: "PresetWFChartView",
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    },
    deName: {
      type: String,
      required: !0
    }
  },
  setup(e) {
    const t = S("preset-wf-chart-view"), {
      proxy: s
    } = N(), o = te(s, (i, n) => new ve(e.modelPath, i, n));
    return z(s, "deName", o.setDeName.bind(o)), {
      c: o,
      ns: t
    };
  },
  render() {
    return c("div", {
      class: this.ns.b()
    }, [c("img", {
      attrs: {
        src: this.c.imgSrc
      }
    })]);
  }
});
const ye = U({
  name: "WFToolbar",
  props: {
    wfLinks: {
      type: Array,
      required: !0
    }
  },
  setup(e, {
    emit: t
  }) {
    return {
      ns: S("wf-toolbar"),
      handleClick: async (i, n) => {
        t("wf-link-click", i, n);
      }
    };
  },
  render() {
    const e = this.wfLinks || [];
    return c("div", {
      class: `${this.ns.b()}`
    }, [e.length > 0 && e.map((t) => {
      const s = t.sequenceFlowName == "\u9A73\u56DE" || t.sequenceFlowName == "\u53D6\u6D88";
      return c("div", {
        key: t.sequenceFlowId,
        class: [this.ns.e("item"), s ? this.ns.em("item", "reject") : ""]
      }, [c("i-button", {
        attrs: {
          title: t.sequenceFlowName
        },
        on: {
          click: (o) => this.handleClick(t, o)
        }
      }, [t.sequenceFlowName || ""])]);
    })]);
  }
}), Fe = typeof btoa == "function", B = typeof Buffer == "function";
typeof TextDecoder == "function" && new TextDecoder();
const W = typeof TextEncoder == "function" ? new TextEncoder() : void 0, ge = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", I = Array.prototype.slice.call(ge);
((e) => {
  let t = {};
  return e.forEach((s, o) => t[s] = o), t;
})(I);
const x = String.fromCharCode.bind(String);
typeof Uint8Array.from == "function" && Uint8Array.from.bind(Uint8Array);
const Ce = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (t) => t == "+" ? "-" : "_"), Ee = (e) => {
  let t, s, o, i, n = "";
  const l = e.length % 3;
  for (let d = 0; d < e.length; ) {
    if ((s = e.charCodeAt(d++)) > 255 || (o = e.charCodeAt(d++)) > 255 || (i = e.charCodeAt(d++)) > 255)
      throw new TypeError("invalid character found");
    t = s << 16 | o << 8 | i, n += I[t >> 18 & 63] + I[t >> 12 & 63] + I[t >> 6 & 63] + I[t & 63];
  }
  return l ? n.slice(0, l - 3) + "===".substring(l) : n;
}, q = Fe ? (e) => btoa(e) : B ? (e) => Buffer.from(e, "binary").toString("base64") : Ee, Ue = B ? (e) => Buffer.from(e).toString("base64") : (e) => {
  let s = [];
  for (let o = 0, i = e.length; o < i; o += 4096)
    s.push(x.apply(null, e.subarray(o, o + 4096)));
  return q(s.join(""));
}, xe = (e) => {
  if (e.length < 2) {
    var t = e.charCodeAt(0);
    return t < 128 ? e : t < 2048 ? x(192 | t >>> 6) + x(128 | t & 63) : x(224 | t >>> 12 & 15) + x(128 | t >>> 6 & 63) + x(128 | t & 63);
  } else {
    var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
    return x(240 | t >>> 18 & 7) + x(128 | t >>> 12 & 63) + x(128 | t >>> 6 & 63) + x(128 | t & 63);
  }
}, Se = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, ke = (e) => e.replace(Se, xe), O = B ? (e) => Buffer.from(e, "utf8").toString("base64") : W ? (e) => Ue(W.encode(e)) : (e) => q(ke(e)), $ = (e, t = !1) => t ? Ce(O(e)) : O(e);
function Te(e, t, s) {
  const o = m([]), i = m({
    Authorization: `Bearer ${he("access_token")}`
  }), n = m(""), l = m(""), d = {
    count: 0,
    cacheFiles: []
  };
  T(
    () => e.value,
    (r) => {
      o.value = r ? JSON.parse(r) : [];
    },
    { immediate: !0 }
  ), T(
    () => e.data,
    (r) => {
      if (r) {
        const a = s.calcBaseUrl(r);
        n.value = a.uploadUrl, l.value = a.downloadUrl;
      }
    },
    { immediate: !0, deep: !0 }
  ), T(
    o,
    (r) => {
      (r == null ? void 0 : r.length) && l.value && r.forEach((a) => {
        a.url = a.url || l.value.replace("%fileId%", a.id);
      });
    },
    { immediate: !0 }
  ), T(
    l,
    (r) => {
      r && o.value.length && o.value.forEach((a) => {
        a.url = l.value.replace("%fileId%", a.id);
      });
    },
    { immediate: !0 }
  );
  const u = () => {
    const r = [...o.value, ...d.cacheFiles], a = r.length > 0 ? JSON.stringify(r.map((h) => ({ name: h.name, id: h.id }))) : null;
    d.cacheFiles = [], t(a);
  }, y = (r) => {
    const a = ["html", "js", "exe", "sh"], h = r.name.trim().toLowerCase();
    if (a.some((L) => h.endsWith(`.${L}`)))
      return ibiz.message.error("\u4E0D\u53EF\u4E0A\u4F20 html\u3001js\u3001 exe\u3001sh\u7C7B\u578B\u7684\u6587\u4EF6\uFF01"), !1;
    d.count += 1;
  }, f = (r) => {
    !r || (d.cacheFiles.push({
      name: r.filename,
      id: r.fileid
    }), d.count -= 1, d.count === 0 && u());
  }, v = (r, a) => {
    throw d.count -= 1, new j({
      response: { data: a, status: r.status }
    });
  }, F = (r) => {
    if (e.disabled)
      return;
    const a = o.value.findIndex((h) => h.id === r.id);
    a !== -1 && o.value.splice(a, 1), u();
  }, E = (r) => {
    const a = r.url || l.value.replace("%fileId%", r.id);
    s.fileDownload({ url: a, name: r.name });
  }, p = m(!1), g = m(""), C = m("");
  return {
    uploadUrl: n,
    downloadUrl: l,
    headers: i,
    files: o,
    onDownload: E,
    onError: v,
    onRemove: F,
    onSuccess: f,
    beforeUpload: y,
    showModal: p,
    modalTitle: g,
    iframeUrl: C,
    onModalCancel: () => {
      p.value = !1, g.value = "", C.value = "";
    },
    previewFile: (r) => {
      p.value = !0, g.value = r.name;
      const a = window.Environment.previewFileUrl;
      if (a) {
        const h = encodeURIComponent(
          $(
            `${window.location.origin}${r.url}?fullfilename=${r.name}`
          )
        );
        C.value = `${a}/onlinePreview?url=${h}`;
      }
    }
  };
}
const De = U({
  name: "SyFileUpload",
  props: se(),
  emits: oe(),
  setup(e, {
    emit: t
  }) {
    const s = S("sy-file-upload"), o = e.controller, {
      uploadUrl: i,
      headers: n,
      files: l,
      onDownload: d,
      onError: u,
      onRemove: y,
      onSuccess: f,
      beforeUpload: v,
      showModal: F,
      modalTitle: E,
      iframeUrl: p,
      onModalCancel: g,
      previewFile: C
    } = Te(e, (w) => {
      t("change", w);
    }, o);
    return {
      ns: s,
      c: o,
      uploadUrl: i,
      headers: n,
      files: l,
      onDownload: d,
      onError: u,
      onRemove: y,
      onSuccess: f,
      beforeUpload: v,
      showModal: F,
      modalTitle: E,
      iframeUrl: p,
      onModalCancel: g,
      previewFile: C
    };
  },
  render(e) {
    return e("div", {
      class: [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
    }, [e("IUpload", {
      ref: "fileUpload",
      props: {
        action: this.uploadUrl,
        headers: this.headers,
        disabled: this.disabled,
        "default-file-list": this.files,
        multiple: this.c.model.multiple,
        type: this.c.model.isDrag ? "drag" : "select",
        accept: this.c.model.accept,
        "before-upload": this.beforeUpload,
        "on-success": this.onSuccess,
        "on-error": this.onError,
        "on-remove": this.onRemove,
        "on-preview": this.onDownload,
        "show-upload-list": !1
      }
    }, [this.c.model.isDrag ? e("div", {
      class: this.ns.bm("box", "drag")
    }, [e("i-icon", {
      attrs: {
        type: "md-cloud-upload"
      }
    }), e("div", {
      class: this.ns.be("box", "title")
    }, [e("span", ["\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216"]), e("span", ["\u70B9\u51FB\u4E0A\u4F20"])])]) : e("i-button", {
      attrs: {
        icon: "ios-cloud-upload-outline"
      },
      class: this.ns.bm("box", "select")
    }, ["\u4E0A\u4F20\u6587\u4EF6"])]), e("div", {
      class: this.ns.b("file-list")
    }, [this.files.map((t) => e("div", {
      class: this.ns.b("file-item"),
      key: t.id
    }, [e("div", {
      class: this.ns.b("file-item-left")
    }, [e("i-icon", {
      attrs: {
        type: "md-document"
      }
    })]), e("div", {
      class: this.ns.b("file-item-right")
    }, [e("div", {
      class: this.ns.b("file-item-right-title"),
      on: {
        click: () => this.previewFile(t)
      }
    }, [t.name]), e("div", {
      class: this.ns.b("file-item-right-action")
    }, [e("i-icon", {
      attrs: {
        type: "md-download"
      },
      on: {
        click: () => this.onDownload(t)
      }
    }), e("i-icon", {
      attrs: {
        type: "md-eye"
      },
      on: {
        click: () => this.previewFile(t)
      }
    }), this.disabled || this.readonly ? null : e("i-icon", {
      attrs: {
        type: "md-close"
      },
      on: {
        click: () => this.onRemove(t)
      }
    })])])]))]), e("i-modal", {
      attrs: {
        value: this.showModal,
        title: this.modalTitle,
        "class-name": this.ns.b("modal"),
        width: "70%",
        transfer: !1,
        "footer-hide": !0
      },
      on: {
        "on-cancel": this.onModalCancel
      }
    }, [e("iframe", {
      class: this.ns.b("iframe"),
      attrs: {
        src: this.iframeUrl
      }
    })])]);
  }
});
function P(e, t) {
  if (e.url = t.replace("%fileId%", e.id), e.status || (e.status = "finished"), !e.fileName) {
    const s = e.name.lastIndexOf(".");
    e.fileName = e.name.substring(0, s), e.fileExt = e.name.substring(s), e.isImage = ue(e.name);
  }
  return e;
}
function H(e) {
  const t = m(""), s = m(""), o = m([]);
  return T(
    e.data,
    (i) => {
      if (i) {
        const n = e.controller.value.calcBaseUrl(i);
        t.value = n.uploadUrl, s.value = n.downloadUrl;
      }
    },
    { immediate: !0, deep: !0 }
  ), T(
    e.value,
    (i) => {
      o.value = i ? JSON.parse(i) : [], o.value.length && s.value && o.value.forEach((n) => {
        P(n, s.value);
      });
    },
    { immediate: !0 }
  ), T(
    s,
    (i) => {
      i && o.value.length && o.value.forEach((n) => {
        P(n, i);
      });
    },
    { immediate: !0 }
  ), {
    downloadUrl: s,
    uploadUrl: t,
    valueList: o
  };
}
function J(e) {
  const t = m("undo"), s = m([]), { downloadUrl: o, value: i, uploadUrl: n } = e;
  T(
    i,
    (w) => {
      w.length > 0 && (s.value = [], w.forEach((b) => {
        s.value.push(P(b, o.value));
      }));
    },
    {
      immediate: !0,
      deep: !0
    }
  );
  const l = (w, b) => {
    const r = ["html", "js", "exe", "sh"], a = [];
    return b.forEach((h, D) => {
      const L = h.name.trim().toLowerCase();
      if (r.some((K) => L.endsWith(`.${K}`))) {
        a.push(D);
        return;
      }
      s.value.push({
        name: h.name,
        status: h.status,
        percentage: h.percentage,
        id: h.uid,
        url: ""
      });
    }), a.length === b.length ? (ibiz.message.error("\u4E0D\u53EF\u4E0A\u4F20 html\u3001js\u3001 exe\u3001sh\u7C7B\u578B\u7684\u6587\u4EF6\uFF01"), !1) : (a.length && (a.forEach((h) => {
      w.splice(h, 1), b.splice(h, 1);
    }), ibiz.message.error("\u4E0D\u53EF\u4E0A\u4F20 html\u3001js\u3001 exe\u3001sh\u7C7B\u578B\u7684\u6587\u4EF6\uFF01")), !0);
  }, d = (w) => {
    w.forEach((b) => {
      s.value.find((r) => r.id === b.uid ? (r.percentage = b.percentage, !0) : !1);
    });
  }, u = (w, b) => {
    w.forEach((r) => {
      s.value.find((a) => a.id === r.uid ? (a.status = r.status, a.id = b.data.fileid, a.name = b.data.filename, P(a, o.value), !0) : !1);
    });
  }, y = (w, b) => {
    var a;
    w.forEach((h) => {
      s.value.find((D) => D.id === h.uid ? (D.status = h.status, !0) : !1);
    });
    const r = new j(b);
    ibiz.notification.error({
      title: (a = r.status) == null ? void 0 : a.toString(),
      desc: r.message,
      duration: 10
    });
  }, f = (w) => {
    s.value = s.value.filter((b) => b.status === "finished"), t.value = "done";
  }, v = () => {
    me({
      multiple: e.multiple,
      accept: e.accept,
      uploadUrl: n.value,
      beforeUpload: l,
      progress: d,
      success: u,
      error: y,
      finish: f
    });
  }, F = m(!1), E = m(""), p = m("");
  return {
    selectFile: v,
    fileList: s,
    uploadState: t,
    showModal: F,
    modalTitle: E,
    iframeUrl: p,
    onModalCancel: () => {
      F.value = !1, E.value = "", p.value = "";
    },
    previewFile: (w) => {
      F.value = !0, E.value = w.name;
      const b = window.Environment.previewFileUrl;
      if (b) {
        const r = encodeURIComponent(
          $(
            `${window.location.origin}${w.url}?fullfilename=${w.name}`
          )
        );
        p.value = `${b}/onlinePreview?url=${r}`;
      }
    }
  };
}
const Ie = U({
  name: "SyGridFileUpload",
  props: A(),
  setup(e) {
    const t = S("sy-grid-file-upload"), {
      value: s,
      data: o,
      controller: i
    } = _(e), {
      downloadUrl: n,
      uploadUrl: l,
      valueList: d
    } = H({
      value: s,
      data: o,
      controller: i
    }), {
      fileList: u,
      showModal: y,
      modalTitle: f,
      iframeUrl: v,
      previewFile: F,
      onModalCancel: E
    } = J({
      downloadUrl: n,
      uploadUrl: l,
      value: d
    });
    return {
      ns: t,
      fileList: u,
      showModal: y,
      modalTitle: f,
      iframeUrl: v,
      downloadFile: (g) => {
        e.controller.fileDownload(g);
      },
      previewFile: F,
      onModalCancel: E
    };
  },
  render() {
    return c("grid-editor", {
      attrs: {
        disabled: this.disabled,
        readonly: this.readonly
      },
      class: [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
    }, [c("div", {
      class: this.ns.b("file-list")
    }, [this.fileList.map((e) => c("div", {
      class: this.ns.b("file-item"),
      key: e.id
    }, [c("div", {
      class: this.ns.b("file-item-title"),
      on: {
        click: () => this.previewFile(e)
      }
    }, [e.name]), c("div", {
      class: this.ns.b("file-item-action")
    }, [c("i-icon", {
      attrs: {
        type: "md-download"
      },
      on: {
        click: () => this.downloadFile(e)
      }
    }), c("i-icon", {
      attrs: {
        type: "md-eye"
      },
      on: {
        click: () => this.previewFile(e)
      }
    })])]))]), c("i-modal", {
      attrs: {
        value: this.showModal,
        title: this.modalTitle,
        "class-name": this.ns.b("modal"),
        width: "70%",
        transfer: !1,
        "footer-hide": !0
      },
      on: {
        "on-cancel": this.onModalCancel
      }
    }, [c("iframe", {
      class: this.ns.b("iframe"),
      attrs: {
        src: this.iframeUrl
      }
    })])]);
  }
}), Pe = U({
  name: "SyGridFileUploadContainer",
  props: A(),
  render(e) {
    return this.disabled || this.readonly ? e("SyGridFileUpload", {
      props: {
        ...this.$props
      }
    }) : e("SyEditGridFileUpload", {
      props: {
        ...this.$props
      }
    });
  }
});
const Ne = U({
  name: "SyEditGridFileUploadPopover",
  props: {
    uploadUrl: {
      type: String,
      required: !0
    },
    downloadUrl: {
      type: String,
      required: !0
    },
    value: {
      type: Array,
      required: !0
    },
    controller: {
      type: M,
      required: !0
    }
  },
  emits: {
    close: (e) => !0
  },
  setup(e, {
    emit: t
  }) {
    const s = S("sy-edit-grid-file-upload-popover"), {
      downloadUrl: o,
      value: i,
      uploadUrl: n
    } = _(e), {
      fileList: l,
      uploadState: d,
      selectFile: u
    } = J({
      downloadUrl: o,
      value: i,
      uploadUrl: n
    }), y = m(), f = m(!1), v = ie(y, async (p) => {
      t("close", {
        isModified: f.value,
        resultFiles: l.value
      });
    });
    return T(d, (p) => {
      p === "done" ? (f.value = !0, v.proceed()) : p === "loading" && v.pause();
    }), {
      ns: s,
      componentRef: y,
      fileList: l,
      deleteFile: (p) => {
        const g = l.value.findIndex((C) => C.id === p.id);
        l.value.splice(g, 1), f.value = !0;
      },
      selectFile: u,
      downloadFile: (p) => {
        e.controller.fileDownload(p);
      }
    };
  },
  render() {
    return c("div", {
      ref: "componentRef",
      style: "width:300px",
      class: this.ns.b()
    }, [c("div", {
      class: this.ns.b("file-list")
    }, [this.fileList.map((e) => c("div", {
      class: this.ns.b("file-item"),
      key: e.id
    }, [c("div", {
      class: this.ns.b("file-item-title"),
      on: {
        click: () => this.downloadFile(e)
      }
    }, [e.name]), c("div", {
      class: this.ns.b("file-item-action")
    }, [c("i-icon", {
      attrs: {
        type: "md-close"
      },
      on: {
        click: () => this.deleteFile(e)
      }
    })])]))]), c("div", {
      on: {
        click: () => this.selectFile()
      },
      class: this.ns.e("button")
    }, [c("i-icon", {
      attrs: {
        type: "md-add"
      }
    }), "\u6DFB\u52A0\u6587\u4EF6"])]);
  }
});
const Le = U({
  name: "SyEditGridFileUpload",
  props: A(),
  setup(e) {
    const t = S("sy-edit-grid-file-upload"), {
      value: s,
      data: o,
      controller: i
    } = _(e), {
      downloadUrl: n,
      uploadUrl: l,
      valueList: d
    } = H({
      value: s,
      data: o,
      controller: i
    }), u = m(), y = async () => {
      if (!u.value)
        throw new pe("\u5BB9\u5668\u5143\u7D20\u4E0D\u5B58\u5728");
      const f = u.value.$el, v = f.offsetHeight, F = ibiz.overlay.createPopover((g) => g(Ne, {
        props: {
          value: d.value,
          uploadUrl: l.value,
          downloadUrl: n.value,
          controller: i.value
        },
        on: {
          close: (C) => {
            F.dismiss(C);
          }
        }
      }), void 0, {
        noArrow: !0,
        placement: "bottom-start",
        offsetOpts: {
          mainAxis: -v,
          crossAxis: 0
        }
      });
      await F.present(f);
      const {
        isModified: E,
        resultFiles: p
      } = await F.onWillDismiss();
      if (E) {
        const g = p.length > 0 ? JSON.stringify(p.map((C) => ({
          name: C.name,
          id: C.id
        }))) : null;
        await e.rowDataChange(g), await e.rowSave();
      }
    };
    return re(u, "click", (f) => {
      e.disabled || y();
    }), {
      ns: t,
      valueList: d,
      componentRef: u
    };
  },
  render() {
    return c("grid-editor", {
      attrs: {
        disabled: this.disabled,
        readonly: this.readonly
      },
      ref: "componentRef",
      class: this.ns.b()
    }, [c("div", {
      class: this.ns.b("file-list")
    }, [this.valueList.map((e) => c("div", {
      class: this.ns.b("file-item"),
      key: e.id
    }, [c("div", {
      class: this.ns.b("file-item-title")
    }, [e.name])]))])]);
  }
});
class _e {
  constructor() {
    k(this, "component", we);
  }
}
class Ae {
  constructor() {
    k(this, "component", be);
  }
  async createController(t, s) {
    const o = new V(t, s);
    return await o.init(), o;
  }
}
class Be {
  constructor() {
    k(this, "component", "IndexView");
  }
}
const Y = U({
  name: "WFStepTraceGrid",
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    },
    deName: {
      type: String,
      required: !0
    }
  },
  setup(e) {
    const {
      proxy: t
    } = N(), s = ne(t, e.modelPath);
    z(t, "deName", s.setDeName.bind(s));
    const o = S("wf-step-trace-grid"), i = m([]);
    s.nerve.self.evt.on("mounted", () => {
      var l;
      !s.data || (l = s.data.usertasks) == null || l.forEach((d) => {
        d.identitylinks.length > 0 || (d.comments.length > 0 && d.comments.forEach((u) => {
          i.value.push({
            nodeName: d.userTaskName,
            personName: u.authorName,
            time: u.time,
            content: u.type,
            comment: u.fullMessage
          });
        }), i.value.sort((u, y) => Date.parse(y.time) - Date.parse(u.time)));
      });
    });
    const n = m([{
      title: "\u5904\u7406\u73AF\u8282",
      key: "nodeName",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u4EBA",
      key: "personName",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u65F6\u95F4",
      key: "time",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u5185\u5BB9",
      key: "content",
      width: 180,
      resizable: !0
    }, {
      title: "\u5904\u7406\u610F\u89C1",
      key: "comment"
    }]);
    return {
      c: s,
      ns: o,
      gridData: i,
      columns: n
    };
  },
  render() {
    return c("div", {
      class: this.ns.b()
    }, [c("div", {
      class: this.ns.e("title")
    }, ["\u5BA1\u6279\u4FE1\u606F"]), c("i-table", {
      attrs: {
        "disabled-hover": !0,
        columns: this.columns,
        data: this.gridData
      },
      class: this.ns.e("grid")
    })]);
  }
}), Ge = U({
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(e) {
    const {
      proxy: t
    } = N(), s = ae(t, e.modelPath), o = S(`view-${fe.DE_WF_DYNA_EDIT_VIEW3}`.toLowerCase()), i = m(["mainForm"]);
    return {
      c: s,
      ns: o,
      onTabClick: (l) => {
        i.value.includes(l) || i.value.push(l);
      },
      lazyList: i
    };
  },
  render(e) {
    const t = [];
    if (this.c.complete) {
      const {
        activeForm: s
      } = this.c;
      s && this.c.providers[s.name] && t.push(e(this.c.providers[s.name].component, {
        props: {
          modelData: s,
          context: this.c.context,
          params: this.c.params
        },
        style: {
          height: "auto"
        },
        on: {
          neuronInit: this.c.nerve.onNeuronInit("form")
        }
      }));
    }
    if (this.c.complete && this.c.model.drTab.pages[0]) {
      const s = this.c.model.drTab.pages[0], o = this.c.drPages[s.source.name];
      t.push(e(Y, {
        attrs: {
          context: o.context,
          params: o.params,
          deName: this.c.model.appEntity.source.codeName,
          modal: this.modal,
          modelPath: s.embedView.source.modelPath
        }
      }));
    }
    return e("view-base", {
      attrs: {
        controller: this.c
      },
      scopedSlots: {
        toolbar: () => this.c.complete ? [this.c.wfLinks.length > 0 && e("wf-toolbar", {
          attrs: {
            wfLinks: this.c.wfLinks
          },
          on: {
            "wf-link-click": (s) => {
              this.c.onLinkClick(s);
            }
          }
        })] : null
      }
    }, [this.c.complete && e("i-tabs", {
      class: [this.ns.be("", "tab")],
      attrs: {
        name: this.c.model.drTab.source.name
      },
      on: {
        "on-click": this.onTabClick
      }
    }, [e("i-tab-pane", {
      class: this.ns.be("", "tab-item"),
      attrs: {
        tab: this.c.model.drTab.source.name,
        label: this.c.model.drTab.source.editItemCaption,
        name: "mainForm"
      }
    }, [t]), this.c.model.drTab.pages.map((s) => {
      const o = this.c.drPages[s.source.name];
      return e("i-tab-pane", {
        class: this.ns.be("", "tab-item"),
        attrs: {
          tab: this.c.model.drTab.source.name,
          disabled: this.c.isNewData,
          label: s.source.caption,
          name: s.source.name
        }
      }, [!this.c.isNewData && this.lazyList.includes(s.source.name) && e("ViewShell", {
        props: {
          context: o.context,
          params: o.params,
          modal: {
            mode: R.EMBED
          },
          modelPath: s.embedView.source.modelPath,
          deName: this.c.model.appEntity.source.codeName
        },
        on: {
          neuronInit: this.c.nerve.onNeuronInit(s.source.name)
        },
        key: o.key
      })]);
    })])]);
  }
});
class We {
  constructor() {
    k(this, "component", Ge);
  }
}
const Oe = U({
  name: "SyEditView3",
  props: {
    context: Object,
    params: {
      type: Object
    },
    modelPath: {
      type: String,
      required: !0
    },
    modal: {
      type: Object
    }
  },
  setup(e) {
    const {
      proxy: t
    } = N(), s = le(t, e.modelPath), o = S("view-deeditview3"), i = m(["mainForm"]);
    return {
      c: s,
      ns: o,
      onTabClick: (l) => {
        i.value.includes(l) || i.value.push(l);
      },
      lazyList: i
    };
  },
  render(e) {
    return e("view-base", {
      attrs: {
        controller: this.c
      }
    }, [this.c.complete && e("i-tabs", {
      class: [this.ns.be("", "tab")],
      attrs: {
        name: this.c.model.drTab.source.name
      },
      on: {
        "on-click": this.onTabClick
      }
    }, [e("i-tab-pane", {
      class: this.ns.be("", "tab-item"),
      attrs: {
        tab: this.c.model.drTab.source.name,
        label: this.c.model.drTab.source.editItemCaption,
        name: "mainForm"
      }
    }, [e("edit-form-control", {
      attrs: {
        modelData: this.c.model.form,
        context: this.c.context,
        params: this.c.params
      },
      style: {
        height: "auto"
      },
      on: {
        neuronInit: this.c.nerve.onNeuronInit(this.c.model.form.source.name)
      }
    }), e(Y, {
      attrs: {
        context: this.c.drPages[this.c.model.drTab.pages[0].source.name].context,
        params: this.c.drPages[this.c.model.drTab.pages[0].source.name].params,
        deName: this.c.model.appEntity.source.codeName,
        modal: this.modal,
        modelPath: this.c.model.drTab.pages[0].embedView.source.modelPath
      }
    })]), this.c.model.drTab.pages.map((t) => {
      const s = this.c.drPages[t.source.name];
      if (!!s)
        return e("i-tab-pane", {
          class: this.ns.be("", "tab-item"),
          attrs: {
            tab: this.c.model.drTab.source.name,
            disabled: this.c.isNewData,
            label: t.source.caption,
            name: t.source.name
          }
        }, [!this.c.isNewData && this.lazyList.includes(t.source.name) && e("ViewShell", {
          props: {
            context: s.context,
            params: s.params,
            modal: {
              mode: R.EMBED
            },
            modelPath: t.embedView.source.modelPath,
            deName: this.c.model.appEntity.source.codeName
          },
          on: {
            neuronInit: this.c.nerve.onNeuronInit(t.source.name)
          },
          key: s.key
        })]);
    })])]);
  }
});
class Ve {
  constructor() {
    k(this, "component", Oe);
  }
}
class Me {
  constructor() {
    k(this, "formEditor", "SyFileUpload");
    k(this, "gridEditor", "SyGridFileUploadContainer");
  }
  async createController(t, s) {
    const o = new M(t, s);
    return await o.init(), o;
  }
}
const Qe = {
  mateUrl: import.meta.url,
  install(e) {
    ibiz.config.enableDataInfoBar = !1, e.component("WfToolbar", ye), ibiz.register.view.register(
      "VIEW_CUSTOM_SyWebIndexView",
      new Be()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_PresetWFChartView",
      new _e()
    ), ibiz.register.gridColumn.register(
      "GRID_COLRENDER_CodeListGridColumn",
      new Ae()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_SyWfDynaEditView3",
      new We()
    ), ibiz.register.view.register(
      "VIEW_CUSTOM_SyEditView3",
      new Ve()
    ), e.component("SyFileUpload", De), e.component("SyGridFileUpload", Ie), e.component("SyEditGridFileUpload", Le), e.component("SyGridFileUploadContainer", Pe), ibiz.register.editor.register(
      "EDITOR_CUSTOMSTYLE_SyFileUpload",
      new Me()
    );
  }
};
export {
  Qe as default
};
