@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,84 @@
|
|
|
1
|
+
import { isArray as b } from "lodash-es";
|
|
2
|
+
import { ref as f, computed as I, unref as o, toValue as A } from "vue";
|
|
3
|
+
function B(u, l, n) {
|
|
4
|
+
const s = f([]), h = f([]), k = I(() => {
|
|
5
|
+
const { showCheckbox: e, showRadio: c } = o(u), t = A(s);
|
|
6
|
+
return e ? t : c ? t ? [t] : [] : [];
|
|
7
|
+
});
|
|
8
|
+
function i() {
|
|
9
|
+
return o(s);
|
|
10
|
+
}
|
|
11
|
+
function a() {
|
|
12
|
+
const { showCheckbox: e, showRadio: c } = o(u);
|
|
13
|
+
return e ? o(n).getCheckboxRecords(!0) : c ? o(n).getRadioRecord(!0) : [];
|
|
14
|
+
}
|
|
15
|
+
function r(e) {
|
|
16
|
+
const { tableRowId: c } = o(u);
|
|
17
|
+
h.value = a(), s.value = o(h).map((t) => t[c || "id"]), l("selection-change", {
|
|
18
|
+
keys: i(),
|
|
19
|
+
rows: a(),
|
|
20
|
+
data: e
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const C = (e) => {
|
|
24
|
+
r(e), l("checkbox-change", e);
|
|
25
|
+
}, v = (e) => {
|
|
26
|
+
r(e), l("checkbox-all", e);
|
|
27
|
+
}, y = (e) => {
|
|
28
|
+
l("checkbox-range-change", e);
|
|
29
|
+
const { records: c } = e;
|
|
30
|
+
c && c.length === 1 || r(e);
|
|
31
|
+
}, d = async (e, c = []) => {
|
|
32
|
+
const { tableRowId: t, showCheckbox: w, showRadio: R } = o(u);
|
|
33
|
+
h.value = e, w && (b(c) && c.length === 0 && b(e) && e.length !== 0 && (c = e.map((g) => g[t || "id"])), s.value = c, o(n) && await o(n).setCheckboxRow(e, !0)), R && (e = e, s.value = e[t || "id"], o(n) && await o(n).setRadioRow(e)), setTimeout(() => {
|
|
34
|
+
l("selection-change", {
|
|
35
|
+
keys: i(),
|
|
36
|
+
rows: a()
|
|
37
|
+
});
|
|
38
|
+
}, 200);
|
|
39
|
+
}, S = () => {
|
|
40
|
+
const { showCheckbox: e, showRadio: c } = o(u);
|
|
41
|
+
e && (s.value = [], h.value = [], o(n) && o(n).clearCheckboxRow(), l("selection-change", {
|
|
42
|
+
keys: i(),
|
|
43
|
+
rows: a()
|
|
44
|
+
})), c && (s.value = void 0, h.value = void 0, o(n) && o(n).clearRadioRow());
|
|
45
|
+
};
|
|
46
|
+
async function x(e) {
|
|
47
|
+
const { rows: c, cols: t } = e;
|
|
48
|
+
if (c.length !== 1 && o(n) && t.some((w) => w.type === "checkbox")) {
|
|
49
|
+
const w = o(n).isCheckedByCheckboxRow(c[0]);
|
|
50
|
+
await o(n).setCheckboxRow(c, !w);
|
|
51
|
+
const { tableRowId: R } = o(u);
|
|
52
|
+
h.value = a(), s.value = o(h).map((g) => g[R || "id"]), l("selection-change", {
|
|
53
|
+
keys: i(),
|
|
54
|
+
rows: a(),
|
|
55
|
+
data: e
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function K(e) {
|
|
60
|
+
var c, t;
|
|
61
|
+
h.value = e.row, s.value = (t = e.row) == null ? void 0 : t[((c = o(u)) == null ? void 0 : c.tableRowId) || "id"], l("radio-change", e), l("selection-change", {
|
|
62
|
+
keys: i(),
|
|
63
|
+
rows: a(),
|
|
64
|
+
data: e
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
selectedKeys: s,
|
|
69
|
+
selectedRows: h,
|
|
70
|
+
setSelectedRowKeys: d,
|
|
71
|
+
onCellAreaSelectionEndSetCheckbox: x,
|
|
72
|
+
clearSelectedRowKeys: S,
|
|
73
|
+
onCheckboxChange: C,
|
|
74
|
+
onCheckboxAll: v,
|
|
75
|
+
getSelectRowKeys: i,
|
|
76
|
+
getSelectRows: a,
|
|
77
|
+
onCheckboxRangeChange: y,
|
|
78
|
+
onRadioChange: K,
|
|
79
|
+
getCheckboxSelectedKeys: k
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
B as useRowSelection
|
|
84
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { provide as e, inject as o } from "vue";
|
|
2
|
+
const n = Symbol("tt-table"), r = Symbol("tt-table-form");
|
|
3
|
+
function a(t) {
|
|
4
|
+
e(n, t);
|
|
5
|
+
}
|
|
6
|
+
function b() {
|
|
7
|
+
return o(n);
|
|
8
|
+
}
|
|
9
|
+
function l(t) {
|
|
10
|
+
e(r, t);
|
|
11
|
+
}
|
|
12
|
+
function m() {
|
|
13
|
+
return o(r);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
a as createTableContext,
|
|
17
|
+
l as createTableFormContext,
|
|
18
|
+
b as useTableContext,
|
|
19
|
+
m as useTableFormContext
|
|
20
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { delay as w } from "lodash-es";
|
|
2
|
+
import { unref as a, nextTick as i } from "vue";
|
|
3
|
+
function b(n, R, f, E, m, u) {
|
|
4
|
+
const r = () => {
|
|
5
|
+
i(() => {
|
|
6
|
+
const o = a(n), { tableData: t } = o.getTableData();
|
|
7
|
+
E.setState({
|
|
8
|
+
modelValue: t
|
|
9
|
+
}), E.setProxyState({ isTableEvent: !1 }), f("update:modelValue", t);
|
|
10
|
+
});
|
|
11
|
+
}, c = () => {
|
|
12
|
+
E.setProxyState({ isTableEvent: !0 });
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
...{
|
|
16
|
+
/**
|
|
17
|
+
* @description: 插入行
|
|
18
|
+
* @param {VxeTablePropTypes.Row | VxeTablePropTypes.Row[]} records
|
|
19
|
+
* @return {Promise<InsertReturnData>}
|
|
20
|
+
*/
|
|
21
|
+
insert: async function(t) {
|
|
22
|
+
c();
|
|
23
|
+
const s = await a(n).insert(t);
|
|
24
|
+
return r(), s;
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* @description: 插入指定行
|
|
28
|
+
* @param {VxeTablePropTypes.Row | VxeTablePropTypes.Row[]} records
|
|
29
|
+
* @param {*} row
|
|
30
|
+
* @return {Promise<InsertReturnData>}
|
|
31
|
+
*/
|
|
32
|
+
insertAt: async function(t, e) {
|
|
33
|
+
c();
|
|
34
|
+
const d = await a(n).insertAt(t, e);
|
|
35
|
+
return r(), d;
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @description: 退出编辑并还原数据
|
|
39
|
+
* @param {VxeTablePropTypes.Row} row
|
|
40
|
+
*/
|
|
41
|
+
clearEditRevertData: async function(t) {
|
|
42
|
+
var e, s;
|
|
43
|
+
c(), await ((e = a(n)) == null ? void 0 : e.clearEdit()), (s = a(n)) == null || s.revertData(t), r();
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* @description: 指定行激活编辑
|
|
47
|
+
* @param row 指定行
|
|
48
|
+
* @param fieldOrColumn 指定列
|
|
49
|
+
*/
|
|
50
|
+
setEditRow: async function(t, e) {
|
|
51
|
+
var s;
|
|
52
|
+
await ((s = a(n)) == null ? void 0 : s.setEditRow(t, e));
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* @description: 指定单元格激活编辑
|
|
56
|
+
* @param row 指定行
|
|
57
|
+
* @param fieldOrColumn 指定列
|
|
58
|
+
*/
|
|
59
|
+
setEditCell: async function(t, e) {
|
|
60
|
+
var s;
|
|
61
|
+
await ((s = a(n)) == null ? void 0 : s.setEditCell(t, e));
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* @description: 删除行
|
|
65
|
+
* @param {any} row
|
|
66
|
+
* @return {*}
|
|
67
|
+
*/
|
|
68
|
+
remove: async function(t) {
|
|
69
|
+
c();
|
|
70
|
+
const e = await a(n).remove(t);
|
|
71
|
+
return r(), e;
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* 删除复选框选中的行数据
|
|
75
|
+
*/
|
|
76
|
+
removeCheckboxRow: async function() {
|
|
77
|
+
var e;
|
|
78
|
+
c();
|
|
79
|
+
const t = await a(n).removeCheckboxRow();
|
|
80
|
+
return (e = u == null ? void 0 : u.clearSelectedRowKeys) == null || e.call(u), r(), t;
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* 删除单选框选中的行数据
|
|
84
|
+
*/
|
|
85
|
+
removeRadioRow: async function() {
|
|
86
|
+
var e;
|
|
87
|
+
c();
|
|
88
|
+
const t = await a(n).removeRadioRow();
|
|
89
|
+
return (e = u == null ? void 0 : u.clearSelectedRowKeys) == null || e.call(u), r(), t;
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* 删除当前行选中的行数据
|
|
93
|
+
*/
|
|
94
|
+
removeCurrentRow: async function() {
|
|
95
|
+
c();
|
|
96
|
+
const t = await a(n).removeCurrentRow();
|
|
97
|
+
return r(), t;
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* 删除所有新增的临时数据
|
|
101
|
+
*/
|
|
102
|
+
removeInsertRow: async function() {
|
|
103
|
+
c();
|
|
104
|
+
const t = await a(n).removeInsertRow();
|
|
105
|
+
return r(), t;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
...{
|
|
109
|
+
/**
|
|
110
|
+
* 加载数据
|
|
111
|
+
* @param data 数据
|
|
112
|
+
*/
|
|
113
|
+
loadData: async function(t) {
|
|
114
|
+
var l, v;
|
|
115
|
+
const e = a(n).getTreeExpandRecords();
|
|
116
|
+
c();
|
|
117
|
+
const s = await a(n).loadData(t), d = (v = (l = a(m)) == null ? void 0 : l.treeConfig) == null ? void 0 : v.reserve;
|
|
118
|
+
return e.length > 0 && d && a(n).setTreeExpand(e, !0), r(), s;
|
|
119
|
+
},
|
|
120
|
+
/**
|
|
121
|
+
* 加载数据并恢复到初始状态
|
|
122
|
+
* @param data 数据
|
|
123
|
+
*/
|
|
124
|
+
reloadData: async function(t) {
|
|
125
|
+
var l, v;
|
|
126
|
+
const e = a(n).getTreeExpandRecords();
|
|
127
|
+
c();
|
|
128
|
+
const s = await a(n).reloadData(t), d = (v = (l = a(m)) == null ? void 0 : l.treeConfig) == null ? void 0 : v.reserve;
|
|
129
|
+
return e.length > 0 && d && a(n).setTreeExpand(e, !0), r(), s;
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* 重新加载列
|
|
133
|
+
* @param columns 列对象
|
|
134
|
+
*/
|
|
135
|
+
reloadColumn: async function(t) {
|
|
136
|
+
const e = a(n).getTreeExpandRecords();
|
|
137
|
+
return c(), await E.setTableColumns(t), w(() => {
|
|
138
|
+
var l, v;
|
|
139
|
+
const d = (v = (l = a(m)) == null ? void 0 : l.treeConfig) == null ? void 0 : v.reserve;
|
|
140
|
+
e.length > 0 && d && a(n).setTreeExpand(e, !0);
|
|
141
|
+
}, 50), r(), E.getTableColumns();
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* 局部加载行数据并恢复到初始状态
|
|
145
|
+
* @param rows 行对象
|
|
146
|
+
* @param record 新数据
|
|
147
|
+
* @param field 指定字段名
|
|
148
|
+
*/
|
|
149
|
+
reloadRow: async function(t, e, s) {
|
|
150
|
+
c();
|
|
151
|
+
const d = await a(n).reloadRow(t, e, s);
|
|
152
|
+
return r(), d;
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* 手动清空单元格内容,如果不传参数,则清空整个表格内容,如果传了行则清空指定行内容,如果传了指定字段,则清空该字段内容
|
|
156
|
+
* @param rows 指定行
|
|
157
|
+
* @param field 字段名
|
|
158
|
+
*/
|
|
159
|
+
clearData: async function(t, e) {
|
|
160
|
+
c();
|
|
161
|
+
const s = await a(n).clearData(t, e);
|
|
162
|
+
return r(), s;
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* 重新懒加载展开行,并展开内容
|
|
166
|
+
* @param rows 指定行
|
|
167
|
+
*/
|
|
168
|
+
reloadRowExpand: async function(t) {
|
|
169
|
+
c();
|
|
170
|
+
const e = await a(n).reloadRowExpand(t);
|
|
171
|
+
return r(), e;
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* 重新懒加载树节点,并展开该节点
|
|
175
|
+
* @param rows 指定行
|
|
176
|
+
*/
|
|
177
|
+
reloadTreeExpand: async function(t) {
|
|
178
|
+
c();
|
|
179
|
+
const e = await a(n).reloadTreeExpand(t);
|
|
180
|
+
return r(), e;
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
...{
|
|
184
|
+
/**
|
|
185
|
+
* 设置空数据展示的text
|
|
186
|
+
*/
|
|
187
|
+
setEmptyText: (o) => {
|
|
188
|
+
R.emptyText = o, E.setState({
|
|
189
|
+
emptyText: o
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
b as useTableEvents
|
|
197
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { omit as p, cloneDeep as y, isFunction as d, isEqual as T } from "lodash-es";
|
|
2
|
+
import { ref as C, computed as f, unref as n, toValue as m, watch as D, watchEffect as E } from "vue";
|
|
3
|
+
function B(o, w, g, F, I) {
|
|
4
|
+
const r = C([]), b = f(() => {
|
|
5
|
+
const { form: t } = n(o), { submitButtonOptions: e = {} } = t || {};
|
|
6
|
+
return Object.assign(e, { loading: n(g) }), {
|
|
7
|
+
...t,
|
|
8
|
+
submitButtonOptions: e
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
async function S(t) {
|
|
12
|
+
const e = F(), a = { currentPage: 1, pageSize: e == null ? void 0 : e.pageSize };
|
|
13
|
+
await w({ tablePage: a, searchInfo: t });
|
|
14
|
+
}
|
|
15
|
+
const P = f(() => {
|
|
16
|
+
const { table: t = {}, tableRowId: e, useSearchForm: a, testId: s } = m(o), u = p(n(l), ["tableRowId"]);
|
|
17
|
+
return y({
|
|
18
|
+
useSearchForm: a || !1,
|
|
19
|
+
// TODO: getProps 使用toRaw会导致堆栈溢出问题后续优化
|
|
20
|
+
...t,
|
|
21
|
+
...u,
|
|
22
|
+
tableRowId: (t == null ? void 0 : t.tableRowId) || e,
|
|
23
|
+
// 继承外层的 testId,如果 table.testId 未设置则使用外层的 testId
|
|
24
|
+
testId: (t == null ? void 0 : t.testId) || s,
|
|
25
|
+
beforeFetch: async (i) => {
|
|
26
|
+
const { handleSearchInfoFn: h } = m(o);
|
|
27
|
+
let c = i;
|
|
28
|
+
return h && d(h) && (c = await h(c)), t != null && t.beforeFetch && d(t == null ? void 0 : t.beforeFetch) && (c = await (t == null ? void 0 : t.beforeFetch(c))), c;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}), l = f(() => {
|
|
32
|
+
const { columnsKey: t, showSetting: e, showSetColumn: a, showRefresh: s, showExport: u } = n(o).table || {}, { toolConfig: i } = n(o);
|
|
33
|
+
return {
|
|
34
|
+
columnsKey: t,
|
|
35
|
+
showSetting: e,
|
|
36
|
+
showRefresh: s,
|
|
37
|
+
showSetColumn: a,
|
|
38
|
+
showExport: u,
|
|
39
|
+
...i
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return D(
|
|
43
|
+
() => r.value,
|
|
44
|
+
(t, e) => {
|
|
45
|
+
T(t, e) || I("update:table-data", t);
|
|
46
|
+
},
|
|
47
|
+
{ deep: !0 }
|
|
48
|
+
), E(() => {
|
|
49
|
+
r.value = n(o).tableData || [];
|
|
50
|
+
}), {
|
|
51
|
+
tableData: r,
|
|
52
|
+
getFormProps: b,
|
|
53
|
+
handleSearchInfoChange: S,
|
|
54
|
+
getTableProps: P,
|
|
55
|
+
getTableToolProps: l
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
B as useTableForm
|
|
60
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useStore as i } from "@tanstack/vue-store";
|
|
2
|
+
import { defineComponent as s, h as p } from "vue";
|
|
3
|
+
import f from "../Table.vue.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import u from "../TableForm.vue.js";
|
|
6
|
+
import { TableApi as c } from "../utils/table-api.js";
|
|
7
|
+
import { TableFormApi as d } from "../utils/table-form-api.js";
|
|
8
|
+
function S(r) {
|
|
9
|
+
const t = new d(r), e = t;
|
|
10
|
+
return e.useStore = (n) => i(t.store, n), [s(
|
|
11
|
+
(n, { attrs: a, slots: o }) => () => p(u, { ...r, ...n, ...a, tableFormApi: e }, o),
|
|
12
|
+
{
|
|
13
|
+
name: "TtTableFormRender",
|
|
14
|
+
inheritAttrs: !1
|
|
15
|
+
}
|
|
16
|
+
), e];
|
|
17
|
+
}
|
|
18
|
+
function w(r) {
|
|
19
|
+
const t = new c(r), e = t;
|
|
20
|
+
e.useStore = (o) => i(t.store, o);
|
|
21
|
+
const { testId: m } = r, n = m ? { testId: m } : {};
|
|
22
|
+
return [s(
|
|
23
|
+
(o, { attrs: l, slots: b }) => () => p(f, { ...n, ...o, ...l, tableApi: e }, b),
|
|
24
|
+
{
|
|
25
|
+
name: "TtTableRender",
|
|
26
|
+
inheritAttrs: !1
|
|
27
|
+
}
|
|
28
|
+
), e];
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
S as useTableFormRender,
|
|
32
|
+
w as useTableRender
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useTemplateSlot as e } from "../../../../hooks/useTemplateSlot.js";
|
|
2
|
+
function c() {
|
|
3
|
+
const { getSlotKeys: t, replaceSlotKey: o } = e("t-"), { getSlotKeys: l, replaceSlotKey: r } = e("form-");
|
|
4
|
+
return {
|
|
5
|
+
replaceTableSlotKey: o,
|
|
6
|
+
// 表格插槽key前缀替换方法
|
|
7
|
+
replaceFormSlotKey: r,
|
|
8
|
+
// 表单插槽key前缀替换方法
|
|
9
|
+
getTableSlotKeysFunc: t,
|
|
10
|
+
// 获取表格插槽key的方法
|
|
11
|
+
getFormSlotKeysFunc: l
|
|
12
|
+
// 获取表单插槽key的方法
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
c as useTableSlot
|
|
17
|
+
};
|