@hengdian-tech/components-vue2 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/dist/index.cjs.js +4 -0
- package/dist/index.es.js +1359 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/src/_adapter/index.d.ts +115 -0
- package/dist/types/src/components/base-button/props.d.ts +31 -0
- package/dist/types/src/components/base-button-group/props.d.ts +26 -0
- package/dist/types/src/components/base-card/props.d.ts +24 -0
- package/dist/types/src/components/base-container/props.d.ts +26 -0
- package/dist/types/src/components/base-descriptions/props.d.ts +35 -0
- package/dist/types/src/components/base-dialog/props.d.ts +47 -0
- package/dist/types/src/components/base-divider/props.d.ts +18 -0
- package/dist/types/src/components/base-menu/props.d.ts +14 -0
- package/dist/types/src/components/base-pagination/props.d.ts +28 -0
- package/dist/types/src/components/base-search-bar/props.d.ts +43 -0
- package/dist/types/src/components/base-table/props.d.ts +57 -0
- package/dist/types/src/components/base-tabs/props.d.ts +30 -0
- package/dist/types/src/components/base-tag/props.d.ts +29 -0
- package/dist/types/src/components/base-title/props.d.ts +19 -0
- package/dist/types/src/components/saber-avue-form/index.d.ts +47 -0
- package/dist/types/src/components/saber-avue-form/props.d.ts +14 -0
- package/dist/types/src/components/saber-form-tip/props.d.ts +16 -0
- package/dist/types/src/index.d.ts +63 -0
- package/package.json +60 -0
- package/types/shims-vue.d.ts +14 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,1359 @@
|
|
|
1
|
+
import W from "@vue/composition-api";
|
|
2
|
+
import { Dialog as I, Button as V, DropdownItem as E, Dropdown as D, Tooltip as F, Table as j, TableColumn as H, Tabs as L, TabPane as U, Menu as Y, Pagination as G, Form as q, FormItem as J, Input as Q, Select as K, Option as X, DatePicker as Z } from "element-ui";
|
|
3
|
+
const ee = {
|
|
4
|
+
name: "BaseCard",
|
|
5
|
+
props: {
|
|
6
|
+
header: { type: String, default: "" },
|
|
7
|
+
padding: { type: String, default: "16px" },
|
|
8
|
+
shadow: { type: String, default: "sm" },
|
|
9
|
+
border: { type: Boolean, default: !0 },
|
|
10
|
+
headerPadding: { type: String, default: "16px" },
|
|
11
|
+
showTitleBar: { type: Boolean, default: !0 },
|
|
12
|
+
showRadius: { type: Boolean, default: !0 },
|
|
13
|
+
headerBg: { type: String, default: "linear-gradient(90deg, rgba(49, 119, 236, 0.06) 0%, rgba(49, 119, 236, 0.01) 100%), #FFF" },
|
|
14
|
+
titleLevel: { type: String, default: "primary" }
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
cardCustomStyle() {
|
|
18
|
+
if (this.shadow === "never" || this.shadow === "hover")
|
|
19
|
+
return {};
|
|
20
|
+
const s = {
|
|
21
|
+
sm: "var(--shadow-sm)",
|
|
22
|
+
md: "var(--shadow-md)",
|
|
23
|
+
lg: "var(--shadow-lg)"
|
|
24
|
+
};
|
|
25
|
+
let e;
|
|
26
|
+
return this.shadow in s ? e = s[this.shadow] : this.shadow === "always" && (e = "var(--shadow-sm)"), { boxShadow: e };
|
|
27
|
+
},
|
|
28
|
+
bodyStyle() {
|
|
29
|
+
return { padding: this.padding };
|
|
30
|
+
},
|
|
31
|
+
headerStyle() {
|
|
32
|
+
const s = { padding: this.headerPadding };
|
|
33
|
+
return this.headerBg && (s.background = this.headerBg), s;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var te = function() {
|
|
38
|
+
var e = this, t = e._self._c;
|
|
39
|
+
return t("div", { class: [
|
|
40
|
+
"base-card",
|
|
41
|
+
`is-shadow-${e.shadow}`,
|
|
42
|
+
{ "is-borderless": !e.border, "is-no-radius": !e.showRadius }
|
|
43
|
+
], style: e.cardCustomStyle }, [e.$slots.header || e.header || e.$slots.extra ? t("div", { staticClass: "base-card__header", style: e.headerStyle }, [t("div", { staticClass: "base-card__header-left" }, [e.$slots.header ? [e._t("header")] : e.header ? [e.showTitleBar ? t("i", { staticClass: "base-card__title-bar", class: `base-card__title-bar--${e.titleLevel}` }) : e._e(), t("span", { staticClass: "base-card__title" }, [e._v(e._s(e.header))])] : e._e()], 2), e.$slots.extra ? t("div", { staticClass: "base-card__extra" }, [e._t("extra")], 2) : e._e()]) : e._e(), t("div", { staticClass: "base-card__body", style: e.bodyStyle }, [e._t("default")], 2)]);
|
|
44
|
+
}, se = [];
|
|
45
|
+
function m(s, e, t, a, n, l, u, i) {
|
|
46
|
+
var o = typeof s == "function" ? s.options : s;
|
|
47
|
+
e && (o.render = e, o.staticRenderFns = t, o._compiled = !0), a && (o.functional = !0), l && (o._scopeId = "data-v-" + l);
|
|
48
|
+
var h;
|
|
49
|
+
if (u ? (h = function(c) {
|
|
50
|
+
c = c || // cached call
|
|
51
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
52
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !c && typeof __VUE_SSR_CONTEXT__ != "undefined" && (c = __VUE_SSR_CONTEXT__), n && n.call(this, c), c && c._registeredComponents && c._registeredComponents.add(u);
|
|
53
|
+
}, o._ssrRegister = h) : n && (h = i ? function() {
|
|
54
|
+
n.call(
|
|
55
|
+
this,
|
|
56
|
+
(o.functional ? this.parent : this).$root.$options.shadowRoot
|
|
57
|
+
);
|
|
58
|
+
} : n), h)
|
|
59
|
+
if (o.functional) {
|
|
60
|
+
o._injectStyles = h;
|
|
61
|
+
var g = o.render;
|
|
62
|
+
o.render = function(B, b) {
|
|
63
|
+
return h.call(b), g(B, b);
|
|
64
|
+
};
|
|
65
|
+
} else {
|
|
66
|
+
var y = o.beforeCreate;
|
|
67
|
+
o.beforeCreate = y ? [].concat(y, h) : [h];
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
exports: s,
|
|
71
|
+
options: o
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
var ae = /* @__PURE__ */ m(
|
|
75
|
+
ee,
|
|
76
|
+
te,
|
|
77
|
+
se,
|
|
78
|
+
!1,
|
|
79
|
+
null,
|
|
80
|
+
"29c33e50",
|
|
81
|
+
null,
|
|
82
|
+
null
|
|
83
|
+
);
|
|
84
|
+
const ne = ae.exports, le = {
|
|
85
|
+
name: "BaseContainer",
|
|
86
|
+
props: {
|
|
87
|
+
showHeader: { type: Boolean, default: !1 },
|
|
88
|
+
showSearch: { type: Boolean, default: !1 },
|
|
89
|
+
showSideNav: { type: Boolean, default: !1 },
|
|
90
|
+
layoutMode: { type: String, default: "vertical" },
|
|
91
|
+
headerHeight: { type: String, default: "40px" },
|
|
92
|
+
searchMinHeight: { type: String, default: "64px" },
|
|
93
|
+
sideNavWidth: { type: [Number, String], default: 4 },
|
|
94
|
+
gap: { type: String, default: "8px" },
|
|
95
|
+
padding: { type: String, default: "8px" },
|
|
96
|
+
debug: { type: Boolean, default: !1 }
|
|
97
|
+
},
|
|
98
|
+
computed: {
|
|
99
|
+
sideNavActualWidth() {
|
|
100
|
+
return typeof this.sideNavWidth == "number" ? `calc(${this.sideNavWidth} / 24 * (100% - ${this.gap}))` : this.sideNavWidth;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var oe = function() {
|
|
105
|
+
var e = this, t = e._self._c;
|
|
106
|
+
return e.layoutMode === "vertical" ? t("div", { staticClass: "base-container base-container--vertical", class: { debug: e.debug }, style: { padding: e.padding, gap: e.gap } }, [e.showHeader ? t("div", { staticClass: "base-container__header", style: { height: e.headerHeight } }, [e._t("header")], 2) : e._e(), e.showSearch ? t("div", { staticClass: "base-container__search", style: { minHeight: e.searchMinHeight } }, [e._t("search")], 2) : e._e(), t("div", { staticClass: "base-container__main base-container__main--scroll" }, [e._t("default")], 2)]) : e.layoutMode === "top-split" ? t("div", { staticClass: "base-container base-container--top-split", class: { debug: e.debug }, style: { padding: e.padding, gap: e.gap } }, [e.showHeader ? t("div", { staticClass: "base-container__header", style: { height: e.headerHeight } }, [e._t("header")], 2) : e._e(), e.showSearch ? t("div", { staticClass: "base-container__search", style: { minHeight: e.searchMinHeight } }, [e._t("search")], 2) : e._e(), t("div", { staticClass: "base-container__split", style: { gap: e.gap } }, [e.showSideNav ? t("div", { staticClass: "base-container__side-nav", style: { width: e.sideNavActualWidth } }, [e._t("sideNav")], 2) : e._e(), t("div", { staticClass: "base-container__main base-container__main--scroll" }, [e._t("default")], 2)])]) : t("div", { staticClass: "base-container base-container--full-split", class: { debug: e.debug } }, [e.showSideNav ? t("div", { staticClass: "base-container__side-nav", style: { width: e.sideNavActualWidth } }, [e._t("sideNav")], 2) : e._e(), t("div", { staticClass: "base-container__right", style: { padding: e.padding, gap: e.gap } }, [e.showHeader ? t("div", { staticClass: "base-container__header", style: { height: e.headerHeight } }, [e._t("header")], 2) : e._e(), e.showSearch ? t("div", { staticClass: "base-container__search", style: { minHeight: e.searchMinHeight } }, [e._t("search")], 2) : e._e(), t("div", { staticClass: "base-container__main base-container__main--scroll" }, [e._t("default")], 2)])]);
|
|
107
|
+
}, re = [];
|
|
108
|
+
var ie = /* @__PURE__ */ m(
|
|
109
|
+
le,
|
|
110
|
+
oe,
|
|
111
|
+
re,
|
|
112
|
+
!1,
|
|
113
|
+
null,
|
|
114
|
+
"372b29ff",
|
|
115
|
+
null,
|
|
116
|
+
null
|
|
117
|
+
);
|
|
118
|
+
const de = ie.exports, ce = {
|
|
119
|
+
name: "BaseDivider",
|
|
120
|
+
props: {
|
|
121
|
+
direction: { type: String, default: "horizontal" },
|
|
122
|
+
contentPosition: { type: String, default: "center" },
|
|
123
|
+
content: { type: String, default: "" },
|
|
124
|
+
margin: { type: String, default: "24px 0" },
|
|
125
|
+
borderColor: { type: String, default: "" }
|
|
126
|
+
// 注意:不可声明 class prop —— Vue 2 保留属性,声明会触发
|
|
127
|
+
// [Vue warn] "class" is a reserved attribute(B2 冒烟运行时错误)。消费方 class 自动合并到根元素。
|
|
128
|
+
},
|
|
129
|
+
computed: {
|
|
130
|
+
dividerStyle() {
|
|
131
|
+
return {
|
|
132
|
+
margin: this.direction === "horizontal" ? this.margin : "0",
|
|
133
|
+
borderColor: this.borderColor || void 0
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
// 共享模板统一判空:content 有值或默认插槽有实际内容(空插槽不渲染)
|
|
137
|
+
hasSlotText() {
|
|
138
|
+
return !!(this.content || this.$slots.default && this.$slots.default.length);
|
|
139
|
+
},
|
|
140
|
+
// 默认插槽有实际内容时渲染插槽,否则渲染 content(fallback 双分支)
|
|
141
|
+
hasSlotContent() {
|
|
142
|
+
const s = this.$slots.default, e = this.$scopedSlots.default;
|
|
143
|
+
return !!(s && s.length || e && e({}).length);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
var ue = function() {
|
|
148
|
+
var e = this, t = e._self._c;
|
|
149
|
+
return t("div", { staticClass: "base-divider", class: [
|
|
150
|
+
`base-divider--${e.direction}`,
|
|
151
|
+
`base-divider--${e.contentPosition}`,
|
|
152
|
+
{ "base-divider--with-text": e.$slots.default || e.content }
|
|
153
|
+
], style: e.dividerStyle }, [e.hasSlotText ? t("span", { staticClass: "base-divider__text" }, [e.hasSlotContent ? [e._t("default")] : [e._v(e._s(e.content))]], 2) : e._e()]);
|
|
154
|
+
}, pe = [];
|
|
155
|
+
var fe = /* @__PURE__ */ m(
|
|
156
|
+
ce,
|
|
157
|
+
ue,
|
|
158
|
+
pe,
|
|
159
|
+
!1,
|
|
160
|
+
null,
|
|
161
|
+
"762bd7d0",
|
|
162
|
+
null,
|
|
163
|
+
null
|
|
164
|
+
);
|
|
165
|
+
const he = fe.exports, _e = {
|
|
166
|
+
name: "SDialog",
|
|
167
|
+
props: {
|
|
168
|
+
modelValue: { type: Boolean, default: !1 },
|
|
169
|
+
title: { type: String, default: "" },
|
|
170
|
+
width: { type: [String, Number], default: "" },
|
|
171
|
+
showClose: { type: Boolean, default: !1 },
|
|
172
|
+
closeOnClickModal: { type: Boolean, default: !0 },
|
|
173
|
+
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
174
|
+
destroyOnClose: { type: Boolean, default: !1 },
|
|
175
|
+
// alignCenter 仅作吸收:element-ui 无此 prop(其 center 只是文字居中),
|
|
176
|
+
// v2 的垂直水平居中由 style.scss 根容器 flex 完成,不转发给 el-dialog
|
|
177
|
+
alignCenter: { type: Boolean, default: !1 },
|
|
178
|
+
top: { type: [String, Number], default: "" }
|
|
179
|
+
},
|
|
180
|
+
emits: [
|
|
181
|
+
"update:modelValue",
|
|
182
|
+
"update:model-value",
|
|
183
|
+
"update:visible",
|
|
184
|
+
"update:value",
|
|
185
|
+
"input",
|
|
186
|
+
"open",
|
|
187
|
+
"opened",
|
|
188
|
+
"close",
|
|
189
|
+
"closed"
|
|
190
|
+
],
|
|
191
|
+
render(s) {
|
|
192
|
+
const e = this.$props, t = this.$attrs, a = this.$scopedSlots, n = this.$slots, l = e.modelValue === !0 || t.visible === !0 || t.value === !0, u = (c) => {
|
|
193
|
+
this.$emit("update:modelValue", c), this.$emit("update:model-value", c), this.$emit("update:visible", c), this.$emit("update:value", c), this.$emit("input", c);
|
|
194
|
+
}, i = (c) => {
|
|
195
|
+
const B = a[c];
|
|
196
|
+
if (B) {
|
|
197
|
+
const x = B({});
|
|
198
|
+
return Array.isArray(x) ? x : x ? [x] : void 0;
|
|
199
|
+
}
|
|
200
|
+
const b = n[c];
|
|
201
|
+
return b && b.length ? b : void 0;
|
|
202
|
+
}, o = [], h = i("default"), g = i("header"), y = i("footer");
|
|
203
|
+
return h && h.length && o.push(s("template", { slot: "default" }, h)), g && g.length && o.push(s("template", { slot: "title" }, g)), y && y.length && o.push(s("template", { slot: "footer" }, y)), s(
|
|
204
|
+
I,
|
|
205
|
+
{
|
|
206
|
+
attrs: {
|
|
207
|
+
...t,
|
|
208
|
+
visible: l,
|
|
209
|
+
title: e.title,
|
|
210
|
+
width: String(e.width),
|
|
211
|
+
top: String(e.top),
|
|
212
|
+
// 显式转发声明过的 props:v2 中声明过的 prop 会从 $attrs 被提取走,
|
|
213
|
+
// 不在这里重发就会被吞 —— showClose 会露出 el-dialog 自带的关闭按钮、
|
|
214
|
+
// closeOnClickModal/closeOnPressEscape/destroyOnClose 全部退回 el-dialog 默认值
|
|
215
|
+
showClose: e.showClose,
|
|
216
|
+
closeOnClickModal: e.closeOnClickModal,
|
|
217
|
+
closeOnPressEscape: e.closeOnPressEscape,
|
|
218
|
+
destroyOnClose: e.destroyOnClose
|
|
219
|
+
},
|
|
220
|
+
on: {
|
|
221
|
+
"update:visible": u,
|
|
222
|
+
open: () => this.$emit("open"),
|
|
223
|
+
opened: () => this.$emit("opened"),
|
|
224
|
+
close: () => this.$emit("close"),
|
|
225
|
+
closed: () => this.$emit("closed")
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
o.length ? o : void 0
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}, me = {
|
|
232
|
+
name: "SCloseBtn",
|
|
233
|
+
props: { size: { type: Number, default: 24 } },
|
|
234
|
+
emits: ["click"],
|
|
235
|
+
render(s) {
|
|
236
|
+
const e = this.$props;
|
|
237
|
+
return s("i", {
|
|
238
|
+
class: "el-icon-close base-dialog__header-close",
|
|
239
|
+
style: { fontSize: `${e.size}px` },
|
|
240
|
+
onClick: (t) => this.$emit("click", t)
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}, O = {
|
|
244
|
+
name: "SIcon",
|
|
245
|
+
props: {
|
|
246
|
+
size: { type: Number, default: 16 },
|
|
247
|
+
icon: { type: String, default: "" }
|
|
248
|
+
},
|
|
249
|
+
render(s) {
|
|
250
|
+
var a;
|
|
251
|
+
const e = this.$props, t = this.$slots;
|
|
252
|
+
if (t.default) {
|
|
253
|
+
const n = typeof t.default == "function" ? t.default() : t.default;
|
|
254
|
+
if (Array.isArray(n) && n.length === 1) {
|
|
255
|
+
const l = n[0];
|
|
256
|
+
if (l && typeof l == "object" && "props" in l) {
|
|
257
|
+
const u = ((a = l.props) == null ? void 0 : a.style) || {};
|
|
258
|
+
l.props.style = {
|
|
259
|
+
...u,
|
|
260
|
+
fontSize: `${e.size}px`
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return n;
|
|
265
|
+
}
|
|
266
|
+
return e.icon ? s("i", {
|
|
267
|
+
class: `el-icon-${e.icon} base-dialog__header-icon`,
|
|
268
|
+
style: { fontSize: `${e.size}px`, color: "#ffffff" }
|
|
269
|
+
}) : null;
|
|
270
|
+
}
|
|
271
|
+
}, ge = Symbol("Comment"), ye = Symbol("Text");
|
|
272
|
+
function be(s, e) {
|
|
273
|
+
var a;
|
|
274
|
+
const t = { ...s };
|
|
275
|
+
if (e) {
|
|
276
|
+
e.key !== void 0 && (t.key = e.key, t.data && (t.data = { ...t.data, key: e.key }));
|
|
277
|
+
for (const n of Object.keys(e))
|
|
278
|
+
n !== "key" && t.data && (t.data = {
|
|
279
|
+
...t.data,
|
|
280
|
+
attrs: { ...(a = t.data) == null ? void 0 : a.attrs, [n]: e[n] }
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
return t;
|
|
284
|
+
}
|
|
285
|
+
const P = {
|
|
286
|
+
name: "SArrowDown",
|
|
287
|
+
render(s) {
|
|
288
|
+
return s("i", { class: "el-icon-arrow-down" });
|
|
289
|
+
}
|
|
290
|
+
}, ve = {
|
|
291
|
+
name: "SQuestionFilled",
|
|
292
|
+
render(s) {
|
|
293
|
+
return s("i", { class: "el-icon-question" });
|
|
294
|
+
}
|
|
295
|
+
}, Se = {
|
|
296
|
+
primary: "primary",
|
|
297
|
+
secondary: "default",
|
|
298
|
+
outline: "default",
|
|
299
|
+
ghost: "default",
|
|
300
|
+
text: "default",
|
|
301
|
+
success: "success",
|
|
302
|
+
warning: "warning",
|
|
303
|
+
danger: "danger",
|
|
304
|
+
info: "info"
|
|
305
|
+
}, xe = {
|
|
306
|
+
primary: "base-btn--primary",
|
|
307
|
+
secondary: "base-btn--secondary",
|
|
308
|
+
outline: "base-btn--outline",
|
|
309
|
+
ghost: "base-btn--ghost",
|
|
310
|
+
text: "base-btn--text",
|
|
311
|
+
success: "base-btn--success",
|
|
312
|
+
warning: "base-btn--warning",
|
|
313
|
+
danger: "base-btn--danger",
|
|
314
|
+
info: "base-btn--info"
|
|
315
|
+
}, Ce = {
|
|
316
|
+
name: "BaseButton",
|
|
317
|
+
components: { SButton: V },
|
|
318
|
+
props: {
|
|
319
|
+
type: { type: String, default: "secondary" },
|
|
320
|
+
size: { type: String, default: "default" },
|
|
321
|
+
disabled: { type: Boolean, default: !1 },
|
|
322
|
+
loading: { type: Boolean, default: !1 },
|
|
323
|
+
round: { type: Boolean, default: !1 },
|
|
324
|
+
circle: { type: Boolean, default: !1 },
|
|
325
|
+
icon: { type: String, default: "" },
|
|
326
|
+
plain: { type: Boolean, default: !1 },
|
|
327
|
+
autofocus: { type: Boolean, default: !1 }
|
|
328
|
+
},
|
|
329
|
+
emits: ["click"],
|
|
330
|
+
computed: {
|
|
331
|
+
elType() {
|
|
332
|
+
return Se[this.type] || "default";
|
|
333
|
+
},
|
|
334
|
+
cssClass() {
|
|
335
|
+
return xe[this.type] || "base-btn--secondary";
|
|
336
|
+
},
|
|
337
|
+
sizeClass() {
|
|
338
|
+
return `base-btn--${this.size || "default"}`;
|
|
339
|
+
},
|
|
340
|
+
isIconOnly() {
|
|
341
|
+
return !this.$slots.default;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
var $e = function() {
|
|
346
|
+
var e = this, t = e._self._c;
|
|
347
|
+
return t("SButton", e._b({ staticClass: "base-btn", class: [e.cssClass, e.sizeClass, { "is-icon-only": e.isIconOnly }], attrs: { type: e.elType, size: e.size, disabled: e.disabled, loading: e.loading, round: e.round, circle: e.circle, icon: e.icon, plain: e.plain, autofocus: e.autofocus }, on: { click: function(a) {
|
|
348
|
+
return e.$emit("click", a);
|
|
349
|
+
} }, scopedSlots: e._u([e.$slots.icon ? { key: "icon", fn: function() {
|
|
350
|
+
return [e._t("icon")];
|
|
351
|
+
}, proxy: !0 } : null], null, !0) }, "SButton", e.$attrs, !1), [e._t("default")], 2);
|
|
352
|
+
}, we = [];
|
|
353
|
+
var Be = /* @__PURE__ */ m(
|
|
354
|
+
Ce,
|
|
355
|
+
$e,
|
|
356
|
+
we,
|
|
357
|
+
!1,
|
|
358
|
+
null,
|
|
359
|
+
"12b8192d",
|
|
360
|
+
null,
|
|
361
|
+
null
|
|
362
|
+
);
|
|
363
|
+
const Te = Be.exports, A = {
|
|
364
|
+
footer: { padding: "16px 0 32px 0", bgColor: "#fff", defaultMaxShow: 0 },
|
|
365
|
+
inline: { padding: "0", bgColor: "transparent", defaultMaxShow: 4 },
|
|
366
|
+
embed: { padding: "0", bgColor: "transparent", defaultMaxShow: 0 }
|
|
367
|
+
}, ke = {
|
|
368
|
+
name: "BaseButtonGroup",
|
|
369
|
+
props: {
|
|
370
|
+
type: { type: String, default: "embed" },
|
|
371
|
+
gap: { type: String, default: "8px" },
|
|
372
|
+
vertical: { type: Boolean, default: !1 },
|
|
373
|
+
wrap: { type: Boolean, default: !0 },
|
|
374
|
+
justify: { type: String, default: "flex-start" },
|
|
375
|
+
padding: { type: String, default: "" },
|
|
376
|
+
bgColor: { type: String, default: "" },
|
|
377
|
+
maxShowNum: { type: Number, default: 0 },
|
|
378
|
+
moreBtnType: { type: String, default: "default" },
|
|
379
|
+
moreText: { type: String, default: "更多" }
|
|
380
|
+
},
|
|
381
|
+
render(s) {
|
|
382
|
+
const e = this, t = e.$slots;
|
|
383
|
+
function a() {
|
|
384
|
+
return e.padding || A[e.type].padding;
|
|
385
|
+
}
|
|
386
|
+
function n() {
|
|
387
|
+
return e.bgColor || A[e.type].bgColor;
|
|
388
|
+
}
|
|
389
|
+
function l() {
|
|
390
|
+
return e.maxShowNum > 0 ? e.maxShowNum : A[e.type].defaultMaxShow;
|
|
391
|
+
}
|
|
392
|
+
function u() {
|
|
393
|
+
var p, f;
|
|
394
|
+
const r = (f = t.default) != null ? f : (p = e.$scopedSlots) == null ? void 0 : p.default;
|
|
395
|
+
return (Array.isArray(r) ? r : typeof r == "function" ? r() : []).filter((_) => !(_.type === ge || _.type === ye && typeof _.children == "string" && !_.children.trim()));
|
|
396
|
+
}
|
|
397
|
+
function i(r) {
|
|
398
|
+
if (typeof r.children == "string")
|
|
399
|
+
return r.children;
|
|
400
|
+
if (Array.isArray(r.children))
|
|
401
|
+
return r.children.map((d) => typeof d == "string" ? d : d && typeof d == "object" ? i(d) : "").join("");
|
|
402
|
+
if (r.children && typeof r.children == "object" && !Array.isArray(r.children)) {
|
|
403
|
+
const d = r.children.default;
|
|
404
|
+
if (typeof d == "function") {
|
|
405
|
+
const p = d();
|
|
406
|
+
if (typeof p == "string")
|
|
407
|
+
return p;
|
|
408
|
+
if (Array.isArray(p))
|
|
409
|
+
return p.map((f) => typeof f == "string" ? f : f && typeof f == "object" ? i(f) : "").join("");
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return "";
|
|
413
|
+
}
|
|
414
|
+
function o(r, d) {
|
|
415
|
+
var _, C, $, v, S, w, T;
|
|
416
|
+
const p = d.charAt(0).toUpperCase() + d.slice(1), f = (T = (S = (C = (_ = r.data) == null ? void 0 : _.on) == null ? void 0 : C[d]) != null ? S : (v = ($ = r.data) == null ? void 0 : $.nativeOn) == null ? void 0 : v[d]) != null ? T : (w = r.props) == null ? void 0 : w[`on${p}`];
|
|
417
|
+
if (Array.isArray(f)) {
|
|
418
|
+
const k = f.filter((z) => typeof z == "function");
|
|
419
|
+
return (z) => k.forEach((N) => N(z));
|
|
420
|
+
}
|
|
421
|
+
return typeof f == "function" ? f : void 0;
|
|
422
|
+
}
|
|
423
|
+
function h(r) {
|
|
424
|
+
var p, f, _, C, $, v, S, w, T, k;
|
|
425
|
+
const d = (k = (S = (C = (p = r.props) == null ? void 0 : p.disabled) != null ? C : (_ = (f = r.componentOptions) == null ? void 0 : f.propsData) == null ? void 0 : _.disabled) != null ? S : (v = ($ = r.data) == null ? void 0 : $.props) == null ? void 0 : v.disabled) != null ? k : (T = (w = r.data) == null ? void 0 : w.attrs) == null ? void 0 : T.disabled;
|
|
426
|
+
return d === "" || d === "disabled" || d === !0;
|
|
427
|
+
}
|
|
428
|
+
const g = u(), y = l(), c = y > 0 && g.length > y, B = c ? g.slice(0, y) : g, b = c ? g.slice(y) : [], x = {
|
|
429
|
+
gap: e.gap,
|
|
430
|
+
flexDirection: e.vertical ? "column" : "row",
|
|
431
|
+
flexWrap: e.wrap ? "wrap" : "nowrap",
|
|
432
|
+
justifyContent: e.justify,
|
|
433
|
+
padding: a(),
|
|
434
|
+
backgroundColor: n()
|
|
435
|
+
};
|
|
436
|
+
(e.type === "footer" || e.justify !== "flex-start") && (x.display = "flex");
|
|
437
|
+
const M = [];
|
|
438
|
+
if (B.forEach((r, d) => {
|
|
439
|
+
var p;
|
|
440
|
+
M.push(be(r, { key: (p = r.key) != null ? p : `visible-${d}` }));
|
|
441
|
+
}), c) {
|
|
442
|
+
const r = b.map((_, C) => {
|
|
443
|
+
var S;
|
|
444
|
+
const $ = i(_), v = o(_, "click");
|
|
445
|
+
return s(E, {
|
|
446
|
+
key: (S = _.key) != null ? S : `overflow-${C}`,
|
|
447
|
+
disabled: h(_),
|
|
448
|
+
onClick: (w) => {
|
|
449
|
+
v && v(w);
|
|
450
|
+
}
|
|
451
|
+
}, { default: () => $ });
|
|
452
|
+
}), d = e.moreBtnType === "text", p = [];
|
|
453
|
+
e.moreText && p.push(e.moreText), p.push(s(O, null, s(P)));
|
|
454
|
+
const f = s(V, {
|
|
455
|
+
size: "default",
|
|
456
|
+
class: ["base-btn-group__more-trigger", { "base-btn-group__more-trigger--text": d }],
|
|
457
|
+
text: d
|
|
458
|
+
}, p);
|
|
459
|
+
M.push(s(D, {
|
|
460
|
+
class: "base-btn-group__more",
|
|
461
|
+
trigger: "click",
|
|
462
|
+
placement: "bottom-end",
|
|
463
|
+
hideOnClick: !0
|
|
464
|
+
}, [
|
|
465
|
+
f,
|
|
466
|
+
s("template", { slot: "dropdown" }, r)
|
|
467
|
+
]));
|
|
468
|
+
}
|
|
469
|
+
return s("div", {
|
|
470
|
+
class: ["base-btn-group", `base-btn-group--${e.type}`],
|
|
471
|
+
style: x
|
|
472
|
+
}, M);
|
|
473
|
+
}
|
|
474
|
+
}, Fe = null, Oe = null;
|
|
475
|
+
var Me = /* @__PURE__ */ m(
|
|
476
|
+
ke,
|
|
477
|
+
Fe,
|
|
478
|
+
Oe,
|
|
479
|
+
!1,
|
|
480
|
+
null,
|
|
481
|
+
null,
|
|
482
|
+
null,
|
|
483
|
+
null
|
|
484
|
+
);
|
|
485
|
+
const R = Me.exports, ze = {
|
|
486
|
+
name: "BaseTag",
|
|
487
|
+
components: { STooltip: F },
|
|
488
|
+
props: {
|
|
489
|
+
type: { type: String, default: "default" },
|
|
490
|
+
variant: { type: String, default: "solid" },
|
|
491
|
+
text: { type: String, default: "" },
|
|
492
|
+
maxWidth: { type: String, default: "240px" },
|
|
493
|
+
textEllipsis: { type: Boolean, default: !0 },
|
|
494
|
+
placement: { type: String, default: "top" },
|
|
495
|
+
effect: { type: String, default: "dark" }
|
|
496
|
+
},
|
|
497
|
+
emits: ["click"],
|
|
498
|
+
data() {
|
|
499
|
+
return {
|
|
500
|
+
isOverflow: !1
|
|
501
|
+
};
|
|
502
|
+
},
|
|
503
|
+
computed: {
|
|
504
|
+
computedText() {
|
|
505
|
+
return this.text;
|
|
506
|
+
},
|
|
507
|
+
// 共享模板判空:默认插槽有实际内容($slots 数组 或 $scopedSlots 函数产物)时渲染插槽,否则显示 computedText
|
|
508
|
+
hasDefaultSlot() {
|
|
509
|
+
const s = this.$slots.default, e = this.$scopedSlots.default;
|
|
510
|
+
return !!(s && s.length || e && e({}).length);
|
|
511
|
+
},
|
|
512
|
+
popperClass() {
|
|
513
|
+
return this.effect === "light" ? "base-tag__popper--light" : "base-tag__popper";
|
|
514
|
+
},
|
|
515
|
+
tagStyle() {
|
|
516
|
+
const s = {};
|
|
517
|
+
return this.textEllipsis && this.maxWidth && this.maxWidth !== "none" && (s.maxWidth = this.maxWidth), s;
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
methods: {
|
|
521
|
+
checkOverflow() {
|
|
522
|
+
this.$nextTick(() => {
|
|
523
|
+
const s = this.$refs.tagRef;
|
|
524
|
+
s && (this.isOverflow = s.scrollWidth > s.offsetWidth);
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
mounted() {
|
|
529
|
+
this.checkOverflow();
|
|
530
|
+
const s = new ResizeObserver(() => this.checkOverflow());
|
|
531
|
+
this.$refs.tagRef && s.observe(this.$refs.tagRef), this.__resizeObserver = s;
|
|
532
|
+
},
|
|
533
|
+
beforeDestroy() {
|
|
534
|
+
var s;
|
|
535
|
+
(s = this.__resizeObserver) == null || s.disconnect();
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
var Ae = function() {
|
|
539
|
+
var e = this, t = e._self._c;
|
|
540
|
+
return t("STooltip", { attrs: { disabled: !e.isOverflow, content: e.computedText, placement: e.placement, effect: e.effect, "show-after": 200, "popper-class": e.popperClass } }, [t("span", { ref: "tagRef", class: [
|
|
541
|
+
"base-tag",
|
|
542
|
+
`base-tag--${e.type}`,
|
|
543
|
+
`base-tag--${e.variant}`,
|
|
544
|
+
{ "is-ellipsis": e.textEllipsis }
|
|
545
|
+
], style: e.tagStyle, on: { click: function(a) {
|
|
546
|
+
return e.$emit("click", a);
|
|
547
|
+
} } }, [e.hasDefaultSlot ? [e._t("default")] : [e._v(e._s(e.computedText))]], 2)]);
|
|
548
|
+
}, Ve = [];
|
|
549
|
+
var Pe = /* @__PURE__ */ m(
|
|
550
|
+
ze,
|
|
551
|
+
Ae,
|
|
552
|
+
Ve,
|
|
553
|
+
!1,
|
|
554
|
+
null,
|
|
555
|
+
"9f391aa1",
|
|
556
|
+
null,
|
|
557
|
+
null
|
|
558
|
+
);
|
|
559
|
+
const Re = Pe.exports, Ne = {
|
|
560
|
+
name: "BaseTitle",
|
|
561
|
+
props: {
|
|
562
|
+
level: { type: String, default: "primary" },
|
|
563
|
+
showBar: { type: Boolean, default: !0 },
|
|
564
|
+
border: { type: Boolean, default: !1 },
|
|
565
|
+
headerBg: { type: String, default: "" },
|
|
566
|
+
barColor: { type: String, default: "" }
|
|
567
|
+
},
|
|
568
|
+
computed: {
|
|
569
|
+
headerStyle() {
|
|
570
|
+
return this.headerBg ? { background: this.headerBg } : {};
|
|
571
|
+
},
|
|
572
|
+
barStyle() {
|
|
573
|
+
return this.barColor ? { background: this.barColor } : {};
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
var We = function() {
|
|
578
|
+
var e = this, t = e._self._c;
|
|
579
|
+
return t("div", { staticClass: "base-title", class: [`is-level-${e.level}`, { "is-bordered": e.border }], style: e.headerStyle }, [t("div", { staticClass: "base-title__left" }, [e.showBar ? t("i", { staticClass: "base-title__bar", style: e.barStyle }) : e._e(), t("span", { staticClass: "base-title__text" }, [e._t("default")], 2)]), e.$slots.extra ? t("div", { staticClass: "base-title__extra" }, [e._t("extra")], 2) : e._e()]);
|
|
580
|
+
}, Ie = [];
|
|
581
|
+
var Ee = /* @__PURE__ */ m(
|
|
582
|
+
Ne,
|
|
583
|
+
We,
|
|
584
|
+
Ie,
|
|
585
|
+
!1,
|
|
586
|
+
null,
|
|
587
|
+
"a36ee5ed",
|
|
588
|
+
null,
|
|
589
|
+
null
|
|
590
|
+
);
|
|
591
|
+
const De = Ee.exports, je = {
|
|
592
|
+
name: "BaseDialog",
|
|
593
|
+
components: { SDialog: _e, SCloseBtn: me, SIcon: O, STooltip: F, BaseButtonGroup: R },
|
|
594
|
+
props: {
|
|
595
|
+
modelValue: { type: Boolean, default: !1 },
|
|
596
|
+
title: { type: String, default: "" },
|
|
597
|
+
widthPreset: { type: String, default: "default" },
|
|
598
|
+
width: { type: [String, Number], default: void 0 },
|
|
599
|
+
centered: { type: Boolean, default: !0 },
|
|
600
|
+
closeOnClickModal: { type: Boolean, default: !1 },
|
|
601
|
+
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
602
|
+
destroyOnClose: { type: Boolean, default: !1 },
|
|
603
|
+
headerIcon: { default: void 0 },
|
|
604
|
+
headerIconTooltip: { type: String, default: "" },
|
|
605
|
+
headerIconPlacement: { type: String, default: "top" },
|
|
606
|
+
headerIconEffect: { type: String, default: "dark" },
|
|
607
|
+
closeTooltip: { type: String, default: "" },
|
|
608
|
+
closeTooltipPlacement: { type: String, default: "top" },
|
|
609
|
+
closeTooltipEffect: { type: String, default: "dark" },
|
|
610
|
+
bodyPadding: { type: String, default: "32px" },
|
|
611
|
+
showFooter: { type: Boolean, default: !0 },
|
|
612
|
+
footerMode: { type: String, default: "fixed" },
|
|
613
|
+
footerJustify: { type: String, default: "center" },
|
|
614
|
+
footerPadding: { default: void 0 }
|
|
615
|
+
},
|
|
616
|
+
emits: ["update:modelValue", "open", "opened", "close", "closed"],
|
|
617
|
+
computed: {
|
|
618
|
+
computedFooterPadding() {
|
|
619
|
+
return this.footerPadding !== void 0 ? this.footerPadding : this.footerMode === "scroll" ? "32px 0 0 0" : "0 0 32px 0";
|
|
620
|
+
},
|
|
621
|
+
computedWidth() {
|
|
622
|
+
return this.width ? this.width : `${{
|
|
623
|
+
xs: 480,
|
|
624
|
+
small: 720,
|
|
625
|
+
default: 960,
|
|
626
|
+
large: 1200,
|
|
627
|
+
xl: 1440
|
|
628
|
+
}[this.widthPreset] / 1920 * 100}vw`;
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
methods: {
|
|
632
|
+
emitClose() {
|
|
633
|
+
this.$emit("update:modelValue", !1), this.$emit("update:visible", !1), this.$emit("update:value", !1), this.$emit("input", !1);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
var He = function() {
|
|
638
|
+
var e = this, t = e._self._c;
|
|
639
|
+
return t("SDialog", e._b({ staticClass: "base-dialog", class: [
|
|
640
|
+
`base-dialog--preset-${e.widthPreset}`,
|
|
641
|
+
{ "base-dialog--centered": e.centered }
|
|
642
|
+
], attrs: { "model-value": e.modelValue, width: e.computedWidth, "show-close": !1, "close-on-click-modal": e.closeOnClickModal, "close-on-press-escape": e.closeOnPressEscape, "destroy-on-close": e.destroyOnClose, "align-center": !0 }, on: { "update:model-value": function(a) {
|
|
643
|
+
return e.$emit("update:modelValue", a);
|
|
644
|
+
}, "update:visible": function(a) {
|
|
645
|
+
return e.$emit("update:visible", a);
|
|
646
|
+
}, "update:value": function(a) {
|
|
647
|
+
return e.$emit("update:value", a);
|
|
648
|
+
}, input: function(a) {
|
|
649
|
+
return e.$emit("input", a);
|
|
650
|
+
}, open: function(a) {
|
|
651
|
+
return e.$emit("open");
|
|
652
|
+
}, opened: function(a) {
|
|
653
|
+
return e.$emit("opened");
|
|
654
|
+
}, close: function(a) {
|
|
655
|
+
return e.$emit("close");
|
|
656
|
+
}, closed: function(a) {
|
|
657
|
+
return e.$emit("closed");
|
|
658
|
+
} }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
659
|
+
return [t("div", { staticClass: "base-dialog__header" }, [t("div", { staticClass: "base-dialog__header-left" }, [t("span", { staticClass: "base-dialog__title" }, [e._v(e._s(e.title))]), e._t("header-icon", function() {
|
|
660
|
+
return [e.headerIconTooltip ? t("STooltip", { attrs: { content: e.headerIconTooltip, placement: e.headerIconPlacement, effect: e.headerIconEffect, "show-after": 200 } }, [t("SIcon", { staticClass: "base-dialog__header-icon", attrs: { size: 16, icon: e.headerIcon } })], 1) : e.headerIcon ? t("SIcon", { staticClass: "base-dialog__header-icon", attrs: { size: 16, icon: e.headerIcon } }) : e._e()];
|
|
661
|
+
})], 2), t("div", { staticClass: "base-dialog__header-right" }, [e._t("header-extra"), e.closeTooltip ? t("STooltip", { attrs: { content: e.closeTooltip, placement: e.closeTooltipPlacement, effect: e.closeTooltipEffect, "show-after": 200 } }, [t("SCloseBtn", { attrs: { size: 24 }, on: { click: e.emitClose } })], 1) : t("SCloseBtn", { attrs: { size: 24 }, on: { click: e.emitClose } })], 2)])];
|
|
662
|
+
}, proxy: !0 }, e.showFooter && e.footerMode === "fixed" ? { key: "footer", fn: function() {
|
|
663
|
+
return [t("div", { staticClass: "base-dialog__footer", style: { padding: e.computedFooterPadding } }, [e._t("footer", function() {
|
|
664
|
+
return [t("BaseButtonGroup", { attrs: { type: "embed", justify: e.footerJustify } }, [e._t("footer-buttons")], 2)];
|
|
665
|
+
})], 2)];
|
|
666
|
+
}, proxy: !0 } : null], null, !0) }, "SDialog", e.$attrs, !1), [t("div", { staticClass: "base-dialog__body", class: {
|
|
667
|
+
"base-dialog__body--scroll-footer": e.footerMode === "scroll"
|
|
668
|
+
}, style: { padding: e.bodyPadding } }, [t("div", { staticClass: "base-dialog__content" }, [e._t("default")], 2), e.showFooter && e.footerMode === "scroll" ? t("div", { staticClass: "base-dialog__footer", style: { padding: e.computedFooterPadding } }, [e._t("footer", function() {
|
|
669
|
+
return [t("BaseButtonGroup", { attrs: { type: "embed", justify: e.footerJustify } }, [e._t("footer-buttons")], 2)];
|
|
670
|
+
})], 2) : e._e()])]);
|
|
671
|
+
}, Le = [];
|
|
672
|
+
var Ue = /* @__PURE__ */ m(
|
|
673
|
+
je,
|
|
674
|
+
He,
|
|
675
|
+
Le,
|
|
676
|
+
!1,
|
|
677
|
+
null,
|
|
678
|
+
null,
|
|
679
|
+
null,
|
|
680
|
+
null
|
|
681
|
+
);
|
|
682
|
+
const Ye = Ue.exports, Ge = {
|
|
683
|
+
name: "BaseTable",
|
|
684
|
+
inheritAttrs: !1,
|
|
685
|
+
components: { STable: j, STableColumn: H },
|
|
686
|
+
props: {
|
|
687
|
+
data: { type: Array, default: () => [] },
|
|
688
|
+
columns: { type: Array, default: () => [] },
|
|
689
|
+
headerBg: { type: String, default: "#f8f9fa" },
|
|
690
|
+
colRatio: { type: String, default: "" },
|
|
691
|
+
overflowTooltip: { type: Boolean, default: !0 },
|
|
692
|
+
emptyText: { type: String, default: "暂无数据" },
|
|
693
|
+
stripe: { type: Boolean, default: !0 },
|
|
694
|
+
border: { type: Boolean, default: !0 }
|
|
695
|
+
},
|
|
696
|
+
emits: ["selection-change", "sort-change", "row-click"],
|
|
697
|
+
computed: {
|
|
698
|
+
ratioWeights() {
|
|
699
|
+
return this.colRatio ? this.colRatio.split(":").map((s) => {
|
|
700
|
+
const e = parseInt(s.trim(), 10);
|
|
701
|
+
return isNaN(e) ? 0 : e;
|
|
702
|
+
}) : [];
|
|
703
|
+
},
|
|
704
|
+
computedColumns() {
|
|
705
|
+
const s = this.columns || [];
|
|
706
|
+
if (!s.length)
|
|
707
|
+
return s;
|
|
708
|
+
const e = this.ratioWeights;
|
|
709
|
+
if (!e.length)
|
|
710
|
+
return s;
|
|
711
|
+
const t = [];
|
|
712
|
+
if (s.forEach((n, l) => {
|
|
713
|
+
!n.width && n.type !== "selection" && n.type !== "index" && t.push(l);
|
|
714
|
+
}), t.length !== e.length)
|
|
715
|
+
return s;
|
|
716
|
+
const a = e.reduce((n, l) => n + l, 0);
|
|
717
|
+
return a <= 0 ? s : s.map((n, l) => {
|
|
718
|
+
const u = t.indexOf(l);
|
|
719
|
+
if (u === -1)
|
|
720
|
+
return { ...n };
|
|
721
|
+
const i = e[u] / a * 100;
|
|
722
|
+
return {
|
|
723
|
+
...n,
|
|
724
|
+
width: `${Math.round(i * 1e4) / 1e4}%`,
|
|
725
|
+
minWidth: n.minWidth || void 0
|
|
726
|
+
};
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
methods: {
|
|
731
|
+
emitSelectionChange(s) {
|
|
732
|
+
this.$emit("selection-change", s);
|
|
733
|
+
},
|
|
734
|
+
emitSortChange(s) {
|
|
735
|
+
this.$emit("sort-change", s);
|
|
736
|
+
},
|
|
737
|
+
emitRowClick(s, e, t) {
|
|
738
|
+
this.$emit("row-click", s, e, t);
|
|
739
|
+
},
|
|
740
|
+
getColumnFormatter(s) {
|
|
741
|
+
if (s.formatter)
|
|
742
|
+
return s.formatter;
|
|
743
|
+
const e = s.minusOneText !== void 0, t = s.money;
|
|
744
|
+
if (!(!e && !t))
|
|
745
|
+
return (a, n, l, u) => {
|
|
746
|
+
let i = l;
|
|
747
|
+
if (e && i === -1)
|
|
748
|
+
return s.minusOneText;
|
|
749
|
+
if (t && i !== void 0 && i !== null && i !== "") {
|
|
750
|
+
const o = Number(i);
|
|
751
|
+
if (!isNaN(o)) {
|
|
752
|
+
const h = s.moneyThousands !== !1, g = o.toFixed(2).split(".");
|
|
753
|
+
return h && (g[0] = g[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",")), g.join(".");
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return i;
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
var qe = function() {
|
|
762
|
+
var e = this, t = e._self._c;
|
|
763
|
+
return t("div", { staticClass: "base-table", style: { "--base-table-header-bg": e.headerBg } }, [t("STable", e._b({ attrs: { data: e.data, stripe: e.stripe, border: e.border, "empty-text": e.emptyText, size: "small" }, on: { "selection-change": e.emitSelectionChange, "sort-change": e.emitSortChange, "row-click": e.emitRowClick } }, "STable", e.$attrs, !1), [e.computedColumns.length > 0 ? e._l(e.computedColumns, function(a, n) {
|
|
764
|
+
var l, u, i;
|
|
765
|
+
return t("STableColumn", { key: n, attrs: { type: a.type, prop: a.type ? void 0 : a.prop, label: a.type ? void 0 : a.label, width: a.width, "min-width": a.minWidth, align: (l = a.align) != null ? l : "left", fixed: a.fixed, sortable: (u = a.sortable) != null ? u : !1, "show-overflow-tooltip": (i = a.showOverflowTooltip) != null ? i : e.overflowTooltip, "reserve-selection": a.reserveSelection, "class-name": a.className, formatter: e.getColumnFormatter(a) }, scopedSlots: e._u([a.slotName ? { key: "default", fn: function(o) {
|
|
766
|
+
return [e._t(a.slotName, null, null, o)];
|
|
767
|
+
} } : null], null, !0) });
|
|
768
|
+
}) : e._t("default")], 2)], 1);
|
|
769
|
+
}, Je = [];
|
|
770
|
+
var Qe = /* @__PURE__ */ m(
|
|
771
|
+
Ge,
|
|
772
|
+
qe,
|
|
773
|
+
Je,
|
|
774
|
+
!1,
|
|
775
|
+
null,
|
|
776
|
+
null,
|
|
777
|
+
null,
|
|
778
|
+
null
|
|
779
|
+
);
|
|
780
|
+
const Ke = Qe.exports, Xe = {
|
|
781
|
+
name: "BaseDescriptions",
|
|
782
|
+
components: { STooltip: F },
|
|
783
|
+
props: {
|
|
784
|
+
mode: { type: String, default: "fixed" },
|
|
785
|
+
labelWidth: { type: String, default: "100px" },
|
|
786
|
+
columnMode: { type: Number, default: 2 },
|
|
787
|
+
labelBg: { type: String, default: "#f8f9fa" },
|
|
788
|
+
contentBg: { type: String, default: "#ffffff" },
|
|
789
|
+
labelColor: { type: String, default: "#333333" },
|
|
790
|
+
contentColor: { type: String, default: "#333333" },
|
|
791
|
+
contentOverflow: { type: String, default: "wrap" },
|
|
792
|
+
data: { type: Object, default: () => ({}) },
|
|
793
|
+
options: { type: Array, default: () => [] }
|
|
794
|
+
},
|
|
795
|
+
data() {
|
|
796
|
+
return {
|
|
797
|
+
isTextOverflow: [],
|
|
798
|
+
computedLabelWidth: "100px"
|
|
799
|
+
};
|
|
800
|
+
},
|
|
801
|
+
computed: {
|
|
802
|
+
hasOptions() {
|
|
803
|
+
return this.options.length > 0;
|
|
804
|
+
},
|
|
805
|
+
finalLabelWidth() {
|
|
806
|
+
return this.mode === "fixed" ? this.labelWidth : this.computedLabelWidth;
|
|
807
|
+
},
|
|
808
|
+
cssVars() {
|
|
809
|
+
return {
|
|
810
|
+
"--label-width": this.finalLabelWidth,
|
|
811
|
+
"--label-bg": this.labelBg,
|
|
812
|
+
"--content-bg": this.contentBg,
|
|
813
|
+
"--label-color": this.labelColor,
|
|
814
|
+
"--content-color": this.contentColor,
|
|
815
|
+
"--border-color": "#ebeef5"
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
watch: {
|
|
820
|
+
options: {
|
|
821
|
+
handler() {
|
|
822
|
+
this.calcMaxLabelWidth(), this.checkTextEllipsis();
|
|
823
|
+
},
|
|
824
|
+
deep: !0
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
methods: {
|
|
828
|
+
async calcMaxLabelWidth() {
|
|
829
|
+
if (this.mode !== "grid" || !this.$refs.measureWrap)
|
|
830
|
+
return;
|
|
831
|
+
await this.$nextTick();
|
|
832
|
+
const s = this.$refs.measureWrap.querySelectorAll("span");
|
|
833
|
+
let e = 0;
|
|
834
|
+
s.forEach((t) => {
|
|
835
|
+
const a = t.getBoundingClientRect();
|
|
836
|
+
e = Math.max(e, a.width);
|
|
837
|
+
}), this.computedLabelWidth = `${Math.ceil(e) + 24}px`;
|
|
838
|
+
},
|
|
839
|
+
async checkTextEllipsis() {
|
|
840
|
+
await this.$nextTick();
|
|
841
|
+
const s = this.options, e = new Array(s.length).fill(!1), t = this.$refs.rootRef;
|
|
842
|
+
if (!t)
|
|
843
|
+
return;
|
|
844
|
+
s.forEach((n, l) => {
|
|
845
|
+
const u = t.querySelector(`.ellipsis-wrap[data-ellipsis-index="${l}"]`);
|
|
846
|
+
if (!u)
|
|
847
|
+
return;
|
|
848
|
+
const i = u.querySelector(".text-ellipsis");
|
|
849
|
+
i && (e[l] = i.scrollWidth > i.clientWidth);
|
|
850
|
+
}), e.some((n, l) => n !== this.isTextOverflow[l]) && (this.isTextOverflow = e);
|
|
851
|
+
},
|
|
852
|
+
handleResize() {
|
|
853
|
+
this.checkTextEllipsis();
|
|
854
|
+
},
|
|
855
|
+
getItemBoxWidth(s) {
|
|
856
|
+
var t;
|
|
857
|
+
return `${(100 / ((t = s.column) != null ? t : this.columnMode)).toFixed(6)}%`;
|
|
858
|
+
},
|
|
859
|
+
getDisplayValue(s) {
|
|
860
|
+
const e = this.data, t = s.field ? e[s.field] : s.value;
|
|
861
|
+
return t == null || t === "" ? "" : String(t);
|
|
862
|
+
},
|
|
863
|
+
getItemOverflow(s) {
|
|
864
|
+
var e;
|
|
865
|
+
return (e = s.overflow) != null ? e : this.contentOverflow;
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
mounted() {
|
|
869
|
+
this.calcMaxLabelWidth(), this.checkTextEllipsis(), window.addEventListener("resize", this.handleResize);
|
|
870
|
+
},
|
|
871
|
+
updated() {
|
|
872
|
+
this.checkTextEllipsis();
|
|
873
|
+
},
|
|
874
|
+
beforeDestroy() {
|
|
875
|
+
window.removeEventListener("resize", this.handleResize);
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
var Ze = function() {
|
|
879
|
+
var e = this, t = e._self._c;
|
|
880
|
+
return t("div", { ref: "rootRef", staticClass: "base-descriptions", style: e.cssVars }, [t("div", { staticClass: "bd-wrap" }, [t("div", { staticClass: "bd-container" }, [e.hasOptions ? e._l(e.options, function(a, n) {
|
|
881
|
+
return t("div", { key: n, staticClass: "bd-item", style: { width: e.getItemBoxWidth(a) } }, [t("div", { staticClass: "bd-label" }, [e._v(" " + e._s(a.label) + " ")]), t("div", { staticClass: "bd-content" }, [a.slot && e.$slots[a.slot] ? [e._t(a.slot, null, { item: a, value: e.getDisplayValue(a) })] : e.getItemOverflow(a) === "ellipsis" ? [t("STooltip", { attrs: { content: e.getDisplayValue(a), effect: a.tooltipEffect || "dark", placement: a.tooltipPlacement || "top", disabled: !e.isTextOverflow[n] } }, [t("div", { staticClass: "ellipsis-wrap", attrs: { "data-ellipsis-index": n } }, [t("span", { staticClass: "text-ellipsis" }, [e._v(e._s(e.getDisplayValue(a)))])])])] : [e._v(" " + e._s(e.getDisplayValue(a) || "") + " ")]], 2)]);
|
|
882
|
+
}) : e._t("default")], 2)]), e.mode === "grid" ? t("div", { ref: "measureWrap", staticClass: "bd-measure" }, e._l(e.options, function(a) {
|
|
883
|
+
return t("span", { key: a.label }, [e._v(e._s(a.label))]);
|
|
884
|
+
}), 0) : e._e()]);
|
|
885
|
+
}, et = [];
|
|
886
|
+
var tt = /* @__PURE__ */ m(
|
|
887
|
+
Xe,
|
|
888
|
+
Ze,
|
|
889
|
+
et,
|
|
890
|
+
!1,
|
|
891
|
+
null,
|
|
892
|
+
"b5ffd37f",
|
|
893
|
+
null,
|
|
894
|
+
null
|
|
895
|
+
);
|
|
896
|
+
const st = tt.exports, at = {
|
|
897
|
+
name: "BaseTabs",
|
|
898
|
+
inheritAttrs: !1,
|
|
899
|
+
components: { STabs: L, STabPane: U },
|
|
900
|
+
props: {
|
|
901
|
+
modelValue: { type: [String, Number], default: void 0 },
|
|
902
|
+
type: { type: String, default: "line" },
|
|
903
|
+
items: { type: Array, default: void 0 },
|
|
904
|
+
cardBody: { type: Boolean, default: !0 },
|
|
905
|
+
bodyPadding: { type: String, default: "16px" },
|
|
906
|
+
segmentActiveBg: { type: String, default: "#FFFFFF" },
|
|
907
|
+
headerMargin: { type: String, default: "16px 16px 0 16px" }
|
|
908
|
+
},
|
|
909
|
+
emits: ["update:modelValue", "tab-click", "tab-remove", "change"],
|
|
910
|
+
data() {
|
|
911
|
+
return {
|
|
912
|
+
internalValue: void 0
|
|
913
|
+
};
|
|
914
|
+
},
|
|
915
|
+
computed: {
|
|
916
|
+
effectiveModelValue() {
|
|
917
|
+
var e;
|
|
918
|
+
if (this.modelValue !== void 0)
|
|
919
|
+
return this.modelValue;
|
|
920
|
+
if (this.internalValue !== void 0)
|
|
921
|
+
return this.internalValue;
|
|
922
|
+
const s = this.items;
|
|
923
|
+
if (s != null && s.length)
|
|
924
|
+
return (e = s[0].name) != null ? e : 0;
|
|
925
|
+
},
|
|
926
|
+
filteredAttrs() {
|
|
927
|
+
const s = ["type", "model-value", "modelValue", "items", "cardBody", "bodyPadding", "segmentActiveBg", "headerMargin"], e = {};
|
|
928
|
+
for (const t of Object.keys(this.$attrs))
|
|
929
|
+
s.includes(t) || (e[t] = this.$attrs[t]);
|
|
930
|
+
return e;
|
|
931
|
+
},
|
|
932
|
+
hasItems() {
|
|
933
|
+
const s = this.items;
|
|
934
|
+
return !!(s && s.length > 0);
|
|
935
|
+
},
|
|
936
|
+
cssVars() {
|
|
937
|
+
return {
|
|
938
|
+
"--base-tabs-body-padding": this.bodyPadding,
|
|
939
|
+
"--base-tabs-header-margin": this.headerMargin,
|
|
940
|
+
"--base-tabs-segment-active-bg": this.segmentActiveBg
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
methods: {
|
|
945
|
+
handleUpdateModelValue(s) {
|
|
946
|
+
this.internalValue = s, this.$emit("update:modelValue", s);
|
|
947
|
+
},
|
|
948
|
+
handleTabClick(s, e) {
|
|
949
|
+
this.$emit("tab-click", s, e);
|
|
950
|
+
},
|
|
951
|
+
handleTabRemove(s) {
|
|
952
|
+
this.$emit("tab-remove", s);
|
|
953
|
+
},
|
|
954
|
+
handleChange(s) {
|
|
955
|
+
this.$emit("change", s);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
var nt = function() {
|
|
960
|
+
var e = this, t = e._self._c;
|
|
961
|
+
return t("div", { staticClass: "base-tabs", class: [
|
|
962
|
+
`is-type-${e.type}`,
|
|
963
|
+
{ "has-card-body": e.cardBody }
|
|
964
|
+
], style: e.cssVars }, [t("STabs", e._b({ attrs: { "model-value": e.effectiveModelValue, value: e.effectiveModelValue }, on: { "update:model-value": e.handleUpdateModelValue, input: e.handleUpdateModelValue, "tab-click": e.handleTabClick, "tab-remove": e.handleTabRemove, change: e.handleChange } }, "STabs", e.filteredAttrs, !1), [e.hasItems ? e._l(e.items, function(a, n) {
|
|
965
|
+
var l, u;
|
|
966
|
+
return t("STabPane", { key: (l = a.name) != null ? l : n, attrs: { label: a.label, name: (u = a.name) != null ? u : n, disabled: a.disabled } }, [e._t(a.slot || "default", null, { item: a })], 2);
|
|
967
|
+
}) : e._t("default")], 2)], 1);
|
|
968
|
+
}, lt = [];
|
|
969
|
+
var ot = /* @__PURE__ */ m(
|
|
970
|
+
at,
|
|
971
|
+
nt,
|
|
972
|
+
lt,
|
|
973
|
+
!1,
|
|
974
|
+
null,
|
|
975
|
+
"baf06111",
|
|
976
|
+
null,
|
|
977
|
+
null
|
|
978
|
+
);
|
|
979
|
+
const rt = ot.exports, it = {
|
|
980
|
+
name: "BaseMenu",
|
|
981
|
+
inheritAttrs: !1,
|
|
982
|
+
components: { SMenu: Y },
|
|
983
|
+
props: {
|
|
984
|
+
collapse: { type: Boolean, default: !1 },
|
|
985
|
+
level2Icon: { type: Boolean, default: !1 }
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
var dt = function() {
|
|
989
|
+
var e = this, t = e._self._c;
|
|
990
|
+
return t("div", { staticClass: "base-menu", class: [
|
|
991
|
+
{ "is-collapse": e.collapse },
|
|
992
|
+
{ "has-level2-icon": e.level2Icon }
|
|
993
|
+
] }, [t("SMenu", e._b({ attrs: { collapse: e.collapse } }, "SMenu", e.$attrs, !1), [e._t("default")], 2)], 1);
|
|
994
|
+
}, ct = [];
|
|
995
|
+
var ut = /* @__PURE__ */ m(
|
|
996
|
+
it,
|
|
997
|
+
dt,
|
|
998
|
+
ct,
|
|
999
|
+
!1,
|
|
1000
|
+
null,
|
|
1001
|
+
"99b1b4e8",
|
|
1002
|
+
null,
|
|
1003
|
+
null
|
|
1004
|
+
);
|
|
1005
|
+
const pt = ut.exports, ft = {
|
|
1006
|
+
name: "BasePagination",
|
|
1007
|
+
inheritAttrs: !1,
|
|
1008
|
+
components: { SPagination: G },
|
|
1009
|
+
props: {
|
|
1010
|
+
modelValue: { type: Number, default: 1 },
|
|
1011
|
+
pageSize: { type: Number, default: 10 },
|
|
1012
|
+
total: { type: Number, default: 0 },
|
|
1013
|
+
pageSizes: { type: Array, default: () => [10, 20, 50, 100] },
|
|
1014
|
+
layout: { type: String, default: "total, sizes, prev, pager, next, jumper" },
|
|
1015
|
+
disabled: { type: Boolean, default: !1 },
|
|
1016
|
+
hideOnSinglePage: { type: Boolean, default: !1 },
|
|
1017
|
+
pagerCount: { type: Number, default: 7 },
|
|
1018
|
+
gotoText: { type: String, default: "前往" },
|
|
1019
|
+
totalText: { type: String, default: "共" },
|
|
1020
|
+
pageClassifier: { type: String, default: "页" }
|
|
1021
|
+
},
|
|
1022
|
+
emits: ["update:modelValue", "update:pageSize"],
|
|
1023
|
+
computed: {
|
|
1024
|
+
filteredAttrs() {
|
|
1025
|
+
const s = [
|
|
1026
|
+
"model-value",
|
|
1027
|
+
"modelValue",
|
|
1028
|
+
"modelValue",
|
|
1029
|
+
"page-size",
|
|
1030
|
+
"pageSize",
|
|
1031
|
+
"total",
|
|
1032
|
+
"page-sizes",
|
|
1033
|
+
"pageSizes",
|
|
1034
|
+
"layout",
|
|
1035
|
+
"disabled",
|
|
1036
|
+
"hide-on-single-page",
|
|
1037
|
+
"hideOnSinglePage",
|
|
1038
|
+
"pager-count",
|
|
1039
|
+
"pagerCount",
|
|
1040
|
+
"goto-text",
|
|
1041
|
+
"gotoText",
|
|
1042
|
+
"page-classifier",
|
|
1043
|
+
"pageClassifier"
|
|
1044
|
+
], e = {};
|
|
1045
|
+
for (const t of Object.keys(this.$attrs))
|
|
1046
|
+
s.includes(t) || (e[t] = this.$attrs[t]);
|
|
1047
|
+
return e;
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
methods: {
|
|
1051
|
+
handleCurrentPageUpdate(s) {
|
|
1052
|
+
this.$emit("update:modelValue", s);
|
|
1053
|
+
},
|
|
1054
|
+
handlePageSizeUpdate(s) {
|
|
1055
|
+
this.$emit("update:pageSize", s);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
var ht = function() {
|
|
1060
|
+
var e = this, t = e._self._c;
|
|
1061
|
+
return t("div", { staticClass: "base-pagination" }, [t("SPagination", e._b({ attrs: { "current-page": e.modelValue, "page-size": e.pageSize, total: e.total, "page-sizes": e.pageSizes, layout: e.layout, disabled: e.disabled, "hide-on-single-page": e.hideOnSinglePage, "pager-count": e.pagerCount, "goto-text": e.gotoText, "page-classifier": e.pageClassifier }, on: { "update:current-page": e.handleCurrentPageUpdate, "update:page-size": e.handlePageSizeUpdate, "current-change": e.handleCurrentPageUpdate, "size-change": e.handlePageSizeUpdate }, scopedSlots: e._u([{ key: "total", fn: function({ total: a }) {
|
|
1062
|
+
return [e.totalText ? t("span", [e._v(e._s(e.totalText))]) : t("span", [e._v("共 " + e._s(a) + " 条")])];
|
|
1063
|
+
} }, { key: "jumper", fn: function() {
|
|
1064
|
+
return [t("span", [e._v(e._s(e.gotoText))])];
|
|
1065
|
+
}, proxy: !0 }]) }, "SPagination", e.filteredAttrs, !1))], 1);
|
|
1066
|
+
}, _t = [];
|
|
1067
|
+
var mt = /* @__PURE__ */ m(
|
|
1068
|
+
ft,
|
|
1069
|
+
ht,
|
|
1070
|
+
_t,
|
|
1071
|
+
!1,
|
|
1072
|
+
null,
|
|
1073
|
+
"6f9913f8",
|
|
1074
|
+
null,
|
|
1075
|
+
null
|
|
1076
|
+
);
|
|
1077
|
+
const gt = mt.exports, yt = {
|
|
1078
|
+
name: "SaberFormTip",
|
|
1079
|
+
components: { SIcon: O, SQuestionFilled: ve, STooltip: F },
|
|
1080
|
+
props: {
|
|
1081
|
+
content: { type: String, default: "" },
|
|
1082
|
+
placement: { type: String, default: "right" },
|
|
1083
|
+
effect: { type: String, default: "light" },
|
|
1084
|
+
popperClass: { type: String, default: "" },
|
|
1085
|
+
tipClass: { type: String, default: "" }
|
|
1086
|
+
},
|
|
1087
|
+
emits: ["click"],
|
|
1088
|
+
methods: {
|
|
1089
|
+
handleClick(s) {
|
|
1090
|
+
this.$emit("click", s);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
var bt = function() {
|
|
1095
|
+
var e = this, t = e._self._c;
|
|
1096
|
+
return t("STooltip", { attrs: { content: e.content, placement: e.placement, effect: e.effect, "popper-class": e.popperClass, disabled: !e.content, trigger: "hover" } }, [t("span", { staticClass: "saber-form-tip", class: e.tipClass, on: { click: e.handleClick } }, [t("SIcon", [t("SQuestionFilled")], 1)], 1)]);
|
|
1097
|
+
}, vt = [], St = /* @__PURE__ */ m(
|
|
1098
|
+
yt,
|
|
1099
|
+
bt,
|
|
1100
|
+
vt,
|
|
1101
|
+
!1,
|
|
1102
|
+
null,
|
|
1103
|
+
null,
|
|
1104
|
+
null,
|
|
1105
|
+
null
|
|
1106
|
+
);
|
|
1107
|
+
const xt = St.exports, Ct = {
|
|
1108
|
+
name: "SaberAvueForm",
|
|
1109
|
+
props: {
|
|
1110
|
+
modelValue: {
|
|
1111
|
+
type: Object,
|
|
1112
|
+
default: () => ({})
|
|
1113
|
+
},
|
|
1114
|
+
column: {
|
|
1115
|
+
type: Array,
|
|
1116
|
+
default: () => []
|
|
1117
|
+
},
|
|
1118
|
+
labelWidth: {
|
|
1119
|
+
type: [String, Number],
|
|
1120
|
+
default: "128px"
|
|
1121
|
+
},
|
|
1122
|
+
size: {
|
|
1123
|
+
type: String,
|
|
1124
|
+
default: "small",
|
|
1125
|
+
validator: (s) => ["small", "default", "large"].includes(s)
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
emits: ["update:modelValue"],
|
|
1129
|
+
data() {
|
|
1130
|
+
return {
|
|
1131
|
+
avueFormRegistered: !1
|
|
1132
|
+
};
|
|
1133
|
+
},
|
|
1134
|
+
computed: {
|
|
1135
|
+
processedColumns() {
|
|
1136
|
+
return (this.column || []).map((e) => {
|
|
1137
|
+
const t = { ...e };
|
|
1138
|
+
return e.hasTip && e.tip ? t.tip = e.tip : e.hasTip || delete t.tip, t;
|
|
1139
|
+
});
|
|
1140
|
+
},
|
|
1141
|
+
mergedBind() {
|
|
1142
|
+
const s = {};
|
|
1143
|
+
for (const e of Object.keys(this.$attrs))
|
|
1144
|
+
e.startsWith("on") || (s[e] = this.$attrs[e]);
|
|
1145
|
+
return {
|
|
1146
|
+
props: {
|
|
1147
|
+
...s,
|
|
1148
|
+
// avue 2.x 认顶层 column(字段渲染依赖 formOption.column ← option.column 或 column,
|
|
1149
|
+
// 只传 option 时字段区不渲染,B2 冒烟实测字段区为空);avue 3.x 只认 option —— 双版本各传各的
|
|
1150
|
+
column: this.processedColumns,
|
|
1151
|
+
option: { column: this.processedColumns },
|
|
1152
|
+
labelWidth: this.labelWidth,
|
|
1153
|
+
size: this.size,
|
|
1154
|
+
// avue 2.x 的 v-model 契约:value prop(required,缺失会 Vue warn)+ input 事件
|
|
1155
|
+
value: this.modelValue
|
|
1156
|
+
},
|
|
1157
|
+
on: {
|
|
1158
|
+
...this.$listeners,
|
|
1159
|
+
input: (e) => this.$emit("update:modelValue", e)
|
|
1160
|
+
}
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
created() {
|
|
1165
|
+
var s, e, t, a;
|
|
1166
|
+
try {
|
|
1167
|
+
this.avueFormRegistered = !!((a = (t = (e = (s = this.$root) == null ? void 0 : s.constructor) == null ? void 0 : e.options) == null ? void 0 : t.components) != null && a["avue-form"]);
|
|
1168
|
+
} catch {
|
|
1169
|
+
this.avueFormRegistered = !1;
|
|
1170
|
+
}
|
|
1171
|
+
this.avueFormRegistered || console.warn(
|
|
1172
|
+
`[SaberAvueForm] 未检测到 <avue-form> 组件。SaberAvueForm 依赖 @smallwei/avue,如需要使用请安装并注册:
|
|
1173
|
+
pnpm add @smallwei/avue
|
|
1174
|
+
import Avue from "@smallwei/avue"
|
|
1175
|
+
app.use(Avue)`
|
|
1176
|
+
);
|
|
1177
|
+
},
|
|
1178
|
+
render(s) {
|
|
1179
|
+
if (!this.avueFormRegistered)
|
|
1180
|
+
return s("div", {
|
|
1181
|
+
style: {
|
|
1182
|
+
padding: "24px",
|
|
1183
|
+
border: "1px dashed #d9d9d9",
|
|
1184
|
+
borderRadius: "4px",
|
|
1185
|
+
color: "#999",
|
|
1186
|
+
fontSize: "14px",
|
|
1187
|
+
textAlign: "center"
|
|
1188
|
+
}
|
|
1189
|
+
}, [
|
|
1190
|
+
s("p", "SaberAvueForm 需要使用 @smallwei/avue"),
|
|
1191
|
+
s("p", { style: { fontSize: "12px", marginTop: "8px" } }, "请安装并注册:pnpm add @smallwei/avue → app.use(Avue)")
|
|
1192
|
+
]);
|
|
1193
|
+
const e = this.mergedBind;
|
|
1194
|
+
return s(
|
|
1195
|
+
"avue-form",
|
|
1196
|
+
{
|
|
1197
|
+
ref: "formRef",
|
|
1198
|
+
props: e.props,
|
|
1199
|
+
on: e.on
|
|
1200
|
+
},
|
|
1201
|
+
this.$slots
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
}, $t = {
|
|
1205
|
+
name: "BaseSearchBar",
|
|
1206
|
+
components: { SIcon: O, SArrowDown: P, SForm: q, SFormItem: J, SInput: Q, SSelect: K, SOption: X, SDatePicker: Z },
|
|
1207
|
+
props: {
|
|
1208
|
+
modelValue: { type: Object, default: () => ({}) },
|
|
1209
|
+
options: { type: Array, default: () => [] },
|
|
1210
|
+
showNumber: { type: Number, default: 4 },
|
|
1211
|
+
padding: { type: String, default: "16px" },
|
|
1212
|
+
bgColor: { type: String, default: "#FFFFFF" }
|
|
1213
|
+
},
|
|
1214
|
+
emits: ["update:modelValue", "search", "reset"],
|
|
1215
|
+
data() {
|
|
1216
|
+
return {
|
|
1217
|
+
isExpanded: !1
|
|
1218
|
+
};
|
|
1219
|
+
},
|
|
1220
|
+
computed: {
|
|
1221
|
+
model: {
|
|
1222
|
+
get() {
|
|
1223
|
+
return this.modelValue;
|
|
1224
|
+
},
|
|
1225
|
+
set(s) {
|
|
1226
|
+
this.$emit("update:modelValue", s);
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
showToggle() {
|
|
1230
|
+
const s = this.options;
|
|
1231
|
+
let e = 0;
|
|
1232
|
+
for (const t of s) {
|
|
1233
|
+
const a = this.itemSpan(t);
|
|
1234
|
+
if (e + a > this.showNumber)
|
|
1235
|
+
return !0;
|
|
1236
|
+
e += a;
|
|
1237
|
+
}
|
|
1238
|
+
return !1;
|
|
1239
|
+
},
|
|
1240
|
+
visibleOptions() {
|
|
1241
|
+
const s = this.options;
|
|
1242
|
+
if (this.isExpanded)
|
|
1243
|
+
return s;
|
|
1244
|
+
const e = [];
|
|
1245
|
+
let t = 0;
|
|
1246
|
+
for (const a of s) {
|
|
1247
|
+
const n = this.itemSpan(a);
|
|
1248
|
+
if (t + n > this.showNumber && e.length > 0)
|
|
1249
|
+
break;
|
|
1250
|
+
e.push(a), t += n;
|
|
1251
|
+
}
|
|
1252
|
+
return e;
|
|
1253
|
+
},
|
|
1254
|
+
wrapperStyle() {
|
|
1255
|
+
return { padding: this.padding, backgroundColor: this.bgColor };
|
|
1256
|
+
},
|
|
1257
|
+
fieldsGridStyle() {
|
|
1258
|
+
return { gridTemplateColumns: `repeat(${this.showNumber}, 1fr)` };
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
methods: {
|
|
1262
|
+
handleSearch() {
|
|
1263
|
+
this.$emit("search", { ...this.model });
|
|
1264
|
+
},
|
|
1265
|
+
handleReset() {
|
|
1266
|
+
const s = {};
|
|
1267
|
+
this.options.forEach((e) => {
|
|
1268
|
+
s[e.prop] = null;
|
|
1269
|
+
}), this.model = s, this.$emit("reset");
|
|
1270
|
+
},
|
|
1271
|
+
toggleExpand() {
|
|
1272
|
+
this.isExpanded = !this.isExpanded;
|
|
1273
|
+
},
|
|
1274
|
+
/** 筛选项占位跨度 — itemSpan 未传默认 1,且不超过 showNumber */
|
|
1275
|
+
itemSpan(s) {
|
|
1276
|
+
return Math.min(this.showNumber, Math.max(1, s.itemSpan || 1));
|
|
1277
|
+
},
|
|
1278
|
+
/** 筛选项占位跨度样式 */
|
|
1279
|
+
fieldSpanStyle(s) {
|
|
1280
|
+
return { gridColumn: `span ${this.itemSpan(s)}` };
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
var wt = function() {
|
|
1285
|
+
var e = this, t = e._self._c;
|
|
1286
|
+
return t("div", { staticClass: "base-search-bar", style: e.wrapperStyle }, [t("SForm", { staticClass: "base-search-bar__form", attrs: { model: e.model } }, [t("div", { staticClass: "base-search-bar__fields", style: e.fieldsGridStyle }, e._l(e.visibleOptions, function(a) {
|
|
1287
|
+
return t("div", { key: a.prop, staticClass: "base-search-bar__field-item", class: { "is-date-range": a.type === "date-range" }, style: e.fieldSpanStyle(a) }, [t("SFormItem", { staticClass: "base-search-bar__form-item", attrs: { label: a.label, prop: a.prop } }, [e.$slots[a.prop] ? e._t(a.prop, null, { item: a, model: e.model }) : a.type === "input" ? t("SInput", { attrs: { placeholder: a.placeholder || "请输入", clearable: a.clearable !== !1 }, model: { value: e.model[a.prop], callback: function(n) {
|
|
1288
|
+
e.$set(e.model, a.prop, n);
|
|
1289
|
+
}, expression: "model[item.prop]" } }) : a.type === "select" ? t("SSelect", { staticStyle: { width: "100%" }, attrs: { placeholder: a.placeholder || "请选择", clearable: a.clearable !== !1 }, model: { value: e.model[a.prop], callback: function(n) {
|
|
1290
|
+
e.$set(e.model, a.prop, n);
|
|
1291
|
+
}, expression: "model[item.prop]" } }, e._l(a.options || [], function(n) {
|
|
1292
|
+
return t("SOption", { key: n.value, attrs: { label: n.label, value: n.value } });
|
|
1293
|
+
}), 1) : a.type === "date" ? t("SDatePicker", { staticStyle: { width: "100%" }, attrs: { type: "date", placeholder: a.placeholder || "请选择日期", "value-format": a.valueFormat || "YYYY-MM-DD", clearable: a.clearable !== !1 }, model: { value: e.model[a.prop], callback: function(n) {
|
|
1294
|
+
e.$set(e.model, a.prop, n);
|
|
1295
|
+
}, expression: "model[item.prop]" } }) : a.type === "date-range" ? t("SDatePicker", { staticStyle: { width: "100%" }, attrs: { type: "daterange", "range-separator": "至", "start-placeholder": a.startPlaceholder || "开始日期", "end-placeholder": a.endPlaceholder || "结束日期", "value-format": a.valueFormat || "YYYY-MM-DD", clearable: a.clearable !== !1 }, model: { value: e.model[a.prop], callback: function(n) {
|
|
1296
|
+
e.$set(e.model, a.prop, n);
|
|
1297
|
+
}, expression: "model[item.prop]" } }) : t("SInput", { attrs: { placeholder: a.placeholder || "请输入", clearable: a.clearable !== !1 }, model: { value: e.model[a.prop], callback: function(n) {
|
|
1298
|
+
e.$set(e.model, a.prop, n);
|
|
1299
|
+
}, expression: "model[item.prop]" } })], 2)], 1);
|
|
1300
|
+
}), 0)]), t("div", { staticClass: "base-search-bar__actions" }, [t("BaseButtonGroup", { attrs: { gap: "8px", wrap: !1, justify: "flex-end" } }, [t("BaseButton", { on: { click: e.handleReset } }, [e._v(" 重置 ")]), t("BaseButton", { attrs: { type: "primary" }, on: { click: e.handleSearch } }, [e._v(" 搜索 ")]), e.showToggle ? t("BaseButton", { staticClass: "base-search-bar__toggle-btn", on: { click: e.toggleExpand }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
1301
|
+
return [t("span", { staticClass: "base-search-bar__toggle-icon", class: { "is-expanded": e.isExpanded } }, [t("SIcon", [t("SArrowDown")], 1)], 1)];
|
|
1302
|
+
}, proxy: !0 }], null, !1, 3698179774) }) : e._e()], 1)], 1)], 1);
|
|
1303
|
+
}, Bt = [];
|
|
1304
|
+
var Tt = /* @__PURE__ */ m(
|
|
1305
|
+
$t,
|
|
1306
|
+
wt,
|
|
1307
|
+
Bt,
|
|
1308
|
+
!1,
|
|
1309
|
+
null,
|
|
1310
|
+
"258a9f50",
|
|
1311
|
+
null,
|
|
1312
|
+
null
|
|
1313
|
+
);
|
|
1314
|
+
const kt = Tt.exports, Ft = [
|
|
1315
|
+
ne,
|
|
1316
|
+
de,
|
|
1317
|
+
he,
|
|
1318
|
+
Te,
|
|
1319
|
+
R,
|
|
1320
|
+
Re,
|
|
1321
|
+
De,
|
|
1322
|
+
Ye,
|
|
1323
|
+
Ke,
|
|
1324
|
+
st,
|
|
1325
|
+
rt,
|
|
1326
|
+
pt,
|
|
1327
|
+
gt,
|
|
1328
|
+
xt,
|
|
1329
|
+
Ct,
|
|
1330
|
+
kt
|
|
1331
|
+
];
|
|
1332
|
+
function Ot(s) {
|
|
1333
|
+
const e = s;
|
|
1334
|
+
e.__saberCompositionApiInstalled || (e.__saberCompositionApiInstalled = !0, s.use(W)), Ft.forEach((t) => {
|
|
1335
|
+
const a = t.name || t.__name;
|
|
1336
|
+
a && s.component(a, t);
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
const At = { install: Ot };
|
|
1340
|
+
export {
|
|
1341
|
+
Te as BaseButton,
|
|
1342
|
+
R as BaseButtonGroup,
|
|
1343
|
+
ne as BaseCard,
|
|
1344
|
+
de as BaseContainer,
|
|
1345
|
+
st as BaseDescriptions,
|
|
1346
|
+
Ye as BaseDialog,
|
|
1347
|
+
he as BaseDivider,
|
|
1348
|
+
pt as BaseMenu,
|
|
1349
|
+
gt as BasePagination,
|
|
1350
|
+
kt as BaseSearchBar,
|
|
1351
|
+
Ke as BaseTable,
|
|
1352
|
+
rt as BaseTabs,
|
|
1353
|
+
Re as BaseTag,
|
|
1354
|
+
De as BaseTitle,
|
|
1355
|
+
Ct as SaberAvueForm,
|
|
1356
|
+
xt as SaberFormTip,
|
|
1357
|
+
At as default,
|
|
1358
|
+
Ot as install
|
|
1359
|
+
};
|