@dazhicheng/ui 1.6.79 → 1.6.81
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/api/supplier.d.ts +16 -0
- package/dist/api/supplier.js +39 -12
- package/dist/assets/svg/download.svg.js +1 -1
- package/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-button/index.d.ts +28 -28
- package/dist/components/tt-button/index.vue.d.ts +16 -16
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +5 -5
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +3 -3
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +7 -7
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +1 -1
- package/dist/components/tt-drawer/index.d.ts +109 -109
- package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +60 -60
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-empty/index.d.ts +4 -4
- package/dist/components/tt-form/src/components/FormElInput.vue.d.ts +10 -10
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-image/index.d.ts +29 -29
- package/dist/components/tt-image/src/components/ImageViewer.d.ts +20 -20
- package/dist/components/tt-image/tt-image.d.ts +29 -29
- package/dist/components/tt-input-textarea/index.vue.d.ts +40 -40
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal/index.d.ts +150 -150
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +42 -42
- package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +17 -17
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +5 -5
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +133 -122
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +77 -66
- package/dist/components/tt-panel-select/src/hooks/usePanelData.d.ts +2 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +14 -14
- package/dist/components/tt-panel-select/src/index.vue.d.ts +7 -5
- package/dist/components/tt-panel-select/src/index.vue.js +300 -219
- package/dist/components/tt-panel-select/src/types.d.ts +12 -0
- package/dist/components/tt-table/index.js +6 -5
- package/dist/components/tt-table/src/TableForm.vue.js +3 -2
- package/dist/components/tt-table/src/hooks/useQuery.js +52 -50
- package/dist/components/tt-upload/index.d.ts +60 -60
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +37 -37
- package/dist/components/tt-upload/src/typing.d.ts +17 -17
- package/dist/hooks/basicDataCodes.d.ts +5 -0
- package/dist/hooks/basicDataCodes.js +61 -60
- package/dist/hooks/missingOptionsCache.d.ts +53 -0
- package/dist/hooks/missingOptionsCache.js +133 -0
- package/dist/hooks/panelSelectEchoFields.d.ts +12 -0
- package/dist/hooks/panelSelectEchoFields.js +46 -0
- package/dist/hooks/useBasicDataOptions.d.ts +2 -0
- package/dist/hooks/useBasicDataOptions.js +85 -78
- package/dist/hooks/useDataPermissionOptions.d.ts +10 -0
- package/dist/hooks/useDataPermissionOptions.js +83 -66
- package/dist/hooks/useFormSchemasLink.js +240 -194
- package/dist/hooks/usePanelSelectSchemas.d.ts +11 -0
- package/dist/hooks/usePanelSelectSchemas.js +158 -122
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as ne, useTemplateRef as
|
|
1
|
+
import { defineComponent as ne, useTemplateRef as U, ref as w, computed as m, watch as M, nextTick as z, createElementBlock as d, openBlock as n, normalizeClass as s, createElementVNode as y, createCommentVNode as I, createVNode as h, createBlock as P, unref as i, withKeys as ie, withCtx as c, createTextVNode as $, normalizeStyle as H, Fragment as V, renderList as E, toDisplayString as F } from "vue";
|
|
2
2
|
import { TtButton as ue } from "../../../tt-button/index.js";
|
|
3
|
-
import { TtText as
|
|
3
|
+
import { TtText as S } from "../../../tt-text/index.js";
|
|
4
4
|
import { Search as de } from "@element-plus/icons-vue";
|
|
5
5
|
import { useResizeObserver as ce } from "@vueuse/core";
|
|
6
|
-
import { ElInput as fe, ElIcon as pe, ElCheckbox as
|
|
6
|
+
import { ElInput as fe, ElIcon as pe, ElCheckbox as D, ElScrollbar as he } from "element-plus";
|
|
7
7
|
import { DEFAULT_PANEL_SELECT_SEPARATORS as ve, splitPanelSelectText as me } from "../common.js";
|
|
8
|
-
const we = ["data-virtual-index", "data-flash-seed"], Y = 2,
|
|
8
|
+
const we = ["data-virtual-index", "data-flash-seed"], Y = 2, Se = /* @__PURE__ */ ne({
|
|
9
9
|
name: "PanelMiddle",
|
|
10
10
|
__name: "PanelMiddle",
|
|
11
11
|
props: {
|
|
@@ -31,26 +31,26 @@ const we = ["data-virtual-index", "data-flash-seed"], Y = 2, $e = /* @__PURE__ *
|
|
|
31
31
|
middlePlaceholder: {}
|
|
32
32
|
},
|
|
33
33
|
emits: ["update:keyword", "checkAll", "allCheck", "groupCheck", "optionCheck", "optionsCheck", "selectCreatedOptions"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
34
|
+
setup(l, { expose: W, emit: j }) {
|
|
35
|
+
const t = l, f = j, g = U("scrollbarRef"), x = U("searchInputRef"), J = w(), T = w(0), G = w(0), C = w(""), b = w(), K = w(0), R = w(!1);
|
|
36
36
|
let B;
|
|
37
|
-
const Q =
|
|
37
|
+
const Q = m(() => t.rows.length * t.rowHeight), X = m(() => Math.max(1, Math.ceil(G.value / t.rowHeight))), k = m(() => Math.max(0, Math.floor(T.value / t.rowHeight) - Y)), Z = m(() => Math.min(t.rows.length, k.value + X.value + Y * 2)), _ = m(() => k.value * t.rowHeight), ee = m(() => t.rows.slice(k.value, Z.value)), le = m(() => {
|
|
38
38
|
var e;
|
|
39
|
-
return ((e =
|
|
40
|
-
}), te =
|
|
41
|
-
() =>
|
|
39
|
+
return ((e = t.rows[0]) == null ? void 0 : e.type) === "group";
|
|
40
|
+
}), te = m(
|
|
41
|
+
() => t.rows.filter((e) => e.type === "options").flatMap((e) => e.options).filter((e) => !e.disabled)
|
|
42
42
|
);
|
|
43
43
|
M(
|
|
44
|
-
() =>
|
|
44
|
+
() => t.keyword,
|
|
45
45
|
(e) => {
|
|
46
|
-
|
|
46
|
+
C.value = e;
|
|
47
47
|
},
|
|
48
48
|
{ immediate: !0 }
|
|
49
49
|
);
|
|
50
50
|
function A() {
|
|
51
51
|
var a;
|
|
52
52
|
const e = (a = g.value) == null ? void 0 : a.wrapRef;
|
|
53
|
-
e && (J.value = e,
|
|
53
|
+
e && (J.value = e, G.value = e.clientHeight, T.value = e.scrollTop);
|
|
54
54
|
}
|
|
55
55
|
ce(
|
|
56
56
|
() => {
|
|
@@ -59,104 +59,104 @@ const we = ["data-virtual-index", "data-flash-seed"], Y = 2, $e = /* @__PURE__ *
|
|
|
59
59
|
},
|
|
60
60
|
() => A()
|
|
61
61
|
);
|
|
62
|
-
function
|
|
62
|
+
function L() {
|
|
63
63
|
var a;
|
|
64
64
|
const e = (a = g.value) == null ? void 0 : a.wrapRef;
|
|
65
65
|
e && (T.value = e.scrollTop);
|
|
66
66
|
}
|
|
67
67
|
function ae(e) {
|
|
68
|
-
b.value = void 0,
|
|
68
|
+
b.value = void 0, K.value += 1, requestAnimationFrame(() => {
|
|
69
69
|
b.value = e, B && clearTimeout(B), B = setTimeout(() => {
|
|
70
70
|
b.value = void 0;
|
|
71
71
|
}, 1400);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
async function
|
|
75
|
-
var
|
|
76
|
-
await
|
|
77
|
-
const a =
|
|
74
|
+
async function N(e) {
|
|
75
|
+
var p;
|
|
76
|
+
await z(), A();
|
|
77
|
+
const a = t.rows.findIndex((r) => r.type === "group" && r.group.value === e);
|
|
78
78
|
if (a < 0) return;
|
|
79
|
-
const o = a *
|
|
80
|
-
(
|
|
81
|
-
|
|
79
|
+
const o = a * t.rowHeight;
|
|
80
|
+
(p = g.value) == null || p.setScrollTop(o), requestAnimationFrame(() => {
|
|
81
|
+
L(), ae(e);
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function oe(e) {
|
|
85
|
-
var
|
|
86
|
-
if (
|
|
85
|
+
var O;
|
|
86
|
+
if (t.disabled)
|
|
87
87
|
return;
|
|
88
88
|
e.preventDefault();
|
|
89
|
-
const a = ((
|
|
90
|
-
|
|
89
|
+
const a = ((O = e.clipboardData) == null ? void 0 : O.getData("text")) || "";
|
|
90
|
+
C.value = a.trim(), t.pasteSearch ? f("update:keyword", C.value) : (R.value = !0, requestAnimationFrame(() => {
|
|
91
91
|
R.value = !1;
|
|
92
92
|
}));
|
|
93
|
-
const o = me(a,
|
|
93
|
+
const o = me(a, t.separator), p = () => {
|
|
94
94
|
requestAnimationFrame(() => {
|
|
95
|
-
var
|
|
96
|
-
const u = (
|
|
95
|
+
var q;
|
|
96
|
+
const u = (q = x.value) == null ? void 0 : q.input;
|
|
97
97
|
u == null || u.focus(), u == null || u.select();
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
if (!o.length) {
|
|
101
|
-
|
|
101
|
+
p();
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
const r = new Set(o),
|
|
105
|
-
if (!
|
|
106
|
-
|
|
104
|
+
const r = new Set(o), v = te.value.filter((u) => r.has(u.label) || r.has(String(u.value))).map((u) => u.value);
|
|
105
|
+
if (!v.length) {
|
|
106
|
+
p();
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
109
|
+
if (t.multiple) {
|
|
110
|
+
f("optionsCheck", v, !0), p();
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
f("optionCheck", v.at(-1), !0), p();
|
|
114
114
|
}
|
|
115
115
|
function re(e) {
|
|
116
|
-
|
|
116
|
+
C.value = e, !R.value && f("update:keyword", e);
|
|
117
117
|
}
|
|
118
118
|
function se(e) {
|
|
119
119
|
var a;
|
|
120
|
-
!
|
|
120
|
+
!t.allowCreate || t.disabled || e.isComposing || (a = x.value) != null && a.isComposing || (e.preventDefault(), e.stopPropagation(), f("update:keyword", C.value), f("selectCreatedOptions"));
|
|
121
121
|
}
|
|
122
122
|
return M(
|
|
123
|
-
() =>
|
|
123
|
+
() => t.scrollToGroupValue,
|
|
124
124
|
async (e) => {
|
|
125
|
-
e !== void 0 && await
|
|
125
|
+
e !== void 0 && await N(e);
|
|
126
126
|
},
|
|
127
127
|
{ flush: "post" }
|
|
128
128
|
), M(
|
|
129
|
-
() =>
|
|
129
|
+
() => t.rows.length,
|
|
130
130
|
async () => {
|
|
131
|
-
await
|
|
131
|
+
await z(), A();
|
|
132
132
|
},
|
|
133
133
|
{ immediate: !0 }
|
|
134
134
|
), W({
|
|
135
|
-
scrollToGroup:
|
|
135
|
+
scrollToGroup: N,
|
|
136
136
|
inputFocus: () => {
|
|
137
137
|
var e, a;
|
|
138
138
|
(a = (e = x.value) == null ? void 0 : e.focus) == null || a.call(e);
|
|
139
139
|
}
|
|
140
|
-
}), (e, a) => (
|
|
141
|
-
class:
|
|
140
|
+
}), (e, a) => (n(), d("div", {
|
|
141
|
+
class: s(`${l.prefixCls}__list`)
|
|
142
142
|
}, [
|
|
143
|
-
|
|
144
|
-
class:
|
|
143
|
+
y("div", {
|
|
144
|
+
class: s(`${l.prefixCls}__toolbar`)
|
|
145
145
|
}, [
|
|
146
146
|
h(i(fe), {
|
|
147
147
|
ref_key: "searchInputRef",
|
|
148
148
|
ref: x,
|
|
149
|
-
"model-value":
|
|
150
|
-
class:
|
|
151
|
-
placeholder:
|
|
149
|
+
"model-value": C.value,
|
|
150
|
+
class: s(`${l.prefixCls}__search`),
|
|
151
|
+
placeholder: t.allowCreate ? `${t.middlePlaceholder}(可创建)` : t.middlePlaceholder,
|
|
152
152
|
clearable: "",
|
|
153
153
|
"onUpdate:modelValue": re,
|
|
154
154
|
onPaste: oe,
|
|
155
155
|
onKeydown: ie(se, ["enter"])
|
|
156
156
|
}, {
|
|
157
|
-
prefix:
|
|
157
|
+
prefix: c(() => [
|
|
158
158
|
h(i(pe), null, {
|
|
159
|
-
default:
|
|
159
|
+
default: c(() => [
|
|
160
160
|
h(i(de))
|
|
161
161
|
]),
|
|
162
162
|
_: 1
|
|
@@ -164,122 +164,133 @@ const we = ["data-virtual-index", "data-flash-seed"], Y = 2, $e = /* @__PURE__ *
|
|
|
164
164
|
]),
|
|
165
165
|
_: 1
|
|
166
166
|
}, 8, ["model-value", "class", "placeholder"]),
|
|
167
|
-
|
|
167
|
+
l.multiple && l.showMultiple ? (n(), P(i(ue), {
|
|
168
168
|
key: 0,
|
|
169
|
-
disabled:
|
|
169
|
+
disabled: l.disabled,
|
|
170
170
|
plain: "",
|
|
171
|
-
onClick: a[0] || (a[0] = () =>
|
|
171
|
+
onClick: a[0] || (a[0] = () => f("checkAll", !0))
|
|
172
172
|
}, {
|
|
173
|
-
default:
|
|
174
|
-
|
|
173
|
+
default: c(() => [...a[2] || (a[2] = [
|
|
174
|
+
y("span", null, "全选", -1)
|
|
175
175
|
])]),
|
|
176
176
|
_: 1
|
|
177
|
-
}, 8, ["disabled"])) :
|
|
177
|
+
}, 8, ["disabled"])) : I("", !0)
|
|
178
178
|
], 2),
|
|
179
|
-
|
|
179
|
+
t.showAll ? (n(), d("div", {
|
|
180
180
|
key: 0,
|
|
181
|
-
class:
|
|
181
|
+
class: s([`${l.prefixCls}__panel-head`, le.value ? "is-standalone" : ""])
|
|
182
182
|
}, [
|
|
183
|
-
h(i(
|
|
184
|
-
disabled:
|
|
185
|
-
"model-value":
|
|
186
|
-
onChange: a[1] || (a[1] = (o) =>
|
|
183
|
+
h(i(D), {
|
|
184
|
+
disabled: l.disabled,
|
|
185
|
+
"model-value": t.allChecked,
|
|
186
|
+
onChange: a[1] || (a[1] = (o) => f("allCheck", !!o))
|
|
187
187
|
}, {
|
|
188
|
-
default:
|
|
189
|
-
h(i(
|
|
190
|
-
default:
|
|
191
|
-
|
|
188
|
+
default: c(() => [
|
|
189
|
+
h(i(S), null, {
|
|
190
|
+
default: c(() => [...a[3] || (a[3] = [
|
|
191
|
+
$("全部", -1)
|
|
192
192
|
])]),
|
|
193
193
|
_: 1
|
|
194
194
|
})
|
|
195
195
|
]),
|
|
196
196
|
_: 1
|
|
197
197
|
}, 8, ["disabled", "model-value"])
|
|
198
|
-
], 2)) :
|
|
199
|
-
|
|
200
|
-
class:
|
|
198
|
+
], 2)) : I("", !0),
|
|
199
|
+
y("div", {
|
|
200
|
+
class: s(`${l.prefixCls}__checkbox-group`)
|
|
201
201
|
}, [
|
|
202
202
|
h(i(he), {
|
|
203
203
|
ref_key: "scrollbarRef",
|
|
204
204
|
ref: g,
|
|
205
|
-
class:
|
|
206
|
-
onScroll:
|
|
205
|
+
class: s(`${l.prefixCls}__middle-scrollbar`),
|
|
206
|
+
onScroll: L
|
|
207
207
|
}, {
|
|
208
|
-
default:
|
|
209
|
-
|
|
210
|
-
class:
|
|
211
|
-
style:
|
|
208
|
+
default: c(() => [
|
|
209
|
+
y("div", {
|
|
210
|
+
class: s(`${l.prefixCls}__middle-virtual-host`),
|
|
211
|
+
style: H({ height: `${Q.value}px` })
|
|
212
212
|
}, [
|
|
213
|
-
|
|
214
|
-
style:
|
|
213
|
+
y("div", {
|
|
214
|
+
style: H({ transform: `translateY(${_.value}px)` })
|
|
215
215
|
}, [
|
|
216
|
-
(
|
|
216
|
+
(n(!0), d(V, null, E(ee.value, (o, p) => (n(), d("div", {
|
|
217
217
|
key: o.key,
|
|
218
|
-
style:
|
|
219
|
-
class:
|
|
220
|
-
`${
|
|
221
|
-
o.type === "group" ? `${
|
|
218
|
+
style: H({ height: `${l.rowHeight}px` }),
|
|
219
|
+
class: s([
|
|
220
|
+
`${l.prefixCls}__middle-row`,
|
|
221
|
+
o.type === "group" ? `${l.prefixCls}__middle-group` : `${l.prefixCls}__middle-options`,
|
|
222
222
|
o.type === "options" && o.isLast ? "is-last" : "",
|
|
223
|
-
o.type === "options" &&
|
|
224
|
-
b.value === o.group.value ? `${
|
|
223
|
+
o.type === "options" && k.value + p === 0 && !t.showAll ? "is-first" : "",
|
|
224
|
+
b.value === o.group.value ? `${l.prefixCls}__group-flash` : ""
|
|
225
225
|
]),
|
|
226
|
-
"data-virtual-index":
|
|
227
|
-
"data-flash-seed":
|
|
226
|
+
"data-virtual-index": k.value + p,
|
|
227
|
+
"data-flash-seed": K.value
|
|
228
228
|
}, [
|
|
229
|
-
o.type === "group" ? (
|
|
229
|
+
o.type === "group" ? (n(), d("div", {
|
|
230
230
|
key: 0,
|
|
231
|
-
class:
|
|
231
|
+
class: s(`${l.prefixCls}__panel-head`)
|
|
232
232
|
}, [
|
|
233
|
-
|
|
233
|
+
t.multiple ? (n(), P(i(D), {
|
|
234
234
|
key: 0,
|
|
235
|
-
"model-value":
|
|
236
|
-
indeterminate:
|
|
237
|
-
disabled:
|
|
238
|
-
onChange: (r) =>
|
|
235
|
+
"model-value": l.groupCheckedMap[String(o.group.value)],
|
|
236
|
+
indeterminate: l.groupIndeterminateMap[String(o.group.value)],
|
|
237
|
+
disabled: l.disabled,
|
|
238
|
+
onChange: (r) => f("groupCheck", o.group.value, !!r)
|
|
239
239
|
}, {
|
|
240
|
-
default:
|
|
241
|
-
h(i(
|
|
242
|
-
default:
|
|
243
|
-
|
|
240
|
+
default: c(() => [
|
|
241
|
+
h(i(S), null, {
|
|
242
|
+
default: c(() => [
|
|
243
|
+
$(F(o.group.label), 1)
|
|
244
244
|
]),
|
|
245
245
|
_: 2
|
|
246
246
|
}, 1024)
|
|
247
247
|
]),
|
|
248
248
|
_: 2
|
|
249
|
-
}, 1032, ["model-value", "indeterminate", "disabled", "onChange"])) : (
|
|
250
|
-
default:
|
|
251
|
-
|
|
249
|
+
}, 1032, ["model-value", "indeterminate", "disabled", "onChange"])) : (n(), P(i(S), { key: 1 }, {
|
|
250
|
+
default: c(() => [
|
|
251
|
+
$(F(o.group.label), 1)
|
|
252
252
|
]),
|
|
253
253
|
_: 2
|
|
254
254
|
}, 1024))
|
|
255
|
-
], 2)) : (
|
|
255
|
+
], 2)) : (n(), d("div", {
|
|
256
256
|
key: 1,
|
|
257
|
-
class:
|
|
257
|
+
class: s(`${l.prefixCls}__option-row`)
|
|
258
258
|
}, [
|
|
259
|
-
(
|
|
259
|
+
(n(!0), d(V, null, E(o.options, (r) => (n(), d("div", {
|
|
260
260
|
key: r.value,
|
|
261
|
-
class:
|
|
261
|
+
class: s(`${l.prefixCls}__option-cell`)
|
|
262
262
|
}, [
|
|
263
|
-
h(i(
|
|
264
|
-
"model-value":
|
|
265
|
-
disabled:
|
|
266
|
-
class:
|
|
267
|
-
onChange: (
|
|
263
|
+
h(i(D), {
|
|
264
|
+
"model-value": t.selectedValueSet.has(r.value),
|
|
265
|
+
disabled: l.disabled || r.disabled,
|
|
266
|
+
class: s(`${l.prefixCls}__option`),
|
|
267
|
+
onChange: (v) => f("optionCheck", r.value, !!v)
|
|
268
268
|
}, {
|
|
269
|
-
default:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
269
|
+
default: c(() => {
|
|
270
|
+
var v;
|
|
271
|
+
return [
|
|
272
|
+
y("span", {
|
|
273
|
+
class: s(`${l.prefixCls}__option-label`)
|
|
274
|
+
}, [
|
|
275
|
+
h(i(S), { "tool-tip-line": 2 }, {
|
|
276
|
+
default: c(() => [
|
|
277
|
+
$(F(r.label), 1)
|
|
278
|
+
]),
|
|
279
|
+
_: 2
|
|
280
|
+
}, 1024),
|
|
281
|
+
r.deleted === !0 || ((v = r.raw) == null ? void 0 : v.deleted) === !0 ? (n(), d("span", {
|
|
282
|
+
key: 0,
|
|
283
|
+
class: s(`${l.prefixCls}__deleted-mark`)
|
|
284
|
+
}, " 删 ", 2)) : I("", !0)
|
|
285
|
+
], 2)
|
|
286
|
+
];
|
|
287
|
+
}),
|
|
277
288
|
_: 2
|
|
278
289
|
}, 1032, ["model-value", "disabled", "class", "onChange"])
|
|
279
290
|
], 2))), 128)),
|
|
280
|
-
(
|
|
291
|
+
(n(!0), d(V, null, E(l.optionPerRow - o.options.length, (r) => (n(), d("div", {
|
|
281
292
|
key: `empty-${o.key}-${r}`,
|
|
282
|
-
class:
|
|
293
|
+
class: s(`${l.prefixCls}__option-cell`)
|
|
283
294
|
}, null, 2))), 128))
|
|
284
295
|
], 2))
|
|
285
296
|
], 14, we))), 128))
|
|
@@ -293,5 +304,5 @@ const we = ["data-virtual-index", "data-flash-seed"], Y = 2, $e = /* @__PURE__ *
|
|
|
293
304
|
}
|
|
294
305
|
});
|
|
295
306
|
export {
|
|
296
|
-
|
|
307
|
+
Se as default
|
|
297
308
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { TtButton as
|
|
4
|
-
import { TtIcon as
|
|
5
|
-
import { TtText as
|
|
6
|
-
import { useResizeObserver as
|
|
7
|
-
import { ElScrollbar as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as N, ref as x, computed as r, watch as I, nextTick as A, createElementBlock as n, openBlock as i, normalizeClass as a, createElementVNode as m, createVNode as c, unref as o, withCtx as h, createTextVNode as $, normalizeStyle as g, Fragment as P, renderList as Y, createCommentVNode as k, toDisplayString as _ } from "vue";
|
|
2
|
+
import R from "../../../../assets/svg/close.svg.js";
|
|
3
|
+
import { TtButton as D } from "../../../tt-button/index.js";
|
|
4
|
+
import { TtIcon as T } from "../../../tt-icon/index.js";
|
|
5
|
+
import { TtText as F } from "../../../tt-text/index.js";
|
|
6
|
+
import { useResizeObserver as L } from "@vueuse/core";
|
|
7
|
+
import { ElScrollbar as j } from "element-plus";
|
|
8
|
+
const u = 34, O = 8, Z = /* @__PURE__ */ N({
|
|
9
9
|
name: "PanelRight",
|
|
10
10
|
__name: "PanelRight",
|
|
11
11
|
props: {
|
|
@@ -15,92 +15,103 @@ const r = 34, R = 8, X = /* @__PURE__ */ V({
|
|
|
15
15
|
disabled: { type: Boolean }
|
|
16
16
|
},
|
|
17
17
|
emits: ["clearAll", "remove"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
() => Math.min(
|
|
21
|
-
),
|
|
18
|
+
setup(e, { emit: S }) {
|
|
19
|
+
const d = e, C = S, f = x(), v = x(0), b = x(0), z = r(() => d.selectedOptions.length * u), B = r(() => Math.max(1, Math.ceil(b.value / u))), p = r(() => Math.max(0, Math.floor(v.value / u) - O)), E = r(
|
|
20
|
+
() => Math.min(d.selectedOptions.length, p.value + B.value + O * 2)
|
|
21
|
+
), M = r(() => p.value * u), V = r(() => d.selectedOptions.slice(p.value, E.value));
|
|
22
22
|
function w() {
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
var t;
|
|
24
|
+
const l = (t = f.value) == null ? void 0 : t.wrapRef;
|
|
25
|
+
l && (b.value = l.clientHeight, v.value = l.scrollTop);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
var
|
|
29
|
-
const
|
|
30
|
-
|
|
27
|
+
function H() {
|
|
28
|
+
var t;
|
|
29
|
+
const l = (t = f.value) == null ? void 0 : t.wrapRef;
|
|
30
|
+
l && (v.value = l.scrollTop);
|
|
31
31
|
}
|
|
32
|
-
return
|
|
33
|
-
() =>
|
|
32
|
+
return I(
|
|
33
|
+
() => d.selectedOptions.length,
|
|
34
34
|
async () => {
|
|
35
|
-
await
|
|
35
|
+
await A(), w();
|
|
36
36
|
},
|
|
37
37
|
{ immediate: !0 }
|
|
38
|
-
),
|
|
38
|
+
), L(
|
|
39
39
|
() => {
|
|
40
|
-
var
|
|
41
|
-
return (
|
|
40
|
+
var l;
|
|
41
|
+
return (l = f.value) == null ? void 0 : l.wrapRef;
|
|
42
42
|
},
|
|
43
43
|
() => w()
|
|
44
|
-
), (
|
|
45
|
-
class:
|
|
44
|
+
), (l, t) => (i(), n("div", {
|
|
45
|
+
class: a(`${e.prefixCls}__right`)
|
|
46
46
|
}, [
|
|
47
|
-
|
|
48
|
-
class:
|
|
47
|
+
m("div", {
|
|
48
|
+
class: a(`${e.prefixCls}__selected-actions`)
|
|
49
49
|
}, [
|
|
50
|
-
|
|
51
|
-
disabled:
|
|
50
|
+
c(o(D), {
|
|
51
|
+
disabled: e.disabled,
|
|
52
52
|
class: "w-full",
|
|
53
53
|
plain: "",
|
|
54
|
-
onClick:
|
|
54
|
+
onClick: t[0] || (t[0] = (s) => C("clearAll"))
|
|
55
55
|
}, {
|
|
56
56
|
default: h(() => [
|
|
57
|
-
|
|
57
|
+
c(o(T), {
|
|
58
58
|
class: "mr-[4px]",
|
|
59
59
|
size: 14,
|
|
60
60
|
"is-custom-svg": "",
|
|
61
|
-
icon:
|
|
61
|
+
icon: o(R)
|
|
62
62
|
}, null, 8, ["icon"]),
|
|
63
|
-
|
|
63
|
+
t[1] || (t[1] = $(" 取消选择 ", -1))
|
|
64
64
|
]),
|
|
65
65
|
_: 1
|
|
66
66
|
}, 8, ["disabled"])
|
|
67
67
|
], 2),
|
|
68
|
-
|
|
68
|
+
c(o(j), {
|
|
69
69
|
ref_key: "scrollbarRef",
|
|
70
|
-
ref:
|
|
71
|
-
class:
|
|
72
|
-
onScroll:
|
|
70
|
+
ref: f,
|
|
71
|
+
class: a(`${e.prefixCls}__selected-list ${e.prefixCls}__right-scrollbar`),
|
|
72
|
+
onScroll: H
|
|
73
73
|
}, {
|
|
74
74
|
default: h(() => [
|
|
75
|
-
|
|
76
|
-
style: g({ height: `${
|
|
75
|
+
m("div", {
|
|
76
|
+
style: g({ height: `${z.value}px` })
|
|
77
77
|
}, [
|
|
78
|
-
|
|
79
|
-
style: g({ transform: `translateY(${
|
|
78
|
+
m("div", {
|
|
79
|
+
style: g({ transform: `translateY(${M.value}px)` })
|
|
80
80
|
}, [
|
|
81
|
-
(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
default: h(() => [
|
|
88
|
-
y(Y(a.label), 1)
|
|
89
|
-
]),
|
|
90
|
-
_: 2
|
|
91
|
-
}, 1024),
|
|
92
|
-
!t.disabled && !a.disabled ? (m(), d("span", {
|
|
93
|
-
key: 0,
|
|
94
|
-
class: n(`${t.prefixCls}__selected-item-close`)
|
|
81
|
+
(i(!0), n(P, null, Y(V.value, (s) => {
|
|
82
|
+
var y;
|
|
83
|
+
return i(), n("div", {
|
|
84
|
+
key: s.value,
|
|
85
|
+
style: g({ height: `${u}px` }),
|
|
86
|
+
class: a(`${e.prefixCls}__selected-item`)
|
|
95
87
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
88
|
+
m("span", {
|
|
89
|
+
class: a(`${e.prefixCls}__selected-item-label`)
|
|
90
|
+
}, [
|
|
91
|
+
c(o(F), null, {
|
|
92
|
+
default: h(() => [
|
|
93
|
+
$(_(s.label), 1)
|
|
94
|
+
]),
|
|
95
|
+
_: 2
|
|
96
|
+
}, 1024),
|
|
97
|
+
s.deleted === !0 || ((y = s.raw) == null ? void 0 : y.deleted) === !0 ? (i(), n("span", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: a(`${e.prefixCls}__deleted-mark`)
|
|
100
|
+
}, " 删 ", 2)) : k("", !0)
|
|
101
|
+
], 2),
|
|
102
|
+
!e.disabled && !s.disabled ? (i(), n("span", {
|
|
103
|
+
key: 0,
|
|
104
|
+
class: a(`${e.prefixCls}__selected-item-close`)
|
|
105
|
+
}, [
|
|
106
|
+
c(o(T), {
|
|
107
|
+
size: 14,
|
|
108
|
+
"is-custom-svg": "",
|
|
109
|
+
icon: o(R),
|
|
110
|
+
onClick: (q) => C("remove", s.value)
|
|
111
|
+
}, null, 8, ["icon", "onClick"])
|
|
112
|
+
], 2)) : k("", !0)
|
|
113
|
+
], 6);
|
|
114
|
+
}), 128))
|
|
104
115
|
], 4)
|
|
105
116
|
], 4)
|
|
106
117
|
]),
|
|
@@ -110,5 +121,5 @@ const r = 34, R = 8, X = /* @__PURE__ */ V({
|
|
|
110
121
|
}
|
|
111
122
|
});
|
|
112
123
|
export {
|
|
113
|
-
|
|
124
|
+
Z as default
|
|
114
125
|
};
|