@dazhicheng/ui 1.5.199 → 1.5.202
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/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/api/dataTypeContext.js +17 -0
- package/dist/assets/img/empty_images/no_data.png.js +4 -0
- package/dist/assets/img/empty_images/search.png.js +4 -0
- package/dist/assets/img/image_status/develop.png.js +4 -0
- package/dist/assets/img/image_status/loading.gif.js +4 -0
- package/dist/assets/img/image_status/loading_fail.png.js +4 -0
- package/dist/assets/img/image_status/no_network.png.js +4 -0
- package/dist/assets/img/image_status/no_permission.png.js +4 -0
- package/dist/assets/svg/RiRefreshLine.svg.js +4 -0
- package/dist/assets/svg/action_more.svg.js +4 -0
- package/dist/assets/svg/add.svg.js +4 -0
- package/dist/assets/svg/addCircleLine.svg.js +4 -0
- package/dist/assets/svg/arrowDown.svg.js +4 -0
- package/dist/assets/svg/arrowLineDown.svg.js +5 -0
- package/dist/assets/svg/arrowSUp.svg.js +4 -0
- package/dist/assets/svg/arrowUp.svg.js +4 -0
- package/dist/assets/svg/close.svg.js +4 -0
- package/dist/assets/svg/columnSet.svg.js +4 -0
- package/dist/assets/svg/determinateCircleLine.svg.js +5 -0
- package/dist/assets/svg/drag.svg.js +5 -0
- package/dist/assets/svg/exportSvg.svg.js +4 -0
- package/dist/assets/svg/fileSvg.svg.js +4 -0
- package/dist/assets/svg/help.svg.js +4 -0
- package/dist/assets/svg/item_error.svg.js +4 -0
- package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
- package/dist/assets/svg/paixu-moren.svg.js +4 -0
- package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
- package/dist/assets/svg/quanping.svg.js +4 -0
- package/dist/assets/svg/suoxiao.svg.js +4 -0
- package/dist/components/tt-api-component/index.js +7 -0
- package/dist/components/tt-api-component/index.vue.js +7 -0
- package/dist/components/tt-api-component/index.vue2.js +199 -0
- package/dist/components/tt-area/TtArea.vue.js +7 -0
- package/dist/components/tt-area/TtArea.vue3.js +36 -0
- package/dist/components/tt-button/components/AddButton.vue.js +24 -0
- package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
- package/dist/components/tt-button/index.js +9 -0
- package/dist/components/tt-button/index.vue.js +7 -0
- package/dist/components/tt-button/index.vue2.js +68 -0
- package/dist/components/tt-checkbox/index.js +7 -0
- package/dist/components/tt-checkbox/index.vue.js +77 -0
- package/dist/components/tt-checkbox/index.vue2.js +4 -0
- package/dist/components/tt-drawer/index.js +14 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +157 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
- package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
- package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
- package/dist/components/tt-drawer/src/index.js +17 -0
- package/dist/components/tt-drawer/src/props.js +72 -0
- package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
- package/dist/components/tt-empty/index.js +34 -0
- package/dist/components/tt-form/index.js +59 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
- package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
- package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
- package/dist/components/tt-form/src/components/Slot.js +28 -0
- package/dist/components/tt-form/src/config.js +57 -0
- package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
- package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
- package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
- package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
- package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
- package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
- package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
- package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
- package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
- package/dist/components/tt-form/src/form/useFormField.js +24 -0
- package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +345 -0
- package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +101 -0
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
- package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
- package/dist/components/tt-form/src/form-render/context.js +15 -0
- package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
- package/dist/components/tt-form/src/form-render/expandable.js +46 -0
- package/dist/components/tt-form/src/form-render/form.vue2.js +196 -0
- package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
- package/dist/components/tt-form/src/form-render/helper.js +22 -0
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
- package/dist/components/tt-form/src/formApi.js +790 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +277 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
- package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
- package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
- package/dist/components/tt-form/src/group-form/utils.js +106 -0
- package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
- package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
- package/dist/components/tt-form/src/index.vue2.js +147 -0
- package/dist/components/tt-form/src/index.vue3.js +5 -0
- package/dist/components/tt-form/src/shared/createContext.js +14 -0
- package/dist/components/tt-form/src/shared/global-state.js +22 -0
- package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
- package/dist/components/tt-form/src/types/forms.js +6 -0
- package/dist/components/tt-form/src/useForm.js +28 -0
- package/dist/components/tt-form/src/useFormContext.js +320 -0
- package/dist/components/tt-form/src/utils/array-path.js +18 -0
- package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
- package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
- package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
- package/dist/components/tt-icon/index.js +11 -0
- package/dist/components/tt-icon/index.vue.js +8 -0
- package/dist/components/tt-icon/index.vue2.js +115 -0
- package/dist/components/tt-image/index.js +9 -0
- package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
- package/dist/components/tt-image/tt-image.js +55 -0
- package/dist/components/tt-loading/index.js +8 -0
- package/dist/components/tt-loading/src/directive.js +51 -0
- package/dist/components/tt-loading/src/loading.vue.js +7 -0
- package/dist/components/tt-loading/src/loading.vue2.js +75 -0
- package/dist/components/tt-loading/src/service.js +79 -0
- package/dist/components/tt-log/index.js +7 -0
- package/dist/components/tt-log/index.vue.js +31 -0
- package/dist/components/tt-log/index.vue2.js +4 -0
- package/dist/components/tt-modal/index.js +14 -0
- package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
- package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
- package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
- package/dist/components/tt-modal/src/index.js +17 -0
- package/dist/components/tt-modal/src/props.js +75 -0
- package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
- package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
- package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
- package/dist/components/tt-modal-form/index.vue.js +201 -0
- package/dist/components/tt-modal-form/index.vue2.js +4 -0
- package/dist/components/tt-modal-form/useModalForm.js +30 -0
- package/dist/components/tt-nav-anchor/index.js +8 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
- package/dist/components/tt-nav-anchor/src/constants.js +4 -0
- package/dist/components/tt-panel-select/index.js +7 -0
- package/dist/components/tt-panel-select/src/common.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
- package/dist/components/tt-panel-select/src/index.vue.js +386 -0
- package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
- package/dist/components/tt-select/index.js +8 -0
- package/dist/components/tt-select/src/Select.vue.js +315 -0
- package/dist/components/tt-select/src/Select.vue3.js +5 -0
- package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
- package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
- package/dist/components/tt-select/src/components/Table.vue.js +307 -0
- package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
- package/dist/components/tt-select/src/const.js +19 -0
- package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
- package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
- package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
- package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
- package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
- package/dist/components/tt-select/src/props.js +201 -0
- package/dist/components/tt-select/src/utils/index.js +16 -0
- package/dist/components/tt-table/index.js +63 -0
- package/dist/components/tt-table/src/Table.vue.js +623 -0
- package/dist/components/tt-table/src/Table.vue3.js +5 -0
- package/dist/components/tt-table/src/TableForm.vue.js +356 -0
- package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
- package/dist/components/tt-table/src/componentMap.js +4 -0
- package/dist/components/tt-table/src/components/RowContext.js +24 -0
- package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
- package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
- package/dist/components/tt-table/src/components/TableButtons.js +117 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +234 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.js +15 -0
- package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
- package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
- package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
- package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
- package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
- package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
- package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
- package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
- package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
- package/dist/components/tt-table/src/props.js +482 -0
- package/dist/components/tt-table/src/toolProps.js +30 -0
- package/dist/components/tt-table/src/utils/context.js +17 -0
- package/dist/components/tt-table/src/utils/table-api.js +386 -0
- package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
- package/dist/components/tt-text/index.js +7 -0
- package/dist/components/tt-text/index.vue.js +7 -0
- package/dist/components/tt-text/index.vue2.js +73 -0
- package/dist/components/tt-upload/index.js +9 -0
- package/dist/components/tt-upload/src/TtUpload.vue.js +306 -0
- package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
- package/dist/components/tt-upload/src/typing.js +107 -0
- package/dist/directives/auto-tip/index.js +62 -0
- package/dist/directives/dialog-resize/index.js +49 -0
- package/dist/directives/dialog-resize/use-css-variable.js +44 -0
- package/dist/directives/dialog-resize/use-draggable.js +35 -0
- package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
- package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
- package/dist/directives/dialog-resize/use-resizer.js +37 -0
- package/dist/directives/disabled-tip/index.js +78 -0
- package/dist/directives/index.js +8 -0
- package/dist/hooks/useDataPermissionOptions.js +142 -0
- package/dist/hooks/useFormSchemasLink.js +261 -0
- package/dist/hooks/useFormat.js +44 -0
- package/dist/hooks/useLoading.js +22 -0
- package/dist/hooks/useScreenshotOss.js +69 -0
- package/dist/hooks/useSetup.js +59 -0
- package/dist/hooks/useTable.js +13 -0
- package/dist/hooks/useTemplateSlot.js +13 -0
- package/dist/index.js +142 -60274
- package/dist/plugins/default/renderCellContent.js +58 -0
- package/dist/plugins/vxeTable/switchStatus.js +91 -0
- package/dist/plugins.js +4 -146
- package/dist/style.css +1 -1
- package/dist/utils/xhr.js +8 -0
- package/package.json +5 -3
- package/dist/index-NG5FNCLD.js +0 -3430
- package/dist/index.modern-4Cf3dcJP.js +0 -3069
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineComponent as V, ref as f, computed as s, watch as z, nextTick as H, createElementBlock as c, openBlock as p, normalizeClass as o, createElementVNode as v, createVNode as r, unref as t, withCtx as h, createTextVNode as b, normalizeStyle as g, Fragment as N, renderList as I, createCommentVNode as A, toDisplayString as P } from "vue";
|
|
2
|
+
import w from "../../../../assets/svg/close.svg.js";
|
|
3
|
+
import { TtButton as Y } from "../../../tt-button/index.js";
|
|
4
|
+
import { TtIcon as y } from "../../../tt-icon/index.js";
|
|
5
|
+
import { TtText as D } from "../../../tt-text/index.js";
|
|
6
|
+
import { ElScrollbar as F } from "element-plus";
|
|
7
|
+
const n = 34, $ = 8, U = /* @__PURE__ */ V({
|
|
8
|
+
name: "PanelRight",
|
|
9
|
+
__name: "PanelRight",
|
|
10
|
+
props: {
|
|
11
|
+
prefixCls: {},
|
|
12
|
+
multiple: { type: Boolean },
|
|
13
|
+
selectedOptions: {},
|
|
14
|
+
disabled: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
emits: ["clearAll", "remove"],
|
|
17
|
+
setup(_, { emit: k }) {
|
|
18
|
+
const a = _, C = k, u = f(), d = f(0), x = f(340), T = s(() => a.selectedOptions.length * n), R = s(() => Math.max(1, Math.ceil(x.value / n))), m = s(() => Math.max(0, Math.floor(d.value / n) - $)), S = s(
|
|
19
|
+
() => Math.min(a.selectedOptions.length, m.value + R.value + $ * 2)
|
|
20
|
+
), B = s(() => m.value * n), E = s(() => a.selectedOptions.slice(m.value, S.value));
|
|
21
|
+
function M() {
|
|
22
|
+
var l;
|
|
23
|
+
const e = (l = u.value) == null ? void 0 : l.wrapRef;
|
|
24
|
+
e && (x.value = e.clientHeight, d.value = e.scrollTop);
|
|
25
|
+
}
|
|
26
|
+
function O() {
|
|
27
|
+
var l;
|
|
28
|
+
const e = (l = u.value) == null ? void 0 : l.wrapRef;
|
|
29
|
+
e && (d.value = e.scrollTop);
|
|
30
|
+
}
|
|
31
|
+
return z(
|
|
32
|
+
() => a.selectedOptions.length,
|
|
33
|
+
async () => {
|
|
34
|
+
await H(), M();
|
|
35
|
+
},
|
|
36
|
+
{ immediate: !0 }
|
|
37
|
+
), (e, l) => (p(), c("div", {
|
|
38
|
+
class: o(`${e.prefixCls}__right`)
|
|
39
|
+
}, [
|
|
40
|
+
v("div", {
|
|
41
|
+
class: o(`${e.prefixCls}__selected-actions`)
|
|
42
|
+
}, [
|
|
43
|
+
r(t(Y), {
|
|
44
|
+
disabled: e.disabled,
|
|
45
|
+
class: "w-full",
|
|
46
|
+
plain: "",
|
|
47
|
+
onClick: l[0] || (l[0] = (i) => C("clearAll"))
|
|
48
|
+
}, {
|
|
49
|
+
default: h(() => [
|
|
50
|
+
r(t(y), {
|
|
51
|
+
class: "mr-[4px]",
|
|
52
|
+
size: 14,
|
|
53
|
+
"is-custom-svg": "",
|
|
54
|
+
icon: t(w)
|
|
55
|
+
}, null, 8, ["icon"]),
|
|
56
|
+
l[1] || (l[1] = b(" 取消全选 ", -1))
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
}, 8, ["disabled"])
|
|
60
|
+
], 2),
|
|
61
|
+
r(t(F), {
|
|
62
|
+
ref_key: "scrollbarRef",
|
|
63
|
+
ref: u,
|
|
64
|
+
class: o(`${e.prefixCls}__selected-list ${e.prefixCls}__right-scrollbar`),
|
|
65
|
+
height: "340px",
|
|
66
|
+
onScroll: O
|
|
67
|
+
}, {
|
|
68
|
+
default: h(() => [
|
|
69
|
+
v("div", {
|
|
70
|
+
style: g({ height: `${T.value}px` })
|
|
71
|
+
}, [
|
|
72
|
+
v("div", {
|
|
73
|
+
style: g({ transform: `translateY(${B.value}px)` })
|
|
74
|
+
}, [
|
|
75
|
+
(p(!0), c(N, null, I(E.value, (i) => (p(), c("div", {
|
|
76
|
+
key: i.value,
|
|
77
|
+
style: g({ height: `${n}px` }),
|
|
78
|
+
class: o(`${e.prefixCls}__selected-item`)
|
|
79
|
+
}, [
|
|
80
|
+
r(t(D), null, {
|
|
81
|
+
default: h(() => [
|
|
82
|
+
b(P(i.label), 1)
|
|
83
|
+
]),
|
|
84
|
+
_: 2
|
|
85
|
+
}, 1024),
|
|
86
|
+
e.disabled ? A("", !0) : (p(), c("span", {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: o(`${e.prefixCls}__selected-item-close`)
|
|
89
|
+
}, [
|
|
90
|
+
r(t(y), {
|
|
91
|
+
size: 14,
|
|
92
|
+
"is-custom-svg": "",
|
|
93
|
+
icon: t(w),
|
|
94
|
+
onClick: (L) => C("remove", i.value)
|
|
95
|
+
}, null, 8, ["icon", "onClick"])
|
|
96
|
+
], 2))
|
|
97
|
+
], 6))), 128))
|
|
98
|
+
], 4)
|
|
99
|
+
], 4)
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 8, ["class"])
|
|
103
|
+
], 2));
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export {
|
|
107
|
+
U as default
|
|
108
|
+
};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { isFunction as w } from "@dazhicheng/utils";
|
|
2
|
+
import { objectOmit as X } from "@vueuse/core";
|
|
3
|
+
import { get as i, cloneDeep as Y } from "lodash-es";
|
|
4
|
+
import { pinyin as Z } from "pinyin-pro";
|
|
5
|
+
import { computed as d, ref as T, unref as ee, nextTick as te } from "vue";
|
|
6
|
+
function oe(a) {
|
|
7
|
+
const A = d(() => {
|
|
8
|
+
const e = a.treeConfig || {};
|
|
9
|
+
return {
|
|
10
|
+
transform: e.transform,
|
|
11
|
+
labelField: e.labelField ?? "label",
|
|
12
|
+
valueField: e.valueField ?? "value",
|
|
13
|
+
disabledField: e.disabledField ?? "disabled",
|
|
14
|
+
childrenField: e.childrenField ?? "children",
|
|
15
|
+
parentField: e.parentField ?? "pid",
|
|
16
|
+
rootParentValue: e.rootParentValue ?? null
|
|
17
|
+
};
|
|
18
|
+
}), p = T(!1), C = T([]), P = T(!1), S = T(!1), M = d(() => w(a.api) ? C.value : a.options || []), N = d(() => K(M.value)), z = d(() => !V() && a.showPinyinMode ? $(G.value) : D(N.value)), O = d(() => j(N.value)), B = d(() => O.value.filter((e) => {
|
|
19
|
+
var t;
|
|
20
|
+
return (t = e.children) == null ? void 0 : t.length;
|
|
21
|
+
})), G = d(() => O.value.filter((e) => e.children === void 0));
|
|
22
|
+
async function L() {
|
|
23
|
+
if (!(!a.api || !w(a.api))) {
|
|
24
|
+
if (p.value) {
|
|
25
|
+
P.value = !0;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
C.value = [];
|
|
29
|
+
try {
|
|
30
|
+
p.value = !0;
|
|
31
|
+
let e = ee(a.params);
|
|
32
|
+
a.beforeFetch && w(a.beforeFetch) && (e = await a.beforeFetch(Y(e)) || e);
|
|
33
|
+
let t = await a.api(e);
|
|
34
|
+
a.afterFetch && w(a.afterFetch) && (t = await a.afterFetch(t) || t), S.value = !0, C.value = Array.isArray(t) ? t : i(t, a.resultField || "") || [];
|
|
35
|
+
} catch {
|
|
36
|
+
S.value = !1;
|
|
37
|
+
} finally {
|
|
38
|
+
p.value = !1, P.value && (P.value = !1, await te(), L());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function K(e) {
|
|
43
|
+
const { childrenField: t, transform: r, valueField: n, labelField: l, disabledField: o, parentField: s } = A.value, u = e.some((b) => Array.isArray(i(b, t))), h = e.some((b) => {
|
|
44
|
+
const F = i(b, t);
|
|
45
|
+
return Array.isArray(F) && F.length > 0;
|
|
46
|
+
}), v = u || h ? e : r ? U(e) : e;
|
|
47
|
+
function g(b, F = 0, m) {
|
|
48
|
+
return b.map((c) => {
|
|
49
|
+
const J = i(c, n), x = i(c, t), Q = Array.isArray(x), W = [l, n, o, t].filter(
|
|
50
|
+
(y) => !!y
|
|
51
|
+
), f = {
|
|
52
|
+
...X(c, W),
|
|
53
|
+
label: String(i(c, l) ?? ""),
|
|
54
|
+
value: J,
|
|
55
|
+
disabled: !!i(c, o),
|
|
56
|
+
pid: (m == null ? void 0 : m.value) ?? i(c, s),
|
|
57
|
+
level: F,
|
|
58
|
+
path: [],
|
|
59
|
+
raw: c
|
|
60
|
+
};
|
|
61
|
+
if (f.path = m ? [...m.path, f] : [f], Q) {
|
|
62
|
+
const y = x;
|
|
63
|
+
f.children = y.length ? g(y, F + 1, f) : [];
|
|
64
|
+
} else
|
|
65
|
+
f.children = void 0;
|
|
66
|
+
return f;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return g(v);
|
|
70
|
+
}
|
|
71
|
+
function U(e) {
|
|
72
|
+
const t = /* @__PURE__ */ new Map(), r = [], { childrenField: n, valueField: l, parentField: o, rootParentValue: s } = A.value;
|
|
73
|
+
return e.forEach((u) => {
|
|
74
|
+
const h = i(u, l);
|
|
75
|
+
t.set(h, { ...u });
|
|
76
|
+
}), t.forEach((u) => {
|
|
77
|
+
const h = i(u, o), v = h === s ? void 0 : t.get(h);
|
|
78
|
+
if (v) {
|
|
79
|
+
const g = i(v, n) || [];
|
|
80
|
+
g.push(u), v[n] = g;
|
|
81
|
+
} else
|
|
82
|
+
r.push(u);
|
|
83
|
+
}), r;
|
|
84
|
+
}
|
|
85
|
+
function D(e) {
|
|
86
|
+
return e.filter((t) => {
|
|
87
|
+
var r;
|
|
88
|
+
return (r = t.children) == null ? void 0 : r.length;
|
|
89
|
+
}).map((t) => {
|
|
90
|
+
var r;
|
|
91
|
+
return {
|
|
92
|
+
...t,
|
|
93
|
+
children: (r = t.children) != null && r.some((n) => {
|
|
94
|
+
var l;
|
|
95
|
+
return (l = n.children) == null ? void 0 : l.length;
|
|
96
|
+
}) ? D(t.children) : void 0
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function $(e) {
|
|
101
|
+
return k(e).map((r) => {
|
|
102
|
+
const n = {
|
|
103
|
+
label: String(r.label),
|
|
104
|
+
value: r.value,
|
|
105
|
+
disabled: !1,
|
|
106
|
+
pid: null,
|
|
107
|
+
level: 0,
|
|
108
|
+
path: [],
|
|
109
|
+
raw: { label: r.label, value: r.value }
|
|
110
|
+
};
|
|
111
|
+
return n.path = [n], n.children = void 0, n;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function j(e) {
|
|
115
|
+
var n;
|
|
116
|
+
const t = [], r = [...e];
|
|
117
|
+
for (; r.length; ) {
|
|
118
|
+
const l = r.shift();
|
|
119
|
+
l && (t.push(l), (n = l.children) != null && n.length && r.unshift(...l.children));
|
|
120
|
+
}
|
|
121
|
+
return t;
|
|
122
|
+
}
|
|
123
|
+
function E(e, t) {
|
|
124
|
+
const r = t.trim().toLowerCase();
|
|
125
|
+
return r ? e.filter((n) => n.label.toLowerCase().includes(r)) : e;
|
|
126
|
+
}
|
|
127
|
+
function q(e, t) {
|
|
128
|
+
const r = E(e, t);
|
|
129
|
+
return a.showOriginMode ? R(r) : a.showPinyinMode ? k(r) : V() ? I(r) : _(r);
|
|
130
|
+
}
|
|
131
|
+
function V() {
|
|
132
|
+
const { childrenField: e, transform: t } = A.value, r = M.value.some((o) => Array.isArray(i(o, e))), n = M.value.some((o) => {
|
|
133
|
+
const s = i(o, e);
|
|
134
|
+
return Array.isArray(s) && !!s.length;
|
|
135
|
+
});
|
|
136
|
+
return t || !t && (r || n);
|
|
137
|
+
}
|
|
138
|
+
function _(e) {
|
|
139
|
+
const t = /* @__PURE__ */ new Map();
|
|
140
|
+
return e.forEach((r) => {
|
|
141
|
+
const n = r.path.at(-2), l = (n == null ? void 0 : n.value) ?? r.value, o = (n == null ? void 0 : n.label) ?? r.label, s = t.get(l) || { value: l, label: o, options: [] };
|
|
142
|
+
s.options.push(r), t.set(l, s);
|
|
143
|
+
}), Array.from(t.values());
|
|
144
|
+
}
|
|
145
|
+
function I(e) {
|
|
146
|
+
return _(e);
|
|
147
|
+
}
|
|
148
|
+
function R(e) {
|
|
149
|
+
return e.length ? [
|
|
150
|
+
{
|
|
151
|
+
value: "__origin__",
|
|
152
|
+
label: "",
|
|
153
|
+
options: e
|
|
154
|
+
}
|
|
155
|
+
] : [];
|
|
156
|
+
}
|
|
157
|
+
function k(e) {
|
|
158
|
+
const t = /* @__PURE__ */ new Map();
|
|
159
|
+
return e.forEach((r) => {
|
|
160
|
+
const n = H(r.label), l = t.get(n) || { value: n, label: n.toUpperCase(), options: [] };
|
|
161
|
+
l.options.push(r), t.set(n, l);
|
|
162
|
+
}), Array.from(t.values()).sort((r, n) => String(r.value).localeCompare(String(n.value)));
|
|
163
|
+
}
|
|
164
|
+
function H(e) {
|
|
165
|
+
const t = String(e || "").trim(), r = t.charAt(0).toLowerCase();
|
|
166
|
+
if (/^[a-z]$/.test(r)) return r;
|
|
167
|
+
const l = String(Z(t, { pattern: "initial" })).replace(/\s+/g, "").charAt(0).toLowerCase();
|
|
168
|
+
return /^[a-z]$/.test(l) ? l : "#";
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
loading: p,
|
|
172
|
+
fetchApi: L,
|
|
173
|
+
treeOptions: N,
|
|
174
|
+
navTreeOptions: z,
|
|
175
|
+
navNodes: B,
|
|
176
|
+
leafNodes: G,
|
|
177
|
+
filterNodes: E,
|
|
178
|
+
buildOptionGroups: q,
|
|
179
|
+
isFirstLoaded: S
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export {
|
|
183
|
+
oe as usePanelSelectData
|
|
184
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { computed as s, unref as n } from "vue";
|
|
2
|
+
function O(f) {
|
|
3
|
+
const { multiple: u, modelValue: d, selectedValues: o, leafNodes: c, allValue: r } = f, h = s(() => {
|
|
4
|
+
const l = new Set(n(o)), t = n(c).filter((e) => l.has(e.value));
|
|
5
|
+
if (l.has(n(r))) {
|
|
6
|
+
const e = n(r);
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
label: "全部",
|
|
10
|
+
value: e,
|
|
11
|
+
level: 0,
|
|
12
|
+
path: [],
|
|
13
|
+
raw: { label: "全部", value: e }
|
|
14
|
+
},
|
|
15
|
+
...t
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
}), v = s(() => {
|
|
20
|
+
const l = n(c).filter((t) => !t.disabled).map((t) => t.value);
|
|
21
|
+
return l.length > 0 && l.every((t) => n(o).includes(t));
|
|
22
|
+
}), p = s(() => {
|
|
23
|
+
const l = n(c).filter((e) => !e.disabled).map((e) => e.value), t = l.filter((e) => n(o).includes(e)).length;
|
|
24
|
+
return t > 0 && t < l.length;
|
|
25
|
+
});
|
|
26
|
+
function m(l) {
|
|
27
|
+
const t = l.options.filter((e) => !e.disabled).map((e) => e.value);
|
|
28
|
+
return t.length > 0 && t.every((e) => n(o).includes(e));
|
|
29
|
+
}
|
|
30
|
+
function S(l) {
|
|
31
|
+
const t = l.options.filter((a) => !a.disabled).map((a) => a.value), e = t.filter((a) => n(o).includes(a)).length;
|
|
32
|
+
return t.length > 0 && e > 0 && e < t.length;
|
|
33
|
+
}
|
|
34
|
+
function g(l, t) {
|
|
35
|
+
const e = l.options.filter((i) => !i.disabled).map((i) => i.value);
|
|
36
|
+
if (!e.length) return;
|
|
37
|
+
if (!n(u)) {
|
|
38
|
+
d.value = t ? e[0] : void 0;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const a = new Set(n(o));
|
|
42
|
+
a.delete(n(r)), e.forEach((i) => t ? a.add(i) : a.delete(i)), o.value = Array.from(a);
|
|
43
|
+
}
|
|
44
|
+
function k(l) {
|
|
45
|
+
if (!n(u)) {
|
|
46
|
+
d.value = l ? n(r) : void 0;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
o.value = l ? [n(r)] : [];
|
|
50
|
+
}
|
|
51
|
+
function C(l, t) {
|
|
52
|
+
if (!n(u)) {
|
|
53
|
+
d.value = t ? l : void 0;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const e = new Set(n(o));
|
|
57
|
+
e.delete(n(r)), t ? e.add(l) : e.delete(l), o.value = Array.from(e);
|
|
58
|
+
}
|
|
59
|
+
function b(l, t) {
|
|
60
|
+
if (!l.length) return;
|
|
61
|
+
if (!n(u)) {
|
|
62
|
+
d.value = t ? l.at(-1) : void 0;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const e = new Set(n(o));
|
|
66
|
+
e.delete(n(r)), l.forEach((a) => t ? e.add(a) : e.delete(a)), o.value = Array.from(e);
|
|
67
|
+
}
|
|
68
|
+
function A(l) {
|
|
69
|
+
const t = n(c).filter((a) => !a.disabled).map((a) => a.value), e = new Set(n(o));
|
|
70
|
+
e.delete(n(r)), t.forEach((a) => l ? e.add(a) : e.delete(a)), o.value = Array.from(e);
|
|
71
|
+
}
|
|
72
|
+
function w(l) {
|
|
73
|
+
o.value = n(o).filter((t) => t !== l);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
selectedOptions: h,
|
|
77
|
+
isAllChecked: v,
|
|
78
|
+
isIndeterminate: p,
|
|
79
|
+
isGroupChecked: m,
|
|
80
|
+
isGroupIndeterminate: S,
|
|
81
|
+
handleGroupCheck: g,
|
|
82
|
+
handleAllOptionCheck: k,
|
|
83
|
+
handleOptionCheck: C,
|
|
84
|
+
handleOptionsCheck: b,
|
|
85
|
+
handleCheckAll: A,
|
|
86
|
+
removeSelected: w
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
O as usePanelSelectSelection
|
|
91
|
+
};
|