@sirpho/components 1.0.0

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/README.md ADDED
@@ -0,0 +1 @@
1
+ # 组件库
@@ -0,0 +1,29 @@
1
+ export declare const SelectCommonContext: (args: any) => {
2
+ rowData: import("vue").Ref<{
3
+ [x: string]: any;
4
+ }>;
5
+ rowDataList: import("vue").Ref<{
6
+ [x: string]: any;
7
+ }[]>;
8
+ inputText: import("vue").ComputedRef<import('../../../node_modules/ant-design-vue/lib/select').SelectValue>;
9
+ getRequest: (requestParams?: {}) => Promise<any>;
10
+ handleFocus: () => Promise<void>;
11
+ onClear: () => void;
12
+ deselect: (value: any) => void;
13
+ getList: (isFirst?: boolean, requestParams?: {}) => Promise<void>;
14
+ columns: import("vue").Ref<any[]>;
15
+ gridData: import("vue").Ref<{
16
+ [x: string]: any;
17
+ }[]>;
18
+ gridLoading: import("vue").Ref<boolean>;
19
+ handleCellClick: (params: any) => void;
20
+ handleCheckboxChange: () => void;
21
+ handleInputChange: (field?: string | number) => void;
22
+ setInit: () => void;
23
+ filter: any;
24
+ doOnMount: () => Promise<void>;
25
+ loadData: (params: any) => Promise<void>;
26
+ setValue: (_data?: any) => void;
27
+ setValue1: (_data?: any[]) => void;
28
+ inputValue: import("vue").Ref<any>;
29
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 多列下拉全局配置
3
+ */
4
+ export declare const globalConfig: any;
5
+ /**
6
+ * vxeTable默认配置
7
+ */
8
+ export declare const vxeTableDefaultConfig: any;
9
+ export declare function registerVariant(defHttp: any, variants: any): void;
@@ -0,0 +1,14 @@
1
+ import { PropType } from 'vue';
2
+ import { VxeGlobalRendererHandles } from 'vxe-table';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ params: PropType<VxeGlobalRendererHandles.RenderFilterParams<import("vxe-table").VxeTableDataRow>>;
5
+ id: NumberConstructor;
6
+ sort: BooleanConstructor;
7
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ params: PropType<VxeGlobalRendererHandles.RenderFilterParams<import("vxe-table").VxeTableDataRow>>;
9
+ id: NumberConstructor;
10
+ sort: BooleanConstructor;
11
+ }>>, {
12
+ sort: boolean;
13
+ }>;
14
+ export default _default;
@@ -0,0 +1,72 @@
1
+ import { type ModalProps } from '../../../node_modules/ant-design-vue';
2
+ import { type VxeGridPropTypes } from "vxe-table";
3
+ interface Props extends ModalProps {
4
+ /** 数据接口 */
5
+ request: (param: any) => Promise<any>;
6
+ /** 接口参数 */
7
+ params?: any;
8
+ /** 表格列 */
9
+ columns?: VxeGridPropTypes.Columns;
10
+ /** 标题 */
11
+ title?: string;
12
+ visible: boolean;
13
+ }
14
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
15
+ params: () => {};
16
+ columns: () => ({
17
+ field: string;
18
+ title: string;
19
+ cellType: string;
20
+ sortable: boolean;
21
+ width?: undefined;
22
+ } | {
23
+ field: string;
24
+ title: string;
25
+ cellType: string;
26
+ sortable: boolean;
27
+ width: number;
28
+ })[];
29
+ title: string;
30
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ "update:visible": (...args: any[]) => void;
32
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
33
+ params: () => {};
34
+ columns: () => ({
35
+ field: string;
36
+ title: string;
37
+ cellType: string;
38
+ sortable: boolean;
39
+ width?: undefined;
40
+ } | {
41
+ field: string;
42
+ title: string;
43
+ cellType: string;
44
+ sortable: boolean;
45
+ width: number;
46
+ })[];
47
+ title: string;
48
+ }>>> & {
49
+ "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
50
+ }, {
51
+ title: string;
52
+ params: any;
53
+ columns: VxeGridPropTypes.Columns<import("vxe-table").VxeTableDataRow>;
54
+ }>;
55
+ export default _default;
56
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
57
+ type __VLS_TypePropsToRuntimeProps<T> = {
58
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
59
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
60
+ } : {
61
+ type: import('vue').PropType<T[K]>;
62
+ required: true;
63
+ };
64
+ };
65
+ type __VLS_WithDefaults<P, D> = {
66
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
67
+ default: D[K];
68
+ }> : P[K];
69
+ };
70
+ type __VLS_Prettify<T> = {
71
+ [K in keyof T]: T[K];
72
+ } & {};
@@ -0,0 +1,42 @@
1
+
2
+ declare const _default: import("vue").DefineComponent<{
3
+ extraHeight: {
4
+ type: NumberConstructor;
5
+ default: number;
6
+ };
7
+ direction: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ size: {
12
+ type: ArrayConstructor;
13
+ default: () => never[];
14
+ };
15
+ id: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
20
+ extraHeight: {
21
+ type: NumberConstructor;
22
+ default: number;
23
+ };
24
+ direction: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ size: {
29
+ type: ArrayConstructor;
30
+ default: () => never[];
31
+ };
32
+ id: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ }>>, {
37
+ extraHeight: number;
38
+ direction: string;
39
+ size: unknown[];
40
+ id: string;
41
+ }>;
42
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import VxeContainer from './VxeContainer/index.vue';
2
+ import FilterExtend from './FilterExtend/index.vue';
3
+ import StatusPop from './StatusPop/index.vue';
4
+ export { VxeContainer, FilterExtend, StatusPop, };
@@ -0,0 +1 @@
1
+ export declare function onMountedOrActivated(hook: Fn): void;
@@ -0,0 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ interface IUseCalcHeight {
3
+ height: Ref;
4
+ calcHeight: Function;
5
+ }
6
+ export default function useCalcHeight(elementId: string, minHeight?: number): IUseCalcHeight;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ interface WindowSizeOptions {
2
+ once?: boolean;
3
+ immediate?: boolean;
4
+ listenerOptions?: AddEventListenerOptions | boolean;
5
+ }
6
+ export declare function useWindowSizeFn<T>(fn: Fn<T>, wait?: number, options?: WindowSizeOptions): (() => void)[];
7
+ export {};
@@ -0,0 +1,749 @@
1
+ import { Fragment as q, Comment as se, Text as ce, onMounted as de, nextTick as R, onActivated as ue, ref as H, defineComponent as G, useSlots as fe, toRefs as pe, createVNode as v, isVNode as me, reactive as be, computed as X, watch as ae, resolveComponent as E, openBlock as O, createElementBlock as $, unref as i, withCtx as w, createElementVNode as k, renderList as U, normalizeClass as ge, createTextVNode as K, toDisplayString as J, withDirectives as z, createBlock as le, vShow as F, pushScopeId as ve, popScopeId as ye } from "vue";
2
+ import { Splitpanes as he, Pane as xe } from "splitpanes";
3
+ import { useDebounceFn as _e, tryOnMounted as Te, tryOnUnmounted as we } from "@vueuse/core";
4
+ import { Tabs as Se, TabPane as Q, Tooltip as De, message as ke, Modal as Oe, Skeleton as Ce } from "ant-design-vue";
5
+ function W(e, a) {
6
+ (a == null || a > e.length) && (a = e.length);
7
+ for (var t = 0, c = Array(a); t < a; t++)
8
+ c[t] = e[t];
9
+ return c;
10
+ }
11
+ function Ve(e, a) {
12
+ if (e) {
13
+ if (typeof e == "string")
14
+ return W(e, a);
15
+ var t = {}.toString.call(e).slice(8, -1);
16
+ return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? W(e, a) : void 0;
17
+ }
18
+ }
19
+ function $e(e) {
20
+ if (Array.isArray(e))
21
+ return W(e);
22
+ }
23
+ function je(e) {
24
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null)
25
+ return Array.from(e);
26
+ }
27
+ function Ae() {
28
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
29
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
30
+ }
31
+ function Y(e) {
32
+ return $e(e) || je(e) || Ve(e) || Ae();
33
+ }
34
+ var Ie = typeof global == "object" && global && global.Object === Object && global;
35
+ const Ee = Ie;
36
+ var Ne = typeof self == "object" && self && self.Object === Object && self, Le = Ee || Ne || Function("return this")();
37
+ const oe = Le;
38
+ var qe = oe.Symbol;
39
+ const M = qe;
40
+ var re = Object.prototype, ze = re.hasOwnProperty, Fe = re.toString, L = M ? M.toStringTag : void 0;
41
+ function He(e) {
42
+ var a = ze.call(e, L), t = e[L];
43
+ try {
44
+ e[L] = void 0;
45
+ var c = !0;
46
+ } catch {
47
+ }
48
+ var f = Fe.call(e);
49
+ return c && (a ? e[L] = t : delete e[L]), f;
50
+ }
51
+ var Me = Object.prototype, Ue = Me.toString;
52
+ function Be(e) {
53
+ return Ue.call(e);
54
+ }
55
+ var We = "[object Null]", Pe = "[object Undefined]", Z = M ? M.toStringTag : void 0;
56
+ function Re(e) {
57
+ return e == null ? e === void 0 ? Pe : We : Z && Z in Object(e) ? He(e) : Be(e);
58
+ }
59
+ function Ge(e) {
60
+ return e != null && typeof e == "object";
61
+ }
62
+ function Ke(e) {
63
+ return e && (e.type === se || e.type === q && e.children.length === 0 || e.type === ce && e.children.trim() === "");
64
+ }
65
+ function Xe() {
66
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], a = [];
67
+ return e.forEach(function(t) {
68
+ Array.isArray(t) ? a.push.apply(a, Y(t)) : t.type === q ? a.push.apply(a, Y(t.children)) : a.push(t);
69
+ }), a.filter(function(t) {
70
+ return !Ke(t);
71
+ });
72
+ }
73
+ var Je = "[object Symbol]";
74
+ function Qe(e) {
75
+ return typeof e == "symbol" || Ge(e) && Re(e) == Je;
76
+ }
77
+ var Ye = /\s/;
78
+ function Ze(e) {
79
+ for (var a = e.length; a-- && Ye.test(e.charAt(a)); )
80
+ ;
81
+ return a;
82
+ }
83
+ var et = /^\s+/;
84
+ function tt(e) {
85
+ return e && e.slice(0, Ze(e) + 1).replace(et, "");
86
+ }
87
+ function P(e) {
88
+ var a = typeof e;
89
+ return e != null && (a == "object" || a == "function");
90
+ }
91
+ var ee = 0 / 0, nt = /^[-+]0x[0-9a-f]+$/i, at = /^0b[01]+$/i, lt = /^0o[0-7]+$/i, ot = parseInt;
92
+ function te(e) {
93
+ if (typeof e == "number")
94
+ return e;
95
+ if (Qe(e))
96
+ return ee;
97
+ if (P(e)) {
98
+ var a = typeof e.valueOf == "function" ? e.valueOf() : e;
99
+ e = P(a) ? a + "" : a;
100
+ }
101
+ if (typeof e != "string")
102
+ return e === 0 ? e : +e;
103
+ e = tt(e);
104
+ var t = at.test(e);
105
+ return t || lt.test(e) ? ot(e.slice(2), t ? 2 : 8) : nt.test(e) ? ee : +e;
106
+ }
107
+ var rt = function() {
108
+ return oe.Date.now();
109
+ };
110
+ const B = rt;
111
+ var it = "Expected a function", st = Math.max, ct = Math.min;
112
+ function dt(e, a, t) {
113
+ var c, f, b, y, p, h, x = 0, C = !1, _ = !1, S = !0;
114
+ if (typeof e != "function")
115
+ throw new TypeError(it);
116
+ a = te(a) || 0, P(t) && (C = !!t.leading, _ = "maxWait" in t, b = _ ? st(te(t.maxWait) || 0, a) : b, S = "trailing" in t ? !!t.trailing : S);
117
+ function V(l) {
118
+ var m = c, d = f;
119
+ return c = f = void 0, x = l, y = e.apply(d, m), y;
120
+ }
121
+ function N(l) {
122
+ return x = l, p = setTimeout(D, a), C ? V(l) : y;
123
+ }
124
+ function A(l) {
125
+ var m = l - h, d = l - x, T = a - m;
126
+ return _ ? ct(T, b - d) : T;
127
+ }
128
+ function j(l) {
129
+ var m = l - h, d = l - x;
130
+ return h === void 0 || m >= a || m < 0 || _ && d >= b;
131
+ }
132
+ function D() {
133
+ var l = B();
134
+ if (j(l))
135
+ return I(l);
136
+ p = setTimeout(D, A(l));
137
+ }
138
+ function I(l) {
139
+ return p = void 0, S && c ? V(l) : (c = f = void 0, y);
140
+ }
141
+ function o() {
142
+ p !== void 0 && clearTimeout(p), x = 0, c = h = f = p = void 0;
143
+ }
144
+ function n() {
145
+ return p === void 0 ? y : I(B());
146
+ }
147
+ function r() {
148
+ var l = B(), m = j(l);
149
+ if (c = arguments, f = this, h = l, m) {
150
+ if (p === void 0)
151
+ return N(h);
152
+ if (_)
153
+ return clearTimeout(p), p = setTimeout(D, a), V(h);
154
+ }
155
+ return p === void 0 && (p = setTimeout(D, a)), y;
156
+ }
157
+ return r.cancel = o, r.flush = n, r;
158
+ }
159
+ function ut(e, a = 150, t) {
160
+ const f = _e(() => {
161
+ e();
162
+ }, a), b = () => {
163
+ t && t.immediate && f().then(), window.addEventListener("resize", f);
164
+ }, y = () => {
165
+ window.removeEventListener("resize", f);
166
+ };
167
+ return Te(() => {
168
+ b();
169
+ }), we(() => {
170
+ y();
171
+ }), [b, y];
172
+ }
173
+ function ft(e) {
174
+ let a;
175
+ de(() => {
176
+ e(), R(() => {
177
+ a = !0;
178
+ });
179
+ }), ue(() => {
180
+ a && e();
181
+ });
182
+ }
183
+ function pt(e, a = 100) {
184
+ const t = H(300), c = () => {
185
+ const f = document.getElementById(e), b = document.body.clientHeight;
186
+ let y = 0;
187
+ if (!f) {
188
+ console.warn("vxe ext core useCalcHeight DOM is null");
189
+ return;
190
+ }
191
+ y = f.getBoundingClientRect().top;
192
+ const p = b - y - 8;
193
+ t.value = p < a ? a : p;
194
+ };
195
+ return ut(dt(c, 300)), ft(() => {
196
+ c();
197
+ }), { height: t, calcHeight: c };
198
+ }
199
+ function ne(e) {
200
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !me(e);
201
+ }
202
+ const qt = /* @__PURE__ */ G({
203
+ props: {
204
+ extraHeight: {
205
+ type: Number,
206
+ default: 0
207
+ },
208
+ direction: {
209
+ type: String,
210
+ default: "horizontal"
211
+ },
212
+ size: {
213
+ type: Array,
214
+ default: () => []
215
+ },
216
+ id: {
217
+ type: String,
218
+ default: "#1"
219
+ }
220
+ },
221
+ setup(e, {
222
+ expose: a
223
+ }) {
224
+ const t = fe(), c = "@sirpho-vxe-container", {
225
+ height: f,
226
+ calcHeight: b
227
+ } = pt(`${c}-${e.id}`);
228
+ return a({
229
+ reCalcHeight: () => {
230
+ R(() => {
231
+ b();
232
+ });
233
+ }
234
+ }), () => {
235
+ var j;
236
+ let p;
237
+ const {
238
+ extraHeight: h,
239
+ direction: x,
240
+ size: C
241
+ } = pe(e), _ = x.value === "horizontal", S = f.value - h.value, V = Xe((j = t.default) == null ? void 0 : j.call(t)), N = V.length, A = Math.floor(S - 0.5);
242
+ return N === 0 ? v("div", {
243
+ id: `${c}-${e.id}`,
244
+ class: "vxe-container",
245
+ "data-calc-height": S,
246
+ style: {
247
+ height: A + "px"
248
+ }
249
+ }, null) : v(he, {
250
+ id: `${c}-${e.id}`,
251
+ class: "vxe-container default-theme",
252
+ horizontal: _,
253
+ "data-calc-height": S,
254
+ style: {
255
+ height: A + "px"
256
+ }
257
+ }, ne(p = V.map((D, I) => v(xe, {
258
+ size: C.value[I],
259
+ "min-size": "20",
260
+ "max-size": "100"
261
+ }, ne(D) ? D : {
262
+ default: () => [D]
263
+ }))) ? p : {
264
+ default: () => [p]
265
+ });
266
+ };
267
+ }
268
+ });
269
+ const ie = (e) => (ve("data-v-4fc5c7cd"), e = e(), ye(), e), mt = { class: "my-filter-excel" }, bt = { class: "my-fe-search" }, gt = { class: "my-fe-search-top" }, vt = /* @__PURE__ */ ie(() => /* @__PURE__ */ k("i", { class: "vxe-icon-search my-fe-search-icon" }, null, -1)), yt = { class: "my-fe-search-list" }, ht = {
270
+ key: 0,
271
+ class: "vxe-icon-checkbox-unchecked my-fe-search-item-icon"
272
+ }, xt = {
273
+ key: 1,
274
+ class: "vxe-icon-checkbox-indeterminate my-fe-search-item-icon icon-color"
275
+ }, _t = {
276
+ key: 2,
277
+ class: "vxe-icon-checkbox-checked my-fe-search-item-icon icon-color"
278
+ }, Tt = /* @__PURE__ */ ie(() => /* @__PURE__ */ k("span", { style: { "padding-left": "10px" } }, " (全选)", -1)), wt = ["onClick"], St = { style: { "padding-left": "10px" } }, Dt = { class: "container" }, kt = { class: "my-fe-footer" }, Ot = /* @__PURE__ */ K("确认"), Ct = /* @__PURE__ */ K("重置"), Vt = {
279
+ name: "FilterExtend"
280
+ }, $t = /* @__PURE__ */ G({
281
+ ...Vt,
282
+ props: {
283
+ params: Object,
284
+ id: Number,
285
+ sort: Boolean || void 0
286
+ },
287
+ setup(e) {
288
+ const a = e, t = be({
289
+ option: {
290
+ data: {}
291
+ },
292
+ colValList: []
293
+ }), c = {
294
+ vals: [],
295
+ // 按选项:
296
+ dVals: [],
297
+ // 按选项:暂存默认值
298
+ sVal: "",
299
+ // 按选项:
300
+ tab: "1",
301
+ // 当前tab(1:按选项,2:按条件)
302
+ cdt: "",
303
+ cdt2: "",
304
+ cdt3: "",
305
+ cdt4: ""
306
+ }, f = [
307
+ { label: "无", value: "null" },
308
+ { label: "数值类", value: "number" },
309
+ { label: "文本类", value: "text" },
310
+ { label: "日期类", value: "date" }
311
+ ], b = ["number-between", "number-no-between", "date-between", "date-no-between"], y = ["text-empty", "text-no-empty"], p = {
312
+ null: [],
313
+ number: [
314
+ { label: "大于", value: "number-bigger" },
315
+ { label: "小于", value: "number-smaller" },
316
+ { label: "介于", value: "number-between" },
317
+ { label: "不介于", value: "number-no-between" },
318
+ { label: "等于", value: "number-equal" },
319
+ { label: "不等于", value: "number-no-equal" },
320
+ { label: "大于或等于", value: "number-bigger-or-equal" },
321
+ { label: "小于或等于", value: "number-smaller-or-equal" }
322
+ ],
323
+ text: [
324
+ { label: "文本包含", value: "text-include" },
325
+ { label: "文本不包含", value: "text-no-include" },
326
+ { label: "文本等于", value: "text-equal" },
327
+ { label: "单元格为空", value: "text-empty" },
328
+ { label: "单元格有内容", value: "text-no-empty" },
329
+ { label: "文本开头为", value: "text-begin" },
330
+ { label: "文本结尾为", value: "text-end" }
331
+ ],
332
+ date: [
333
+ { label: "日期为", value: "date-equal" },
334
+ { label: "日期早于", value: "date-before" },
335
+ { label: "日期晚于", value: "date-after" },
336
+ { label: "日期介于", value: "date-between" },
337
+ { label: "日期不介于", value: "date-no-between" }
338
+ ]
339
+ }, h = X(() => {
340
+ const o = t.option.data.cdt;
341
+ return o === "number" || o === "text" || o === "null" || o === "date" ? p[o] : [];
342
+ }), x = X(() => {
343
+ var r;
344
+ const { option: o, colValList: n } = t;
345
+ if (o) {
346
+ if (o.data.sVal) {
347
+ const l = n.filter((m) => String(m).indexOf(String(o.data.sVal)) > -1);
348
+ return o.data.vals = [...l], a.sort ? l.sort() : l;
349
+ }
350
+ return o.data.vals = ((r = o.data.dVals) == null ? void 0 : r.length) > 0 ? [...o.data.dVals] : [...n], a.sort ? n.sort() : n;
351
+ }
352
+ return [];
353
+ }), C = () => {
354
+ const { params: o } = a;
355
+ if (o) {
356
+ const { $table: n, column: r } = o, { fullData: l } = n.getTableData();
357
+ r.filters[0].data = {
358
+ ...c,
359
+ ...r.filters[0].data
360
+ }, t.option = r.filters[0], t.colValList = Array.from(new Set(l.map((m) => m[r.field])));
361
+ }
362
+ if (t.option) {
363
+ const { data: n } = t.option;
364
+ n.vals.length === 0 && (n.vals = [...t.colValList]);
365
+ }
366
+ }, _ = () => {
367
+ const { option: o, colValList: n } = t;
368
+ if (o) {
369
+ const { data: r } = o;
370
+ r.vals = r.vals.length > 0 ? [] : [...n];
371
+ }
372
+ }, S = (o) => {
373
+ const { option: n } = t;
374
+ if (n) {
375
+ const { data: r } = n, l = r.vals.indexOf(o);
376
+ l === -1 ? r.vals.push(o) : r.vals.splice(l, 1);
377
+ }
378
+ }, V = () => {
379
+ const { params: o } = a, { option: n } = t;
380
+ if (!o || !n)
381
+ return;
382
+ const { $panel: r } = o;
383
+ if (n.data.tab === "1") {
384
+ const { data: l } = n;
385
+ if (l.vals.length === 0) {
386
+ D();
387
+ return;
388
+ }
389
+ l.dVals = [...l.vals], r.changeOption(null, !0, n), r.confirmFilter();
390
+ } else if (n.data.tab === "2") {
391
+ const { cdt: l, cdt2: m } = n.data;
392
+ if (!m) {
393
+ ke.warning("请选择条件");
394
+ return;
395
+ }
396
+ switch (l) {
397
+ case "number":
398
+ j();
399
+ return;
400
+ case "text":
401
+ N();
402
+ return;
403
+ case "date":
404
+ A();
405
+ return;
406
+ default:
407
+ return;
408
+ }
409
+ }
410
+ }, N = () => {
411
+ if (!a.params || !t.option)
412
+ return;
413
+ const { $table: o, column: n, $panel: r } = a.params, { data: l } = t.option, { cdt2: m, cdt3: d } = l, s = o.getTableData().fullData.filter((g) => {
414
+ switch (m) {
415
+ case "text-include":
416
+ return String(g[n.field]).indexOf(String(d)) !== -1;
417
+ case "text-no-include":
418
+ return String(g[n.field]).indexOf(String(d)) === -1;
419
+ case "text-equal":
420
+ return String(g[n.field]) === String(d);
421
+ case "text-empty":
422
+ return !g[n.field];
423
+ case "text-no-empty":
424
+ return !!g[n.field];
425
+ case "text-begin":
426
+ return String(g[n.field]).startsWith(String(d));
427
+ case "text-end":
428
+ return String(g[n.field]).endsWith(String(d));
429
+ default:
430
+ return !1;
431
+ }
432
+ }).map((g) => g[n.field]);
433
+ l.vals = Array.from(new Set(s)), r.changeOption(null, !0, t.option), r.confirmFilter();
434
+ }, A = () => {
435
+ if (!a.params || !t.option)
436
+ return;
437
+ const { $table: o, column: n, $panel: r } = a.params, { data: l } = t.option, { cdt2: m, cdt3: d, cdt4: T } = l, g = o.getTableData().fullData.filter((u) => {
438
+ switch (m) {
439
+ case "date-equal":
440
+ return isNaN(new Date(u[n.field]).getTime()) ? !1 : new Date(d).getTime() === new Date(u[n.field]).getTime();
441
+ case "date-before":
442
+ return isNaN(new Date(u[n.field]).getTime()) ? !1 : new Date(d).getTime() > new Date(u[n.field]).getTime();
443
+ case "date-after":
444
+ return isNaN(new Date(u[n.field]).getTime()) ? !1 : new Date(d).getTime() < new Date(u[n.field]).getTime();
445
+ case "date-between":
446
+ return isNaN(new Date(u[n.field]).getTime()) ? !1 : new Date(d).getTime() < new Date(u[n.field]).getTime() && new Date(T).getTime() > new Date(u[n.field]).getTime();
447
+ case "date-no-between":
448
+ return isNaN(new Date(u[n.field]).getTime()) ? !1 : new Date(d).getTime() > new Date(u[n.field]).getTime() && new Date(T).getTime() < new Date(u[n.field]).getTime();
449
+ default:
450
+ return !1;
451
+ }
452
+ }).map((u) => u[n.field]);
453
+ l.vals = Array.from(new Set(g)), r.changeOption(null, !0, t.option), r.confirmFilter();
454
+ }, j = () => {
455
+ if (!a.params || !t.option)
456
+ return;
457
+ const { $table: o, column: n, $panel: r } = a.params, { data: l } = t.option, { cdt2: m, cdt3: d, cdt4: T } = l, g = o.getTableData().fullData.filter((u) => {
458
+ switch (m) {
459
+ case "number-bigger":
460
+ return +u[n.field] > +d;
461
+ case "number-smaller":
462
+ return +u[n.field] < +d;
463
+ case "number-between":
464
+ return +u[n.field] >= +d && +u[n.field] <= +T;
465
+ case "number-no-between":
466
+ return +u[n.field] < +d || +u[n.field] > +T;
467
+ case "number-equal":
468
+ return +u[n.field] == +d;
469
+ case "number-no-equal":
470
+ return +u[n.field] != +d;
471
+ case "number-bigger-or-equal":
472
+ return +u[n.field] >= +d;
473
+ case "number-smaller-or-equal":
474
+ return +u[n.field] <= +d;
475
+ default:
476
+ return !1;
477
+ }
478
+ }).map((u) => u[n.field]);
479
+ l.vals = Array.from(new Set(g)), r.changeOption(null, !0, t.option), r.confirmFilter();
480
+ }, D = () => {
481
+ const { params: o } = a;
482
+ if (o) {
483
+ const { $panel: n } = o;
484
+ n.resetFilter();
485
+ }
486
+ }, I = () => {
487
+ t.option.data.cdt2 = "", t.option.data.cdt3 = "", t.option.data.cdt4 = "";
488
+ };
489
+ return ae(
490
+ () => a.id,
491
+ () => {
492
+ C();
493
+ },
494
+ { immediate: !0 }
495
+ ), (o, n) => {
496
+ const r = E("vxe-input"), l = E("vxe-list"), m = E("vxe-option"), d = E("vxe-select"), T = E("vxe-button");
497
+ return O(), $("div", mt, [
498
+ v(i(Se), {
499
+ activeKey: i(t).option.data.tab,
500
+ "onUpdate:activeKey": n[5] || (n[5] = (s) => i(t).option.data.tab = s),
501
+ size: "small"
502
+ }, {
503
+ default: w(() => [
504
+ v(i(Q), {
505
+ key: "1",
506
+ tab: "按选项"
507
+ }, {
508
+ default: w(() => [
509
+ k("div", bt, [
510
+ k("div", gt, [
511
+ v(r, {
512
+ modelValue: i(t).option.data.sVal,
513
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => i(t).option.data.sVal = s),
514
+ placeholder: "搜索"
515
+ }, null, 8, ["modelValue"]),
516
+ vt
517
+ ]),
518
+ k("div", yt, [
519
+ k("div", {
520
+ class: "my-fe-search-item",
521
+ onClick: _
522
+ }, [
523
+ i(t).option.data.vals.length === 0 ? (O(), $("span", ht)) : i(t).option.data.vals.length !== i(x).length ? (O(), $("span", xt)) : (O(), $("span", _t)),
524
+ Tt
525
+ ]),
526
+ v(l, {
527
+ height: "165",
528
+ "scroll-y": { enabled: !0 },
529
+ data: i(x)
530
+ }, {
531
+ default: w(({ items: s }) => [
532
+ (O(!0), $(q, null, U(s, (g, u) => (O(), $("div", {
533
+ style: { height: "20px" },
534
+ class: "my-fe-search-item",
535
+ key: u,
536
+ onClick: (At) => S(g)
537
+ }, [
538
+ k("span", {
539
+ class: ge([
540
+ i(t).option.data.vals.indexOf(g) === -1 ? "vxe-icon-checkbox-unchecked my-fe-search-item-icon" : "vxe-icon-checkbox-checked icon-color my-fe-search-item-icon"
541
+ ])
542
+ }, null, 2),
543
+ v(i(De), null, {
544
+ title: w(() => [
545
+ K(J(g), 1)
546
+ ]),
547
+ default: w(() => [
548
+ k("span", St, J(g), 1)
549
+ ]),
550
+ _: 2
551
+ }, 1024)
552
+ ], 8, wt))), 128))
553
+ ]),
554
+ _: 1
555
+ }, 8, ["data"])
556
+ ])
557
+ ])
558
+ ]),
559
+ _: 1
560
+ }),
561
+ v(i(Q), {
562
+ key: "2",
563
+ tab: "按条件",
564
+ "force-render": ""
565
+ }, {
566
+ default: w(() => [
567
+ k("div", Dt, [
568
+ v(d, {
569
+ modelValue: i(t).option.data.cdt,
570
+ "onUpdate:modelValue": n[1] || (n[1] = (s) => i(t).option.data.cdt = s),
571
+ transfer: "",
572
+ onChange: I
573
+ }, {
574
+ default: w(() => [
575
+ (O(), $(q, null, U(f, (s) => v(m, {
576
+ key: s.value,
577
+ value: s.value,
578
+ label: s.label
579
+ }, null, 8, ["value", "label"])), 64))
580
+ ]),
581
+ _: 1
582
+ }, 8, ["modelValue"]),
583
+ z(v(d, {
584
+ style: { "margin-top": "10px" },
585
+ modelValue: i(t).option.data.cdt2,
586
+ "onUpdate:modelValue": n[2] || (n[2] = (s) => i(t).option.data.cdt2 = s),
587
+ transfer: ""
588
+ }, {
589
+ default: w(() => [
590
+ (O(!0), $(q, null, U(i(h), (s) => (O(), le(m, {
591
+ key: s.value,
592
+ value: s.value,
593
+ label: s.label
594
+ }, null, 8, ["value", "label"]))), 128))
595
+ ]),
596
+ _: 1
597
+ }, 8, ["modelValue"]), [
598
+ [F, i(t).option.data.cdt !== "null" && i(t).option.data.cdt]
599
+ ]),
600
+ z(v(r, {
601
+ style: { "margin-top": "10px" },
602
+ type: i(t).option.data.cdt,
603
+ modelValue: i(t).option.data.cdt3,
604
+ "onUpdate:modelValue": n[3] || (n[3] = (s) => i(t).option.data.cdt3 = s),
605
+ transfer: ""
606
+ }, null, 8, ["type", "modelValue"]), [
607
+ [F, i(t).option.data.cdt2 && !y.find((s) => s === i(t).option.data.cdt2)]
608
+ ]),
609
+ z(k("div", null, "与", 512), [
610
+ [F, i(t).option.data.cdt2 && b.find((s) => s === i(t).option.data.cdt2)]
611
+ ]),
612
+ z(v(r, {
613
+ transfer: "",
614
+ modelValue: i(t).option.data.cdt4,
615
+ "onUpdate:modelValue": n[4] || (n[4] = (s) => i(t).option.data.cdt4 = s),
616
+ type: i(t).option.data.cdt
617
+ }, null, 8, ["modelValue", "type"]), [
618
+ [F, i(t).option.data.cdt2 && b.find((s) => s === i(t).option.data.cdt2)]
619
+ ])
620
+ ])
621
+ ]),
622
+ _: 1
623
+ })
624
+ ]),
625
+ _: 1
626
+ }, 8, ["activeKey"]),
627
+ k("div", kt, [
628
+ v(T, {
629
+ status: "primary",
630
+ onClick: V
631
+ }, {
632
+ default: w(() => [
633
+ Ot
634
+ ]),
635
+ _: 1
636
+ }),
637
+ v(T, { onClick: D }, {
638
+ default: w(() => [
639
+ Ct
640
+ ]),
641
+ _: 1
642
+ })
643
+ ])
644
+ ]);
645
+ };
646
+ }
647
+ });
648
+ const jt = (e, a) => {
649
+ const t = e.__vccOpts || e;
650
+ for (const [c, f] of a)
651
+ t[c] = f;
652
+ return t;
653
+ }, zt = /* @__PURE__ */ jt($t, [["__scopeId", "data-v-4fc5c7cd"]]), Ft = /* @__PURE__ */ G({
654
+ props: {
655
+ request: null,
656
+ params: { default: () => ({}) },
657
+ columns: { default: () => [
658
+ {
659
+ field: "opContent",
660
+ title: "操作内容",
661
+ cellType: "string",
662
+ sortable: !0
663
+ },
664
+ {
665
+ field: "reason",
666
+ title: "操作理由",
667
+ cellType: "string",
668
+ sortable: !0
669
+ },
670
+ {
671
+ field: "opUser",
672
+ title: "操作人",
673
+ cellType: "string",
674
+ sortable: !0
675
+ },
676
+ {
677
+ field: "opTime",
678
+ title: "操作时间",
679
+ cellType: "string",
680
+ sortable: !0,
681
+ width: 180
682
+ }
683
+ ] },
684
+ title: { default: "操作记录" },
685
+ visible: { type: Boolean }
686
+ },
687
+ emits: ["update:visible"],
688
+ setup(e, { emit: a }) {
689
+ const t = e, c = H(!1), f = H(!1), b = H([]), y = async () => {
690
+ const C = {
691
+ ...t.params
692
+ };
693
+ c.value = !0;
694
+ const _ = await t.request(C).finally(() => {
695
+ c.value = !1;
696
+ });
697
+ b.value = _.data || [];
698
+ }, p = () => {
699
+ f.value = !0, y();
700
+ };
701
+ ae(
702
+ () => t.visible,
703
+ () => {
704
+ t.visible && p();
705
+ }
706
+ );
707
+ const h = () => {
708
+ f.value = !1, c.value = !1, b.value = [];
709
+ }, x = () => {
710
+ a("update:visible", !1), R(() => {
711
+ h();
712
+ });
713
+ };
714
+ return (C, _) => {
715
+ const S = E("vxe-grid");
716
+ return O(), le(i(Oe), {
717
+ footer: !1,
718
+ title: e.title,
719
+ open: e.visible,
720
+ width: "800px",
721
+ onCancel: x
722
+ }, {
723
+ default: w(() => [
724
+ v(i(Ce), {
725
+ loading: c.value,
726
+ paragraph: { rows: 6 },
727
+ active: ""
728
+ }, {
729
+ default: w(() => [
730
+ v(S, {
731
+ columns: e.columns,
732
+ data: b.value,
733
+ "auto-resize": "",
734
+ height: "400"
735
+ }, null, 8, ["columns", "data"])
736
+ ]),
737
+ _: 1
738
+ }, 8, ["loading"])
739
+ ]),
740
+ _: 1
741
+ }, 8, ["title", "open"]);
742
+ };
743
+ }
744
+ });
745
+ export {
746
+ zt as FilterExtend,
747
+ Ft as StatusPop,
748
+ qt as VxeContainer
749
+ };
@@ -0,0 +1,2 @@
1
+ (function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("splitpanes"),require("@vueuse/core"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","splitpanes","@vueuse/core","ant-design-vue"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x["sirpho-components"]={},x.Vue,x.splitpanes,x.VueUse,x.antDesignVue))})(this,function(x,e,q,A,N){"use strict";function I(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,s=Array(o);n<o;n++)s[n]=t[n];return s}function G(t,o){if(t){if(typeof t=="string")return I(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(t,o):void 0}}function K(t){if(Array.isArray(t))return I(t)}function X(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function J(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F(t){return K(t)||X(t)||G(t)||J()}var Q=typeof global=="object"&&global&&global.Object===Object&&global;const Y=Q;var Z=typeof self=="object"&&self&&self.Object===Object&&self,ee=Y||Z||Function("return this")();const z=ee;var te=z.Symbol;const B=te;var H=Object.prototype,ne=H.hasOwnProperty,ae=H.toString,j=B?B.toStringTag:void 0;function oe(t){var o=ne.call(t,j),n=t[j];try{t[j]=void 0;var s=!0}catch{}var u=ae.call(t);return s&&(o?t[j]=n:delete t[j]),u}var re=Object.prototype,le=re.toString;function ie(t){return le.call(t)}var ce="[object Null]",se="[object Undefined]",M=B?B.toStringTag:void 0;function de(t){return t==null?t===void 0?se:ce:M&&M in Object(t)?oe(t):ie(t)}function fe(t){return t!=null&&typeof t=="object"}function ue(t){return t&&(t.type===e.Comment||t.type===e.Fragment&&t.children.length===0||t.type===e.Text&&t.children.trim()==="")}function pe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=[];return t.forEach(function(n){Array.isArray(n)?o.push.apply(o,F(n)):n.type===e.Fragment?o.push.apply(o,F(n.children)):o.push(n)}),o.filter(function(n){return!ue(n)})}var me="[object Symbol]";function be(t){return typeof t=="symbol"||fe(t)&&de(t)==me}var ge=/\s/;function he(t){for(var o=t.length;o--&&ge.test(t.charAt(o)););return o}var ye=/^\s+/;function xe(t){return t&&t.slice(0,he(t)+1).replace(ye,"")}function v(t){var o=typeof t;return t!=null&&(o=="object"||o=="function")}var U=0/0,_e=/^[-+]0x[0-9a-f]+$/i,we=/^0b[01]+$/i,Te=/^0o[0-7]+$/i,Se=parseInt;function P(t){if(typeof t=="number")return t;if(be(t))return U;if(v(t)){var o=typeof t.valueOf=="function"?t.valueOf():t;t=v(o)?o+"":o}if(typeof t!="string")return t===0?t:+t;t=xe(t);var n=we.test(t);return n||Te.test(t)?Se(t.slice(2),n?2:8):_e.test(t)?U:+t}var ke=function(){return z.Date.now()};const L=ke;var Ve="Expected a function",Ce=Math.max,Ne=Math.min;function De(t,o,n){var s,u,b,h,p,y,_=0,V=!1,w=!1,S=!0;if(typeof t!="function")throw new TypeError(Ve);o=P(o)||0,v(n)&&(V=!!n.leading,w="maxWait"in n,b=w?Ce(P(n.maxWait)||0,o):b,S="trailing"in n?!!n.trailing:S);function C(r){var m=s,d=u;return s=u=void 0,_=r,h=t.apply(d,m),h}function $(r){return _=r,p=setTimeout(k,o),V?C(r):h}function E(r){var m=r-y,d=r-_,T=o-m;return w?Ne(T,b-d):T}function D(r){var m=r-y,d=r-_;return y===void 0||m>=o||m<0||w&&d>=b}function k(){var r=L();if(D(r))return O(r);p=setTimeout(k,E(r))}function O(r){return p=void 0,S&&s?C(r):(s=u=void 0,h)}function l(){p!==void 0&&clearTimeout(p),_=0,s=y=u=p=void 0}function a(){return p===void 0?h:O(L())}function i(){var r=L(),m=D(r);if(s=arguments,u=this,y=r,m){if(p===void 0)return $(y);if(w)return clearTimeout(p),p=setTimeout(k,o),C(y)}return p===void 0&&(p=setTimeout(k,o)),h}return i.cancel=l,i.flush=a,i}function Ee(t,o=150,n){let s=()=>{t()};const u=A.useDebounceFn(s,o),b=()=>{n&&n.immediate&&u().then(),window.addEventListener("resize",u)},h=()=>{window.removeEventListener("resize",u)};return A.tryOnMounted(()=>{b()}),A.tryOnUnmounted(()=>{h()}),[b,h]}function Oe(t){let o;e.onMounted(()=>{t(),e.nextTick(()=>{o=!0})}),e.onActivated(()=>{o&&t()})}function je(t,o=100){const n=e.ref(300),s=()=>{const u=document.getElementById(t),b=document.body.clientHeight;let h=0;if(!u){console.warn("vxe ext core useCalcHeight DOM is null");return}h=u.getBoundingClientRect().top;const p=b-h-8;n.value=p<o?o:p};return Ee(De(s,300)),Oe(()=>{s()}),{height:n,calcHeight:s}}const Ye="";function W(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const $e=e.defineComponent({props:{extraHeight:{type:Number,default:0},direction:{type:String,default:"horizontal"},size:{type:Array,default:()=>[]},id:{type:String,default:"#1"}},setup(t,{expose:o}){const n=e.useSlots(),s="@sirpho-vxe-container",{height:u,calcHeight:b}=je(`${s}-${t.id}`);return o({reCalcHeight:()=>{e.nextTick(()=>{b()})}}),()=>{var D;let p;const{extraHeight:y,direction:_,size:V}=e.toRefs(t),w=_.value==="horizontal",S=u.value-y.value,C=pe((D=n.default)==null?void 0:D.call(n)),$=C.length,E=Math.floor(S-.5);return $===0?e.createVNode("div",{id:`${s}-${t.id}`,class:"vxe-container","data-calc-height":S,style:{height:E+"px"}},null):e.createVNode(q.Splitpanes,{id:`${s}-${t.id}`,class:"vxe-container default-theme",horizontal:w,"data-calc-height":S,style:{height:E+"px"}},W(p=C.map((k,O)=>e.createVNode(q.Pane,{size:V.value[O],"min-size":"20","max-size":"100"},W(k)?k:{default:()=>[k]})))?p:{default:()=>[p]})}}}),Ze="",R=t=>(e.pushScopeId("data-v-4fc5c7cd"),t=t(),e.popScopeId(),t),Be={class:"my-filter-excel"},Ae={class:"my-fe-search"},Ie={class:"my-fe-search-top"},ve=R(()=>e.createElementVNode("i",{class:"vxe-icon-search my-fe-search-icon"},null,-1)),Le={class:"my-fe-search-list"},qe={key:0,class:"vxe-icon-checkbox-unchecked my-fe-search-item-icon"},Fe={key:1,class:"vxe-icon-checkbox-indeterminate my-fe-search-item-icon icon-color"},ze={key:2,class:"vxe-icon-checkbox-checked my-fe-search-item-icon icon-color"},He=R(()=>e.createElementVNode("span",{style:{"padding-left":"10px"}}," (全选)",-1)),Me=["onClick"],Ue={style:{"padding-left":"10px"}},Pe={class:"container"},We={class:"my-fe-footer"},Re=e.createTextVNode("确认"),Ge=e.createTextVNode("重置"),Ke={name:"FilterExtend"},Xe=e.defineComponent({...Ke,props:{params:Object,id:Number,sort:Boolean||void 0},setup(t){const o=t,n=e.reactive({option:{data:{}},colValList:[]}),s={vals:[],dVals:[],sVal:"",tab:"1",cdt:"",cdt2:"",cdt3:"",cdt4:""},u=[{label:"无",value:"null"},{label:"数值类",value:"number"},{label:"文本类",value:"text"},{label:"日期类",value:"date"}],b=["number-between","number-no-between","date-between","date-no-between"],h=["text-empty","text-no-empty"],p={null:[],number:[{label:"大于",value:"number-bigger"},{label:"小于",value:"number-smaller"},{label:"介于",value:"number-between"},{label:"不介于",value:"number-no-between"},{label:"等于",value:"number-equal"},{label:"不等于",value:"number-no-equal"},{label:"大于或等于",value:"number-bigger-or-equal"},{label:"小于或等于",value:"number-smaller-or-equal"}],text:[{label:"文本包含",value:"text-include"},{label:"文本不包含",value:"text-no-include"},{label:"文本等于",value:"text-equal"},{label:"单元格为空",value:"text-empty"},{label:"单元格有内容",value:"text-no-empty"},{label:"文本开头为",value:"text-begin"},{label:"文本结尾为",value:"text-end"}],date:[{label:"日期为",value:"date-equal"},{label:"日期早于",value:"date-before"},{label:"日期晚于",value:"date-after"},{label:"日期介于",value:"date-between"},{label:"日期不介于",value:"date-no-between"}]},y=e.computed(()=>{const l=n.option.data.cdt;return l==="number"||l==="text"||l==="null"||l==="date"?p[l]:[]}),_=e.computed(()=>{var i;const{option:l,colValList:a}=n;if(l){if(l.data.sVal){const r=a.filter(m=>String(m).indexOf(String(l.data.sVal))>-1);return l.data.vals=[...r],o.sort?r.sort():r}return l.data.vals=((i=l.data.dVals)==null?void 0:i.length)>0?[...l.data.dVals]:[...a],o.sort?a.sort():a}return[]}),V=()=>{const{params:l}=o;if(l){const{$table:a,column:i}=l,{fullData:r}=a.getTableData();i.filters[0].data={...s,...i.filters[0].data},n.option=i.filters[0],n.colValList=Array.from(new Set(r.map(m=>m[i.field])))}if(n.option){const{data:a}=n.option;a.vals.length===0&&(a.vals=[...n.colValList])}},w=()=>{const{option:l,colValList:a}=n;if(l){const{data:i}=l;i.vals=i.vals.length>0?[]:[...a]}},S=l=>{const{option:a}=n;if(a){const{data:i}=a,r=i.vals.indexOf(l);r===-1?i.vals.push(l):i.vals.splice(r,1)}},C=()=>{const{params:l}=o,{option:a}=n;if(!l||!a)return;const{$panel:i}=l;if(a.data.tab==="1"){const{data:r}=a;if(r.vals.length===0){k();return}r.dVals=[...r.vals],i.changeOption(null,!0,a),i.confirmFilter()}else if(a.data.tab==="2"){const{cdt:r,cdt2:m}=a.data;if(!m){N.message.warning("请选择条件");return}switch(r){case"number":D();return;case"text":$();return;case"date":E();return;default:return}}},$=()=>{if(!o.params||!n.option)return;const{$table:l,column:a,$panel:i}=o.params,{data:r}=n.option,{cdt2:m,cdt3:d}=r,c=l.getTableData().fullData.filter(g=>{switch(m){case"text-include":return String(g[a.field]).indexOf(String(d))!==-1;case"text-no-include":return String(g[a.field]).indexOf(String(d))===-1;case"text-equal":return String(g[a.field])===String(d);case"text-empty":return!g[a.field];case"text-no-empty":return!!g[a.field];case"text-begin":return String(g[a.field]).startsWith(String(d));case"text-end":return String(g[a.field]).endsWith(String(d));default:return!1}}).map(g=>g[a.field]);r.vals=Array.from(new Set(c)),i.changeOption(null,!0,n.option),i.confirmFilter()},E=()=>{if(!o.params||!n.option)return;const{$table:l,column:a,$panel:i}=o.params,{data:r}=n.option,{cdt2:m,cdt3:d,cdt4:T}=r,g=l.getTableData().fullData.filter(f=>{switch(m){case"date-equal":return isNaN(new Date(f[a.field]).getTime())?!1:new Date(d).getTime()===new Date(f[a.field]).getTime();case"date-before":return isNaN(new Date(f[a.field]).getTime())?!1:new Date(d).getTime()>new Date(f[a.field]).getTime();case"date-after":return isNaN(new Date(f[a.field]).getTime())?!1:new Date(d).getTime()<new Date(f[a.field]).getTime();case"date-between":return isNaN(new Date(f[a.field]).getTime())?!1:new Date(d).getTime()<new Date(f[a.field]).getTime()&&new Date(T).getTime()>new Date(f[a.field]).getTime();case"date-no-between":return isNaN(new Date(f[a.field]).getTime())?!1:new Date(d).getTime()>new Date(f[a.field]).getTime()&&new Date(T).getTime()<new Date(f[a.field]).getTime();default:return!1}}).map(f=>f[a.field]);r.vals=Array.from(new Set(g)),i.changeOption(null,!0,n.option),i.confirmFilter()},D=()=>{if(!o.params||!n.option)return;const{$table:l,column:a,$panel:i}=o.params,{data:r}=n.option,{cdt2:m,cdt3:d,cdt4:T}=r,g=l.getTableData().fullData.filter(f=>{switch(m){case"number-bigger":return+f[a.field]>+d;case"number-smaller":return+f[a.field]<+d;case"number-between":return+f[a.field]>=+d&&+f[a.field]<=+T;case"number-no-between":return+f[a.field]<+d||+f[a.field]>+T;case"number-equal":return+f[a.field]==+d;case"number-no-equal":return+f[a.field]!=+d;case"number-bigger-or-equal":return+f[a.field]>=+d;case"number-smaller-or-equal":return+f[a.field]<=+d;default:return!1}}).map(f=>f[a.field]);r.vals=Array.from(new Set(g)),i.changeOption(null,!0,n.option),i.confirmFilter()},k=()=>{const{params:l}=o;if(l){const{$panel:a}=l;a.resetFilter()}},O=()=>{n.option.data.cdt2="",n.option.data.cdt3="",n.option.data.cdt4=""};return e.watch(()=>o.id,()=>{V()},{immediate:!0}),(l,a)=>{const i=e.resolveComponent("vxe-input"),r=e.resolveComponent("vxe-list"),m=e.resolveComponent("vxe-option"),d=e.resolveComponent("vxe-select"),T=e.resolveComponent("vxe-button");return e.openBlock(),e.createElementBlock("div",Be,[e.createVNode(e.unref(N.Tabs),{activeKey:e.unref(n).option.data.tab,"onUpdate:activeKey":a[5]||(a[5]=c=>e.unref(n).option.data.tab=c),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(N.TabPane),{key:"1",tab:"按选项"},{default:e.withCtx(()=>[e.createElementVNode("div",Ae,[e.createElementVNode("div",Ie,[e.createVNode(i,{modelValue:e.unref(n).option.data.sVal,"onUpdate:modelValue":a[0]||(a[0]=c=>e.unref(n).option.data.sVal=c),placeholder:"搜索"},null,8,["modelValue"]),ve]),e.createElementVNode("div",Le,[e.createElementVNode("div",{class:"my-fe-search-item",onClick:w},[e.unref(n).option.data.vals.length===0?(e.openBlock(),e.createElementBlock("span",qe)):e.unref(n).option.data.vals.length!==e.unref(_).length?(e.openBlock(),e.createElementBlock("span",Fe)):(e.openBlock(),e.createElementBlock("span",ze)),He]),e.createVNode(r,{height:"165","scroll-y":{enabled:!0},data:e.unref(_)},{default:e.withCtx(({items:c})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,(g,f)=>(e.openBlock(),e.createElementBlock("div",{style:{height:"20px"},class:"my-fe-search-item",key:f,onClick:nt=>S(g)},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(n).option.data.vals.indexOf(g)===-1?"vxe-icon-checkbox-unchecked my-fe-search-item-icon":"vxe-icon-checkbox-checked icon-color my-fe-search-item-icon"])},null,2),e.createVNode(e.unref(N.Tooltip),null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g),1)]),default:e.withCtx(()=>[e.createElementVNode("span",Ue,e.toDisplayString(g),1)]),_:2},1024)],8,Me))),128))]),_:1},8,["data"])])])]),_:1}),e.createVNode(e.unref(N.TabPane),{key:"2",tab:"按条件","force-render":""},{default:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createVNode(d,{modelValue:e.unref(n).option.data.cdt,"onUpdate:modelValue":a[1]||(a[1]=c=>e.unref(n).option.data.cdt=c),transfer:"",onChange:O},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,c=>e.createVNode(m,{key:c.value,value:c.value,label:c.label},null,8,["value","label"])),64))]),_:1},8,["modelValue"]),e.withDirectives(e.createVNode(d,{style:{"margin-top":"10px"},modelValue:e.unref(n).option.data.cdt2,"onUpdate:modelValue":a[2]||(a[2]=c=>e.unref(n).option.data.cdt2=c),transfer:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),c=>(e.openBlock(),e.createBlock(m,{key:c.value,value:c.value,label:c.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),[[e.vShow,e.unref(n).option.data.cdt!=="null"&&e.unref(n).option.data.cdt]]),e.withDirectives(e.createVNode(i,{style:{"margin-top":"10px"},type:e.unref(n).option.data.cdt,modelValue:e.unref(n).option.data.cdt3,"onUpdate:modelValue":a[3]||(a[3]=c=>e.unref(n).option.data.cdt3=c),transfer:""},null,8,["type","modelValue"]),[[e.vShow,e.unref(n).option.data.cdt2&&!h.find(c=>c===e.unref(n).option.data.cdt2)]]),e.withDirectives(e.createElementVNode("div",null,"与",512),[[e.vShow,e.unref(n).option.data.cdt2&&b.find(c=>c===e.unref(n).option.data.cdt2)]]),e.withDirectives(e.createVNode(i,{transfer:"",modelValue:e.unref(n).option.data.cdt4,"onUpdate:modelValue":a[4]||(a[4]=c=>e.unref(n).option.data.cdt4=c),type:e.unref(n).option.data.cdt},null,8,["modelValue","type"]),[[e.vShow,e.unref(n).option.data.cdt2&&b.find(c=>c===e.unref(n).option.data.cdt2)]])])]),_:1})]),_:1},8,["activeKey"]),e.createElementVNode("div",We,[e.createVNode(T,{status:"primary",onClick:C},{default:e.withCtx(()=>[Re]),_:1}),e.createVNode(T,{onClick:k},{default:e.withCtx(()=>[Ge]),_:1})])])}}}),et="",Je=((t,o)=>{const n=t.__vccOpts||t;for(const[s,u]of o)n[s]=u;return n})(Xe,[["__scopeId","data-v-4fc5c7cd"]]),Qe=e.defineComponent({props:{request:null,params:{default:()=>({})},columns:{default:()=>[{field:"opContent",title:"操作内容",cellType:"string",sortable:!0},{field:"reason",title:"操作理由",cellType:"string",sortable:!0},{field:"opUser",title:"操作人",cellType:"string",sortable:!0},{field:"opTime",title:"操作时间",cellType:"string",sortable:!0,width:180}]},title:{default:"操作记录"},visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:o}){const n=t,s=e.ref(!1),u=e.ref(!1),b=e.ref([]),h=async()=>{const V={...n.params};s.value=!0;const w=await n.request(V).finally(()=>{s.value=!1});b.value=w.data||[]},p=()=>{u.value=!0,h()};e.watch(()=>n.visible,()=>{n.visible&&p()});const y=()=>{u.value=!1,s.value=!1,b.value=[]},_=()=>{o("update:visible",!1),e.nextTick(()=>{y()})};return(V,w)=>{const S=e.resolveComponent("vxe-grid");return e.openBlock(),e.createBlock(e.unref(N.Modal),{footer:!1,title:t.title,open:t.visible,width:"800px",onCancel:_},{default:e.withCtx(()=>[e.createVNode(e.unref(N.Skeleton),{loading:s.value,paragraph:{rows:6},active:""},{default:e.withCtx(()=>[e.createVNode(S,{columns:t.columns,data:b.value,"auto-resize":"",height:"400"},null,8,["columns","data"])]),_:1},8,["loading"])]),_:1},8,["title","open"])}}});x.FilterExtend=Je,x.StatusPop=Qe,x.VxeContainer=$e,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .splitpanes{display:flex;width:100%;height:100%}.splitpanes--vertical{flex-direction:row}.splitpanes--horizontal{flex-direction:column}.splitpanes--dragging *{user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{transition:none}.splitpanes__splitter{touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}.vxe-container{background-color:#fff}.splitpanes.default-theme .splitpanes__pane{background:#fff}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:.5rem;border-top:unset;margin-top:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:.5rem;border:none;margin:0}.splitpanes.default-theme .splitpanes__splitter{box-sizing:border-box;position:relative;flex-shrink:0;background:#f0f2f5}.my-filter-excel[data-v-4fc5c7cd]{user-select:none;padding:10px 16px;min-width:230px}.my-filter-excel .my-fe-search[data-v-4fc5c7cd]{padding:0}.ant-tabs-top>.ant-tabs-nav[data-v-4fc5c7cd]{margin-bottom:6px}.ant-tabs-tab[data-v-4fc5c7cd]{padding:6px 0}.ant-tabs-tab+.ant-tabs-tab[data-v-4fc5c7cd]{margin-left:20px}.ant-tabs-tab-btn[data-v-4fc5c7cd]{font-size:14px}.my-filter-excel .my-fe-search .my-fe-search-top[data-v-4fc5c7cd]{position:relative;width:100%;padding-bottom:6px}.my-filter-excel .my-fe-search .my-fe-search-top>input[data-v-4fc5c7cd]{border:1px solid #ababab;height:22px;line-height:22px}.my-filter-excel .my-fe-search .my-fe-search-top>.my-fe-search-icon[data-v-4fc5c7cd]{position:absolute;right:5px;top:7px}.my-filter-excel .my-fe-search .my-fe-search-list[data-v-4fc5c7cd]{margin:0;border:1px solid #e2e4e7;height:200px;padding:6px;border-radius:4px}.my-filter-excel .my-fe-search .my-fe-search-list .scroll[data-v-4fc5c7cd]{overflow:auto;height:165px}.my-filter-excel .my-fe-search .my-fe-search-list .my-fe-search-item[data-v-4fc5c7cd]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:186px}.my-filter-excel .my-fe-search .my-fe-search-list .my-fe-search-item .my-fe-search-item-icon[data-v-4fc5c7cd]{width:16px}.my-filter-excel .my-fe-footer[data-v-4fc5c7cd]{text-align:right;padding-top:10px}.icon-color[data-v-4fc5c7cd]{color:#1e6fff}.container[data-v-4fc5c7cd]{border-radius:4px;border:1px solid #e2e4e7;height:234px;padding:10px}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@sirpho/components",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "dist/index.umd.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/components/index.d.ts",
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "build": "vue-tsc && vite build",
11
+ "prepublish": "pnpm run build",
12
+ "preview": "vite preview"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/sirpho/components.git"
17
+ },
18
+ "author": "sirpho",
19
+ "license": "MIT",
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "devDependencies": {
24
+ "@ant-design/icons-vue": ">=6.1.0",
25
+ "@types/lodash-es": "^4.17.6",
26
+ "@types/node": "^18.13.0",
27
+ "@types/splitpanes": "^2.2.1",
28
+ "@vitejs/plugin-vue": "^4.0.0",
29
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
30
+ "@vueuse/core": "^9.12.0",
31
+ "ant-design-vue": ">=3.2.0",
32
+ "await-to-js": "^3.0.0",
33
+ "less": "^4.5.1",
34
+ "lodash-es": "^4.17.21",
35
+ "rollup-plugin-external-globals": "^0.7.3",
36
+ "splitpanes": "^3.1.5",
37
+ "typescript": "^4.9.3",
38
+ "vite": "^4.1.0",
39
+ "vite-plugin-dts": "3.6.0",
40
+ "vue": "^3.2.28",
41
+ "vue-tsc": "^1.0.24",
42
+ "vue-types": "^5.0.2",
43
+ "vxe-table": "4.5.0"
44
+ },
45
+ "peerDependencies": {
46
+ "@ant-design/icons-vue": ">=6.1.0",
47
+ "@vueuse/core": ">=8.9.0",
48
+ "ant-design-vue": ">=3.2.0",
49
+ "await-to-js": ">=3.0.0",
50
+ "lodash-es": ">=4.17.0",
51
+ "vue": ">=3.2.25",
52
+ "vxe-table": "^4.3.0 || ^4.5.0 || ^4.6.0"
53
+ },
54
+ "volta": {
55
+ "node": "18.17.1",
56
+ "pnpm": "8.6.12"
57
+ },
58
+ "description": "sirpho components"
59
+ }