mic-org 1.0.9 → 1.1.1

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.
package/dist/mic.es.js CHANGED
@@ -1,207 +1,271 @@
1
- import { defineComponent as w, createElementBlock as b, openBlock as g, createElementVNode as y, h as E, render as P, mergeModels as S, useModel as O, toRefs as k, resolveComponent as C, normalizeStyle as M, unref as i, toDisplayString as j, createVNode as R, mergeProps as D, withKeys as X, renderSlot as x, withCtx as Y, Fragment as Z, renderList as ee, createBlock as te } from "vue";
2
- const ne = /* @__PURE__ */ new Map([
1
+ import { defineComponent as z, createElementBlock as x, openBlock as f, createElementVNode as S, h as B, render as J, reactive as P, mergeModels as T, useModel as j, toRefs as U, resolveComponent as b, normalizeStyle as L, unref as p, toDisplayString as N, createVNode as M, mergeProps as A, withKeys as ee, renderSlot as R, withCtx as k, Fragment as E, renderList as O, createBlock as q, watch as te, createCommentVNode as H, createSlots as le, ref as ae, toHandlers as K, createTextVNode as Q } from "vue";
2
+ const oe = /* @__PURE__ */ new Map([
3
3
  ["String", ""],
4
4
  ["Number", 0],
5
5
  ["Null", ""],
6
6
  ["Undefined", ""],
7
7
  ["Boolean", !1],
8
8
  ["Array", []]
9
- ]), B = (e) => Object.prototype.toString.call(e).replace(/^\[object (\S+)\]$/, "$1"), oe = (e, t) => B(e) == t, T = (e, t) => {
10
- const o = B(e);
9
+ ]), ne = () => {
10
+ const a = Array.prototype;
11
+ a?.equal || (a.equal = function(t) {
12
+ if (this.length === 0 || !t)
13
+ return {
14
+ result: !1,
15
+ data: []
16
+ };
17
+ const o = Array.isArray(t) ? t : new Array(t), l = this[0];
18
+ return o.every((n) => this.every((e) => e[n] === l[n])) ? {
19
+ result: !0,
20
+ data: o.map((n) => l[n])
21
+ } : {
22
+ result: !1,
23
+ data: []
24
+ };
25
+ });
26
+ }, se = () => {
27
+ const a = Array.prototype;
28
+ a?.deepIncludes || (a.deepIncludes = function(t) {
29
+ if (this.length === 0 || !t)
30
+ return !1;
31
+ for (let o of this)
32
+ if (Object.entries(t).every(([s, n]) => o[s] == n))
33
+ return !0;
34
+ return !1;
35
+ });
36
+ }, re = () => {
37
+ "exact" in Math || Object.defineProperty(Math, "exact", {
38
+ value: function(a, t, o) {
39
+ let l = new Array(2).fill(0), s = [], n = [];
40
+ `${a}`.includes(".") && (s = `${a}`.split("."), l[0] = s?.[1]?.length ?? 0, a = Number(s.join(""))), `${t}`.includes(".") && (n = `${t}`.split("."), l[1] = n?.[1]?.length, t = Number(n.join("")));
41
+ let e = Math.max(...l);
42
+ switch (o) {
43
+ case "*":
44
+ return a * t / Math.pow(10, l.reduce((u, r) => u + r, 0));
45
+ case "/":
46
+ return a * Math.pow(10, e - l[0]) / (t * Math.pow(10, e - l[1]));
47
+ case "+":
48
+ return (a * Math.pow(10, e - l[0]) + t * Math.pow(10, e - l[1])) / Math.pow(10, e);
49
+ case "-":
50
+ return (a * Math.pow(10, e - l[0]) - t * Math.pow(10, e - l[1])) / Math.pow(10, e);
51
+ }
52
+ },
53
+ writable: !0,
54
+ // 是否可修改
55
+ configurable: !0,
56
+ // 是否可删除
57
+ enumerable: !1
58
+ // 是否可枚举(避免出现在 for...in 循环中)
59
+ });
60
+ };
61
+ ne();
62
+ se();
63
+ re();
64
+ const W = (a) => Object.prototype.toString.call(a).replace(/^\[object (\S+)\]$/, "$1"), ie = (a, t) => W(a) == t, Z = (a, t) => {
65
+ const o = W(a);
11
66
  if (["String", "Number", "Null", "Undefined", "Boolean", "Array"].includes(o))
12
- return t ?? ne.get(o);
67
+ return t ?? oe.get(o);
13
68
  {
14
- const r = e, s = t, n = {};
15
- return Object.keys(r).forEach((c) => {
16
- n[c] = T(
17
- r[c],
18
- s?.[c]
69
+ const s = a, n = t, e = {};
70
+ return Object.keys(s).forEach((u) => {
71
+ e[u] = Z(
72
+ s[u],
73
+ n?.[u]
19
74
  );
20
- }), n;
75
+ }), e;
21
76
  }
22
77
  };
23
78
  /*! Element Plus Icons Vue v2.3.2 */
24
- var le = /* @__PURE__ */ w({
79
+ var ce = /* @__PURE__ */ z({
25
80
  name: "Loading",
26
81
  __name: "loading",
27
- setup(e) {
28
- return (t, o) => (g(), b("svg", {
82
+ setup(a) {
83
+ return (t, o) => (f(), x("svg", {
29
84
  xmlns: "http://www.w3.org/2000/svg",
30
85
  viewBox: "0 0 1024 1024"
31
86
  }, [
32
- y("path", {
87
+ S("path", {
33
88
  fill: "currentColor",
34
89
  d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
35
90
  })
36
91
  ]));
37
92
  }
38
- }), U = le;
39
- const se = (e, { className: t, loadStyle: o, loadComponent: l }) => {
40
- let r = {
93
+ }), X = ce;
94
+ const de = (a, { className: t, loadStyle: o, loadComponent: l }) => {
95
+ let s = {
41
96
  color: "#409EFF",
42
97
  bgColor: "rgba(255,255,255,.8)"
43
- }, s, n, c;
44
- return async (p) => {
45
- s = document.getElementsByClassName(t)?.[0], n = document.createElement("div"), n.style.display = "flex", n.style.flexDirection = "row", n.style.alignItems = "center", n.style.justifyContent = "center", n.style.cursor = "not-allowed", n.style.backgroundColor = o?.bgColor ?? r.bgColor;
46
- const m = (a) => {
47
- a.stopPropagation(), a.preventDefault();
98
+ }, n, e, u;
99
+ return async (r) => {
100
+ n = document.getElementsByClassName(t)?.[0], e = document.createElement("div"), e.style.display = "flex", e.style.flexDirection = "row", e.style.alignItems = "center", e.style.justifyContent = "center", e.style.cursor = "not-allowed", e.style.backgroundColor = o?.bgColor ?? s.bgColor;
101
+ const _ = (g) => {
102
+ g.stopPropagation(), g.preventDefault();
48
103
  };
49
- n.addEventListener("click", m);
104
+ e.addEventListener("click", _);
50
105
  try {
51
- if (s) {
52
- s.style.position = "relative", n.style.position = "absolute", n.style.left = "-1px", n.style.top = "-1px", n.style.zIndex = "10", n.style.width = "calc(100% + 2px)", n.style.height = "calc(100% + 2px)";
53
- const a = l ? E(l) : E(U, {
54
- class: "loader",
106
+ if (n) {
107
+ n.style.position = "relative", e.style.position = "absolute", e.style.left = "-1px", e.style.top = "-1px", e.style.zIndex = "10", e.style.width = "calc(100% + 2px)", e.style.height = "calc(100% + 2px)";
108
+ const g = l ? B(l) : B(X, {
109
+ class: "mic-loader",
55
110
  style: {
56
- color: o?.color ?? r.color,
111
+ color: o?.color ?? s.color,
57
112
  width: "14px",
58
113
  height: "14px"
59
114
  }
60
115
  });
61
- P(a, n), s.appendChild(n);
116
+ J(g, e), n.appendChild(e);
62
117
  } else {
63
- c = document.body.style.overflow, document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", n.style.position = "fixed", n.style.zIndex = "999", n.style.left = "0", n.style.top = "0", n.style.width = "100vw", n.style.height = "100vh";
64
- const a = l ? E(l) : E(U, {
65
- class: "loader",
118
+ u = document.body.style.overflow, document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", e.style.position = "fixed", e.style.zIndex = "99999", e.style.left = "0", e.style.top = "0", e.style.width = "100vw", e.style.height = "100vh";
119
+ const g = l ? B(l) : B(X, {
120
+ class: "mic-loader",
66
121
  style: {
67
- color: o?.color ?? r.color,
122
+ color: o?.color ?? s.color,
68
123
  width: "14px",
69
124
  height: "14px"
70
125
  }
71
126
  });
72
- P(a, n), document.body.appendChild(n);
127
+ J(g, e), document.body.appendChild(e);
73
128
  }
74
- await e(p);
75
- } catch (a) {
76
- console.error("~~ ==== 💥💥💥💥 ==== ~ Load ~~", a);
129
+ await a(r);
130
+ } catch (g) {
131
+ console.error("~~ ==== 💥💥💥💥 ==== ~ Load ~~", g);
77
132
  } finally {
78
- n.removeEventListener("click", m), s ? s.removeChild(n) : (document.body.style.overflow = c, document.documentElement.style.overflow = c, document.body.removeChild(n)), n = null, s = null;
133
+ e.removeEventListener("click", _), n ? n.removeChild(e) : (document.body.style.overflow = u, document.documentElement.style.overflow = u, document.body.removeChild(e)), e = null, n = null;
79
134
  }
80
135
  };
81
- }, re = (e) => {
82
- const t = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"], o = ["", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟"], l = ["角", "分"], r = /^(\d{1,12})(\.(\d{1,2}))?$/;
83
- if (e == null)
136
+ }, ue = (a) => {
137
+ const t = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"], o = ["", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟"], l = ["角", "分"], s = /^(\d{1,12})(\.(\d{1,2}))?$/;
138
+ if (a == null)
84
139
  return "零元整";
85
- const s = String(e).trim().replace(/,/g, "");
86
- if (!r.test(s))
140
+ const n = String(a).trim().replace(/,/g, "");
141
+ if (!s.test(n))
87
142
  throw new Error("金额格式错误!仅支持12位整数+2位小数");
88
- const [n = "", c = ""] = s.split("."), p = parseInt(n, 10), m = c.padEnd(2, "0");
89
- function a(d) {
90
- let u = "", _ = !1;
91
- const $ = d.length;
92
- for (let A = 0; A < $; A++) {
93
- const N = parseInt(d[A], 10), W = $ - 1 - A, q = o[W];
94
- N === 0 ? (_ = !0, (q === "万" || q === "亿") && (u += q, _ = !1)) : (_ && (u += "零"), u += t[N] + q, _ = !1);
143
+ const [e = "", u = ""] = n.split("."), r = parseInt(e, 10), _ = u.padEnd(2, "0");
144
+ function g(V) {
145
+ let h = "", c = !1;
146
+ const d = V.length;
147
+ for (let m = 0; m < d; m++) {
148
+ const D = parseInt(V[m], 10), I = d - 1 - m, C = o[I];
149
+ D === 0 ? (c = !0, (C === "万" || C === "亿") && (h += C, c = !1)) : (c && (h += "零"), h += t[D] + C, c = !1);
95
150
  }
96
- return u = u.replace(/亿万/, "亿"), u || "零";
151
+ return h = h.replace(/亿万/, "亿"), h || "零";
97
152
  }
98
- function f(d) {
99
- let u = "";
100
- const _ = parseInt(d[0], 10), $ = parseInt(d[1], 10);
101
- return _ !== 0 && (u += t[_] + l[0], $ === 0 && (u += "整")), $ !== 0 && (_ === 0 && p !== 0 && (u += "零"), u += t[$] + l[1]), u;
153
+ function v(V) {
154
+ let h = "";
155
+ const c = parseInt(V[0], 10), d = parseInt(V[1], 10);
156
+ return c !== 0 && (h += t[c] + l[0], d === 0 && (h += "整")), d !== 0 && (c === 0 && r !== 0 && (h += "零"), h += t[d] + l[1]), h;
102
157
  }
103
- const h = a(n), v = f(m);
104
- return v ? `${h}元${v}` : `${h}元整`;
105
- }, L = (e, t) => {
106
- const o = Object.prototype.toString.call(e).replace(/^\[object (\S+)\]$/, "$1"), l = Object.prototype.toString.call(t).replace(/^\[object (\S+)\]$/, "$1");
158
+ const w = g(e), $ = v(_);
159
+ return $ ? `${w}元${$}` : `${w}元整`;
160
+ }, F = (a, t) => {
161
+ const o = Object.prototype.toString.call(a).replace(/^\[object (\S+)\]$/, "$1"), l = Object.prototype.toString.call(t).replace(/^\[object (\S+)\]$/, "$1");
107
162
  if (o != l)
108
163
  return !1;
109
164
  if (["String", "Number", "Null", "Undefined", "Boolean"].includes(o))
110
- return e === t;
165
+ return a === t;
111
166
  if (o === "File") {
112
- let s = ["name", "size", "type", "lastModified"];
113
- for (let n of s)
114
- if (!L(e[n], t[n]))
167
+ let n = ["name", "size", "type", "lastModified"];
168
+ for (let e of n)
169
+ if (!F(a[e], t[e]))
115
170
  return !1;
116
171
  }
117
172
  if (o == "Object") {
118
- for (let [s, n] of Object.entries(e))
119
- if (!L(n, t[s]))
173
+ for (let [n, e] of Object.entries(a))
174
+ if (!F(e, t[n]))
120
175
  return !1;
121
176
  }
122
177
  if (o == "Array") {
123
- if (e.length != t.length)
178
+ if (a.length != t.length)
124
179
  return !1;
125
- for (let s = 0; s < e.length; s++)
126
- if (!L(e[s], t[s]))
180
+ for (let n = 0; n < a.length; n++)
181
+ if (!F(a[n], t[n]))
127
182
  return !1;
128
183
  }
129
184
  return !0;
130
- }, Ve = {
131
- check: B,
132
- reset: T,
133
- isType: oe,
134
- capital: re,
135
- equal: L,
136
- load: se
137
- }, ae = () => {
138
- const e = Array.prototype;
139
- e?.equal || (e.equal = function(t) {
140
- if (this.length === 0 || !t)
141
- return {
142
- result: !1,
143
- data: []
144
- };
145
- const o = Array.isArray(t) ? t : new Array(t), l = this[0];
146
- return o.every((s) => this.every((n) => n[s] === l[s])) ? {
147
- result: !0,
148
- data: o.map((s) => l[s])
149
- } : {
150
- result: !1,
151
- data: []
152
- };
153
- });
154
- }, ce = () => {
155
- const e = Array.prototype;
156
- e?.deepIncludes || (e.deepIncludes = function(t) {
157
- if (this.length === 0 || !t)
158
- return !1;
159
- for (let o of this)
160
- if (Object.entries(t).every(([r, s]) => o[r] == s))
161
- return !0;
162
- return !1;
185
+ }, Le = {
186
+ check: W,
187
+ reset: Z,
188
+ isType: ie,
189
+ capital: ue,
190
+ equal: F,
191
+ load: de
192
+ };
193
+ class pe {
194
+ // 显式声明属性类型,并用 private 限制访问
195
+ element;
196
+ observer;
197
+ constructor(t) {
198
+ this.element = t, this.observer = void 0;
199
+ }
200
+ // 绑定监听(增加边界校验)
201
+ bind(t) {
202
+ !this.element || this.observer || (this.observer = new ResizeObserver((o) => {
203
+ const l = o[0];
204
+ if (!l?.contentRect) return;
205
+ const { width: s, height: n } = l.contentRect, e = window.getComputedStyle(this.element);
206
+ t?.(s + parseInt(e.marginLeft) + parseInt(e.marginRight), n + parseInt(e.marginTop) + parseInt(e.marginBottom));
207
+ }), this.observer.observe(this.element, {
208
+ box: "border-box"
209
+ // 显式指定监听的盒模型(可选)
210
+ }));
211
+ }
212
+ // 解绑单个元素监听
213
+ unbind() {
214
+ this.observer && this.element && this.observer.unobserve(this.element), this.observer = void 0;
215
+ }
216
+ // 彻底销毁监听(推荐组件卸载时调用)
217
+ destroy() {
218
+ this.observer?.disconnect(), this.observer = void 0, this.element = null;
219
+ }
220
+ }
221
+ class me {
222
+ domList;
223
+ #e = P({
224
+ value: 0
163
225
  });
164
- }, ie = () => {
165
- const e = Array.prototype, t = (o) => o === null || typeof o != "object" ? String(o) : `{${Object.keys(o).sort().map((s) => `${s}:${t(o[s])}`).join()}}`;
166
- e?.noRepeat || (e.noRepeat = function(o) {
167
- const l = /* @__PURE__ */ new Map();
168
- return this.forEach((r) => {
169
- o ? l.set(t(r?.[o]), r) : l.set(t(r), r);
170
- }), Array.from(l.values());
226
+ #t = P({
227
+ value: 0
171
228
  });
172
- }, de = () => {
173
- "exact" in Math || Object.defineProperty(Math, "exact", {
174
- value: function(e, t, o) {
175
- let l = new Array(2).fill(0), r = [], s = [];
176
- `${e}`.includes(".") && (r = `${e}`.split("."), l[0] = r?.[1]?.length ?? 0, e = Number(r.join(""))), `${t}`.includes(".") && (s = `${t}`.split("."), l[1] = s?.[1]?.length, t = Number(s.join("")));
177
- let n = Math.max(...l);
178
- switch (o) {
179
- case "*":
180
- return e * t / Math.pow(10, l.reduce((c, p) => c + p, 0));
181
- case "/":
182
- return e * Math.pow(10, n - l[0]) / (t * Math.pow(10, n - l[1]));
183
- case "+":
184
- return (e * Math.pow(10, n - l[0]) + t * Math.pow(10, n - l[1])) / Math.pow(10, n);
185
- case "-":
186
- return (e * Math.pow(10, n - l[0]) - t * Math.pow(10, n - l[1])) / Math.pow(10, n);
187
- }
188
- },
189
- writable: !0,
190
- // 是否可修改
191
- configurable: !0,
192
- // 是否可删除
193
- enumerable: !1
194
- // 是否可枚举(避免出现在 for...in 循环中)
195
- });
196
- };
197
- ae();
198
- ce();
199
- ie();
200
- de();
201
- const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
229
+ constructor(t) {
230
+ this.domList = t.map((o) => ({
231
+ ...o,
232
+ height: 0,
233
+ width: 0,
234
+ exa: void 0
235
+ })), this.#l();
236
+ }
237
+ get height() {
238
+ return this.#t;
239
+ }
240
+ get width() {
241
+ return this.#e;
242
+ }
243
+ #l() {
244
+ for (let t of this.domList)
245
+ t.exa = new pe(document.querySelector(t.name)), t.exa.bind((o, l) => {
246
+ t.height = l, t.width = o, this.#t.value = 0, this.#e.value = 0;
247
+ for (let s of this.domList)
248
+ switch (s.type) {
249
+ case "+":
250
+ this.#t.value += s?.height, this.#e.value += s?.width;
251
+ break;
252
+ case "-":
253
+ this.#t.value -= s?.height, this.#e.value -= s?.width;
254
+ break;
255
+ }
256
+ });
257
+ }
258
+ close() {
259
+ for (let t of this.domList)
260
+ t.exa && t.exa.destroy();
261
+ }
262
+ }
263
+ const ze = {
264
+ domHeight: me
265
+ }, fe = { class: "mic-search-item-right" }, he = /* @__PURE__ */ z({
202
266
  name: "MicDate",
203
267
  __name: "index",
204
- props: /* @__PURE__ */ S({
268
+ props: /* @__PURE__ */ T({
205
269
  label: {
206
270
  type: String,
207
271
  required: !0
@@ -221,49 +285,47 @@ const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
221
285
  type: String,
222
286
  required: !1,
223
287
  default: () => "100px"
288
+ },
289
+ span: {
290
+ type: Number,
291
+ required: !1,
292
+ default: () => 1
224
293
  }
225
294
  }, {
226
295
  modelValue: {},
227
296
  modelModifiers: {}
228
297
  }),
229
- emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
230
- setup(e, { emit: t }) {
231
- const o = O(e, "modelValue"), l = e, { label: r, type: s, format: n, border: c, width: p } = k(l), m = t, a = (f) => {
232
- m("change", f);
298
+ emits: /* @__PURE__ */ T(["change"], ["update:modelValue"]),
299
+ setup(a, { emit: t }) {
300
+ const o = j(a, "modelValue"), l = a, { label: s, format: n, border: e, width: u, span: r } = U(l), _ = t, g = (v) => {
301
+ _("change", v);
233
302
  };
234
- return (f, h) => {
235
- const v = C("el-date-picker");
236
- return g(), b("div", {
237
- class: "mic-date",
238
- style: M({ border: i(c) })
303
+ return (v, w) => {
304
+ const $ = b("el-date-picker");
305
+ return f(), x("div", {
306
+ class: "mic-search-item",
307
+ style: L({ border: p(e), "grid-column": `span ${p(r)}` })
239
308
  }, [
240
- y("div", {
241
- class: "mic-date-left f-14",
242
- style: M({ width: i(p) })
243
- }, j(i(r)), 5),
244
- y("div", ue, [
245
- R(v, D({
309
+ S("div", {
310
+ class: "mic-search-item-left",
311
+ style: L({ width: p(u) })
312
+ }, N(p(s)), 5),
313
+ S("div", fe, [
314
+ M($, A({
246
315
  modelValue: o.value,
247
- "onUpdate:modelValue": h[0] || (h[0] = (d) => o.value = d),
248
- format: i(n),
249
- "value-format": i(n),
316
+ "onUpdate:modelValue": w[0] || (w[0] = (V) => o.value = V),
317
+ format: p(n),
318
+ "value-format": p(n),
250
319
  "range-separator": "-"
251
- }, f.$attrs, { onChange: a }), null, 16, ["modelValue", "format", "value-format"])
320
+ }, v.$attrs, { onChange: g }), null, 16, ["modelValue", "format", "value-format"])
252
321
  ])
253
322
  ], 4);
254
323
  };
255
324
  }
256
- }), V = (e, t) => {
257
- const o = e.__vccOpts || e;
258
- for (const [l, r] of t)
259
- o[l] = r;
260
- return o;
261
- }, z = /* @__PURE__ */ V(pe, [["__scopeId", "data-v-6f314cc0"]]), I = (e) => (e.install = (t) => {
262
- t.component(e.name || e.__name, e);
263
- }, e), Ie = I(z), fe = { class: "mic-input-right" }, ye = /* @__PURE__ */ w({
325
+ }), ge = { class: "mic-search-item-right" }, ye = /* @__PURE__ */ z({
264
326
  name: "MicInput",
265
327
  __name: "index",
266
- props: /* @__PURE__ */ S({
328
+ props: /* @__PURE__ */ T({
267
329
  label: {
268
330
  label: String,
269
331
  required: !0
@@ -278,59 +340,45 @@ const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
278
340
  type: String,
279
341
  required: !1,
280
342
  default: () => "100px"
343
+ },
344
+ span: {
345
+ type: Number,
346
+ required: !1,
347
+ default: () => 1
281
348
  }
282
349
  }, {
283
350
  modelValue: {},
284
351
  modelModifiers: {}
285
352
  }),
286
- emits: /* @__PURE__ */ S(["change", "keydown"], ["update:modelValue"]),
287
- setup(e, { emit: t }) {
288
- const o = O(e, "modelValue"), l = e, { label: r, border: s, width: n } = k(l), c = t, p = (a) => {
289
- c("change", a);
290
- }, m = () => {
291
- c("keydown");
353
+ emits: /* @__PURE__ */ T(["change", "keydown"], ["update:modelValue"]),
354
+ setup(a, { emit: t }) {
355
+ const o = j(a, "modelValue"), l = a, { label: s, border: n, width: e, span: u } = U(l), r = t, _ = (v) => {
356
+ r("change", v);
357
+ }, g = () => {
358
+ r("keydown");
292
359
  };
293
- return (a, f) => {
294
- const h = C("el-input");
295
- return g(), b("div", {
296
- class: "mic-input",
297
- style: M({ border: i(s) })
360
+ return (v, w) => {
361
+ const $ = b("el-input");
362
+ return f(), x("div", {
363
+ class: "mic-search-item",
364
+ style: L({ border: p(n), "grid-column": `span ${p(u)}` })
298
365
  }, [
299
- y("div", {
300
- class: "mic-input-left f-14",
301
- style: M({ width: i(n) })
302
- }, j(i(r)), 5),
303
- y("div", fe, [
304
- R(h, D({
366
+ S("div", {
367
+ class: "mic-search-item-left",
368
+ style: L({ width: p(e) })
369
+ }, N(p(s)), 5),
370
+ S("div", ge, [
371
+ M($, A({
305
372
  modelValue: o.value,
306
- "onUpdate:modelValue": f[0] || (f[0] = (v) => o.value = v),
307
- onInput: p,
308
- onKeydown: X(m, ["enter"])
309
- }, a.$attrs), null, 16, ["modelValue"])
373
+ "onUpdate:modelValue": w[0] || (w[0] = (V) => o.value = V),
374
+ onInput: _,
375
+ onKeydown: ee(g, ["enter"])
376
+ }, v.$attrs), null, 16, ["modelValue"])
310
377
  ])
311
378
  ], 4);
312
379
  };
313
380
  }
314
- }), K = /* @__PURE__ */ V(ye, [["__scopeId", "data-v-d35be4c9"]]), ke = I(K), me = { class: "mic-layout" }, he = { class: "mic-layout-header" }, ge = { class: "mic-layout-menu" }, ve = { class: "mic-layout-contain" }, _e = { class: "mic-layout-footer" }, be = /* @__PURE__ */ w({
315
- name: "MicLayout",
316
- __name: "index",
317
- setup(e) {
318
- return (t, o) => (g(), b("div", me, [
319
- y("div", he, [
320
- x(t.$slots, "header", {}, void 0, !0)
321
- ]),
322
- y("div", ge, [
323
- x(t.$slots, "menu", {}, void 0, !0)
324
- ]),
325
- y("div", ve, [
326
- x(t.$slots, "contain", {}, void 0, !0)
327
- ]),
328
- y("div", _e, [
329
- x(t.$slots, "footer", {}, void 0, !0)
330
- ])
331
- ]));
332
- }
333
- }), H = /* @__PURE__ */ V(be, [["__scopeId", "data-v-9993530d"]]), Ae = I(H), Me = /* @__PURE__ */ w({
381
+ }), be = /* @__PURE__ */ z({
334
382
  name: "MicSearch",
335
383
  __name: "index",
336
384
  props: {
@@ -340,19 +388,19 @@ const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
340
388
  default: () => 4
341
389
  }
342
390
  },
343
- setup(e) {
344
- const t = e, { span: o } = k(t);
345
- return (l, r) => (g(), b("div", {
391
+ setup(a) {
392
+ const t = a, { span: o } = U(t);
393
+ return (l, s) => (f(), x("div", {
346
394
  class: "mic-search-box",
347
- style: M({ "grid-template-columns": `repeat(${i(o)}, calc( 100% / ${i(o)} - 12px * ${i(o) - 1} / ${i(o)} ))` })
395
+ style: L({ "grid-template-columns": `repeat(${p(o)}, calc( 100% / ${p(o)} - 12px * ${p(o) - 1} / ${p(o)} ))` })
348
396
  }, [
349
- x(l.$slots, "default", {}, void 0, !0)
397
+ R(l.$slots, "default")
350
398
  ], 4));
351
399
  }
352
- }), G = /* @__PURE__ */ V(Me, [["__scopeId", "data-v-9003d058"]]), qe = I(G), we = { class: "mic-select-right" }, $e = /* @__PURE__ */ w({
400
+ }), ve = { class: "mic-search-item-right" }, _e = /* @__PURE__ */ z({
353
401
  name: "MicSelect",
354
402
  __name: "index",
355
- props: /* @__PURE__ */ S({
403
+ props: /* @__PURE__ */ T({
356
404
  label: {
357
405
  type: String,
358
406
  required: !0
@@ -373,37 +421,42 @@ const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
373
421
  type: String,
374
422
  required: !1,
375
423
  default: () => "100px"
424
+ },
425
+ span: {
426
+ type: Number,
427
+ required: !1,
428
+ default: () => 1
376
429
  }
377
430
  }, {
378
431
  modelValue: {},
379
432
  modelModifiers: {}
380
433
  }),
381
- emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
382
- setup(e, { emit: t }) {
383
- const o = O(e, "modelValue"), l = e, { label: r, options: s, border: n, width: c } = k(l), p = t, m = (a) => {
384
- p("change", a);
434
+ emits: /* @__PURE__ */ T(["change"], ["update:modelValue"]),
435
+ setup(a, { emit: t }) {
436
+ const o = j(a, "modelValue"), l = a, { label: s, options: n, border: e, width: u, span: r } = U(l), _ = t, g = (v) => {
437
+ _("change", v);
385
438
  };
386
- return (a, f) => {
387
- const h = C("el-option"), v = C("el-select");
388
- return g(), b("div", {
389
- class: "mic-select",
390
- style: M({ border: i(n) })
439
+ return (v, w) => {
440
+ const $ = b("el-option"), V = b("el-select");
441
+ return f(), x("div", {
442
+ class: "mic-search-item",
443
+ style: L({ border: p(e), "grid-column": `span ${p(r)}` })
391
444
  }, [
392
- y("div", {
393
- class: "mic-select-left",
394
- style: M({ width: i(c) })
395
- }, j(i(r)), 5),
396
- y("div", we, [
397
- R(v, D({
445
+ S("div", {
446
+ class: "mic-search-item-left",
447
+ style: L({ width: p(u) })
448
+ }, N(p(s)), 5),
449
+ S("div", ve, [
450
+ M(V, A({
398
451
  modelValue: o.value,
399
- "onUpdate:modelValue": f[0] || (f[0] = (d) => o.value = d),
400
- onChange: m
401
- }, a.$attrs), {
402
- default: Y(() => [
403
- (g(!0), b(Z, null, ee(i(s), (d) => (g(), te(h, {
404
- key: d.value,
405
- label: d.label,
406
- value: d.value
452
+ "onUpdate:modelValue": w[0] || (w[0] = (h) => o.value = h),
453
+ onChange: g
454
+ }, v.$attrs), {
455
+ default: k(() => [
456
+ (f(!0), x(E, null, O(p(n), (h) => (f(), q($, {
457
+ key: h.value,
458
+ label: h.label,
459
+ value: h.value
407
460
  }, null, 8, ["label", "value"]))), 128))
408
461
  ]),
409
462
  _: 1
@@ -412,7 +465,7 @@ const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
412
465
  ], 4);
413
466
  };
414
467
  }
415
- }), J = /* @__PURE__ */ V($e, [["__scopeId", "data-v-fb2f025a"]]), Ee = I(J), xe = /* @__PURE__ */ w({
468
+ }), we = /* @__PURE__ */ z({
416
469
  name: "MicVac",
417
470
  __name: "index",
418
471
  props: {
@@ -421,37 +474,376 @@ const ue = { class: "mic-date-right" }, pe = /* @__PURE__ */ w({
421
474
  default: () => 1
422
475
  }
423
476
  },
424
- setup(e) {
425
- const t = e, { span: o } = k(t);
426
- return (l, r) => (g(), b("div", {
427
- class: "mic-vac",
428
- style: M({ "grid-column": `span ${i(o)}` })
477
+ setup(a) {
478
+ const t = a, { span: o } = U(t);
479
+ return (l, s) => (f(), x("div", {
480
+ class: "mic-search-vac",
481
+ style: L({ "grid-column": `span ${p(o)}` })
429
482
  }, [
430
- x(l.$slots, "default", {}, void 0, !0)
483
+ R(l.$slots, "default")
431
484
  ], 4));
432
485
  }
433
- }), Q = /* @__PURE__ */ V(xe, [["__scopeId", "data-v-101c3479"]]), Le = I(Q), F = {
434
- MicDate: z,
435
- MicInput: K,
436
- MicLayout: H,
437
- MicSearch: G,
438
- MicSelect: J,
439
- MicVac: Q
440
- }, Ce = {
441
- install(e) {
442
- Object.keys(F).forEach((t) => {
443
- const o = F[t];
444
- e.component(t, o);
486
+ }), Ve = { class: "mic-table" }, xe = { class: "mic-table-button" }, ke = { class: "mic-table-button-left" }, Se = { class: "mic-table-button-right" }, Ce = { class: "mic-table-cont" }, Me = { class: "mic-table-page" }, $e = { class: "mic-table-page-left" }, De = /* @__PURE__ */ z({
487
+ name: "MicTable",
488
+ __name: "index",
489
+ props: {
490
+ tableAttr: {
491
+ type: Object,
492
+ required: !1,
493
+ // 标记为必传
494
+ default: () => ({})
495
+ },
496
+ tableData: {
497
+ type: Array,
498
+ required: !0
499
+ // 标记为必传
500
+ },
501
+ columns: {
502
+ type: Array,
503
+ required: !0
504
+ // 标记为必传
505
+ },
506
+ // 是否单选
507
+ selectSingle: {
508
+ type: Boolean,
509
+ required: !1,
510
+ default: !1
511
+ },
512
+ // 添加选择项依据的key值
513
+ selectKey: {
514
+ type: String,
515
+ required: !1
516
+ },
517
+ // 添加可选属性:禁用的条件函数
518
+ disabledCondition: {
519
+ type: Function,
520
+ default: null
521
+ },
522
+ // 表格数据页码
523
+ page: {
524
+ type: Object,
525
+ required: !1,
526
+ default: {
527
+ pageSize: 100,
528
+ pageNo: 1,
529
+ total: 0
530
+ }
531
+ }
532
+ },
533
+ emits: ["selection-change", "page-change"],
534
+ setup(a, { expose: t, emit: o }) {
535
+ const l = a, { tableData: s, columns: n, page: e } = U(l), u = o, r = P({
536
+ isCurrentAll: !1,
537
+ //是否全选
538
+ isIndeterminate: !1,
539
+ //是否半选
540
+ selectData: [],
541
+ //选中值
542
+ processedTableData: []
543
+ //处理后的表格数据
544
+ }), _ = () => {
545
+ r.processedTableData = s.value.map((c) => {
546
+ const d = { ...c };
547
+ return d.checked = !1, l?.disabledCondition ? d.disabled = l.disabledCondition(d) : d.disabled = !1, d;
548
+ });
549
+ };
550
+ te(s, () => {
551
+ _();
552
+ }, { immediate: !0, deep: !0 });
553
+ const g = (c) => {
554
+ l.selectSingle || (r.isIndeterminate = !1, r.processedTableData.forEach((d) => {
555
+ d.disabled || (d.checked = c);
556
+ }), r.selectData = r.processedTableData.filter((d) => !d.disabled && d.checked), u("selection-change", r.selectData));
557
+ }, v = (c, d) => {
558
+ if (l.selectSingle)
559
+ r.processedTableData.forEach((m) => {
560
+ m?.[l.selectKey] != c?.[l.selectKey] && (m.checked = !1);
561
+ });
562
+ else {
563
+ const m = r.processedTableData.filter((I) => !I.disabled), D = m.filter((I) => I.checked);
564
+ D.length === 0 ? (r.isCurrentAll = !1, r.isIndeterminate = !1) : D.length === m.length ? (r.isCurrentAll = !0, r.isIndeterminate = !1) : (r.isCurrentAll = !1, r.isIndeterminate = !0);
565
+ }
566
+ r.selectData = r.processedTableData.filter((m) => m.checked), u("selection-change", r.selectData);
567
+ }, w = (c) => {
568
+ let d = c.map((m) => m?.[l?.selectKey]);
569
+ r.processedTableData.forEach((m) => {
570
+ m.checked = d.includes(m?.[l?.selectKey]);
571
+ }), r.selectData = r.processedTableData.filter((m) => m.checked), u("selection-change", r.selectData);
572
+ }, $ = () => {
573
+ r.processedTableData.forEach((c) => {
574
+ c.checked = !1;
575
+ }), r.isCurrentAll = !1, r.isIndeterminate = !1, r.selectData = [], u("selection-change", []);
576
+ }, V = (c) => {
577
+ u("page-change", {
578
+ total: e.value.total,
579
+ pageNo: e.value.pageNo,
580
+ pageSize: c
581
+ });
582
+ }, h = (c) => {
583
+ u("page-change", {
584
+ total: e.value.total,
585
+ pageNo: c,
586
+ pageSize: e.value.pageSize
587
+ });
588
+ };
589
+ return t({
590
+ clearSelection: $,
591
+ setSelection: w
592
+ }), (c, d) => {
593
+ const m = b("el-checkbox"), D = b("el-table-column"), I = b("el-table"), C = b("el-pagination");
594
+ return f(), x("div", Ve, [
595
+ S("div", xe, [
596
+ S("div", ke, [
597
+ R(c.$slots, "buttonLeft")
598
+ ]),
599
+ S("div", Se, [
600
+ R(c.$slots, "buttonRight")
601
+ ])
602
+ ]),
603
+ S("div", Ce, [
604
+ M(I, A({
605
+ data: r.processedTableData,
606
+ "header-cell-style": { background: "#F6F8FC", fontWeight: 400, color: "#333" },
607
+ stripe: ""
608
+ }, l.tableAttr), {
609
+ default: k(() => [
610
+ (f(!0), x(E, null, O(p(n), (i) => (f(), x(E, null, [
611
+ i?.type == "select" && !i?.hidden ? (f(), q(D, A({
612
+ key: 0,
613
+ ref_for: !0
614
+ }, i.attr), {
615
+ header: k(() => [
616
+ M(m, {
617
+ style: { height: "20px" },
618
+ disabled: l.selectSingle,
619
+ indeterminate: r.isIndeterminate,
620
+ modelValue: r.isCurrentAll,
621
+ "onUpdate:modelValue": d[0] || (d[0] = (y) => r.isCurrentAll = y),
622
+ onChange: d[1] || (d[1] = ((y) => g(y)))
623
+ }, null, 8, ["disabled", "indeterminate", "modelValue"])
624
+ ]),
625
+ default: k((y) => [
626
+ M(m, {
627
+ style: { height: "20px" },
628
+ modelValue: y.row.checked,
629
+ "onUpdate:modelValue": (G) => y.row.checked = G,
630
+ disabled: y.row.disabled,
631
+ onChange: (G) => v(y.row)
632
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
633
+ ]),
634
+ _: 1
635
+ }, 16)) : i?.hidden ? H("", !0) : (f(), q(D, A({
636
+ key: 1,
637
+ type: i?.type
638
+ }, { ref_for: !0 }, i.attr), le({ _: 2 }, [
639
+ c.$slots?.[i.attr?.prop] ? {
640
+ name: "default",
641
+ fn: k((y) => [
642
+ R(c.$slots, i.attr?.prop, { scope: y })
643
+ ]),
644
+ key: "0"
645
+ } : void 0
646
+ ]), 1040, ["type"]))
647
+ ], 64))), 256))
648
+ ]),
649
+ _: 3
650
+ }, 16, ["data"])
651
+ ]),
652
+ S("div", Me, [
653
+ S("div", $e, [
654
+ M(C, {
655
+ size: "small",
656
+ onSizeChange: V,
657
+ "page-sizes": [10, 20, 50, 100],
658
+ "page-size": p(e).pageSize,
659
+ layout: "total,sizes",
660
+ total: p(e).total
661
+ }, null, 8, ["page-size", "total"])
662
+ ]),
663
+ M(C, {
664
+ onCurrentChange: h,
665
+ size: "small",
666
+ "current-page": p(e).pageNo,
667
+ "page-sizes": [10, 20, 50, 100],
668
+ "page-size": p(e).pageSize,
669
+ layout: "prev, pager, next",
670
+ total: p(e).total
671
+ }, null, 8, ["current-page", "page-size", "total"])
672
+ ])
673
+ ]);
674
+ };
675
+ }
676
+ }), Ie = {
677
+ key: 0,
678
+ class: "mic-dialog-module"
679
+ }, qe = { class: "dialog-footer" }, Ae = /* @__PURE__ */ z({
680
+ name: "MicDialog",
681
+ __name: "index",
682
+ props: /* @__PURE__ */ T({
683
+ title: {
684
+ type: String,
685
+ required: !0
686
+ },
687
+ width: {
688
+ type: String,
689
+ default: "50%"
690
+ },
691
+ labelWidth: {
692
+ type: String,
693
+ default: "120px"
694
+ },
695
+ formList: {
696
+ type: Array,
697
+ required: !0
698
+ },
699
+ optionList: {
700
+ type: Object,
701
+ default: () => ({})
702
+ },
703
+ rules: {
704
+ type: Object,
705
+ default: () => ({})
706
+ },
707
+ cancelText: {
708
+ type: String,
709
+ default: "取消"
710
+ },
711
+ confirmText: {
712
+ type: String,
713
+ default: "确认"
714
+ }
715
+ }, {
716
+ show: {},
717
+ showModifiers: {},
718
+ form: {},
719
+ formModifiers: {}
720
+ }),
721
+ emits: /* @__PURE__ */ T(["confirm"], ["update:show", "update:form"]),
722
+ setup(a, { emit: t }) {
723
+ const o = j(a, "show"), l = j(a, "form"), s = a, n = t, e = ae(), u = () => {
724
+ o.value = !1;
725
+ }, r = () => {
726
+ e.value.validate(async (_) => {
727
+ _ && n("confirm", l);
728
+ });
729
+ };
730
+ return (_, g) => {
731
+ const v = b("el-input"), w = b("el-date-picker"), $ = b("el-option"), V = b("el-select"), h = b("el-form-item"), c = b("el-col"), d = b("el-row"), m = b("el-form"), D = b("el-button"), I = b("el-dialog");
732
+ return o.value ? (f(), q(I, {
733
+ key: 0,
734
+ modelValue: o.value,
735
+ "onUpdate:modelValue": g[0] || (g[0] = (C) => o.value = C),
736
+ title: s.title,
737
+ width: s.width
738
+ }, {
739
+ footer: k(() => [
740
+ S("div", qe, [
741
+ M(D, {
742
+ class: "mic-dialog-close",
743
+ onClick: u
744
+ }, {
745
+ default: k(() => [
746
+ Q(N(s.cancelText), 1)
747
+ ]),
748
+ _: 1
749
+ }),
750
+ M(D, {
751
+ type: "primary",
752
+ class: "mic-dialog-confirm",
753
+ onClick: r
754
+ }, {
755
+ default: k(() => [
756
+ Q(N(s.confirmText), 1)
757
+ ]),
758
+ _: 1
759
+ })
760
+ ])
761
+ ]),
762
+ default: k(() => [
763
+ M(m, {
764
+ model: l.value,
765
+ ref_key: "formRef",
766
+ ref: e,
767
+ rules: s?.rules,
768
+ "label-width": s.labelWidth
769
+ }, {
770
+ default: k(() => [
771
+ (f(!0), x(E, null, O(s.formList, (C) => (f(), x(E, null, [
772
+ C.module ? (f(), x("p", Ie, N(C.module), 1)) : H("", !0),
773
+ M(d, { gutter: 20 }, {
774
+ default: k(() => [
775
+ (f(!0), x(E, null, O(C.children, (i) => (f(), q(c, {
776
+ span: i.span
777
+ }, {
778
+ default: k(() => [
779
+ M(h, {
780
+ label: i.label,
781
+ prop: i.prop
782
+ }, {
783
+ default: k(() => [
784
+ i.type == "input" ? (f(), q(v, A({
785
+ key: 0,
786
+ modelValue: l.value[i.prop],
787
+ "onUpdate:modelValue": (y) => l.value[i.prop] = y
788
+ }, { ref_for: !0 }, i.attr, K(i.event)), null, 16, ["modelValue", "onUpdate:modelValue"])) : i.type == "time" ? (f(), q(w, A({
789
+ key: 1,
790
+ modelValue: l.value[i.prop],
791
+ "onUpdate:modelValue": (y) => l.value[i.prop] = y
792
+ }, { ref_for: !0 }, i.attr, K(i.event)), null, 16, ["modelValue", "onUpdate:modelValue"])) : i.type == "select" ? (f(), q(V, A({
793
+ key: 2,
794
+ modelValue: l.value[i.prop],
795
+ "onUpdate:modelValue": (y) => l.value[i.prop] = y
796
+ }, { ref_for: !0 }, i.attr, K(i.event)), {
797
+ default: k(() => [
798
+ (f(!0), x(E, null, O(s.optionList?.[i.prop], (y) => (f(), q($, {
799
+ key: y.value,
800
+ label: y.label,
801
+ value: y.value
802
+ }, null, 8, ["label", "value"]))), 128))
803
+ ]),
804
+ _: 2
805
+ }, 1040, ["modelValue", "onUpdate:modelValue"])) : R(_.$slots, i?.prop, {
806
+ key: 3,
807
+ form: l.value,
808
+ attr: i?.attr,
809
+ event: i?.event
810
+ })
811
+ ]),
812
+ _: 2
813
+ }, 1032, ["label", "prop"])
814
+ ]),
815
+ _: 2
816
+ }, 1032, ["span"]))), 256))
817
+ ]),
818
+ _: 2
819
+ }, 1024)
820
+ ], 64))), 256))
821
+ ]),
822
+ _: 3
823
+ }, 8, ["model", "rules", "label-width"])
824
+ ]),
825
+ _: 3
826
+ }, 8, ["modelValue", "title", "width"])) : H("", !0);
827
+ };
828
+ }
829
+ }), Y = {
830
+ MicDate: he,
831
+ MicInput: ye,
832
+ MicSearch: be,
833
+ MicSelect: _e,
834
+ MicVac: we,
835
+ MicTable: De,
836
+ MicDialog: Ae
837
+ }, Ee = {
838
+ install(a) {
839
+ Object.keys(Y).forEach((t) => {
840
+ const o = Y[t];
841
+ a.component(t, o);
445
842
  });
446
843
  }
447
844
  };
448
845
  export {
449
- Ie as MicDate,
450
- ke as MicInput,
451
- Ae as MicLayout,
452
- qe as MicSearch,
453
- Ee as MicSelect,
454
- Le as MicVac,
455
- Ce as default,
456
- Ve as mic
846
+ ze as Mic,
847
+ Ee as default,
848
+ Le as mic
457
849
  };