@dazhicheng/ui 1.5.198 → 1.5.201
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/action_more.svg.js +4 -0
- package/dist/assets/svg/close.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.vue2.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 +156 -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 +65 -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 +346 -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 +102 -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 +197 -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 +278 -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 +149 -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 +30 -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 +178 -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 +33 -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 +317 -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 +233 -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 +305 -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/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,386 @@
|
|
|
1
|
+
var K = Object.defineProperty;
|
|
2
|
+
var A = (a, e, t) => e in a ? K(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var s = (a, e, t) => A(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { mergeWithArrayOverride as r, StateHandler as H, bindMethods as I, isFunction as k } from "@dazhicheng/utils";
|
|
5
|
+
import { GlobalConfig as o } from "@dazhicheng-ui/hooks/useSetup";
|
|
6
|
+
import { Store as z } from "@tanstack/vue-store";
|
|
7
|
+
import { reactive as n, computed as l } from "vue";
|
|
8
|
+
function M() {
|
|
9
|
+
var a, e, t, i, d, h, m, u, c, g, w, p, b, f, y, S, C, x, R, T, v, E, P, D, F;
|
|
10
|
+
return {
|
|
11
|
+
showPager: !0,
|
|
12
|
+
total: 0,
|
|
13
|
+
showCheckbox: !1,
|
|
14
|
+
showExpand: !1,
|
|
15
|
+
showRadio: !1,
|
|
16
|
+
showIndex: !1,
|
|
17
|
+
isCellResize: !1,
|
|
18
|
+
isColumnsDrag: !1,
|
|
19
|
+
isCellSort: !1,
|
|
20
|
+
showAction: !1,
|
|
21
|
+
actionWidth: 0,
|
|
22
|
+
actionTitle: "",
|
|
23
|
+
actionProps: {},
|
|
24
|
+
indexColumnProps: {},
|
|
25
|
+
checkboxColumnProps: {},
|
|
26
|
+
expandColumnProps: {},
|
|
27
|
+
radioColumnProps: {},
|
|
28
|
+
searchInfo: {},
|
|
29
|
+
immediate: !0,
|
|
30
|
+
loading: !1,
|
|
31
|
+
showToolbar: !1,
|
|
32
|
+
columnsFieldSort: [],
|
|
33
|
+
columnsFieldNoSort: [],
|
|
34
|
+
notSetColumnField: [],
|
|
35
|
+
filterNoVisibleField: [],
|
|
36
|
+
showTableAlert: !1,
|
|
37
|
+
modelValue: [],
|
|
38
|
+
title: "",
|
|
39
|
+
showTitle: !1,
|
|
40
|
+
autoHeight: !1,
|
|
41
|
+
leftSlotWidth: 0,
|
|
42
|
+
rightSlotWidth: 0,
|
|
43
|
+
emptyImageStyle: {},
|
|
44
|
+
isHanderSubmit: !1,
|
|
45
|
+
treeNode: !1,
|
|
46
|
+
clearTreeExpand: !0,
|
|
47
|
+
isI18n: !0,
|
|
48
|
+
isDataCloneDeep: !0,
|
|
49
|
+
showOverflow: !0,
|
|
50
|
+
height: void 0,
|
|
51
|
+
showHeaderOverflow: !0,
|
|
52
|
+
isScrollFetch: !1,
|
|
53
|
+
showScrollFetchLoading: !0,
|
|
54
|
+
toolbarConfig: void 0,
|
|
55
|
+
zoomConfig: void 0,
|
|
56
|
+
formApi: void 0,
|
|
57
|
+
useHttpCache: (a = o.table) == null ? void 0 : a.useHttpCache,
|
|
58
|
+
defaultDisplayFields: (e = o.table) == null ? void 0 : e.defaultDisplayFields,
|
|
59
|
+
loadingText: (t = o.table) == null ? void 0 : t.loadingText,
|
|
60
|
+
emptyText: (i = o.table) == null ? void 0 : i.emptyText,
|
|
61
|
+
emptyImageStatus: "no-data",
|
|
62
|
+
noSearchText: (d = o.table) == null ? void 0 : d.noSearchText,
|
|
63
|
+
showSetColumn: (h = o.table) == null ? void 0 : h.showSetColumn,
|
|
64
|
+
showSetting: (m = o.table) == null ? void 0 : m.showSetting,
|
|
65
|
+
showRefresh: (u = o.table) == null ? void 0 : u.showRefresh,
|
|
66
|
+
tableRowId: (c = o.table) == null ? void 0 : c.tableRowId,
|
|
67
|
+
currentPageField: (g = o.table) == null ? void 0 : g.currentPageField,
|
|
68
|
+
pageSizeField: (w = o.table) == null ? void 0 : w.pageSizeField,
|
|
69
|
+
totalField: (p = o.table) == null ? void 0 : p.totalField,
|
|
70
|
+
dataField: (b = o.table) == null ? void 0 : b.dataField,
|
|
71
|
+
pagerConfig: (f = o.table) == null ? void 0 : f.pagerConfig,
|
|
72
|
+
size: (y = o.table) == null ? void 0 : y.size,
|
|
73
|
+
keyboardConfig: (S = o.table) == null ? void 0 : S.keyboardConfig,
|
|
74
|
+
menuConfig: {},
|
|
75
|
+
mouseConfig: (C = o.table) == null ? void 0 : C.mouseConfig,
|
|
76
|
+
checkboxConfig: (x = o.table) == null ? void 0 : x.checkboxConfig,
|
|
77
|
+
radioConfig: (R = o.table) == null ? void 0 : R.radioConfig,
|
|
78
|
+
stripe: (T = o.table) == null ? void 0 : T.stripe,
|
|
79
|
+
border: (v = o.table) == null ? void 0 : v.border,
|
|
80
|
+
updateColumnsApi: (E = o.table) == null ? void 0 : E.updateColumnsApi,
|
|
81
|
+
getColumnsApi: (P = o.table) == null ? void 0 : P.getColumnsApi,
|
|
82
|
+
setColumnsApi: (D = o.table) == null ? void 0 : D.setColumnsApi,
|
|
83
|
+
columnsKey: (F = o.table) == null ? void 0 : F.columnsKey
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
class V {
|
|
87
|
+
/**
|
|
88
|
+
* 构造函数,初始化 store、状态等
|
|
89
|
+
* @param options 表格配置项
|
|
90
|
+
*/
|
|
91
|
+
constructor(e = {}) {
|
|
92
|
+
/** vxe-grid 表格实例 */
|
|
93
|
+
s(this, "grid", n({}));
|
|
94
|
+
/** 表格操作方法集合(TtTableMethods) */
|
|
95
|
+
s(this, "methods", n({}));
|
|
96
|
+
/** 当前表格的 props 状态 */
|
|
97
|
+
s(this, "state", null);
|
|
98
|
+
/** 响应式 store,存储表格的状态 */
|
|
99
|
+
s(this, "store");
|
|
100
|
+
/** 响应式代理状态(loading、selectedKeys) */
|
|
101
|
+
s(this, "proxyState", n({
|
|
102
|
+
loading: !1,
|
|
103
|
+
selectedKeys: [],
|
|
104
|
+
isTableEvent: !1,
|
|
105
|
+
selectedRows: []
|
|
106
|
+
}));
|
|
107
|
+
s(this, "isMounted", !1);
|
|
108
|
+
s(this, "stateHandler");
|
|
109
|
+
/**
|
|
110
|
+
* @description: 获取表格选中数据
|
|
111
|
+
* @return {DT[]}
|
|
112
|
+
*/
|
|
113
|
+
s(this, "selectedKeys", l(() => this.proxyState.selectedKeys));
|
|
114
|
+
/**
|
|
115
|
+
* @description: 获取表格选中数据
|
|
116
|
+
* @return {DT[]}
|
|
117
|
+
*/
|
|
118
|
+
s(this, "selectedRows", l(() => this.proxyState.selectedRows));
|
|
119
|
+
/**
|
|
120
|
+
* 获取表格 loading 状态(响应式)
|
|
121
|
+
*/
|
|
122
|
+
s(this, "getLoading", l(() => this.proxyState.loading));
|
|
123
|
+
/**
|
|
124
|
+
* 是否使用表格的event
|
|
125
|
+
*/
|
|
126
|
+
s(this, "getIsTableEvent", l(() => this.proxyState.isTableEvent));
|
|
127
|
+
const t = { ...e }, i = M();
|
|
128
|
+
this.store = new z(r(t, i), {
|
|
129
|
+
onUpdate: () => {
|
|
130
|
+
this.state = this.store.state;
|
|
131
|
+
}
|
|
132
|
+
}), this.state = this.store.state, this.stateHandler = new H(), I(this);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 组件挂载时调用,注入表格实例和方法
|
|
136
|
+
* @param instance vxe-grid 实例
|
|
137
|
+
* @param methods 表格操作方法
|
|
138
|
+
*/
|
|
139
|
+
mount(e, t) {
|
|
140
|
+
!this.isMounted && e && (Object.setPrototypeOf(this.grid, e), Object.setPrototypeOf(this.methods, t), this.stateHandler.setConditionTrue(), this.isMounted = !0);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 更新表格的状态
|
|
144
|
+
* @param stateOrFn 新状态或返回新状态的函数
|
|
145
|
+
*/
|
|
146
|
+
setState(e) {
|
|
147
|
+
k(e) ? this.store.setState((t) => {
|
|
148
|
+
const i = e(t);
|
|
149
|
+
return r(i, t, ["searchInfo"]);
|
|
150
|
+
}) : this.store.setState((t) => r(e, t, ["searchInfo"]));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 组件卸载时调用,重置挂载状态
|
|
154
|
+
*/
|
|
155
|
+
unmount() {
|
|
156
|
+
this.isMounted = !1, this.stateHandler.reset();
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @description: 表格重载数据
|
|
160
|
+
* @param {FetchParams | undefined} data 加载的params
|
|
161
|
+
* @return {*}
|
|
162
|
+
*/
|
|
163
|
+
async reload(e) {
|
|
164
|
+
try {
|
|
165
|
+
this.methods.reload(e);
|
|
166
|
+
} catch {
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @description: 设置表格props
|
|
171
|
+
* @param {Partial<TtTableProps>} props 表格props
|
|
172
|
+
*/
|
|
173
|
+
setProps(e) {
|
|
174
|
+
this.methods.setProps(e);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* @description: 重新计算高度
|
|
178
|
+
* @return {*}
|
|
179
|
+
*/
|
|
180
|
+
redoHeight() {
|
|
181
|
+
this.methods.redoHeight();
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* @description: 设置表格columns
|
|
185
|
+
* @param {VxeGridPropTypes.Columns<DT>} columns columns
|
|
186
|
+
* @return {*}
|
|
187
|
+
*/
|
|
188
|
+
setTableColumns(e) {
|
|
189
|
+
this.methods.setTableColumns(e);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @description: 获取表格columns
|
|
193
|
+
* @return {VxeGridPropTypes.Columns<DT> | undefined}
|
|
194
|
+
*/
|
|
195
|
+
getTableColumns() {
|
|
196
|
+
return this.methods.getTableColumns();
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* @description: 获取表格数据
|
|
200
|
+
* @return {DT[]}
|
|
201
|
+
*/
|
|
202
|
+
getDataSource() {
|
|
203
|
+
return this.methods.getDataSource();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* @description: 设置表格loading
|
|
207
|
+
* @param {boolean} loading
|
|
208
|
+
*/
|
|
209
|
+
setLoading(e) {
|
|
210
|
+
this.methods.setLoading(e);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* @description: 获取表格pagination
|
|
214
|
+
* @return {VxeGridPropTypes.PagerConfig | undefined}
|
|
215
|
+
*/
|
|
216
|
+
getPagination() {
|
|
217
|
+
return this.methods.getPagination();
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* @description: 设置表格pagination
|
|
221
|
+
* @param {Partial<VxeGridPropTypes.PagerConfig>} props 表格pagination
|
|
222
|
+
*/
|
|
223
|
+
setPagination(e) {
|
|
224
|
+
this.methods.setPagination(e);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @description: 获取选中数据的keys集合
|
|
228
|
+
* @return {Array<string>}
|
|
229
|
+
*/
|
|
230
|
+
getSelectRowKeys() {
|
|
231
|
+
return this.methods.getSelectRowKeys();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @description: 获取选中数据
|
|
235
|
+
* @return {Array<string>}
|
|
236
|
+
*/
|
|
237
|
+
getSelectRows() {
|
|
238
|
+
return this.methods.getSelectRows();
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* @description: 设置表格选中数据
|
|
242
|
+
* @param {TtSelectRowsType[]} rows 选中的数据
|
|
243
|
+
* @param {TtSelectRowKeysType[]} keys 选中的数据keys
|
|
244
|
+
*/
|
|
245
|
+
setSelectedRowKeys(e, t) {
|
|
246
|
+
this.methods.setSelectedRowKeys(e, t);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* @description: 清除全部行选择
|
|
250
|
+
*/
|
|
251
|
+
clearSelectedRowKeys() {
|
|
252
|
+
this.methods.clearSelectedRowKeys();
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* 往表格插入临时数据,从第一行新增一行或多行新数据
|
|
256
|
+
* @param records 新数据
|
|
257
|
+
*/
|
|
258
|
+
async insert(e) {
|
|
259
|
+
return await this.methods.insert(e);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* 往表格指定行中插入临时数据
|
|
263
|
+
* 如果 row 为空则从插入到顶部,如果为树结构,则插入到目标节点顶部
|
|
264
|
+
* 如果 row 为 -1 则从插入到底部,如果为树结构,则插入到目标节点底部
|
|
265
|
+
* 如果 row 为有效行则插入到该行的位置,如果为树结构,则有插入到效的目标节点该行的位置
|
|
266
|
+
* @param {Object/Array} records 新的数据
|
|
267
|
+
* @param {Row} row 指定行
|
|
268
|
+
*/
|
|
269
|
+
async insertAt(e, t) {
|
|
270
|
+
return await this.methods.insertAt(e, t);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* 删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
|
|
274
|
+
* @param rows 指定行
|
|
275
|
+
*/
|
|
276
|
+
async remove(e) {
|
|
277
|
+
return await this.methods.remove(e);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* 删除复选框选中的行数据
|
|
281
|
+
*/
|
|
282
|
+
async removeCheckboxRow() {
|
|
283
|
+
return await this.methods.removeCheckboxRow();
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* 删除单选框选中的行数据
|
|
287
|
+
*/
|
|
288
|
+
async removeRadioRow() {
|
|
289
|
+
return await this.methods.removeRadioRow();
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* 删除当前行选中的行数据
|
|
293
|
+
*/
|
|
294
|
+
async removeCurrentRow() {
|
|
295
|
+
return await this.methods.removeCurrentRow();
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* 清除编辑状态并重置数据
|
|
299
|
+
*/
|
|
300
|
+
clearEditRevertData(e) {
|
|
301
|
+
this.methods.clearEditRevertData(e);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* 指定行激活编辑
|
|
305
|
+
* @param {VxeTablePropTypes.Row} row 行数据
|
|
306
|
+
* @param {string | VxeTableDefines.ColumnInfo} fieldOrColumn 列配置可以时field
|
|
307
|
+
*/
|
|
308
|
+
setEditRow(e, t) {
|
|
309
|
+
this.methods.setEditRow(e, t);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* 指定单元格激活编辑
|
|
313
|
+
* @param {VxeTablePropTypes.Row} row 当前行数据
|
|
314
|
+
* @param {string | VxeTableDefines.ColumnInfo} fieldOrColumn 列配置可以时field
|
|
315
|
+
*/
|
|
316
|
+
setEditCell(e, t) {
|
|
317
|
+
this.methods.setEditCell(e, t);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* 加载数据
|
|
321
|
+
* @param data 数据
|
|
322
|
+
*/
|
|
323
|
+
async loadData(e) {
|
|
324
|
+
return await this.methods.loadData(e);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* 加载数据并恢复到初始状态
|
|
328
|
+
* @param data 数据
|
|
329
|
+
*/
|
|
330
|
+
async reloadData(e) {
|
|
331
|
+
return await this.methods.reloadData(e);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* 重新加载列
|
|
335
|
+
* @param columns 列对象
|
|
336
|
+
*/
|
|
337
|
+
async reloadColumn(e) {
|
|
338
|
+
return await this.methods.reloadColumn(e);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* 局部加载行数据并恢复到初始状态
|
|
342
|
+
* @param rows 行对象
|
|
343
|
+
* @param record 新数据
|
|
344
|
+
* @param field 指定字段名
|
|
345
|
+
*/
|
|
346
|
+
async reloadRow(e, t, i) {
|
|
347
|
+
return await this.methods.reloadRow(e, t, i);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* 手动清空单元格内容,如果不传参数,则清空整个表格内容,如果传了行则清空指定行内容,如果传了指定字段,则清空该字段内容
|
|
351
|
+
* @param data 指定行
|
|
352
|
+
* @param field 字段名
|
|
353
|
+
*/
|
|
354
|
+
async clearData(e, t) {
|
|
355
|
+
return await this.methods.clearData(e, t);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* 重新懒加载展开行,并展开内容
|
|
359
|
+
* @param row 指定行
|
|
360
|
+
*/
|
|
361
|
+
reloadRowExpand(e) {
|
|
362
|
+
this.methods.reloadRowExpand(e);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* 重新懒加载树节点,并展开该节点
|
|
366
|
+
* @param row 指定行
|
|
367
|
+
*/
|
|
368
|
+
reloadTreeExpand(e) {
|
|
369
|
+
this.methods.reloadRowExpand(e);
|
|
370
|
+
}
|
|
371
|
+
/** 获取表格实例 */
|
|
372
|
+
getTableInstance() {
|
|
373
|
+
return this.grid;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* 设置代理状态(loading、selectedKeys)
|
|
377
|
+
* @param state 代理状态对象
|
|
378
|
+
*/
|
|
379
|
+
setProxyState(e) {
|
|
380
|
+
this.proxyState.selectedKeys = e.selectedKeys ?? this.proxyState.selectedKeys, this.proxyState.loading = e.loading ?? this.proxyState.loading, this.proxyState.isTableEvent = e.isTableEvent ?? this.proxyState.isTableEvent, this.proxyState.selectedRows = e.selectedRows ?? this.proxyState.selectedRows;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
export {
|
|
384
|
+
V as TableApi,
|
|
385
|
+
M as getDefaultState
|
|
386
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var p = (r, t, e) => t in r ? d(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var s = (r, t, e) => p(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { mergeWithArrayOverride as a, StateHandler as u, bindMethods as b, isFunction as m } from "@dazhicheng/utils";
|
|
5
|
+
import { Store as c, useStore as f } from "@tanstack/vue-store";
|
|
6
|
+
import { reactive as o, computed as S, toValue as A } from "vue";
|
|
7
|
+
import { getDefaultState as y, TableApi as O } from "./table-api.js";
|
|
8
|
+
class I {
|
|
9
|
+
/**
|
|
10
|
+
* 构造函数,初始化 store、tableApi、状态等
|
|
11
|
+
* @param options 表单+表格配置项
|
|
12
|
+
*/
|
|
13
|
+
constructor(t = {}) {
|
|
14
|
+
/** form 表单实例(FormApi) */
|
|
15
|
+
s(this, "formApi", o({}));
|
|
16
|
+
/** 表格 API 实例(TableApi) */
|
|
17
|
+
s(this, "tableApi", o({}));
|
|
18
|
+
/** vxe-grid 表格实例 */
|
|
19
|
+
s(this, "grid", o({}));
|
|
20
|
+
/** 当前表单+表格的 props 状态 */
|
|
21
|
+
s(this, "state", null);
|
|
22
|
+
/** 表单操作方法集合(TableFormActionType) */
|
|
23
|
+
s(this, "tableForm", o({}));
|
|
24
|
+
/** 响应式 store,存储表单+表格的状态 */
|
|
25
|
+
s(this, "store");
|
|
26
|
+
s(this, "isMounted", !1);
|
|
27
|
+
s(this, "stateHandler");
|
|
28
|
+
/**
|
|
29
|
+
* 当前选中的行 key 数组(响应式)
|
|
30
|
+
*/
|
|
31
|
+
s(this, "selectedKeys", S(() => A(this.tableApi.selectedKeys) ?? []));
|
|
32
|
+
const e = { ...t }, i = y();
|
|
33
|
+
this.store = new c(
|
|
34
|
+
a(e, {
|
|
35
|
+
useSearchForm: !0,
|
|
36
|
+
table: i,
|
|
37
|
+
tableRowId: i.tableRowId || "id"
|
|
38
|
+
}),
|
|
39
|
+
{
|
|
40
|
+
onUpdate: () => {
|
|
41
|
+
this.state = this.store.state;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
), this.state = this.store.state, this.stateHandler = new u();
|
|
45
|
+
const l = new O({
|
|
46
|
+
...this.state.table,
|
|
47
|
+
useSearchForm: this.state.useSearchForm || !1
|
|
48
|
+
}), n = l;
|
|
49
|
+
n.useStore = (h) => f(l.store, h), Object.setPrototypeOf(this.tableApi, n), b(this);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 组件挂载时调用,注入表单和表格实例
|
|
53
|
+
* @param instance 表单操作方法实例
|
|
54
|
+
* @param formApi 表单实例
|
|
55
|
+
*/
|
|
56
|
+
mount(t, e) {
|
|
57
|
+
var i;
|
|
58
|
+
!this.isMounted && t && (Object.setPrototypeOf(this.grid, this.tableApi.grid), Object.setPrototypeOf(this.formApi, e), Object.setPrototypeOf(this.tableForm, t), (i = this.tableApi) == null || i.setState({ formApi: e }), this.stateHandler.setConditionTrue(), this.isMounted = !0);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 更新表单+表格的数据
|
|
62
|
+
* @param stateOrFn 新状态或返回新状态的函数
|
|
63
|
+
*/
|
|
64
|
+
setState(t) {
|
|
65
|
+
m(t) ? this.store.setState((e) => a(t(e), e)) : this.store.setState((e) => a(t, e));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 重新加载表格数据
|
|
69
|
+
* @param data 可选的查询参数
|
|
70
|
+
*/
|
|
71
|
+
async reload(t) {
|
|
72
|
+
this.tableForm.reload(t);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 获取表单实例
|
|
76
|
+
*/
|
|
77
|
+
formInstance() {
|
|
78
|
+
return this.formApi;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 获取 vxe-grid 表格实例
|
|
82
|
+
*/
|
|
83
|
+
vxeGridInstance() {
|
|
84
|
+
return this.tableApi.grid;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 获取表格 API 实例
|
|
88
|
+
*/
|
|
89
|
+
tableInstance() {
|
|
90
|
+
return this.tableApi;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 设置表格属性
|
|
94
|
+
* @param props 表格属性
|
|
95
|
+
*/
|
|
96
|
+
setTableProps(t) {
|
|
97
|
+
this.tableApi.setState(t);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 设置表单属性
|
|
101
|
+
* @param props 表单属性
|
|
102
|
+
*/
|
|
103
|
+
setFormProps(t) {
|
|
104
|
+
this.formApi.setState(t);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 设置表单+表格属性
|
|
108
|
+
* @param props 属性
|
|
109
|
+
*/
|
|
110
|
+
setProps(t) {
|
|
111
|
+
this.setState(t);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* 组件卸载时调用,重置挂载状态
|
|
115
|
+
*/
|
|
116
|
+
unmount() {
|
|
117
|
+
this.isMounted = !1, this.stateHandler.reset();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
I as TableFormApi
|
|
122
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent as c, computed as s, withDirectives as u, createCommentVNode as d, createElementBlock as m, openBlock as f, normalizeStyle as y, renderSlot as T, createTextVNode as h, toDisplayString as b, unref as k } from "vue";
|
|
2
|
+
import x from "@dazhicheng-ui/directives/auto-tip";
|
|
3
|
+
import { ElMessage as C } from "element-plus";
|
|
4
|
+
const V = /* @__PURE__ */ c({
|
|
5
|
+
name: "TtText",
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {},
|
|
9
|
+
toolTip: { type: Boolean, default: !0 },
|
|
10
|
+
placement: { default: "top" },
|
|
11
|
+
toolTipLine: { default: 1 },
|
|
12
|
+
toolTipMaxWidth: { default: 400 },
|
|
13
|
+
toolTipMaxHeight: { default: 600 },
|
|
14
|
+
lineHeight: {},
|
|
15
|
+
visible: { type: Boolean, default: !0 },
|
|
16
|
+
copy: { type: Boolean, default: !1 }
|
|
17
|
+
},
|
|
18
|
+
setup(n) {
|
|
19
|
+
const i = n, p = s(() => i.visible);
|
|
20
|
+
let o = 0, l = null;
|
|
21
|
+
function r() {
|
|
22
|
+
if (i.copy)
|
|
23
|
+
if (o++, l && clearTimeout(l), o === 3) {
|
|
24
|
+
const e = i.modelValue || "--";
|
|
25
|
+
navigator.clipboard ? navigator.clipboard.writeText(e).then(() => {
|
|
26
|
+
C({
|
|
27
|
+
message: "复制成功",
|
|
28
|
+
type: "success",
|
|
29
|
+
plain: !0
|
|
30
|
+
});
|
|
31
|
+
}).catch(() => {
|
|
32
|
+
a(e);
|
|
33
|
+
}) : a(e), o = 0;
|
|
34
|
+
} else
|
|
35
|
+
l = setTimeout(() => {
|
|
36
|
+
o = 0, l = null;
|
|
37
|
+
}, 300);
|
|
38
|
+
}
|
|
39
|
+
function a(e) {
|
|
40
|
+
try {
|
|
41
|
+
const t = document.createElement("textarea");
|
|
42
|
+
t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return (e, t) => p.value ? u((f(), m("span", {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "tool-tip-text",
|
|
49
|
+
style: y({
|
|
50
|
+
whiteSpace: "pre-line",
|
|
51
|
+
"-webkit-line-clamp": e.toolTipLine,
|
|
52
|
+
"word-break": "break-all"
|
|
53
|
+
}),
|
|
54
|
+
onClick: r
|
|
55
|
+
}, [
|
|
56
|
+
T(e.$slots, "default", {}, () => [
|
|
57
|
+
h(b(e.modelValue || "--"), 1)
|
|
58
|
+
], !0)
|
|
59
|
+
], 4)), [
|
|
60
|
+
[
|
|
61
|
+
k(x),
|
|
62
|
+
e.toolTip ? {
|
|
63
|
+
placement: e.placement,
|
|
64
|
+
toolTipMaxWidth: e.toolTipMaxWidth,
|
|
65
|
+
toolTipMaxHeight: e.toolTipMaxHeight
|
|
66
|
+
} : !1
|
|
67
|
+
]
|
|
68
|
+
]) : d("", !0);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
V as default
|
|
73
|
+
};
|