| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- var L = (o, f, a) => new Promise((l, T) => {
- var b = (n) => {
- try {
- E(a.next(n));
- } catch (_) {
- T(_);
- }
- }, I = (n) => {
- try {
- E(a.throw(n));
- } catch (_) {
- T(_);
- }
- }, E = (n) => n.done ? l(n.value) : Promise.resolve(n.value).then(b, I);
- E((a = a.apply(o, f)).next());
- });
- import { computed as v, ref as k, watch as V, resolveComponent as C, openBlock as s, createElementBlock as S, createBlock as c, createCommentVNode as m, withCtx as h, Fragment as Y, renderList as F, createTextVNode as O, toDisplayString as P } from "vue";
- import { I as g, a6 as B, a7 as G, di as y, dj as H } from "./index2.js";
- import { _ as $ } from "./index9.js";
- import { D as j } from "./dayjs.js";
- const R = {
- key: 0,
- class: "custom-input"
- }, W = /* @__PURE__ */ Object.assign({ name: "CustomInput" }, {
- __name: "CustomInput",
- props: {
- // 查询条件整行(SettingFilter 的 filters 项),组件直接读写它的 value 字段
- data: {
- type: Object,
- default: () => ({})
- },
- disabled: {
- type: Boolean,
- default: !1
- }
- },
- setup(o) {
- const f = o, a = v({
- get: () => {
- var t;
- const e = (t = f.data) == null ? void 0 : t.value;
- return e === "" ? void 0 : e;
- },
- set: (e) => {
- f.data && (f.data.value = e == null ? "" : e);
- }
- }), l = v(() => {
- var e;
- return ((e = f.data) == null ? void 0 : e.filterConfig) || null;
- }), T = k(1), b = k(0), I = v(
- () => {
- var e;
- return ((e = l.value) == null ? void 0 : e.filterType) === "DATETIME" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
- }
- ), E = v(() => {
- var t;
- const e = (t = l.value) == null ? void 0 : t.filterType;
- return !e || e === "INPUT";
- }), n = v(() => {
- var t;
- return ["SINGLE_SELECT", "MULTIPLE_SELECT", "GANDER", "IS"].includes((t = l.value) == null ? void 0 : t.filterType);
- }), _ = v(() => {
- var t;
- return ["INT", "FLOAT"].includes((t = l.value) == null ? void 0 : t.filterType);
- }), U = v(() => {
- var t;
- return ["DATE", "DATETIME"].includes((t = l.value) == null ? void 0 : t.filterType);
- });
- V(
- l,
- (e) => L(this, null, function* () {
- if (!e) return;
- const t = ["SINGLE_SELECT", "MULTIPLE_SELECT", "GANDER", "IS"];
- if (T.value = e.step || 1, b.value = e.precision === void 0 ? 0 : e.precision, t.includes(e.filterType) && !e.filterData && !!e.filterApi) {
- const r = yield e.filterApi({ type: "portal_config_type" }, { pageSize: 10, pageNo: 1 });
- e.filterData = (r.list || []).map((d) => {
- var p, D;
- return {
- value: d[(p = e.props) == null ? void 0 : p.value],
- name: d[(D = e.props) == null ? void 0 : D.key]
- };
- });
- }
- }),
- { immediate: !0, deep: !0 }
- );
- function w(e, t) {
- return H(e, t);
- }
- function x(e = y()) {
- var d, p;
- const t = (d = l.value) == null ? void 0 : d.startDate, i = (p = l.value) == null ? void 0 : p.endDate;
- if (!t && !i) return !1;
- const r = y(e).unix();
- if (t && i)
- return r < y(t).unix() || r > y(i).unix();
- if (t)
- return r <= y(t).unix();
- if (i)
- return r >= y(i).unix();
- }
- return (e, t) => {
- const i = g, r = G, d = B, p = $, D = j, M = C("s-office-select"), N = C("s-tree-select");
- return l.value ? (s(), S("div", R, [
- E.value ? (s(), c(i, {
- key: 0,
- style: { width: "100%" },
- disabled: o.disabled,
- value: a.value,
- "onUpdate:value": t[0] || (t[0] = (u) => a.value = u),
- placeholder: e.$l("请输入"),
- maxLength: l.value.length || 200
- }, null, 8, ["disabled", "value", "placeholder", "maxLength"])) : m("", !0),
- n.value ? (s(), c(d, {
- key: 1,
- style: { width: "100%" },
- disabled: o.disabled,
- value: a.value,
- "onUpdate:value": t[1] || (t[1] = (u) => a.value = u),
- mode: l.value.filterType === "MULTIPLE_SELECT" ? "multiple" : void 0,
- allowClear: !0,
- placeholder: e.$l("请选择")
- }, {
- default: h(() => [
- (s(!0), S(Y, null, F(l.value.filterData || [], (u, A) => (s(), c(r, {
- value: u.value,
- key: A
- }, {
- default: h(() => [
- O(P(u.name), 1)
- ]),
- _: 2
- }, 1032, ["value"]))), 128))
- ]),
- _: 1
- }, 8, ["disabled", "value", "mode", "placeholder"])) : m("", !0),
- _.value ? (s(), c(p, {
- key: 2,
- disabled: o.disabled,
- precision: b.value,
- step: T.value,
- style: { width: "100%" },
- value: a.value,
- "onUpdate:value": t[2] || (t[2] = (u) => a.value = u),
- placeholder: e.$l("请输入"),
- min: l.value.minValue,
- max: l.value.maxValue
- }, null, 8, ["disabled", "precision", "step", "value", "placeholder", "min", "max"])) : m("", !0),
- U.value ? (s(), c(D, {
- key: 3,
- style: { width: "100%" },
- disabled: o.disabled,
- value: a.value,
- "onUpdate:value": t[3] || (t[3] = (u) => a.value = u),
- "value-format": I.value,
- "show-time": l.value.filterType === "DATETIME" ? { format: "HH:mm:ss" } : !1,
- placeholder: e.$l("请选择"),
- "disabled-date": x
- }, null, 8, ["disabled", "value", "value-format", "show-time", "placeholder"])) : m("", !0),
- l.value.filterType === "USER" ? (s(), c(M, {
- key: 4,
- value: a.value,
- "onUpdate:value": t[4] || (t[4] = (u) => a.value = u)
- }, null, 8, ["value"])) : m("", !0),
- l.value.filterType === "OFFICE" ? (s(), c(N, {
- key: 5,
- value: a.value,
- "onUpdate:value": t[5] || (t[5] = (u) => a.value = u),
- recursionChildren: w
- }, null, 8, ["value"])) : m("", !0)
- ])) : m("", !0);
- };
- }
- });
- export {
- W as default
- };
|