@ditari/bsui 1.0.7 → 1.0.8
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/cjs/components/components.cjs.js +1 -1
- package/dist/cjs/components/components.d.ts +2 -0
- package/dist/cjs/components/desensitize/Desensitize.cjs.js +1 -0
- package/dist/cjs/components/desensitize/Desensitize.d.ts +30 -0
- package/dist/cjs/components/desensitize/index.cjs.js +1 -0
- package/dist/cjs/components/desensitize/index.d.ts +30 -0
- package/dist/cjs/components/dic/DicReplace.cjs.js +1 -0
- package/dist/cjs/components/dic/DicReplace.d.ts +23 -0
- package/dist/cjs/components/dic/dic.worker.cjs.js +1 -0
- package/dist/cjs/components/dic/index.cjs.js +1 -0
- package/dist/cjs/components/dic/index.d.ts +23 -0
- package/dist/cjs/components/index.cjs.js +1 -1
- package/dist/cjs/components/menu/Menu.cjs.js +1 -1
- package/dist/cjs/components/select/Select.vue.cjs.js +1 -1
- package/dist/cjs/components/select/dic.worker.cjs.js +1 -0
- package/dist/cjs/components/table/Table.cjs.js +1 -0
- package/dist/cjs/components/table/Table.d.ts +71 -0
- package/dist/cjs/components/table/index.cjs.js +1 -1
- package/dist/cjs/components/table/index.d.ts +29 -102
- package/dist/cjs/components/table/interface/table.d.ts +33 -0
- package/dist/cjs/hooks/http/index.cjs.js +1 -1
- package/dist/cjs/hooks/http/index.d.ts +4 -7
- package/dist/cjs/utils/html.cjs.js +1 -0
- package/dist/cjs/utils/html.d.ts +1 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/css/desensitize/style/index.css +1 -0
- package/dist/css/grid/style/index.css +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/table/style/index.css +1 -0
- package/dist/esm/components/components.d.ts +2 -0
- package/dist/esm/components/components.esm.js +18 -14
- package/dist/esm/components/desensitize/Desensitize.d.ts +30 -0
- package/dist/esm/components/desensitize/Desensitize.esm.js +46 -0
- package/dist/esm/components/desensitize/index.d.ts +30 -0
- package/dist/esm/components/desensitize/index.esm.js +7 -0
- package/dist/esm/components/dic/DicReplace.d.ts +23 -0
- package/dist/esm/components/dic/DicReplace.esm.js +38 -0
- package/dist/esm/components/dic/dic.worker.esm.js +17 -0
- package/dist/esm/components/dic/index.d.ts +23 -0
- package/dist/esm/components/dic/index.esm.js +7 -0
- package/dist/esm/components/index.esm.js +22 -18
- package/dist/esm/components/menu/Menu.esm.js +8 -9
- package/dist/esm/components/select/Select.vue.esm.js +32 -28
- package/dist/esm/components/select/dic.worker.esm.js +12 -0
- package/dist/esm/components/select/index.d.ts +39 -58
- package/dist/esm/components/table/Table.d.ts +71 -0
- package/dist/esm/components/table/Table.esm.js +214 -0
- package/dist/esm/components/table/index.d.ts +29 -102
- package/dist/esm/components/table/index.esm.js +4 -5
- package/dist/esm/components/table/interface/table.d.ts +33 -0
- package/dist/esm/hooks/http/index.d.ts +4 -7
- package/dist/esm/hooks/http/index.esm.js +26 -25
- package/dist/esm/utils/html.d.ts +1 -0
- package/dist/esm/utils/html.esm.js +15 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/style/desensitize/style/index.scss +7 -0
- package/dist/style/grid/style/index.scss +15 -6
- package/dist/style/index.scss +2 -0
- package/dist/style/table/style/index.scss +10 -0
- package/dist/style/theme/variable.scss +1 -0
- package/package.json +1 -1
- package/src/components/components.ts +2 -0
- package/src/components/desensitize/Desensitize.tsx +69 -0
- package/src/components/desensitize/index.ts +5 -0
- package/src/components/desensitize/style/index.scss +7 -0
- package/src/components/dic/DicReplace.tsx +55 -0
- package/src/components/dic/dic.worker.ts +25 -0
- package/src/components/dic/index.ts +5 -0
- package/src/components/grid/style/index.scss +15 -6
- package/src/components/index.scss +2 -0
- package/src/components/menu/Menu.jsx +2 -3
- package/src/components/select/Select.vue +11 -5
- package/src/components/select/{dic-worker.ts → dic.worker.ts} +4 -3
- package/src/components/table/Table.tsx +343 -0
- package/src/components/table/{Table.vue → TableBak.vue} +39 -27
- package/src/components/table/index.ts +1 -2
- package/src/components/table/interface/table.ts +54 -0
- package/src/components/table/style/index.scss +10 -0
- package/src/components/theme/variable.scss +1 -0
- package/src/hooks/http/index.ts +12 -14
- package/src/utils/html.ts +17 -0
- package/src/utils/index.ts +1 -0
- package/dist/cjs/components/select/dic-worker.cjs.js +0 -1
- package/dist/cjs/components/table/Field.vue.cjs.js +0 -1
- package/dist/cjs/components/table/Field.vue.cjs2.js +0 -1
- package/dist/cjs/components/table/Field.vue.d.ts +0 -28
- package/dist/cjs/components/table/Table.vue.cjs.js +0 -1
- package/dist/cjs/components/table/Table.vue.cjs2.js +0 -1
- package/dist/cjs/components/table/Table.vue.cjs3.js +0 -1
- package/dist/cjs/components/table/Table.vue.d.ts +0 -142
- package/dist/esm/components/select/dic-worker.esm.js +0 -12
- package/dist/esm/components/table/Field.vue.d.ts +0 -28
- package/dist/esm/components/table/Field.vue.esm.js +0 -38
- package/dist/esm/components/table/Field.vue.esm2.js +0 -4
- package/dist/esm/components/table/Table.vue.d.ts +0 -142
- package/dist/esm/components/table/Table.vue.esm.js +0 -238
- package/dist/esm/components/table/Table.vue.esm2.js +0 -4
- package/dist/esm/components/table/Table.vue.esm3.js +0 -5
- package/dist/esm/style.css +0 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { defineComponent as q, ref as y, computed as S, watchEffect as $, nextTick as A, watch as F, createVNode as p, Fragment as J, withDirectives as Q, vShow as U } from "vue";
|
|
2
|
+
import { Table as I, Space as L, Pagination as V } from "ant-design-vue";
|
|
3
|
+
import { useEleHeight as k } from "../../utils/html.esm.js";
|
|
4
|
+
import { prefixName as W } from "../theme/index.esm.js";
|
|
5
|
+
const X = () => ({
|
|
6
|
+
data: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
height: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 300
|
|
13
|
+
},
|
|
14
|
+
keys: Array,
|
|
15
|
+
rowKey: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: !0,
|
|
18
|
+
default: "id"
|
|
19
|
+
},
|
|
20
|
+
loading: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
pagination: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({})
|
|
27
|
+
},
|
|
28
|
+
config: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: () => ({})
|
|
31
|
+
}
|
|
32
|
+
}), m = {
|
|
33
|
+
defaultPageSize: 20,
|
|
34
|
+
hideOnSinglePage: !1,
|
|
35
|
+
pageSizeOptions: ["10", "20", "30", "40"],
|
|
36
|
+
responsive: !0,
|
|
37
|
+
showQuickJumper: !0,
|
|
38
|
+
showLessItems: !0,
|
|
39
|
+
showTotal: (a) => `总共 ${a} 条`
|
|
40
|
+
}, N = `${W}-pagination`, Z = /* @__PURE__ */ q({
|
|
41
|
+
name: "DTable",
|
|
42
|
+
props: X(),
|
|
43
|
+
// emits: { "update:keys": (keys: []) => void }
|
|
44
|
+
// TODO 需要做调整
|
|
45
|
+
emits: {
|
|
46
|
+
"update:keys": (a) => null
|
|
47
|
+
},
|
|
48
|
+
setup(a, {
|
|
49
|
+
emit: v,
|
|
50
|
+
slots: w
|
|
51
|
+
}) {
|
|
52
|
+
console.log(w);
|
|
53
|
+
const e = y(a.keys), T = S(() => a.data), z = S(() => {
|
|
54
|
+
var t;
|
|
55
|
+
return ((t = a.config) == null ? void 0 : t.columns) ?? [];
|
|
56
|
+
}), d = S(() => {
|
|
57
|
+
var t;
|
|
58
|
+
return ((t = a.config) == null ? void 0 : t.pagination) ?? {};
|
|
59
|
+
}), {
|
|
60
|
+
tableRef: P,
|
|
61
|
+
tableHeight: R,
|
|
62
|
+
onPageChange: x,
|
|
63
|
+
onRowClassName: O
|
|
64
|
+
} = E();
|
|
65
|
+
function E() {
|
|
66
|
+
const {
|
|
67
|
+
rowClassName: t,
|
|
68
|
+
keepSelected: n,
|
|
69
|
+
selection: f,
|
|
70
|
+
onPageChange: r
|
|
71
|
+
} = a.config, i = y(null), l = y(), u = y(null), o = (s) => {
|
|
72
|
+
var C;
|
|
73
|
+
const g = (C = i == null ? void 0 : i.value) == null ? void 0 : C.$el, D = k(g.getElementsByClassName("ant-table-header")[0]);
|
|
74
|
+
let b = 0;
|
|
75
|
+
a.config.pagination && (b = k(document.getElementsByClassName(N)[0])), l.value = s - (D + b), g.getElementsByClassName("ant-table-body")[0].style.height = l.value - 10 + "px", u.value = g.getElementsByClassName("ant-table-body")[0];
|
|
76
|
+
};
|
|
77
|
+
return $(() => {
|
|
78
|
+
a.height !== 0 && A(() => {
|
|
79
|
+
o(a.height);
|
|
80
|
+
});
|
|
81
|
+
}), {
|
|
82
|
+
tableRef: i,
|
|
83
|
+
tableHeight: l,
|
|
84
|
+
onPageChange: (s, g) => {
|
|
85
|
+
r && r({
|
|
86
|
+
page: s,
|
|
87
|
+
size: g
|
|
88
|
+
}), u.value.scrollTop = 0, (f === "S" || !n) && (e.value = [], v("update:keys", e.value));
|
|
89
|
+
},
|
|
90
|
+
onRowClassName: (s, g) => t ? t(s, g) : void 0
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const B = H();
|
|
94
|
+
function H() {
|
|
95
|
+
const {
|
|
96
|
+
rowKey: t,
|
|
97
|
+
config: {
|
|
98
|
+
selection: n,
|
|
99
|
+
getCheckboxProps: f
|
|
100
|
+
}
|
|
101
|
+
} = a;
|
|
102
|
+
if (n === "N")
|
|
103
|
+
return;
|
|
104
|
+
const r = (l, u) => {
|
|
105
|
+
n === "S" ? (e.value = [], e.value = u ? [l[t]] : []) : e.value = u ? e.value.concat(l[t]) : e.value.filter((o) => o !== l[t]), v("update:keys", e.value);
|
|
106
|
+
}, i = (l, u, o) => {
|
|
107
|
+
const h = o.map((c) => c[t]);
|
|
108
|
+
e.value = l ? e.value.concat(h) : e.value.filter((c) => !h.includes(c)), v("update:keys", e.value);
|
|
109
|
+
};
|
|
110
|
+
return F(() => a.keys, (l) => {
|
|
111
|
+
e.value = l;
|
|
112
|
+
}), {
|
|
113
|
+
selectedRowKeys: e,
|
|
114
|
+
onSelect: r,
|
|
115
|
+
onSelectAll: i,
|
|
116
|
+
fixed: !0,
|
|
117
|
+
columnTitle: n === "S" ? "选择" : null,
|
|
118
|
+
columnWidth: n === "S" ? 60 : 40,
|
|
119
|
+
getCheckboxProps: f
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const K = j();
|
|
123
|
+
function j() {
|
|
124
|
+
return (t) => {
|
|
125
|
+
let n;
|
|
126
|
+
const {
|
|
127
|
+
rowKey: f,
|
|
128
|
+
config: {
|
|
129
|
+
click: r,
|
|
130
|
+
dbClick: i,
|
|
131
|
+
selection: l,
|
|
132
|
+
getCheckboxProps: u
|
|
133
|
+
}
|
|
134
|
+
} = a, o = t[f], h = () => {
|
|
135
|
+
if (l === "N")
|
|
136
|
+
return;
|
|
137
|
+
e.value.some((s) => s === o) ? e.value = e.value.filter((s) => s !== o) : (l === "S" && (e.value = []), e.value.push(o)), v("update:keys", e.value);
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
onClick: () => {
|
|
141
|
+
if (!r)
|
|
142
|
+
return;
|
|
143
|
+
const c = u ? u(t) : null;
|
|
144
|
+
c && c.value === o || (clearTimeout(n), n = setTimeout(() => {
|
|
145
|
+
h(), r(t);
|
|
146
|
+
}, 200));
|
|
147
|
+
},
|
|
148
|
+
// 点击行
|
|
149
|
+
onDblclick: () => {
|
|
150
|
+
i && (clearTimeout(n), i(t));
|
|
151
|
+
}
|
|
152
|
+
// onContextmenu: (event) => {
|
|
153
|
+
// //TODO
|
|
154
|
+
// },
|
|
155
|
+
// onMouseenter: (event) => {
|
|
156
|
+
// //TODO
|
|
157
|
+
// }, // 鼠标移入行
|
|
158
|
+
// onMouseleave: (event) => {
|
|
159
|
+
// //TODO
|
|
160
|
+
// }
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return () => {
|
|
165
|
+
var t;
|
|
166
|
+
return p(J, null, [p(I, {
|
|
167
|
+
ref: P,
|
|
168
|
+
"row-key": a.rowKey,
|
|
169
|
+
bordered: a.config.bordered,
|
|
170
|
+
columns: z.value,
|
|
171
|
+
dataSource: T.value,
|
|
172
|
+
loading: a.loading,
|
|
173
|
+
size: ((t = a.config) == null ? void 0 : t.size) ?? "small",
|
|
174
|
+
scroll: {
|
|
175
|
+
scrollToFirstRowOnChange: !0,
|
|
176
|
+
x: "100%",
|
|
177
|
+
y: R.value + "px"
|
|
178
|
+
},
|
|
179
|
+
pagination: !1,
|
|
180
|
+
customRow: K,
|
|
181
|
+
rowSelection: B,
|
|
182
|
+
rowClassName: O
|
|
183
|
+
}, {
|
|
184
|
+
bodyCell: ({
|
|
185
|
+
column: n
|
|
186
|
+
}) => {
|
|
187
|
+
if (n.slot === "action")
|
|
188
|
+
return p(L, null, {
|
|
189
|
+
default: () => [w.action && w.action()]
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}), Q(p(V, {
|
|
193
|
+
class: [N],
|
|
194
|
+
current: d.value.current,
|
|
195
|
+
"onUpdate:current": (n) => d.value.current = n,
|
|
196
|
+
pageSize: d.value.pageSize,
|
|
197
|
+
"onUpdate:pageSize": (n) => d.value.pageSize = n,
|
|
198
|
+
disabled: a.loading,
|
|
199
|
+
"show-size-changer": !0,
|
|
200
|
+
size: "default",
|
|
201
|
+
"hide-on-single-page": m.hideOnSinglePage,
|
|
202
|
+
"show-quick-jumper": m.showQuickJumper,
|
|
203
|
+
"default-page-size": m.defaultPageSize,
|
|
204
|
+
"page-size-options": m.pageSizeOptions,
|
|
205
|
+
"show-total": m.showTotal,
|
|
206
|
+
total: d.value.total,
|
|
207
|
+
onChange: x
|
|
208
|
+
}, null), [[U, d.value]])]);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
export {
|
|
213
|
+
Z as default
|
|
214
|
+
};
|
|
@@ -1,139 +1,66 @@
|
|
|
1
1
|
export declare const DTable: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
-
bordered: {
|
|
3
|
-
type: import("vue").PropType<boolean | undefined>;
|
|
4
|
-
required: false;
|
|
5
|
-
default: boolean;
|
|
6
|
-
};
|
|
7
|
-
keys: {
|
|
8
|
-
type: import("vue").PropType<import("vue").Ref<(string | number)[]> | undefined>;
|
|
9
|
-
required: false;
|
|
10
|
-
default: undefined;
|
|
11
|
-
};
|
|
12
|
-
size: {
|
|
13
|
-
type: import("vue").PropType<string | undefined>;
|
|
14
|
-
required: false;
|
|
15
|
-
default: string;
|
|
16
|
-
};
|
|
17
|
-
columns: {
|
|
18
|
-
type: import("vue").PropType<any>;
|
|
19
|
-
required: true;
|
|
20
|
-
default: never[];
|
|
21
|
-
};
|
|
22
2
|
data: {
|
|
23
3
|
type: import("vue").PropType<any>;
|
|
24
|
-
required:
|
|
25
|
-
|
|
4
|
+
required: boolean;
|
|
5
|
+
};
|
|
6
|
+
height: {
|
|
7
|
+
type: import("vue").PropType<number>;
|
|
8
|
+
default: number;
|
|
26
9
|
};
|
|
10
|
+
keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
|
|
27
11
|
rowKey: {
|
|
28
|
-
type: import("vue").PropType<string
|
|
29
|
-
required:
|
|
12
|
+
type: import("vue").PropType<string>;
|
|
13
|
+
required: boolean;
|
|
30
14
|
default: string;
|
|
31
15
|
};
|
|
32
16
|
loading: {
|
|
33
17
|
type: import("vue").PropType<false | undefined>;
|
|
34
|
-
required: false;
|
|
35
18
|
default: boolean;
|
|
36
19
|
};
|
|
37
|
-
height: {
|
|
38
|
-
type: import("vue").PropType<number>;
|
|
39
|
-
required: true;
|
|
40
|
-
default: number;
|
|
41
|
-
};
|
|
42
20
|
pagination: {
|
|
43
21
|
type: import("vue").PropType<any>;
|
|
44
|
-
|
|
45
|
-
default: boolean;
|
|
46
|
-
};
|
|
47
|
-
selection: {
|
|
48
|
-
type: import("vue").PropType<"M" | "N" | "S" | undefined>;
|
|
49
|
-
required: false;
|
|
50
|
-
default: string;
|
|
22
|
+
default: () => {};
|
|
51
23
|
};
|
|
52
24
|
config: {
|
|
53
|
-
type: import("vue").PropType<
|
|
54
|
-
|
|
55
|
-
default: {};
|
|
56
|
-
};
|
|
57
|
-
keepSelected: {
|
|
58
|
-
type: import("vue").PropType<boolean | undefined>;
|
|
59
|
-
required: false;
|
|
60
|
-
default: boolean;
|
|
61
|
-
};
|
|
62
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:keys"[], "update:keys", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
|
-
bordered: {
|
|
64
|
-
type: import("vue").PropType<boolean | undefined>;
|
|
65
|
-
required: false;
|
|
66
|
-
default: boolean;
|
|
67
|
-
};
|
|
68
|
-
keys: {
|
|
69
|
-
type: import("vue").PropType<import("vue").Ref<(string | number)[]> | undefined>;
|
|
70
|
-
required: false;
|
|
71
|
-
default: undefined;
|
|
72
|
-
};
|
|
73
|
-
size: {
|
|
74
|
-
type: import("vue").PropType<string | undefined>;
|
|
75
|
-
required: false;
|
|
76
|
-
default: string;
|
|
77
|
-
};
|
|
78
|
-
columns: {
|
|
79
|
-
type: import("vue").PropType<any>;
|
|
80
|
-
required: true;
|
|
81
|
-
default: never[];
|
|
25
|
+
type: import("vue").PropType<import("./interface/table").Config>;
|
|
26
|
+
default: () => {};
|
|
82
27
|
};
|
|
28
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
"update:keys": (keys: []) => null;
|
|
30
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
31
|
data: {
|
|
84
32
|
type: import("vue").PropType<any>;
|
|
85
|
-
required:
|
|
86
|
-
default: never[];
|
|
33
|
+
required: boolean;
|
|
87
34
|
};
|
|
35
|
+
height: {
|
|
36
|
+
type: import("vue").PropType<number>;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
|
|
88
40
|
rowKey: {
|
|
89
|
-
type: import("vue").PropType<string
|
|
90
|
-
required:
|
|
41
|
+
type: import("vue").PropType<string>;
|
|
42
|
+
required: boolean;
|
|
91
43
|
default: string;
|
|
92
44
|
};
|
|
93
45
|
loading: {
|
|
94
46
|
type: import("vue").PropType<false | undefined>;
|
|
95
|
-
required: false;
|
|
96
47
|
default: boolean;
|
|
97
48
|
};
|
|
98
|
-
height: {
|
|
99
|
-
type: import("vue").PropType<number>;
|
|
100
|
-
required: true;
|
|
101
|
-
default: number;
|
|
102
|
-
};
|
|
103
49
|
pagination: {
|
|
104
50
|
type: import("vue").PropType<any>;
|
|
105
|
-
|
|
106
|
-
default: boolean;
|
|
107
|
-
};
|
|
108
|
-
selection: {
|
|
109
|
-
type: import("vue").PropType<"M" | "N" | "S" | undefined>;
|
|
110
|
-
required: false;
|
|
111
|
-
default: string;
|
|
51
|
+
default: () => {};
|
|
112
52
|
};
|
|
113
53
|
config: {
|
|
114
|
-
type: import("vue").PropType<
|
|
115
|
-
|
|
116
|
-
default: {};
|
|
117
|
-
};
|
|
118
|
-
keepSelected: {
|
|
119
|
-
type: import("vue").PropType<boolean | undefined>;
|
|
120
|
-
required: false;
|
|
121
|
-
default: boolean;
|
|
54
|
+
type: import("vue").PropType<import("./interface/table").Config>;
|
|
55
|
+
default: () => {};
|
|
122
56
|
};
|
|
123
57
|
}>> & {
|
|
124
|
-
"onUpdate:keys"?: ((
|
|
58
|
+
"onUpdate:keys"?: ((keys: []) => any) | undefined;
|
|
125
59
|
}, {
|
|
126
|
-
keys: import("vue").Ref<(string | number)[]> | undefined;
|
|
127
|
-
data: any;
|
|
128
|
-
loading: false | undefined;
|
|
129
|
-
config: any;
|
|
130
|
-
size: string | undefined;
|
|
131
|
-
bordered: boolean | undefined;
|
|
132
|
-
columns: any;
|
|
133
|
-
rowKey: string | undefined;
|
|
134
60
|
height: number;
|
|
61
|
+
loading: false | undefined;
|
|
62
|
+
rowKey: string;
|
|
135
63
|
pagination: any;
|
|
136
|
-
|
|
137
|
-
keepSelected: boolean | undefined;
|
|
64
|
+
config: import("./interface/table").Config;
|
|
138
65
|
}>>;
|
|
139
66
|
export default DTable;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import t from "../../utils/install.esm.js";
|
|
2
|
-
import o from "./Table.
|
|
3
|
-
|
|
4
|
-
const i = t(o);
|
|
2
|
+
import o from "./Table.esm.js";
|
|
3
|
+
const r = t(o);
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
r as DTable,
|
|
6
|
+
r as default
|
|
8
7
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Key = string | number;
|
|
2
|
+
export type SelectionType = "N" | "S" | "M";
|
|
3
|
+
export type SizeType = "small" | "middle" | "middle";
|
|
4
|
+
export interface Config {
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
columns: any;
|
|
7
|
+
size?: SizeType;
|
|
8
|
+
selection?: SelectionType;
|
|
9
|
+
keepSelected?: boolean;
|
|
10
|
+
pagination?: Pagination;
|
|
11
|
+
onPageChange?: (paging: {
|
|
12
|
+
page: number;
|
|
13
|
+
size: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
rowClassName?: (record: any, index: number) => any;
|
|
16
|
+
click?: (record: unknown) => void;
|
|
17
|
+
dbClick?: (record: any) => void;
|
|
18
|
+
getCheckboxProps: (record: any) => any;
|
|
19
|
+
}
|
|
20
|
+
export interface Pagination {
|
|
21
|
+
total: number;
|
|
22
|
+
current: number;
|
|
23
|
+
pageSize: number;
|
|
24
|
+
}
|
|
25
|
+
export interface TableProps {
|
|
26
|
+
keys?: Key[];
|
|
27
|
+
data: any;
|
|
28
|
+
rowKey: string;
|
|
29
|
+
loading?: false;
|
|
30
|
+
height: number;
|
|
31
|
+
pagination?: any;
|
|
32
|
+
config: Config;
|
|
33
|
+
}
|
|
@@ -8,12 +8,8 @@ interface Options {
|
|
|
8
8
|
params?: Ref;
|
|
9
9
|
pagination?: Pagination;
|
|
10
10
|
dataKey?: string;
|
|
11
|
+
onSuccess?: any;
|
|
11
12
|
}
|
|
12
|
-
/**
|
|
13
|
-
* 请求分页数据列表
|
|
14
|
-
* @param service 请求后台服务的接口
|
|
15
|
-
* @param options 配置
|
|
16
|
-
*/
|
|
17
13
|
declare const useRequestList: (service: any, options?: Options) => {
|
|
18
14
|
data: import("vue").ComputedRef<any>;
|
|
19
15
|
pagination: import("vue").ComputedRef<{
|
|
@@ -23,7 +19,8 @@ declare const useRequestList: (service: any, options?: Options) => {
|
|
|
23
19
|
}>;
|
|
24
20
|
loading: Ref<boolean>;
|
|
25
21
|
run: (...arg: any) => void;
|
|
26
|
-
|
|
22
|
+
onPageChange: (paging: any) => void;
|
|
27
23
|
onQuery: (p: any) => void;
|
|
28
24
|
};
|
|
29
|
-
|
|
25
|
+
declare const useDoneXIRequest: () => void;
|
|
26
|
+
export { useRequestList, useDoneXIRequest };
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { ref as y, computed as
|
|
1
|
+
import { ref as y, computed as r } from "vue";
|
|
2
2
|
import { usePagination as K } from "vue-request";
|
|
3
|
-
import { get as
|
|
4
|
-
const Q = (
|
|
5
|
-
|
|
3
|
+
import { get as S } from "../../utils/get.esm.js";
|
|
4
|
+
const Q = (i, e = {}) => {
|
|
5
|
+
e.pagination || (e.pagination = {
|
|
6
6
|
currentKey: "page",
|
|
7
7
|
pageSizeKey: "limit",
|
|
8
8
|
totalKey: "data.total"
|
|
9
9
|
});
|
|
10
10
|
const {
|
|
11
|
-
dataKey:
|
|
12
|
-
pagination: { currentKey:
|
|
13
|
-
} =
|
|
11
|
+
dataKey: l,
|
|
12
|
+
pagination: { currentKey: u, pageSizeKey: c }
|
|
13
|
+
} = e, t = e.params || y({}), {
|
|
14
14
|
total: g,
|
|
15
|
-
pageSize:
|
|
15
|
+
pageSize: s,
|
|
16
16
|
current: p,
|
|
17
|
-
loading:
|
|
18
|
-
data:
|
|
17
|
+
loading: v,
|
|
18
|
+
data: d,
|
|
19
19
|
run: n
|
|
20
|
-
} = K(
|
|
20
|
+
} = K(i, {
|
|
21
21
|
manual: !0,
|
|
22
|
-
pagination:
|
|
22
|
+
pagination: e.pagination,
|
|
23
23
|
loadingDelay: 400,
|
|
24
24
|
loadingKeep: 100,
|
|
25
|
-
onSuccess: () => {
|
|
25
|
+
onSuccess: (a, o) => {
|
|
26
|
+
e.onSuccess && e.onSuccess(a, o);
|
|
26
27
|
},
|
|
27
|
-
onError: (
|
|
28
|
-
console.log(
|
|
28
|
+
onError: (a, o) => {
|
|
29
|
+
console.log(o, a);
|
|
29
30
|
}
|
|
30
|
-
}),
|
|
31
|
+
}), m = r(() => ({
|
|
31
32
|
total: g.value,
|
|
32
33
|
current: p.value,
|
|
33
|
-
pageSize:
|
|
34
|
+
pageSize: s.value
|
|
34
35
|
}));
|
|
35
36
|
return {
|
|
36
|
-
data:
|
|
37
|
-
() =>
|
|
37
|
+
data: r(
|
|
38
|
+
() => S(d.value, l || "data", [])
|
|
38
39
|
),
|
|
39
|
-
pagination:
|
|
40
|
-
loading:
|
|
40
|
+
pagination: m,
|
|
41
|
+
loading: v,
|
|
41
42
|
run: n,
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
onPageChange: (a) => {
|
|
44
|
+
t.value[u] = a.page, t.value[c] = a.size, n(t.value || {});
|
|
44
45
|
},
|
|
45
|
-
onQuery: (
|
|
46
|
-
|
|
46
|
+
onQuery: (a) => {
|
|
47
|
+
t.value = { ...t.value, ...a }, t.value[u] = 1, n(t.value || {});
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useEleHeight: (node: Element) => number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const p = (e) => {
|
|
2
|
+
const o = [
|
|
3
|
+
"margin-top",
|
|
4
|
+
"margin-bottom",
|
|
5
|
+
"border-top",
|
|
6
|
+
"border-bottom",
|
|
7
|
+
"padding-top",
|
|
8
|
+
"padding-bottom",
|
|
9
|
+
"height"
|
|
10
|
+
], r = getComputedStyle(e);
|
|
11
|
+
return o.map((t) => parseInt(r.getPropertyValue(t), 10)).reduce((t, n) => t + n);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
p as useEleHeight
|
|
15
|
+
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
@import "../../theme/variable.scss";
|
|
2
2
|
|
|
3
|
+
/*输入框获取焦点时候的影响边框*/
|
|
4
|
+
@mixin input-focus {
|
|
5
|
+
&:focus {
|
|
6
|
+
box-shadow: 0 0 0 $grid-input-border-width $grid-input-focus-border-color;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
3
9
|
.#{$prefix-name}-grid {
|
|
4
10
|
position: relative;
|
|
5
11
|
display: grid;
|
|
@@ -20,13 +26,16 @@
|
|
|
20
26
|
border-right: $gird-border-width solid $grid-border-color;
|
|
21
27
|
}
|
|
22
28
|
.ant-input,
|
|
23
|
-
.ant-select-selector
|
|
29
|
+
.ant-select-selector,
|
|
30
|
+
.ant-input-number {
|
|
24
31
|
border: 0;
|
|
25
32
|
border-radius: 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
@include input-focus;
|
|
34
|
+
// 数字输入框要单独处理
|
|
35
|
+
.ant-input-number-input {
|
|
36
|
+
border: 0;
|
|
37
|
+
border-radius: 0;
|
|
38
|
+
@include input-focus;
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
.ant-input[disabled] {
|
|
@@ -40,7 +49,7 @@
|
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
.ant-form-item-explain {
|
|
43
|
-
display:
|
|
52
|
+
display: $gird-error-display;
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
.ant-select-focused:not(.ant-select-disabled).ant-select:not(
|
package/dist/style/index.scss
CHANGED
package/package.json
CHANGED
|
@@ -3,3 +3,5 @@ export * from "./layout";
|
|
|
3
3
|
export { default as DTable } from "./table";
|
|
4
4
|
export { DGrid, DGridItem } from "./grid";
|
|
5
5
|
export { default as DSelect } from "./select";
|
|
6
|
+
export { default as DDesensitize } from "./desensitize";
|
|
7
|
+
export { default as DicReplace } from "./dic";
|