qidian-vue-ui 2.0.16 → 2.0.17
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/components/dict/select/index.vue.mjs +28 -5
- package/dist/components/index.d.ts +1 -0
- package/dist/components/service-dialog-table-select/index.css +10 -10
- package/dist/components/service-dialog-table-select/index.vue.d.ts +1 -1
- package/dist/components/service-dialog-table-select/index.vue.mjs +1 -1
- package/dist/components/service-dialog-table-select/index.vue2.mjs +32 -25
- package/dist/components/service-dialog-tabs-table-select/index.css +10 -10
- package/dist/components/service-dialog-tabs-table-select/index.vue.d.ts +1 -1
- package/dist/components/service-dialog-tabs-table-select/index.vue.mjs +1 -1
- package/dist/components/service-dialog-tabs-table-select/index.vue2.mjs +8 -7
- package/dist/components/service-tree-select/index.css +5 -0
- package/dist/components/service-tree-select/index.d.ts +2 -0
- package/dist/components/service-tree-select/index.vue.d.ts +25 -0
- package/dist/components/service-tree-select/index.vue.mjs +351 -0
- package/dist/components/service-tree-select/index.vue3.mjs +6 -0
- package/dist/components/service-tree-select/props.d.ts +6 -0
- package/dist/components/service-tree-select/props.mjs +9 -0
- package/dist/components/service-tree-select/types.d.ts +18 -0
- package/dist/index.mjs +57 -54
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, mergeDefaults, computed, toRef, createBlock, openBlock, unref, mergeProps, isRef, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, watch } from "vue";
|
|
1
|
+
import { defineComponent, mergeDefaults, computed, toRef, ref, onMounted, onActivated, onDeactivated, createBlock, openBlock, unref, mergeProps, isRef, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, watch } from "vue";
|
|
2
2
|
import { useVModels } from "../../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
3
3
|
import { isEmpty } from "qidian-shared";
|
|
4
4
|
import { Select } from "tdesign-vue-next";
|
|
@@ -153,13 +153,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
153
153
|
const dictType = toRef(props, "dictType");
|
|
154
154
|
let hasAutoSelected = false;
|
|
155
155
|
let unWatchAutoSelected;
|
|
156
|
+
const autofocus = ref(false);
|
|
157
|
+
let autoOpenedOnce = false;
|
|
156
158
|
const reProps = computed(() => {
|
|
157
159
|
const {
|
|
158
160
|
convStr,
|
|
159
161
|
strict,
|
|
160
162
|
modelValue: modelValue2,
|
|
161
163
|
inputValue: inputValue2,
|
|
162
|
-
popupVisible:
|
|
164
|
+
popupVisible: inPopupVisible,
|
|
163
165
|
valueLabel: valueLabel2,
|
|
164
166
|
dictType: dictType2,
|
|
165
167
|
loading,
|
|
@@ -167,6 +169,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
167
169
|
onDefaultSelectFirst,
|
|
168
170
|
dedupe,
|
|
169
171
|
options,
|
|
172
|
+
autofocus: autofocus2,
|
|
173
|
+
onFocus,
|
|
170
174
|
onChange,
|
|
171
175
|
...selectOptions
|
|
172
176
|
} = props;
|
|
@@ -181,7 +185,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
181
185
|
reValueLabel.value = context.option?.[labelKey] || "";
|
|
182
186
|
}
|
|
183
187
|
};
|
|
188
|
+
const reOnFocus = (context) => {
|
|
189
|
+
onFocus?.(context);
|
|
190
|
+
if (autofocus2 && !autoOpenedOnce && !popupVisible.value) {
|
|
191
|
+
autoOpenedOnce = true;
|
|
192
|
+
popupVisible.value = true;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
184
195
|
return {
|
|
196
|
+
autofocus: autofocus2,
|
|
185
197
|
convStr,
|
|
186
198
|
strict,
|
|
187
199
|
dictType: dictType2,
|
|
@@ -192,12 +204,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
192
204
|
options,
|
|
193
205
|
selectOptions: {
|
|
194
206
|
...selectOptions,
|
|
207
|
+
onFocus: reOnFocus,
|
|
195
208
|
onChange: reOnChange
|
|
196
209
|
},
|
|
197
210
|
models: {
|
|
198
211
|
modelValue: modelValue2,
|
|
199
212
|
inputValue: inputValue2,
|
|
200
|
-
popupVisible:
|
|
213
|
+
popupVisible: inPopupVisible
|
|
201
214
|
}
|
|
202
215
|
};
|
|
203
216
|
});
|
|
@@ -239,6 +252,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
239
252
|
}
|
|
240
253
|
}
|
|
241
254
|
setAutoSelectedWatch();
|
|
255
|
+
onMounted(() => {
|
|
256
|
+
autofocus.value = reProps.value.autofocus;
|
|
257
|
+
});
|
|
258
|
+
onActivated(() => {
|
|
259
|
+
autofocus.value = reProps.value.autofocus;
|
|
260
|
+
});
|
|
261
|
+
onDeactivated(() => {
|
|
262
|
+
autofocus.value = false;
|
|
263
|
+
});
|
|
242
264
|
return (_ctx, _cache) => {
|
|
243
265
|
return openBlock(), createBlock(unref(Select), mergeProps({
|
|
244
266
|
modelValue: reModelValue.value,
|
|
@@ -246,7 +268,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
246
268
|
"input-value": unref(inputValue),
|
|
247
269
|
"onUpdate:inputValue": _cache[1] || (_cache[1] = ($event) => isRef(inputValue) ? inputValue.value = $event : null),
|
|
248
270
|
"popup-visible": unref(popupVisible),
|
|
249
|
-
"onUpdate:popupVisible": _cache[2] || (_cache[2] = ($event) => isRef(popupVisible) ? popupVisible.value = $event : null)
|
|
271
|
+
"onUpdate:popupVisible": _cache[2] || (_cache[2] = ($event) => isRef(popupVisible) ? popupVisible.value = $event : null),
|
|
272
|
+
autofocus: autofocus.value
|
|
250
273
|
}, reProps.value.selectOptions, {
|
|
251
274
|
options: reDictOptions.value,
|
|
252
275
|
loading: unref(dictLoading) || reProps.value.loading
|
|
@@ -259,7 +282,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
259
282
|
])
|
|
260
283
|
};
|
|
261
284
|
})
|
|
262
|
-
]), 1040, ["modelValue", "input-value", "popup-visible", "options", "loading"]);
|
|
285
|
+
]), 1040, ["modelValue", "input-value", "popup-visible", "autofocus", "options", "loading"]);
|
|
263
286
|
};
|
|
264
287
|
}
|
|
265
288
|
});
|
|
@@ -22,5 +22,6 @@ export * from './service-dialog-table-select';
|
|
|
22
22
|
export * from './service-dialog-tabs-table-select';
|
|
23
23
|
export * from './service-popup-table-select';
|
|
24
24
|
export * from './service-select';
|
|
25
|
+
export * from './service-tree-select';
|
|
25
26
|
export * from './steps';
|
|
26
27
|
export * from './upload';
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
.qd-dialog-table-select[data-v-
|
|
1
|
+
.qd-dialog-table-select[data-v-3992bc28] {
|
|
2
2
|
width: 100%;
|
|
3
3
|
}
|
|
4
|
-
.qd-dialog-table-select__trigger[data-v-
|
|
4
|
+
.qd-dialog-table-select__trigger[data-v-3992bc28] {
|
|
5
5
|
width: 100%;
|
|
6
6
|
}
|
|
7
|
-
.qd-dialog-table-select__trigger[data-v-
|
|
7
|
+
.qd-dialog-table-select__trigger[data-v-3992bc28]:not(.qd-dialog-table-select__trigger--readonly):not(.qd-dialog-table-select__trigger--disabled) {
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
}
|
|
10
|
-
.qd-dialog-table-select__input-trigger[data-v-
|
|
10
|
+
.qd-dialog-table-select__input-trigger[data-v-3992bc28] {
|
|
11
11
|
border-top-left-radius: 0;
|
|
12
12
|
border-bottom-left-radius: 0;
|
|
13
13
|
}
|
|
14
|
-
.qd-dialog-table-select__table[data-v-
|
|
15
|
-
.qd-dialog-table-select__table[data-v-
|
|
14
|
+
.qd-dialog-table-select__table[data-v-3992bc28] .qd-crud-search > .t-loading__parent > .t-card__body,
|
|
15
|
+
.qd-dialog-table-select__table[data-v-3992bc28] .qd-crud-table__body > .t-loading__parent > .t-card__body {
|
|
16
16
|
padding: 0 !important;
|
|
17
17
|
}
|
|
18
|
-
.qd-dialog-table-select__table[data-v-
|
|
18
|
+
.qd-dialog-table-select__table[data-v-3992bc28] .qd-crud-table__toolbar {
|
|
19
19
|
display: none;
|
|
20
20
|
}
|
|
21
|
-
.qd-dialog-table-select__table[data-v-
|
|
21
|
+
.qd-dialog-table-select__table[data-v-3992bc28] .qd-service-table {
|
|
22
22
|
margin-top: 0;
|
|
23
23
|
}
|
|
24
|
-
.qd-dialog-table-select__table-add[data-v-
|
|
24
|
+
.qd-dialog-table-select__table-add[data-v-3992bc28] {
|
|
25
25
|
margin-top: var(--td-comp-margin-m);
|
|
26
26
|
display: flex;
|
|
27
27
|
}
|
|
28
|
-
.qd-dialog-table-select__table-add .t-input__wrap[data-v-
|
|
28
|
+
.qd-dialog-table-select__table-add .t-input__wrap[data-v-3992bc28] {
|
|
29
29
|
flex: 1 1 0;
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
margin-right: var(--td-comp-margin-m);
|
|
@@ -28,7 +28,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
|
|
|
28
28
|
cancel: (event: MouseEvent) => void;
|
|
29
29
|
confirm: () => Promise<boolean | void>;
|
|
30
30
|
confirmLoading: boolean;
|
|
31
|
-
selectedOptions: D[];
|
|
31
|
+
selectedOptions: import("@vue/reactivity").UnwrapRefSimple<D>[];
|
|
32
32
|
}) => any;
|
|
33
33
|
} & {
|
|
34
34
|
'dialog-footer-extend'?: (props: {}) => any;
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3992bc28"]]);
|
|
6
6
|
export {
|
|
7
7
|
index as default
|
|
8
8
|
};
|
|
@@ -357,7 +357,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
357
357
|
const confirmLoad = ref(false);
|
|
358
358
|
const selectedRowKeys = ref([]);
|
|
359
359
|
const selectedRows = ref([]);
|
|
360
|
-
|
|
360
|
+
const latestSelectedRows = ref([]);
|
|
361
361
|
let lastRowKey;
|
|
362
362
|
const addCustom = reactive({
|
|
363
363
|
visible: false,
|
|
@@ -562,15 +562,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
562
562
|
return change;
|
|
563
563
|
},
|
|
564
564
|
onSingleClick: (rowKeys, options) => {
|
|
565
|
-
latestSelectedRows = cleanEmptyChildren(options.selectedRowData, reProps.value.tableOptions.tree?.childrenKey);
|
|
565
|
+
latestSelectedRows.value = cleanEmptyChildren(options.selectedRowData, reProps.value.tableOptions.tree?.childrenKey);
|
|
566
566
|
},
|
|
567
567
|
onDoubleClick: (rowKeys, options) => {
|
|
568
|
-
latestSelectedRows = cleanEmptyChildren(options.selectedRowData, reProps.value.tableOptions.tree?.childrenKey);
|
|
568
|
+
latestSelectedRows.value = cleanEmptyChildren(options.selectedRowData, reProps.value.tableOptions.tree?.childrenKey);
|
|
569
569
|
handleConfirm();
|
|
570
570
|
}
|
|
571
571
|
});
|
|
572
572
|
async function handleConfirm(done) {
|
|
573
|
-
|
|
573
|
+
const latestRows = latestSelectedRows.value;
|
|
574
|
+
selectedRows.value = latestRows;
|
|
574
575
|
const {
|
|
575
576
|
selectOptions,
|
|
576
577
|
keys
|
|
@@ -578,17 +579,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
578
579
|
const valueKey = keys.value;
|
|
579
580
|
const labelKey = keys.label;
|
|
580
581
|
if (selectOptions.valueType === "value") {
|
|
581
|
-
modelValue.value = selectOptions.multiple ?
|
|
582
|
+
modelValue.value = selectOptions.multiple ? latestRows.map((item) => get(item, valueKey)) : get(latestRows[0], valueKey);
|
|
582
583
|
} else {
|
|
583
|
-
const rows =
|
|
584
|
+
const rows = latestRows.map((item) => ({
|
|
584
585
|
[valueKey]: get(item, valueKey),
|
|
585
586
|
[labelKey]: get(item, labelKey)
|
|
586
587
|
}));
|
|
587
588
|
modelValue.value = selectOptions.multiple ? rows : rows[0];
|
|
588
589
|
}
|
|
589
590
|
const eventParams = [modelValue.value, {
|
|
590
|
-
option:
|
|
591
|
-
selectedOptions:
|
|
591
|
+
option: latestRows[latestRows.length - 1],
|
|
592
|
+
selectedOptions: latestRows,
|
|
592
593
|
trigger: "check"
|
|
593
594
|
}];
|
|
594
595
|
reProps.value.onChange?.(...eventParams);
|
|
@@ -670,22 +671,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
670
671
|
});
|
|
671
672
|
}
|
|
672
673
|
function handleBeforeOpen() {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
674
|
+
syncSelectionFromModel();
|
|
675
|
+
}
|
|
676
|
+
function getModelValueKeys() {
|
|
677
|
+
if (isEmpty(modelValue.value)) return [];
|
|
678
|
+
const valueKey = reProps.value.keys.value;
|
|
679
|
+
const values = identifyType(modelValue.value) === "array" ? modelValue.value : [modelValue.value];
|
|
680
|
+
return values.map((item) => identifyType(item) === "object" ? get(item, valueKey) : item).filter((value) => ["string", "number"].includes(typeof value));
|
|
681
|
+
}
|
|
682
|
+
function syncSelectionFromModel() {
|
|
683
|
+
const keys = getModelValueKeys();
|
|
684
|
+
const valueKey = reProps.value.keys.value;
|
|
685
|
+
const rowMap = /* @__PURE__ */ new Map();
|
|
686
|
+
const rows = [...reProps.value.fillOptions ?? [], ...selectedRows.value, ...data.value ?? []];
|
|
687
|
+
rows.forEach((row) => {
|
|
688
|
+
const key = get(row, valueKey);
|
|
689
|
+
if (typeof key === "string" || typeof key === "number") rowMap.set(key, row);
|
|
690
|
+
});
|
|
691
|
+
selectedRowKeys.value = keys;
|
|
692
|
+
latestSelectedRows.value = keys.map((key) => rowMap.get(key)).filter((row) => !!row);
|
|
689
693
|
}
|
|
690
694
|
function handleClosed() {
|
|
691
695
|
if (addCustom.visible) cancelAddCustom();
|
|
@@ -695,6 +699,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
695
699
|
selectedRowKeys.value = [];
|
|
696
700
|
}
|
|
697
701
|
}
|
|
702
|
+
watch(modelValue, syncSelectionFromModel, {
|
|
703
|
+
deep: true
|
|
704
|
+
});
|
|
698
705
|
watch(markedFillOptions, (fillOpts) => {
|
|
699
706
|
const currentSelected = (selectedRows.value || []).filter((opt) => !opt[QD_FILL_OPTION_MARK]);
|
|
700
707
|
if (!fillOpts?.length) {
|
|
@@ -837,7 +844,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
837
844
|
cancel: handleFooterCancel,
|
|
838
845
|
confirm: () => handleConfirm(),
|
|
839
846
|
confirmLoading: confirmLoad.value,
|
|
840
|
-
selectedOptions:
|
|
847
|
+
selectedOptions: latestSelectedRows.value
|
|
841
848
|
}, void 0, true)]),
|
|
842
849
|
key: "0"
|
|
843
850
|
} : void 0, _ctx.$slots["dialog-footer-extend"] ? {
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
.qd-dialog-tabs-table-select[data-v-
|
|
1
|
+
.qd-dialog-tabs-table-select[data-v-1461ff61] {
|
|
2
2
|
width: 100%;
|
|
3
3
|
}
|
|
4
|
-
.qd-dialog-tabs-table-select__trigger[data-v-
|
|
4
|
+
.qd-dialog-tabs-table-select__trigger[data-v-1461ff61] {
|
|
5
5
|
width: 100%;
|
|
6
6
|
}
|
|
7
|
-
.qd-dialog-tabs-table-select__trigger[data-v-
|
|
7
|
+
.qd-dialog-tabs-table-select__trigger[data-v-1461ff61]:not(.qd-dialog-tabs-table-select__trigger--readonly):not(.qd-dialog-tabs-table-select__trigger--disabled) {
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
}
|
|
10
|
-
.qd-dialog-tabs-table-select__input-trigger[data-v-
|
|
10
|
+
.qd-dialog-tabs-table-select__input-trigger[data-v-1461ff61] {
|
|
11
11
|
border-top-left-radius: 0;
|
|
12
12
|
border-bottom-left-radius: 0;
|
|
13
13
|
}
|
|
14
|
-
.qd-dialog-tabs-table-select__table[data-v-
|
|
14
|
+
.qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-crud-search > .t-loading__parent > .t-card__body {
|
|
15
15
|
padding-left: 0 !important;
|
|
16
16
|
padding-right: 0 !important;
|
|
17
17
|
padding-bottom: 0 !important;
|
|
18
18
|
}
|
|
19
|
-
.qd-dialog-tabs-table-select__table[data-v-
|
|
19
|
+
.qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-crud-table__body > .t-loading__parent > .t-card__body {
|
|
20
20
|
padding-left: 0 !important;
|
|
21
21
|
padding-right: 0 !important;
|
|
22
22
|
padding-bottom: 0 !important;
|
|
23
23
|
}
|
|
24
|
-
.qd-dialog-tabs-table-select__table[data-v-
|
|
24
|
+
.qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-crud-table__toolbar {
|
|
25
25
|
display: none;
|
|
26
26
|
}
|
|
27
|
-
.qd-dialog-tabs-table-select__table[data-v-
|
|
27
|
+
.qd-dialog-tabs-table-select__table[data-v-1461ff61] .qd-service-table {
|
|
28
28
|
margin-top: 0;
|
|
29
29
|
}
|
|
30
|
-
.qd-dialog-tabs-table-select__table-add[data-v-
|
|
30
|
+
.qd-dialog-tabs-table-select__table-add[data-v-1461ff61] {
|
|
31
31
|
margin-top: var(--td-comp-margin-m);
|
|
32
32
|
display: flex;
|
|
33
33
|
}
|
|
34
|
-
.qd-dialog-tabs-table-select__table-add .t-input__wrap[data-v-
|
|
34
|
+
.qd-dialog-tabs-table-select__table-add .t-input__wrap[data-v-1461ff61] {
|
|
35
35
|
flex: 1 1 0;
|
|
36
36
|
overflow: hidden;
|
|
37
37
|
margin-right: var(--td-comp-margin-m);
|
|
@@ -23,7 +23,7 @@ declare const _default: <D extends TableRowData = TableRowData, R = unknown, P =
|
|
|
23
23
|
cancel: (event: MouseEvent) => void;
|
|
24
24
|
confirm: () => Promise<boolean | void>;
|
|
25
25
|
confirmLoading: boolean;
|
|
26
|
-
selectedOptions: D[];
|
|
26
|
+
selectedOptions: import("@vue/reactivity").UnwrapRefSimple<D>[];
|
|
27
27
|
activeTab: import("tdesign-vue-next").TabValue | undefined;
|
|
28
28
|
}) => any;
|
|
29
29
|
} & {
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1461ff61"]]);
|
|
6
6
|
export {
|
|
7
7
|
index as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import { defineComponent, mergeDefaults, ref, useTemplateRef, computed,
|
|
2
|
+
import { defineComponent, mergeDefaults, ref, useTemplateRef, computed, reactive, h, watch, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, mergeProps, unref, renderSlot, createBlock, withCtx, renderList, createTextVNode, toDisplayString, isRef, createSlots, normalizeProps, guardReactiveProps, nextTick } from "vue";
|
|
3
3
|
import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
4
4
|
import { useDoubleClick, isEmpty, identifyType, suspectedWrapperPromise, createExposeProxy, extractSlotsWithPrefix, hasOwn } from "qidian-shared";
|
|
5
5
|
import { AddIcon, SearchIcon } from "tdesign-icons-vue-next";
|
|
@@ -517,7 +517,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
517
517
|
const confirmLoad2 = ref(false);
|
|
518
518
|
const selectedRowKeys2 = ref([]);
|
|
519
519
|
const selectedRows2 = ref([]);
|
|
520
|
-
const latestSelectedRows2 =
|
|
520
|
+
const latestSelectedRows2 = ref([]);
|
|
521
521
|
const lastRowKey2 = ref(void 0);
|
|
522
522
|
const addCustom2 = reactive({
|
|
523
523
|
visible: false,
|
|
@@ -740,7 +740,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
async function handleConfirm2(done) {
|
|
743
|
-
|
|
743
|
+
const latestRows = latestSelectedRows2.value;
|
|
744
|
+
selectedRows2.value = latestRows;
|
|
744
745
|
const {
|
|
745
746
|
selectOptions,
|
|
746
747
|
keys
|
|
@@ -748,17 +749,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
748
749
|
const valueKey = keys.value;
|
|
749
750
|
const labelKey = keys.label;
|
|
750
751
|
if (selectOptions.valueType === "value") {
|
|
751
|
-
modelValue2.value = selectOptions.multiple ?
|
|
752
|
+
modelValue2.value = selectOptions.multiple ? latestRows.map((item) => get(item, valueKey)) : get(latestRows[0], valueKey);
|
|
752
753
|
} else {
|
|
753
|
-
const rows =
|
|
754
|
+
const rows = latestRows.map((item) => ({
|
|
754
755
|
[valueKey]: get(item, valueKey),
|
|
755
756
|
[labelKey]: get(item, labelKey)
|
|
756
757
|
}));
|
|
757
758
|
modelValue2.value = selectOptions.multiple ? rows : rows[0];
|
|
758
759
|
}
|
|
759
760
|
const eventParams = [modelValue2.value, {
|
|
760
|
-
option:
|
|
761
|
-
selectedOptions:
|
|
761
|
+
option: latestRows[latestRows.length - 1],
|
|
762
|
+
selectedOptions: latestRows,
|
|
762
763
|
trigger: "check"
|
|
763
764
|
}];
|
|
764
765
|
reProps2.value.onChange?.(...eventParams);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ServicePageParams } from 'qidian-shared';
|
|
2
|
+
import type { TreeOptionData, TreeSelectValue } from 'tdesign-vue-next';
|
|
3
|
+
import type { QdServiceTreeSelectInstanceFunctions, QdServiceTreeSelectProps } from './types';
|
|
4
|
+
declare const _default: <D extends TreeOptionData = TreeOptionData, R = unknown, P = ServicePageParams, TP = P>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
|
+
readonly "onUpdate:modelValue"?: ((args_0: TreeSelectValue | undefined) => any) | undefined;
|
|
7
|
+
readonly "onUpdate:data"?: ((args_0: D[] | undefined) => any) | undefined;
|
|
8
|
+
readonly "onUpdate:valueLabel"?: ((args_0: string | string[] | undefined) => any) | undefined;
|
|
9
|
+
readonly "onUpdate:inputValue"?: ((args_0: string | undefined) => any) | undefined;
|
|
10
|
+
readonly "onUpdate:popupVisible"?: ((args_0: boolean | undefined) => any) | undefined;
|
|
11
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:data" | "onUpdate:valueLabel" | "onUpdate:inputValue" | "onUpdate:popupVisible"> & QdServiceTreeSelectProps<D, R, P, TP> & Partial<{}>> & import("vue").PublicProps;
|
|
12
|
+
expose(exposed: import("vue").ShallowUnwrapRef<QdServiceTreeSelectInstanceFunctions<D_1, R_1, P_1, TP_1>>): void;
|
|
13
|
+
attrs: any;
|
|
14
|
+
slots: {
|
|
15
|
+
[x: string]: ((props: any) => any) | undefined;
|
|
16
|
+
[x: number]: ((props: any) => any) | undefined;
|
|
17
|
+
};
|
|
18
|
+
emit: ((evt: "update:modelValue", args_0: TreeSelectValue | undefined) => void) & ((evt: "update:data", args_0: D[] | undefined) => void) & ((evt: "update:valueLabel", args_0: string | string[] | undefined) => void) & ((evt: "update:inputValue", args_0: string | undefined) => void) & ((evt: "update:popupVisible", args_0: boolean | undefined) => void);
|
|
19
|
+
}>) => import("vue").VNode & {
|
|
20
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_PrettifyLocal<T> = {
|
|
24
|
+
[K in keyof T]: T[K];
|
|
25
|
+
} & {};
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import './index.css'
|
|
2
|
+
import { defineComponent, mergeDefaults, ref, computed, watch, onMounted, onActivated, onDeactivated, createBlock, openBlock, unref, mergeProps, isRef, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
3
|
+
import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
4
|
+
import { useServiceLoadMore } from "qidian-shared";
|
|
5
|
+
import { TreeSelect } from "tdesign-vue-next";
|
|
6
|
+
import { qdServiceTreeSelectProps } from "./props.mjs";
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{
|
|
9
|
+
name: "QdServiceTreeSelect"
|
|
10
|
+
},
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
13
|
+
data: {},
|
|
14
|
+
autofocus: { type: Boolean },
|
|
15
|
+
onlyLeaf: { type: Boolean },
|
|
16
|
+
valueLabel: {},
|
|
17
|
+
tree: {},
|
|
18
|
+
transformParams: { type: Function },
|
|
19
|
+
transformRes: { type: Function },
|
|
20
|
+
autoWidth: { type: Boolean },
|
|
21
|
+
borderless: { type: Boolean },
|
|
22
|
+
clearable: { type: Boolean },
|
|
23
|
+
collapsedItems: {},
|
|
24
|
+
disabled: { type: Boolean },
|
|
25
|
+
empty: {},
|
|
26
|
+
filter: { type: Function },
|
|
27
|
+
filterable: { type: Boolean },
|
|
28
|
+
inputProps: {},
|
|
29
|
+
inputValue: {},
|
|
30
|
+
defaultInputValue: {},
|
|
31
|
+
keys: {},
|
|
32
|
+
loading: { type: Boolean },
|
|
33
|
+
loadingText: {},
|
|
34
|
+
max: {},
|
|
35
|
+
minCollapsedNum: {},
|
|
36
|
+
multiple: { type: Boolean },
|
|
37
|
+
panelBottomContent: {},
|
|
38
|
+
panelTopContent: {},
|
|
39
|
+
placeholder: {},
|
|
40
|
+
popupProps: {},
|
|
41
|
+
popupVisible: { type: Boolean },
|
|
42
|
+
prefixIcon: {},
|
|
43
|
+
readonly: { type: Boolean },
|
|
44
|
+
selectInputProps: {},
|
|
45
|
+
size: {},
|
|
46
|
+
suffix: {},
|
|
47
|
+
suffixIcon: {},
|
|
48
|
+
tagProps: {},
|
|
49
|
+
treeProps: {},
|
|
50
|
+
value: {},
|
|
51
|
+
defaultValue: {},
|
|
52
|
+
modelValue: {},
|
|
53
|
+
valueDisplay: {},
|
|
54
|
+
valueType: {},
|
|
55
|
+
onBlur: { type: Function },
|
|
56
|
+
onChange: { type: Function },
|
|
57
|
+
onClear: { type: Function },
|
|
58
|
+
onFocus: { type: Function },
|
|
59
|
+
onInputChange: { type: Function },
|
|
60
|
+
onPopupVisibleChange: { type: Function },
|
|
61
|
+
onRemove: { type: Function },
|
|
62
|
+
onSearch: { type: Function },
|
|
63
|
+
onBefore: { type: Function },
|
|
64
|
+
onAfter: { type: Function },
|
|
65
|
+
onSuccess: { type: Function },
|
|
66
|
+
onError: { type: Function },
|
|
67
|
+
service: { type: Function },
|
|
68
|
+
manual: { type: Boolean }
|
|
69
|
+
}, qdServiceTreeSelectProps),
|
|
70
|
+
emits: ["update:modelValue", "update:valueLabel", "update:inputValue", "update:popupVisible", "update:data"],
|
|
71
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
72
|
+
const props = __props;
|
|
73
|
+
const emit = __emit;
|
|
74
|
+
const { modelValue, valueLabel, inputValue, popupVisible, data } = useVModels(props, emit, {
|
|
75
|
+
passive: true
|
|
76
|
+
});
|
|
77
|
+
const nodeLabelMap = /* @__PURE__ */ new Map();
|
|
78
|
+
const loadingNodes = /* @__PURE__ */ new Map();
|
|
79
|
+
const autofocus = ref(false);
|
|
80
|
+
let autoOpenedOnce = false;
|
|
81
|
+
const reProps = computed(() => {
|
|
82
|
+
const {
|
|
83
|
+
service,
|
|
84
|
+
manual,
|
|
85
|
+
transformParams,
|
|
86
|
+
transformRes,
|
|
87
|
+
onBefore,
|
|
88
|
+
onAfter,
|
|
89
|
+
onSuccess,
|
|
90
|
+
onError,
|
|
91
|
+
tree,
|
|
92
|
+
onlyLeaf,
|
|
93
|
+
valueLabel: valueLabel2,
|
|
94
|
+
modelValue: modelValue2,
|
|
95
|
+
inputValue: inputValue2,
|
|
96
|
+
popupVisible: inPopupVisible,
|
|
97
|
+
data: data2,
|
|
98
|
+
loading: loading2,
|
|
99
|
+
filterable,
|
|
100
|
+
filter,
|
|
101
|
+
autofocus: inAutofocus,
|
|
102
|
+
inputProps,
|
|
103
|
+
treeProps,
|
|
104
|
+
onFocus,
|
|
105
|
+
onChange,
|
|
106
|
+
...treeSelectOptions
|
|
107
|
+
} = props;
|
|
108
|
+
const reOnFocus = (context) => {
|
|
109
|
+
onFocus?.(context);
|
|
110
|
+
if (inAutofocus && !autoOpenedOnce && !popupVisible.value) {
|
|
111
|
+
autoOpenedOnce = true;
|
|
112
|
+
popupVisible.value = true;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const reOnChange = (value, context) => {
|
|
116
|
+
onChange?.(value, context);
|
|
117
|
+
syncValueLabel(value, context);
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
externalLoading: loading2,
|
|
121
|
+
tree,
|
|
122
|
+
onlyLeaf,
|
|
123
|
+
treeSelectOptions: {
|
|
124
|
+
...treeSelectOptions,
|
|
125
|
+
filterable,
|
|
126
|
+
filter: filter || (filterable && onlyLeaf ? filterOnlyLeafTree : void 0),
|
|
127
|
+
inputProps: {
|
|
128
|
+
...inputProps,
|
|
129
|
+
autofocus: autofocus.value
|
|
130
|
+
},
|
|
131
|
+
treeProps: tree?.lazyLoad ? {
|
|
132
|
+
...treeProps,
|
|
133
|
+
label: onlyLeaf ? renderTreeLabel : treeProps?.label,
|
|
134
|
+
lazy: true,
|
|
135
|
+
load: (node) => loadTreeChildren(node)
|
|
136
|
+
} : onlyLeaf ? { ...treeProps, label: renderTreeLabel } : treeProps,
|
|
137
|
+
onFocus: reOnFocus,
|
|
138
|
+
onChange: reOnChange
|
|
139
|
+
},
|
|
140
|
+
serviceOptions: {
|
|
141
|
+
service,
|
|
142
|
+
manual,
|
|
143
|
+
transformParams,
|
|
144
|
+
transformRes,
|
|
145
|
+
onBefore,
|
|
146
|
+
onAfter,
|
|
147
|
+
onSuccess,
|
|
148
|
+
onError
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
const lazyLoad = computed(() => props.tree?.lazyLoad);
|
|
153
|
+
const maxLevel = computed(() => props.tree?.maxLevel);
|
|
154
|
+
const normalizedData = computed(() => normalizeTree(data.value || []));
|
|
155
|
+
const {
|
|
156
|
+
firstLoad,
|
|
157
|
+
loading,
|
|
158
|
+
error,
|
|
159
|
+
refresh: requestRefresh,
|
|
160
|
+
refreshAsync: requestRefreshAsync,
|
|
161
|
+
cancel
|
|
162
|
+
} = useServiceLoadMore({
|
|
163
|
+
...reProps.value.serviceOptions,
|
|
164
|
+
pagination: false,
|
|
165
|
+
onSuccess: (res) => {
|
|
166
|
+
reProps.value.serviceOptions.onSuccess?.(res);
|
|
167
|
+
data.value = res.list;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const treeSelectLoading = computed(() => reProps.value.externalLoading || loading.value);
|
|
171
|
+
function getTreeKeys() {
|
|
172
|
+
const keys = props.keys;
|
|
173
|
+
return {
|
|
174
|
+
value: keys?.value || "value",
|
|
175
|
+
label: keys?.label || "label",
|
|
176
|
+
children: keys?.children || "children"
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function canLazyLoad(level) {
|
|
180
|
+
return lazyLoad.value && (maxLevel.value === void 0 || level < maxLevel.value);
|
|
181
|
+
}
|
|
182
|
+
function renderTreeLabel(createElement, node) {
|
|
183
|
+
const label = props.treeProps?.label;
|
|
184
|
+
const content = typeof label === "function" ? label(createElement, node) : typeof label === "string" ? label : label === false ? null : node.label;
|
|
185
|
+
const children = node.getChildren(false);
|
|
186
|
+
const leaf = children !== true && (!Array.isArray(children) || children.length === 0);
|
|
187
|
+
return createElement(
|
|
188
|
+
"span",
|
|
189
|
+
{ class: { "qd-service-tree-select__label--disabled": !leaf } },
|
|
190
|
+
content
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
function isTreeNodeMatched(filterWords, node) {
|
|
194
|
+
const label = node.data[getTreeKeys().label];
|
|
195
|
+
return String(label ?? "").toLowerCase().includes(filterWords);
|
|
196
|
+
}
|
|
197
|
+
function hasMatchedTreeNodeChildren(filterWords, node) {
|
|
198
|
+
const children = node.getChildren(true);
|
|
199
|
+
return Array.isArray(children) && children.some((child) => isTreeNodeMatched(filterWords, child));
|
|
200
|
+
}
|
|
201
|
+
function filterOnlyLeafTree(filterWords, node) {
|
|
202
|
+
const keyword = filterWords.trim().toLowerCase();
|
|
203
|
+
const matched = isTreeNodeMatched(keyword, node);
|
|
204
|
+
const hasMatchedChildren = hasMatchedTreeNodeChildren(keyword, node);
|
|
205
|
+
if (matched || hasMatchedChildren) return true;
|
|
206
|
+
return node.getParents().some(
|
|
207
|
+
(parent) => isTreeNodeMatched(keyword, parent) && !hasMatchedTreeNodeChildren(keyword, parent)
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
function normalizeTree(items, level = 0) {
|
|
211
|
+
const { children: childrenKey } = getTreeKeys();
|
|
212
|
+
return items.map((item) => {
|
|
213
|
+
const children = item[childrenKey];
|
|
214
|
+
const normalizedChildren = Array.isArray(children) ? normalizeTree(children, level + 1) : children === true ? canLazyLoad(level) ? true : [] : children === void 0 && canLazyLoad(level) ? true : children;
|
|
215
|
+
const leaf = normalizedChildren !== true && (!Array.isArray(normalizedChildren) || normalizedChildren.length === 0);
|
|
216
|
+
const normalizedItem = {
|
|
217
|
+
...item,
|
|
218
|
+
[childrenKey]: normalizedChildren
|
|
219
|
+
};
|
|
220
|
+
if (!props.onlyLeaf) return normalizedItem;
|
|
221
|
+
if (props.multiple) return { ...normalizedItem, checkable: leaf };
|
|
222
|
+
return { ...normalizedItem, activable: leaf };
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function registerNodeLabels(items) {
|
|
226
|
+
const { value: valueKey, label: labelKey, children: childrenKey } = getTreeKeys();
|
|
227
|
+
items.forEach((item) => {
|
|
228
|
+
const label = item[labelKey];
|
|
229
|
+
if (typeof label === "string" || typeof label === "number") {
|
|
230
|
+
nodeLabelMap.set(item[valueKey], String(label));
|
|
231
|
+
}
|
|
232
|
+
const children = item[childrenKey];
|
|
233
|
+
if (Array.isArray(children)) registerNodeLabels(children);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function getValueLabel(value) {
|
|
237
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
238
|
+
const label = value[getTreeKeys().label];
|
|
239
|
+
return typeof label === "string" || typeof label === "number" ? String(label) : "";
|
|
240
|
+
}
|
|
241
|
+
return nodeLabelMap.get(value) || "";
|
|
242
|
+
}
|
|
243
|
+
function syncValueLabel(value, context) {
|
|
244
|
+
if (props.multiple) {
|
|
245
|
+
valueLabel.value = Array.isArray(value) ? value.map(getValueLabel).filter(Boolean) : [];
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const label = context.data?.[getTreeKeys().label];
|
|
249
|
+
valueLabel.value = typeof label === "string" || typeof label === "number" ? String(label) : getValueLabel(value);
|
|
250
|
+
}
|
|
251
|
+
function setTreeNodeState(node, state) {
|
|
252
|
+
const loadNode = node;
|
|
253
|
+
if (loadNode.set) {
|
|
254
|
+
loadNode.set(state);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
node.setData({ ...node.data, ...state });
|
|
258
|
+
}
|
|
259
|
+
async function requestTreeChildren(node) {
|
|
260
|
+
const { service, treeProps } = props;
|
|
261
|
+
const tree = reProps.value.tree;
|
|
262
|
+
let records;
|
|
263
|
+
if (!service) {
|
|
264
|
+
records = await treeProps?.load?.(node) || [];
|
|
265
|
+
} else {
|
|
266
|
+
const params = tree?.transformParams ? await tree.transformParams(node) : node;
|
|
267
|
+
const res = await service(params);
|
|
268
|
+
const transformed = tree?.transformRes ? await tree.transformRes(res, node) : res;
|
|
269
|
+
records = transformed?.records || [];
|
|
270
|
+
}
|
|
271
|
+
const children = normalizeTree(records, node.getLevel() + 1);
|
|
272
|
+
registerNodeLabels(children);
|
|
273
|
+
if (!children.length && props.onlyLeaf) {
|
|
274
|
+
setTreeNodeState(node, props.multiple ? { checkable: true } : { activable: true });
|
|
275
|
+
}
|
|
276
|
+
return children;
|
|
277
|
+
}
|
|
278
|
+
function loadTreeChildren(node) {
|
|
279
|
+
const nodeKey = node.value;
|
|
280
|
+
const pending = loadingNodes.get(nodeKey);
|
|
281
|
+
if (pending) return pending;
|
|
282
|
+
const request = requestTreeChildren(node);
|
|
283
|
+
loadingNodes.set(nodeKey, request);
|
|
284
|
+
return request.catch((err) => {
|
|
285
|
+
setTreeNodeState(node, { loading: false });
|
|
286
|
+
throw err;
|
|
287
|
+
}).finally(() => {
|
|
288
|
+
loadingNodes.delete(nodeKey);
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function refresh() {
|
|
292
|
+
if (!props.service) return;
|
|
293
|
+
requestRefresh();
|
|
294
|
+
}
|
|
295
|
+
function refreshAsync() {
|
|
296
|
+
if (!props.service) return;
|
|
297
|
+
return requestRefreshAsync();
|
|
298
|
+
}
|
|
299
|
+
const expose = {
|
|
300
|
+
firstLoad,
|
|
301
|
+
loading,
|
|
302
|
+
error,
|
|
303
|
+
refresh,
|
|
304
|
+
refreshAsync,
|
|
305
|
+
cancel
|
|
306
|
+
};
|
|
307
|
+
watch(
|
|
308
|
+
() => [data.value, props.keys],
|
|
309
|
+
([items]) => {
|
|
310
|
+
nodeLabelMap.clear();
|
|
311
|
+
registerNodeLabels(items || []);
|
|
312
|
+
},
|
|
313
|
+
{ immediate: true, deep: true }
|
|
314
|
+
);
|
|
315
|
+
onMounted(() => {
|
|
316
|
+
autofocus.value = props.autofocus;
|
|
317
|
+
});
|
|
318
|
+
onActivated(() => {
|
|
319
|
+
autofocus.value = props.autofocus;
|
|
320
|
+
});
|
|
321
|
+
onDeactivated(() => {
|
|
322
|
+
autofocus.value = false;
|
|
323
|
+
});
|
|
324
|
+
__expose(expose);
|
|
325
|
+
return (_ctx, _cache) => {
|
|
326
|
+
return openBlock(), createBlock(unref(TreeSelect), mergeProps({
|
|
327
|
+
class: "qd-service-tree-select",
|
|
328
|
+
modelValue: unref(modelValue),
|
|
329
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
|
|
330
|
+
"input-value": unref(inputValue),
|
|
331
|
+
"onUpdate:inputValue": _cache[1] || (_cache[1] = ($event) => isRef(inputValue) ? inputValue.value = $event : null),
|
|
332
|
+
"popup-visible": unref(popupVisible),
|
|
333
|
+
"onUpdate:popupVisible": _cache[2] || (_cache[2] = ($event) => isRef(popupVisible) ? popupVisible.value = $event : null),
|
|
334
|
+
data: normalizedData.value,
|
|
335
|
+
loading: treeSelectLoading.value
|
|
336
|
+
}, reProps.value.treeSelectOptions), createSlots({ _: 2 }, [
|
|
337
|
+
renderList(_ctx.$slots, (_, name) => {
|
|
338
|
+
return {
|
|
339
|
+
name,
|
|
340
|
+
fn: withCtx((slotProps) => [
|
|
341
|
+
renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))
|
|
342
|
+
])
|
|
343
|
+
};
|
|
344
|
+
})
|
|
345
|
+
]), 1040, ["modelValue", "input-value", "popup-visible", "data", "loading"]);
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
export {
|
|
350
|
+
_sfc_main as default
|
|
351
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ServicePageLoadMoreOptions, ServicePageParams, ServicePageRes, useServiceLoadMore } from 'qidian-shared';
|
|
2
|
+
import type { TdTreeSelectProps, TreeNodeModel, TreeOptionData } from 'tdesign-vue-next';
|
|
3
|
+
export interface QdServiceTreeSelectTreeOptions<D extends TreeOptionData = TreeOptionData, R = unknown, TP = TreeNodeModel<D>> {
|
|
4
|
+
lazyLoad?: boolean;
|
|
5
|
+
maxLevel?: number;
|
|
6
|
+
transformParams?: (node: TreeNodeModel<D>) => TP | Promise<TP>;
|
|
7
|
+
transformRes?: (res: R, node: TreeNodeModel<D>) => ServicePageRes<D> | Promise<ServicePageRes<D>>;
|
|
8
|
+
}
|
|
9
|
+
export interface QdServiceTreeSelectProps<D extends TreeOptionData = TreeOptionData, R = unknown, P = ServicePageParams, TP = P> extends TdTreeSelectProps<D>, Omit<ServicePageLoadMoreOptions<D, R, P, TP, false>, 'pagination' | 'transformParams' | 'transformRes'> {
|
|
10
|
+
data?: D[];
|
|
11
|
+
autofocus?: boolean;
|
|
12
|
+
onlyLeaf?: boolean;
|
|
13
|
+
valueLabel?: string | string[];
|
|
14
|
+
tree?: QdServiceTreeSelectTreeOptions<D, R, TP>;
|
|
15
|
+
transformParams?: (params: undefined) => TP | Promise<TP>;
|
|
16
|
+
transformRes?: (res: R) => ServicePageRes<D> | Promise<ServicePageRes<D>>;
|
|
17
|
+
}
|
|
18
|
+
export type QdServiceTreeSelectInstanceFunctions<D extends TreeOptionData = TreeOptionData, R = unknown, P = ServicePageParams, TP = P> = Pick<ReturnType<typeof useServiceLoadMore<D, R, P, TP, false>>, 'firstLoad' | 'loading' | 'error' | 'refresh' | 'refreshAsync' | 'cancel'>;
|
package/dist/index.mjs
CHANGED
|
@@ -11,45 +11,47 @@ import { default as default8 } from "./components/import-dialog/index.vue.mjs";
|
|
|
11
11
|
import { default as default9 } from "./components/input-number/index.vue.mjs";
|
|
12
12
|
import { default as default10 } from "./components/org/select/index.vue.mjs";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { default as default11 } from "./components/
|
|
15
|
-
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
14
|
+
import { default as default11 } from "./components/service-tree-select/index.vue.mjs";
|
|
15
|
+
/* empty css */
|
|
16
|
+
import { default as default12 } from "./components/auto-tooltip/index.vue.mjs";
|
|
17
|
+
import { default as default13 } from "./components/avatar/index.vue.mjs";
|
|
18
|
+
import { default as default14 } from "./components/card/index.vue.mjs";
|
|
19
|
+
import { default as default15 } from "./components/columns-controller/index.vue.mjs";
|
|
18
20
|
import { useConfig } from "./components/config-provider/useConfig.mjs";
|
|
19
21
|
import { QdConfigProvider } from "./components/config-provider/index.mjs";
|
|
20
22
|
import { qdAsyncCompute, qdCompute, qdUseComputeValue } from "./components/config-renderer/compute.mjs";
|
|
21
23
|
import { getValueByPath, parseVModelPath, resolveVModelBinding, setValueByPath } from "./components/config-renderer/utils.mjs";
|
|
22
24
|
import { defineQdCrudList, defineQdCrudTable, defineQdCrudTabsTable } from "./components/crud/define.mjs";
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
25
|
+
import { default as default16 } from "./components/crud/list/index.vue.mjs";
|
|
26
|
+
import { default as default17 } from "./components/crud/search/index.vue.mjs";
|
|
27
|
+
import { default as default18 } from "./components/crud/table/index.vue.mjs";
|
|
28
|
+
import { default as default19 } from "./components/crud/tabs-table/index.vue.mjs";
|
|
29
|
+
import { default as default20 } from "./components/dict/checkbox-group/index.vue.mjs";
|
|
30
|
+
import { default as default21 } from "./components/dict/radio-group/index.vue.mjs";
|
|
31
|
+
import { default as default22 } from "./components/dict/tag/index.vue.mjs";
|
|
32
|
+
import { default as default23 } from "./components/file-icon/index.vue.mjs";
|
|
31
33
|
import { PROVIDE_FORM_ADD_AFTER_SUBMIT_QUEUE, PROVIDE_FORM_ADD_BEFORE_SUBMIT_QUEUE, PROVIDE_FORM_RESET_QUEUE } from "./components/form/config.mjs";
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
+
import { default as default24 } from "./components/form/index.vue.mjs";
|
|
35
|
+
import { default as default25 } from "./components/form/item.vue.mjs";
|
|
34
36
|
import { qdFormGrid, qdFormGutter } from "./components/form/props.mjs";
|
|
35
37
|
import { PROVIDE_GRID_ITEM_PROPS_KEY, PROVIDE_GRID_WIDTH_KEY } from "./components/grid/config.mjs";
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
38
|
+
import { default as default26 } from "./components/grid/index.vue.mjs";
|
|
39
|
+
import { default as default27 } from "./components/grid/item.vue.mjs";
|
|
40
|
+
import { default as default28 } from "./components/left-ribbon-tag/index.vue.mjs";
|
|
41
|
+
import { default as default29 } from "./components/org/tag/index.vue.mjs";
|
|
42
|
+
import { default as default30 } from "./components/read-write/index.vue.mjs";
|
|
43
|
+
import { default as default31 } from "./components/service/list/index.vue.mjs";
|
|
44
|
+
import { default as default32 } from "./components/service/table/index.vue.mjs";
|
|
45
|
+
import { default as default33 } from "./components/service-dialog-table-select/index.vue.mjs";
|
|
44
46
|
import { defineQdServiceDialogTableSelect } from "./components/service-dialog-table-select/define.mjs";
|
|
45
|
-
import { default as
|
|
47
|
+
import { default as default34 } from "./components/service-dialog-tabs-table-select/index.vue.mjs";
|
|
46
48
|
import { defineQdServiceDialogTabsTableSelect } from "./components/service-dialog-tabs-table-select/define.mjs";
|
|
47
|
-
import { default as
|
|
49
|
+
import { default as default35 } from "./components/service-popup-table-select/index.vue.mjs";
|
|
48
50
|
import { defineQdServicePopupTableSelect } from "./components/service-popup-table-select/define.mjs";
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
+
import { default as default36 } from "./components/service-select/index.vue.mjs";
|
|
52
|
+
import { default as default37 } from "./components/steps/index.vue.mjs";
|
|
51
53
|
import { qdUploadAcceptMap } from "./components/upload/config.mjs";
|
|
52
|
-
import { default as
|
|
54
|
+
import { default as default38 } from "./components/upload/index.vue.mjs";
|
|
53
55
|
import { hasPermi, hasPermiDirective } from "./directive/hasPermi.mjs";
|
|
54
56
|
import { hasRole, hasRoleDirective } from "./directive/hasRole.mjs";
|
|
55
57
|
import { useAgentChat } from "./hooks/useAgentChat/index.mjs";
|
|
@@ -70,43 +72,44 @@ export {
|
|
|
70
72
|
PROVIDE_FORM_RESET_QUEUE,
|
|
71
73
|
PROVIDE_GRID_ITEM_PROPS_KEY,
|
|
72
74
|
PROVIDE_GRID_WIDTH_KEY,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
default12 as QdAutoTooltip,
|
|
76
|
+
default13 as QdAvatar,
|
|
77
|
+
default14 as QdCard,
|
|
78
|
+
default15 as QdColumnsController,
|
|
77
79
|
QdConfigProvider,
|
|
78
80
|
default2 as QdConfigRenderer,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
default16 as QdCrudList,
|
|
82
|
+
default17 as QdCrudSearch,
|
|
83
|
+
default18 as QdCrudTable,
|
|
84
|
+
default19 as QdCrudTabsTable,
|
|
83
85
|
default4 as QdDialog,
|
|
84
86
|
default3 as QdDialogForm,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
default20 as QdDictCheckboxGroup,
|
|
88
|
+
default21 as QdDictRadioGroup,
|
|
87
89
|
default5 as QdDictSelect,
|
|
88
|
-
|
|
90
|
+
default22 as QdDictTag,
|
|
89
91
|
default6 as QdDrawer,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
default23 as QdFileIcon,
|
|
93
|
+
default24 as QdForm,
|
|
94
|
+
default25 as QdFormItem,
|
|
95
|
+
default26 as QdGrid,
|
|
96
|
+
default27 as QdGridItem,
|
|
95
97
|
default7 as QdImage,
|
|
96
98
|
default8 as QdImportDialog,
|
|
97
99
|
default9 as QdInputNumber,
|
|
98
|
-
|
|
100
|
+
default28 as QdLeftRibbonTag,
|
|
99
101
|
default10 as QdOrgSelect,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
default37 as
|
|
102
|
+
default29 as QdOrgTag,
|
|
103
|
+
default30 as QdReadWrite,
|
|
104
|
+
default33 as QdServiceDialogTableSelect,
|
|
105
|
+
default34 as QdServiceDialogTabsTableSelect,
|
|
106
|
+
default31 as QdServiceList,
|
|
107
|
+
default35 as QdServicePopupTableSelect,
|
|
108
|
+
default36 as QdServiceSelect,
|
|
109
|
+
default32 as QdServiceTable,
|
|
110
|
+
default11 as QdServiceTreeSelect,
|
|
111
|
+
default37 as QdSteps,
|
|
112
|
+
default38 as QdUpload,
|
|
110
113
|
auth,
|
|
111
114
|
defineQdCrudList,
|
|
112
115
|
defineQdCrudTable,
|