zhihao-ui 1.3.54 → 1.3.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as z, useSlots as R, inject as T, computed as n, ref as M, watchEffect as A, openBlock as t, createBlock as u, unref as s, withCtx as d, createElementVNode as h, normalizeClass as m, normalizeStyle as W, resolveDynamicComponent as k, createElementBlock as i, toDisplayString as o, renderSlot as S, Fragment as v, withModifiers as V, createTextVNode as f, createVNode as p, createCommentVNode as O } from "vue";
2
2
  import { E as D, a as Z, d as g } from "./vendor-CxcudVpO.js";
3
- import { Z as G } from "./Grid-CCcxjfAs.js";
3
+ import { Z as G } from "./Grid-CDS9IrCA.js";
4
4
  import { w as U } from "./utils-DRDkj6ga.js";
5
5
  const b = "--", X = "YYYY-MM-DDTHH:mm:ss", x = "YYYY-MM-DDT23:59:59", ee = "YYYY-MM-DD", le = "https://static.zhihaoscm.cn/", _ = { key: 1 }, H = {
6
6
  key: 1,
@@ -1,16 +1,16 @@
1
- import { defineComponent as ee, useModel as te, ref as n, watch as L, nextTick as O, resolveDirective as le, openBlock as d, createElementBlock as k, withDirectives as ae, createBlock as w, unref as h, mergeProps as oe, withCtx as B, Fragment as ne, renderList as se, createVNode as re, toDisplayString as ie, createCommentVNode as ce, mergeModels as V } from "vue";
2
- import { e as F, f as ue, g as pe, h as de, i as ve } from "./vendor-CxcudVpO.js";
3
- import { w as fe } from "./utils-DRDkj6ga.js";
4
- const me = { class: "w-100" }, ge = {
1
+ import { defineComponent as te, useModel as le, ref as n, watch as B, nextTick as h, resolveDirective as ae, openBlock as d, createElementBlock as k, withDirectives as oe, createBlock as w, unref as y, mergeProps as ne, withCtx as V, Fragment as se, renderList as re, createVNode as ie, toDisplayString as ce, createCommentVNode as ue, mergeModels as F } from "vue";
2
+ import { e as z, f as pe, g as de, h as ve, i as fe } from "./vendor-CxcudVpO.js";
3
+ import { w as me } from "./utils-DRDkj6ga.js";
4
+ const ge = { class: "w-100" }, he = {
5
5
  key: 1,
6
6
  class: "cascader-select-empty"
7
- }, he = {
7
+ }, ye = {
8
8
  key: 2,
9
9
  class: "loading"
10
- }, ye = /* @__PURE__ */ ee({
10
+ }, Ce = /* @__PURE__ */ te({
11
11
  name: "CascaderLoadMore",
12
12
  __name: "CascaderLoadMore",
13
- props: /* @__PURE__ */ V({
13
+ props: /* @__PURE__ */ F({
14
14
  onChange: {
15
15
  type: Function,
16
16
  required: !1
@@ -94,32 +94,32 @@ const me = { class: "w-100" }, ge = {
94
94
  modelValue: {},
95
95
  modelModifiers: {}
96
96
  }),
97
- emits: /* @__PURE__ */ V(["change", "removeTag"], ["update:modelValue"]),
98
- setup(r, { expose: z, emit: A }) {
99
- const a = r, s = te(r, "modelValue"), v = n(s.value || []), y = n(!1), i = n({
97
+ emits: /* @__PURE__ */ F(["change", "removeTag"], ["update:modelValue"]),
98
+ setup(r, { expose: A, emit: H }) {
99
+ const a = r, s = le(r, "modelValue"), v = n(s.value || []), C = n(!1), i = n({
100
100
  page: 1,
101
101
  size: a.pageSize
102
- }), C = n(void 0), S = n(!1), p = n(a.initialOptions || []), c = n(a.initialOptions || []), f = n(void 0), T = n(!1), H = {
102
+ }), S = n(void 0), b = n(!1), p = n(a.initialOptions || []), c = n(a.initialOptions || []), f = n(void 0), E = n(!1), I = {
103
103
  expandTrigger: "hover",
104
104
  checkStrictly: !1,
105
105
  multiple: a.multiple,
106
106
  emitPath: !0,
107
107
  ...a.cascaderProps
108
- }, M = n(), b = n(), I = () => {
109
- y.value = !0;
110
- }, N = () => {
111
- y.value = !1;
108
+ }, x = n(), P = n(), N = () => {
109
+ C.value = !0;
112
110
  }, W = () => {
111
+ C.value = !1;
112
+ }, $ = () => {
113
113
  var e, l;
114
- (l = (e = h(b).popperRef) == null ? void 0 : e.delayHide) == null || l.call(e);
115
- }, $ = (e) => {
114
+ (l = (e = y(P).popperRef) == null ? void 0 : e.delayHide) == null || l.call(e);
115
+ }, U = (e) => {
116
116
  const l = /* @__PURE__ */ new Map();
117
117
  return (e || []).forEach((o) => {
118
118
  const t = `${o.value}`;
119
119
  l.has(t) || l.set(t, o);
120
120
  }), Array.from(l.values());
121
121
  };
122
- function x(e) {
122
+ function M(e) {
123
123
  const l = [];
124
124
  function o(t, u = "") {
125
125
  const g = u && (a.cascaderProps.emitPath ?? !0) ? `${u}/${t.label}` : t.label;
@@ -129,28 +129,28 @@ const me = { class: "w-100" }, ge = {
129
129
  label: g
130
130
  // 如果需要保留原始路径结构,可加上 fullPath 字段
131
131
  // fullPath: currentPath
132
- }), t.children && t.children.length > 0 && t.children.forEach((Y) => o(Y, g));
132
+ }), t.children && t.children.length > 0 && t.children.forEach((ee) => o(ee, g));
133
133
  }
134
134
  return e.forEach((t) => o(t)), l;
135
135
  }
136
- const E = async (e) => {
136
+ const T = async (e) => {
137
137
  var u;
138
138
  if (!a.forceSearch && !e) return;
139
139
  const l = f.value === e || !f.value && !e;
140
- if (l || (i.value.page = 1), l && C.value !== void 0 && i.value.page > C.value && !T.value) return;
141
- T.value = !1, S.value = !0;
140
+ if (l || (i.value.page = 1), l && S.value !== void 0 && i.value.page > S.value && !E.value) return;
141
+ E.value = !1, b.value = !0;
142
142
  const t = await a.requestFunction(i.value.page, i.value.size, e);
143
143
  if (t && Object.keys(t).length) {
144
- C.value = t.totalPage;
144
+ S.value = t.totalPage;
145
145
  const g = (u = t == null ? void 0 : t.list) == null ? void 0 : u.map(a.handleOptionsFunction);
146
- l && i.value.page !== 1 ? c.value = $([...c.value, ...g]) : c.value = g || [], v.value = F(s.value), p.value = x(c.value);
146
+ l && i.value.page !== 1 ? c.value = U([...c.value, ...g]) : c.value = g || [], v.value = z(s.value), p.value = M(c.value);
147
147
  }
148
- O(() => {
149
- X();
150
- }), f.value = e, S.value = !1;
151
- }, U = () => {
152
- i.value.page = i.value.page + 1, E(f.value);
153
- }, j = (e) => {
148
+ h(() => {
149
+ L();
150
+ }), f.value = e, b.value = !1;
151
+ }, j = () => {
152
+ i.value.page = i.value.page + 1, T(f.value);
153
+ }, Z = (e) => {
154
154
  s.value = e, v.value = e;
155
155
  const l = q(e), o = a.onChange;
156
156
  o && o(e, l);
@@ -159,67 +159,71 @@ const me = { class: "w-100" }, ge = {
159
159
  return a.multiple ? p.value.filter(
160
160
  (o) => (l || []).includes(o.value)
161
161
  ) : p.value.find((o) => o.value === l);
162
- }, Z = () => {
163
- s.value = a.initialValue, v.value = a.initialValue, i.value.page = 1, i.value.size = a.pageSize, p.value = a.initialOptions || [], c.value = a.initialOptions || [], C.value = void 0, f.value = void 0;
164
- }, R = A;
165
- L(
162
+ }, _ = () => {
163
+ s.value = a.initialValue, v.value = a.initialValue, i.value.page = 1, i.value.size = a.pageSize, p.value = a.initialOptions || [], c.value = a.initialOptions || [], S.value = void 0, f.value = void 0;
164
+ }, R = H;
165
+ B(
166
166
  () => a.initialOptions,
167
167
  () => {
168
- p.value = x(a.initialOptions), console.log("options.value", p.value), c.value = a.initialOptions;
168
+ p.value = M(a.initialOptions), console.log("options.value", p.value), c.value = a.initialOptions;
169
169
  },
170
170
  { immediate: !0 }
171
171
  );
172
- const _ = (e) => {
172
+ const Q = (e) => {
173
173
  R("removeTag", e);
174
- }, Q = (e) => {
175
- T.value = e;
176
- }, P = n(null), m = n(null), D = () => {
177
- if (!y.value) return;
178
- const e = b.value.popperRef.contentRef, l = e == null ? void 0 : e.querySelector(".el-cascader-panel .el-scrollbar__wrap");
179
- l && (P.value = l, m.value = () => J(l), l.addEventListener("scroll", m.value));
180
- }, G = () => {
181
- P.value && m.value && (P.value.removeEventListener("scroll", m.value), P.value = null, m.value = null);
182
- }, J = (e) => {
174
+ }, G = (e) => {
175
+ E.value = e;
176
+ }, O = n(null), m = n(null), D = () => {
177
+ if (!C.value) return;
178
+ const e = P.value.popperRef.contentRef, l = e == null ? void 0 : e.querySelector(".el-cascader-panel .el-scrollbar__wrap");
179
+ l && (O.value = l, m.value = () => K(l), l.addEventListener("scroll", m.value));
180
+ }, J = () => {
181
+ O.value && m.value && (O.value.removeEventListener("scroll", m.value), O.value = null, m.value = null);
182
+ }, K = (e) => {
183
183
  const { scrollTop: l, scrollHeight: o, clientHeight: t } = e;
184
184
  let u = o - l;
185
- t + 10 > u && U();
185
+ t + 10 > u && j();
186
186
  };
187
- O(() => D()), L(y, (e) => {
188
- e ? O(() => D()) : G();
187
+ h(() => D()), B(C, (e) => {
188
+ e ? h(() => D()) : J();
189
189
  });
190
- const K = async (e) => {
191
- (a.cascaderProps.emitPath ?? !0) && Array.isArray(e) ? a.multiple ? s.value = e.map((t) => t.at(-1)) : s.value = e.at(-1) : s.value = F(v.value), await O();
190
+ const X = async (e) => {
191
+ (a.cascaderProps.emitPath ?? !0) && Array.isArray(e) ? a.multiple ? s.value = e.map((t) => t.at(-1)) : s.value = e.at(-1) : s.value = z(v.value), await h();
192
192
  const l = q(s.value);
193
193
  R("change", e, l);
194
194
  const o = a.onChange;
195
195
  o && o(e, l);
196
- }, X = () => {
197
- const l = b.value.popperRef.contentRef.querySelectorAll(".el-cascader-node__label");
196
+ }, L = () => {
197
+ const l = P.value.popperRef.contentRef.querySelectorAll(".el-cascader-node__label");
198
198
  console.log(l), l.forEach((o) => {
199
199
  const t = document.createElement("span");
200
200
  t.style.visibility = "hidden", t.style.position = "absolute", t.style.whiteSpace = "nowrap", t.style.font = window.getComputedStyle(o).font, t.textContent = o.textContent || "", document.body.appendChild(t);
201
201
  const u = t.offsetWidth;
202
202
  document.body.removeChild(t), o instanceof HTMLElement && (o.style.whiteSpace = u > 240 ? "break-spaces" : "nowrap");
203
203
  });
204
+ }, Y = () => {
205
+ h(() => {
206
+ L();
207
+ });
204
208
  };
205
- return z({
206
- reset: Z,
209
+ return A({
210
+ reset: _,
207
211
  getSelectedOption: q,
208
- remoteMethod: E,
209
- handleRequestParamsChanged: Q,
212
+ remoteMethod: T,
213
+ handleRequestParamsChanged: G,
210
214
  options: p,
211
215
  cascderOptions: c
212
216
  }), (e, l) => {
213
- const o = le("click-outside");
214
- return d(), k("div", me, [
215
- ae((d(), w(h(ue), oe({
217
+ const o = ae("click-outside");
218
+ return d(), k("div", ge, [
219
+ oe((d(), w(y(pe), ne({
216
220
  ref_key: "remoteSelectRef",
217
- ref: M,
221
+ ref: x,
218
222
  modelValue: s.value,
219
223
  "onUpdate:modelValue": l[0] || (l[0] = (t) => s.value = t),
220
224
  multiple: r.multiple,
221
225
  placeholder: r.placeholder,
222
- "remote-method": E,
226
+ "remote-method": T,
223
227
  teleported: !0,
224
228
  clearable: r.clearable,
225
229
  "collapse-tags": r.collapseTags,
@@ -232,11 +236,11 @@ const me = { class: "w-100" }, ge = {
232
236
  "popper-class": "hidden-dropdown",
233
237
  class: "cascader-select"
234
238
  }, e.$attrs, {
235
- onChange: j,
236
- onRemoveTag: _
239
+ onChange: Z,
240
+ onRemoveTag: Q
237
241
  }), {
238
- default: B(() => [
239
- (d(!0), k(ne, null, se(p.value, (t) => (d(), w(h(pe), {
242
+ default: V(() => [
243
+ (d(!0), k(se, null, re(p.value, (t) => (d(), w(y(de), {
240
244
  key: t.value,
241
245
  label: t.label,
242
246
  value: t.value
@@ -244,39 +248,40 @@ const me = { class: "w-100" }, ge = {
244
248
  ]),
245
249
  _: 1
246
250
  }, 16, ["modelValue", "multiple", "placeholder", "clearable", "collapse-tags", "collapse-tags-tooltip"])), [
247
- [o, W]
251
+ [o, $]
248
252
  ]),
249
- re(h(de), {
253
+ ie(y(ve), {
250
254
  ref_key: "popoverRef",
251
- ref: b,
255
+ ref: P,
252
256
  teleported: r.teleported,
253
257
  placement: a.placement,
254
258
  trigger: a.trigger,
255
259
  "popper-class": a.popperClass,
256
- "virtual-ref": M.value,
257
- onShow: I,
258
- onHide: N,
260
+ "virtual-ref": x.value,
261
+ onShow: N,
262
+ onHide: W,
259
263
  "virtual-triggering": ""
260
264
  }, {
261
- default: B(() => [
262
- !S.value && c.value.length > 0 ? (d(), w(h(ve), {
265
+ default: V(() => [
266
+ !b.value && c.value.length > 0 ? (d(), w(y(fe), {
263
267
  key: 0,
264
268
  modelValue: v.value,
265
269
  "onUpdate:modelValue": l[1] || (l[1] = (t) => v.value = t),
266
270
  border: !1,
267
- props: H,
271
+ props: I,
268
272
  options: c.value,
269
273
  class: "select-cascader-panel",
270
- onChange: K
271
- }, null, 8, ["modelValue", "options"])) : (d(), k("div", ge, ie(r.noDataText), 1)),
272
- S.value ? (d(), k("div", he, "加载中...")) : ce("", !0)
274
+ onChange: X,
275
+ onExpandChange: Y
276
+ }, null, 8, ["modelValue", "options"])) : (d(), k("div", he, ce(r.noDataText), 1)),
277
+ b.value ? (d(), k("div", ye, "加载中...")) : ue("", !0)
273
278
  ]),
274
279
  _: 1
275
280
  }, 8, ["teleported", "placement", "trigger", "popper-class", "virtual-ref"])
276
281
  ]);
277
282
  };
278
283
  }
279
- }), Pe = fe(ye);
284
+ }), Oe = me(Ce);
280
285
  export {
281
- Pe as Z
286
+ Oe as Z
282
287
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as d, openBlock as u, createElementBlock as f, normalizeClass as h, createVNode as _, unref as g, mergeProps as A } from "vue";
2
2
  import { j as D, k } from "./vendor-CxcudVpO.js";
3
- import { D as p, a as E, L as m, b as M } from "./BaseItem-DQKOTeth.js";
3
+ import { D as p, a as E, L as m, b as M } from "./BaseItem-YGnpIugn.js";
4
4
  import { w as y } from "./utils-DRDkj6ga.js";
5
5
  const i = (e, l = E) => e ? D(e).format(l).replace("Invalid date", p) : p, O = (e) => typeof e == "number" ? !0 : typeof e == "string" ? !isNaN(parseFloat(e)) : !1;
6
6
  function P(e) {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, useSlots as _, openBlock as a, createElementBlock as o, createElementVNode as t, renderSlot as l, toDisplayString as i, Fragment as m, renderList as u, unref as n, normalizeClass as D, createCommentVNode as g } from "vue";
2
- import { D as v } from "./BaseItem-DQKOTeth.js";
2
+ import { D as v } from "./BaseItem-YGnpIugn.js";
3
3
  import { _ as k } from "./Button-DSjKm2wO.js";
4
4
  import { w as y } from "./utils-DRDkj6ga.js";
5
5
  const I = { class: "common-card" }, b = { class: "detail-header" }, E = { class: "detail-header--left" }, H = { class: "title common-title" }, M = { class: "info-pair--label" }, $ = { class: "info-pair--value" }, C = {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as r, openBlock as o, createElementBlock as s, createElementVNode as l, createTextVNode as a, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as m, unref as d } from "vue";
2
- import { D as u } from "./BaseItem-DQKOTeth.js";
2
+ import { D as u } from "./BaseItem-YGnpIugn.js";
3
3
  import { w as f } from "./utils-DRDkj6ga.js";
4
4
  const _ = { class: "info-pair" }, v = { class: "info-pair--title" }, h = {
5
5
  key: 0,