@mc20230601/keep-up 1.0.18 → 1.0.26
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/es/components/codeEditor/index.d.ts +11 -11
- package/es/{packages/components → components}/codeEditor/index.mjs +3 -3
- package/es/components/codeEditor/index.mjs.map +1 -0
- package/es/components/commonDrawer/index.d.ts +28 -15
- package/es/{packages/components → components}/commonDrawer/index.mjs +11 -4
- package/es/components/commonDrawer/index.mjs.map +1 -0
- package/es/components/commonEditor/constants.d.ts +17 -0
- package/es/components/commonEditor/constants.mjs +16 -0
- package/es/components/commonEditor/constants.mjs.map +1 -0
- package/es/components/commonEditor/index.d.ts +181 -0
- package/es/components/commonEditor/index.mjs +193 -0
- package/es/components/commonEditor/index.mjs.map +1 -0
- package/es/components/commonEditor/index.module.mjs +4 -0
- package/es/components/commonEditor/index.module.mjs.map +1 -0
- package/es/components/commonEditor/interfaces.d.ts +46 -0
- package/es/components/commonEditor/interfaces.mjs +2 -0
- package/es/components/commonEditor/interfaces.mjs.map +1 -0
- package/es/components/commonEditor/useModeMap.d.ts +4 -0
- package/es/components/commonEditor/useModeMap.mjs +17 -0
- package/es/components/commonEditor/useModeMap.mjs.map +1 -0
- package/es/components/commonFilter/constants.d.ts +2 -0
- package/es/components/commonFilter/constants.mjs +4 -0
- package/es/components/commonFilter/constants.mjs.map +1 -0
- package/es/components/commonFilter/index.d.ts +107 -0
- package/es/components/commonFilter/index.mjs +103 -0
- package/es/components/commonFilter/index.mjs.map +1 -0
- package/es/components/commonFilter/index.module.mjs +4 -0
- package/es/components/commonFilter/index.module.mjs.map +1 -0
- package/es/components/commonFilter/interfaces.d.ts +75 -0
- package/es/components/commonFilter/interfaces.mjs +2 -0
- package/es/components/commonFilter/interfaces.mjs.map +1 -0
- package/es/components/commonFilter/props.d.ts +31 -0
- package/es/components/commonFilter/props.mjs +30 -0
- package/es/components/commonFilter/props.mjs.map +1 -0
- package/es/components/commonFilter/useCollapse.d.ts +2 -0
- package/es/components/commonFilter/useCollapse.mjs +29 -0
- package/es/components/commonFilter/useCollapse.mjs.map +1 -0
- package/es/components/commonFilter/useFieldsParser.d.ts +5 -0
- package/es/components/commonFilter/useFieldsParser.mjs +34 -0
- package/es/components/commonFilter/useFieldsParser.mjs.map +1 -0
- package/es/components/commonFilter/useKeepFilter.d.ts +3 -0
- package/es/components/commonFilter/useKeepFilter.mjs +36 -0
- package/es/components/commonFilter/useKeepFilter.mjs.map +1 -0
- package/es/components/commonFilter/utils.d.ts +3 -0
- package/es/components/commonFilter/utils.mjs +14 -0
- package/es/components/commonFilter/utils.mjs.map +1 -0
- package/es/components/commonJsonPretty/index.d.ts +31 -0
- package/es/components/commonJsonPretty/index.mjs +26 -0
- package/es/components/commonJsonPretty/index.mjs.map +1 -0
- package/es/components/commonLocations/constants.d.ts +28 -0
- package/es/components/commonLocations/constants.mjs +18 -0
- package/es/components/commonLocations/constants.mjs.map +1 -0
- package/es/components/commonLocations/index.d.ts +40 -0
- package/es/components/commonLocations/index.mjs +94 -0
- package/es/components/commonLocations/index.mjs.map +1 -0
- package/es/components/commonLocations/index.module.mjs +4 -0
- package/es/components/commonLocations/index.module.mjs.map +1 -0
- package/es/components/commonLocations/interfaces.d.ts +100 -0
- package/es/components/commonLocations/interfaces.mjs +2 -0
- package/es/components/commonLocations/interfaces.mjs.map +1 -0
- package/es/components/commonLocations/useLocations.d.ts +2 -0
- package/es/components/commonLocations/useLocations.mjs +151 -0
- package/es/components/commonLocations/useLocations.mjs.map +1 -0
- package/es/components/commonLocations/utils.d.ts +14 -0
- package/es/components/commonLocations/utils.mjs +73 -0
- package/es/components/commonLocations/utils.mjs.map +1 -0
- package/es/components/commonModal/index.d.ts +30 -0
- package/es/components/commonModal/index.mjs +56 -0
- package/es/components/commonModal/index.mjs.map +1 -0
- package/es/components/commonModal/index.module.mjs +4 -0
- package/es/components/commonModal/index.module.mjs.map +1 -0
- package/es/components/commonModal/interfaces.d.ts +7 -0
- package/es/components/commonModal/interfaces.mjs +2 -0
- package/es/components/commonModal/interfaces.mjs.map +1 -0
- package/es/components/commonPage/constants.d.ts +18 -0
- package/es/components/commonPage/constants.mjs +16 -0
- package/es/components/commonPage/constants.mjs.map +1 -0
- package/es/components/commonPage/index.d.ts +256 -0
- package/es/components/commonPage/index.mjs +461 -0
- package/es/components/commonPage/index.mjs.map +1 -0
- package/es/components/commonPage/index.module.mjs +4 -0
- package/es/components/commonPage/index.module.mjs.map +1 -0
- package/es/components/commonPage/interfaces.d.ts +113 -0
- package/es/components/commonPage/interfaces.mjs +2 -0
- package/es/components/commonPage/interfaces.mjs.map +1 -0
- package/es/components/commonPage/useAsyncDataSource.d.ts +4 -0
- package/es/components/commonPage/useAsyncDataSource.mjs +39 -0
- package/es/components/commonPage/useAsyncDataSource.mjs.map +1 -0
- package/es/components/commonPage/useLayout.d.ts +6 -0
- package/es/components/commonPage/useLayout.mjs +37 -0
- package/es/components/commonPage/useLayout.mjs.map +1 -0
- package/es/components/commonPage/usePage.d.ts +4 -0
- package/es/components/commonPage/usePage.mjs +64 -0
- package/es/components/commonPage/usePage.mjs.map +1 -0
- package/es/components/commonPage/usePageActions.d.ts +2 -0
- package/es/components/commonPage/usePageActions.mjs +66 -0
- package/es/components/commonPage/usePageActions.mjs.map +1 -0
- package/es/components/commonPage/usePagePreferences.d.ts +3 -0
- package/es/components/commonPage/usePagePreferences.mjs +54 -0
- package/es/components/commonPage/usePagePreferences.mjs.map +1 -0
- package/es/components/commonPage/utils.d.ts +4 -0
- package/es/components/commonPage/utils.mjs +11 -0
- package/es/components/commonPage/utils.mjs.map +1 -0
- package/es/components/commonSetter/components/draggableList/index.d.ts +31 -0
- package/es/components/commonSetter/components/draggableList/index.mjs +113 -0
- package/es/components/commonSetter/components/draggableList/index.mjs.map +1 -0
- package/es/components/commonSetter/components/draggableList/index.module.mjs +4 -0
- package/es/components/commonSetter/components/draggableList/index.module.mjs.map +1 -0
- package/es/components/commonSetter/constants.d.ts +7 -0
- package/es/components/commonSetter/constants.mjs +10 -0
- package/es/components/commonSetter/constants.mjs.map +1 -0
- package/es/components/commonSetter/index.d.ts +31 -0
- package/es/components/commonSetter/index.mjs +108 -0
- package/es/components/commonSetter/index.mjs.map +1 -0
- package/es/components/commonSetter/index.module.mjs +4 -0
- package/es/components/commonSetter/index.module.mjs.map +1 -0
- package/es/components/commonTable/constants.d.ts +11 -0
- package/es/components/commonTable/constants.mjs +14 -0
- package/es/components/commonTable/constants.mjs.map +1 -0
- package/es/components/commonTable/index.d.ts +132 -0
- package/es/components/commonTable/index.mjs +140 -0
- package/es/components/commonTable/index.mjs.map +1 -0
- package/es/components/commonTable/index.module.mjs +4 -0
- package/es/components/commonTable/index.module.mjs.map +1 -0
- package/es/components/commonTable/interfaces.d.ts +54 -0
- package/es/components/commonTable/interfaces.mjs +2 -0
- package/es/components/commonTable/interfaces.mjs.map +1 -0
- package/es/components/commonTable/props.d.ts +71 -0
- package/es/components/commonTable/props.mjs +72 -0
- package/es/components/commonTable/props.mjs.map +1 -0
- package/es/components/commonTable/usePagination.d.ts +3 -0
- package/es/components/commonTable/usePagination.mjs +41 -0
- package/es/components/commonTable/usePagination.mjs.map +1 -0
- package/es/components/commonTable/utils.d.ts +3 -0
- package/es/components/commonTable/utils.mjs +17 -0
- package/es/components/commonTable/utils.mjs.map +1 -0
- package/es/components/elIconPlus/index.d.ts +15 -0
- package/es/components/elIconPlus/index.mjs +31 -0
- package/es/components/elIconPlus/index.mjs.map +1 -0
- package/es/components/formTabs/index.d.ts +35 -0
- package/es/components/formTabs/index.mjs +60 -0
- package/es/components/formTabs/index.mjs.map +1 -0
- package/es/components/formilyCmps/formTab/index.d.ts +83 -0
- package/es/components/formilyCmps/formTab/index.mjs +146 -0
- package/es/components/formilyCmps/formTab/index.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/constants.d.ts +39 -0
- package/es/components/formilyCmps/formilyForm/constants.mjs +41 -0
- package/es/components/formilyCmps/formilyForm/constants.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/index.d.ts +131 -0
- package/es/components/formilyCmps/formilyForm/index.mjs +148 -0
- package/es/components/formilyCmps/formilyForm/index.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/index.module.mjs +4 -0
- package/es/components/formilyCmps/formilyForm/index.module.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/interfaces.d.ts +28 -0
- package/es/components/formilyCmps/formilyForm/interfaces.mjs +2 -0
- package/es/components/formilyCmps/formilyForm/interfaces.mjs.map +1 -0
- package/es/components/formilyCmps/formilyForm/utils.d.ts +3 -0
- package/es/components/formilyCmps/formilyForm/utils.mjs +14 -0
- package/es/components/formilyCmps/formilyForm/utils.mjs.map +1 -0
- package/es/components/formilyCmps/index.d.ts +3 -0
- package/es/components/formilyCmps/index.mjs +3 -0
- package/es/components/formilyCmps/sectionTitle/index.d.ts +28 -0
- package/es/components/formilyCmps/sectionTitle/index.mjs +30 -0
- package/es/components/formilyCmps/sectionTitle/index.mjs.map +1 -0
- package/es/components/formilyCmps/sectionTitle/index.module.mjs +4 -0
- package/es/components/formilyCmps/sectionTitle/index.module.mjs.map +1 -0
- package/es/components/fragment/index.d.ts +4 -0
- package/es/components/fragment/index.mjs +16 -0
- package/es/components/fragment/index.mjs.map +1 -0
- package/es/components/iconFont/index.d.ts +36 -0
- package/es/components/iconFont/index.mjs +44 -0
- package/es/components/iconFont/index.mjs.map +1 -0
- package/es/components/index.d.ts +22 -0
- package/es/components/index.mjs +21 -0
- package/es/{packages/interfaces → components}/index.mjs.map +1 -1
- package/es/components/radioGroup/constants.d.ts +371 -0
- package/es/components/radioGroup/constants.mjs +11 -0
- package/es/components/radioGroup/constants.mjs.map +1 -0
- package/es/components/radioGroup/index.d.ts +203 -0
- package/es/components/radioGroup/index.mjs +60 -0
- package/es/components/radioGroup/index.mjs.map +1 -0
- package/es/components/radioGroup/interfaces.d.ts +7 -0
- package/es/components/radioGroup/interfaces.mjs +2 -0
- package/es/components/radioGroup/interfaces.mjs.map +1 -0
- package/es/components/space/index.d.ts +61 -0
- package/es/components/space/index.mjs +59 -0
- package/es/components/space/index.mjs.map +1 -0
- package/es/components/upload/formilyUpload.d.ts +73 -0
- package/es/components/upload/formilyUpload.mjs +90 -0
- package/es/components/upload/formilyUpload.mjs.map +1 -0
- package/es/components/upload/index.d.ts +271 -0
- package/es/components/upload/index.mjs +22 -0
- package/es/components/upload/index.mjs.map +1 -0
- package/es/components/upload/index.module.mjs +4 -0
- package/es/components/upload/index.module.mjs.map +1 -0
- package/es/components/upload/modalUpload.d.ts +36 -0
- package/es/components/upload/modalUpload.mjs +67 -0
- package/es/components/upload/modalUpload.mjs.map +1 -0
- package/es/components/upload/upload.d.ts +76 -0
- package/es/components/upload/upload.mjs +91 -0
- package/es/components/upload/upload.mjs.map +1 -0
- package/es/constants/common.d.ts +1 -1
- package/es/constants/common.mjs.map +1 -0
- package/es/index.d.ts +17 -1
- package/es/index.mjs +20 -2
- package/es/index.mjs.map +1 -1
- package/es/styles/index.css +298 -0
- package/es/utils/common.d.ts +1 -1
- package/es/utils/common.mjs.map +1 -0
- package/es/{packages/utils → utils}/emitter.mjs +1 -1
- package/es/utils/emitter.mjs.map +1 -0
- package/es/utils/shared.mjs.map +1 -0
- package/es/utils/storage.mjs.map +1 -0
- package/package.json +1 -2
- package/es/_virtual/ace.mjs +0 -4
- package/es/_virtual/ace.mjs.map +0 -1
- package/es/_virtual/mode-javascript.mjs +0 -4
- package/es/_virtual/mode-javascript.mjs.map +0 -1
- package/es/_virtual/theme-monokai.mjs +0 -4
- package/es/_virtual/theme-monokai.mjs.map +0 -1
- package/es/constants/index.d.ts +0 -0
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/ace.mjs +0 -21889
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/ace.mjs.map +0 -1
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/mode-javascript.mjs +0 -1186
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/mode-javascript.mjs.map +0 -1
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/theme-monokai.mjs +0 -22
- package/es/node_modules/.pnpm/ace-builds@1.43.5/node_modules/ace-builds/src-noconflict/theme-monokai.mjs.map +0 -1
- package/es/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs +0 -4
- package/es/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs.map +0 -1
- package/es/packages/components/codeEditor/index.mjs.map +0 -1
- package/es/packages/components/commonDrawer/index.mjs.map +0 -1
- package/es/packages/components/index.mjs +0 -3
- package/es/packages/constants/common.mjs.map +0 -1
- package/es/packages/interfaces/index.mjs +0 -2
- package/es/packages/utils/common.mjs.map +0 -1
- package/es/packages/utils/emitter.mjs.map +0 -1
- package/es/packages/utils/shared.mjs.map +0 -1
- package/es/packages/utils/storage.mjs.map +0 -1
- /package/es/{packages/components → components}/commonDrawer/index.module.mjs +0 -0
- /package/es/{packages/components → components}/commonDrawer/index.module.mjs.map +0 -0
- /package/es/{packages/components → components}/commonDrawer/interfaces.mjs +0 -0
- /package/es/{packages/components → components}/commonDrawer/interfaces.mjs.map +0 -0
- /package/es/{packages/components → components/formilyCmps}/index.mjs.map +0 -0
- /package/es/{packages/constants → constants}/common.mjs +0 -0
- /package/es/{packages/interfaces → interfaces}/common.mjs +0 -0
- /package/es/{packages/interfaces → interfaces}/common.mjs.map +0 -0
- /package/es/{packages/interfaces → interfaces}/commonPage.mjs +0 -0
- /package/es/{packages/interfaces → interfaces}/commonPage.mjs.map +0 -0
- /package/es/{packages/constants → interfaces}/index.mjs +0 -0
- /package/es/{packages/constants → interfaces}/index.mjs.map +0 -0
- /package/es/{packages/utils → utils}/common.mjs +0 -0
- /package/es/{packages/utils → utils}/index.mjs +0 -0
- /package/es/{packages/utils → utils}/index.mjs.map +0 -0
- /package/es/{packages/utils → utils}/shared.mjs +0 -0
- /package/es/{packages/utils → utils}/storage.mjs +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, createVNode, createTextVNode } from 'vue';
|
|
2
|
+
import { cloneDeep } from 'lodash';
|
|
3
|
+
import { ElPopover, ElButton } from 'element-plus';
|
|
4
|
+
import Space from '../space/index.mjs';
|
|
5
|
+
import './constants.mjs';
|
|
6
|
+
import DraggableList from './components/draggableList/index.mjs';
|
|
7
|
+
import styles from './index.module.mjs';
|
|
8
|
+
import { pagePreferencesToKeyMap, Common_Page_Preferences_Type } from '../commonPage/constants.mjs';
|
|
9
|
+
|
|
10
|
+
const props = {
|
|
11
|
+
/** 全量用户偏好-筛选项 */
|
|
12
|
+
allVisibleFilterFields: {
|
|
13
|
+
type: Array,
|
|
14
|
+
default: () => []
|
|
15
|
+
},
|
|
16
|
+
/** 全量用户偏好-表格列 */
|
|
17
|
+
allVisibleColumnFields: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => []
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var CommonSetter = defineComponent({
|
|
23
|
+
name: "CommonSetter",
|
|
24
|
+
inheritAttrs: true,
|
|
25
|
+
props,
|
|
26
|
+
emits: ["confirm"],
|
|
27
|
+
setup(props2, {
|
|
28
|
+
slots,
|
|
29
|
+
emit
|
|
30
|
+
}) {
|
|
31
|
+
const popoverRef = ref();
|
|
32
|
+
const basicFields = ref({
|
|
33
|
+
[pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]: props2.allVisibleFilterFields,
|
|
34
|
+
[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]: props2.allVisibleColumnFields
|
|
35
|
+
});
|
|
36
|
+
watch(() => [props2.allVisibleFilterFields, props2.allVisibleColumnFields], ([v1, v2]) => {
|
|
37
|
+
basicFields.value = {
|
|
38
|
+
[pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]: v1,
|
|
39
|
+
[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]: v2
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
immediate: true,
|
|
43
|
+
deep: true
|
|
44
|
+
});
|
|
45
|
+
const close = () => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
(_b = (_a = popoverRef.value) == null ? void 0 : _a.hide) == null ? void 0 : _b.call(_a);
|
|
48
|
+
basicFields.value = {
|
|
49
|
+
[pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]: props2.allVisibleFilterFields,
|
|
50
|
+
[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]: props2.allVisibleColumnFields
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
return () => {
|
|
54
|
+
var _a;
|
|
55
|
+
const defaultTsx = () => createVNode(Space, {
|
|
56
|
+
"direction": "column",
|
|
57
|
+
"size": 0
|
|
58
|
+
}, {
|
|
59
|
+
default: () => [createVNode(Space, {
|
|
60
|
+
"align": "stretch",
|
|
61
|
+
"size": 4
|
|
62
|
+
}, {
|
|
63
|
+
default: () => [createVNode(DraggableList, {
|
|
64
|
+
"fields": basicFields.value[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]],
|
|
65
|
+
"onUpdate:fields": (fields) => {
|
|
66
|
+
basicFields.value[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]] = fields;
|
|
67
|
+
}
|
|
68
|
+
}, null)]
|
|
69
|
+
}), createVNode(Space, {
|
|
70
|
+
"justify": "center",
|
|
71
|
+
"fill": true,
|
|
72
|
+
"size": 0,
|
|
73
|
+
"style": {
|
|
74
|
+
padding: "16px 0 0 0"
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
default: () => [createVNode(ElButton, {
|
|
78
|
+
"onClick": close
|
|
79
|
+
}, {
|
|
80
|
+
default: () => [createTextVNode("\u53D6\u6D88")]
|
|
81
|
+
}), createVNode(ElButton, {
|
|
82
|
+
"type": "primary",
|
|
83
|
+
"onClick": () => {
|
|
84
|
+
var _a2, _b;
|
|
85
|
+
(_b = (_a2 = popoverRef.value) == null ? void 0 : _a2.hide) == null ? void 0 : _b.call(_a2);
|
|
86
|
+
emit("confirm", cloneDeep(basicFields.value));
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
default: () => [createTextVNode("\u786E\u8BA4")]
|
|
90
|
+
})]
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
return createVNode(ElPopover, {
|
|
94
|
+
"ref": popoverRef,
|
|
95
|
+
"popperClass": styles.container,
|
|
96
|
+
"placement": "bottom-end",
|
|
97
|
+
"width": "fit-content",
|
|
98
|
+
"trigger": "click"
|
|
99
|
+
}, {
|
|
100
|
+
reference: (_a = slots == null ? void 0 : slots.reference) == null ? void 0 : _a.call(slots),
|
|
101
|
+
default: defaultTsx
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export { CommonSetter as default };
|
|
108
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/commonSetter/index.tsx"],"sourcesContent":["import { defineComponent, ref, watch } from 'vue'\nimport { cloneDeep } from 'lodash'\nimport { ElPopover, ElButton } from 'element-plus'\nimport Space from '../space'\nimport { pagePreferencesToKeyMap, Common_Page_Preferences_Type } from './constants'\nimport DraggableList from './components/draggableList'\nimport styles from './index.module.scss'\n\nimport type { PropType } from 'vue'\nimport type { IPagePreferenceItem } from '../commonPage/interfaces'\n\nconst props = {\n /** 全量用户偏好-筛选项 */\n allVisibleFilterFields: {\n type: Array as PropType<IPagePreferenceItem[]>,\n default: () => ([]),\n },\n /** 全量用户偏好-表格列 */\n allVisibleColumnFields: {\n type: Array as PropType<IPagePreferenceItem[]>,\n default: () => ([]),\n },\n}\n\nexport default defineComponent({\n name: 'CommonSetter',\n inheritAttrs: true,\n props,\n emits: ['confirm'],\n setup(props, { slots, emit }) {\n const popoverRef = ref()\n /** 从props派生一个镜像数据,用于CommonSetter临时勾选和排序 */\n const basicFields = ref({\n [pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]: props.allVisibleFilterFields,\n [pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]: props.allVisibleColumnFields,\n })\n /** 数据源改变,则更新镜像数据 */\n watch(() => [props.allVisibleFilterFields, props.allVisibleColumnFields], ([v1, v2]) => {\n basicFields.value = {\n [pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]: v1,\n [pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]: v2,\n }\n }, { immediate: true, deep: true })\n /** 关闭弹窗时,重置镜像数据为props数据源 */\n const close = () => {\n popoverRef.value?.hide?.()\n basicFields.value = {\n [pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]: props.allVisibleFilterFields,\n [pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]: props.allVisibleColumnFields,\n }\n }\n return () => {\n const defaultTsx = () => (\n <Space direction='column' size={0}> \n <Space align='stretch' size={4}>\n {/* <DraggableList\n fields={basicFields.value[pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]]}\n onUpdate:fields={(fields: IPagePreferenceItem[]) => {\n basicFields.value[pagePreferencesToKeyMap[Common_Page_Preferences_Type.FILTER]] = fields\n }}\n /> */}\n <DraggableList\n fields={basicFields.value[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]]}\n onUpdate:fields={(fields: IPagePreferenceItem[]) => {\n basicFields.value[pagePreferencesToKeyMap[Common_Page_Preferences_Type.COLUMN]] = fields\n }}\n />\n </Space>\n <Space justify='center' fill size={0} style={{ padding: '16px 0 0 0' }}>\n <ElButton onClick={close}>取消</ElButton>\n <ElButton\n type='primary'\n onClick={() => {\n popoverRef.value?.hide?.()\n /** cloneDeep,防止本组件镜像数据和useStorage中数据串联 */\n emit('confirm', cloneDeep(basicFields.value))\n }}\n >确认</ElButton>\n </Space>\n </Space>\n )\n return (\n <ElPopover \n ref={popoverRef}\n popperClass={styles.container}\n placement='bottom-end' \n width='fit-content'\n trigger='click'\n v-slots={{\n reference: slots?.reference?.(),\n default: defaultTsx,\n }}\n />\n )\n }\n }\n})\n"],"names":["props","allVisibleFilterFields","type","Array","default","allVisibleColumnFields","defineComponent","name","inheritAttrs","emits","setup","slots","emit","popoverRef","ref","basicFields","pagePreferencesToKeyMap","Common_Page_Preferences_Type","FILTER","COLUMN","watch","v1","v2","value","immediate","deep","close","hide","defaultTsx","_createVNode","Space","DraggableList","fields","padding","ElButton","_createTextVNode","onClick","_a","cloneDeep","ElPopover","styles","container","reference"],"mappings":";;;;;;;;;AAWA,MAAMA,KAAQ,GAAA;AAAA;AAAA,EAEZC,sBAAwB,EAAA;AAAA,IACtBC,IAAMC,EAAAA,KAAAA;AAAAA,IACNC,OAAAA,EAASA,MAAO,EAAA;AAAA,GAClB;AAAA;AAAA,EAEAC,sBAAwB,EAAA;AAAA,IACtBH,IAAMC,EAAAA,KAAAA;AAAAA,IACNC,OAAAA,EAASA,MAAO,EAAA;AAAA,GAClB;AACF,CAAA,CAAA;AAEA,mBAAeE,eAAgB,CAAA;AAAA,EAC7BC,IAAM,EAAA,cAAA;AAAA,EACNC,YAAc,EAAA,IAAA;AAAA,EACdR,KAAAA;AAAAA,EACAS,KAAAA,EAAO,CAAC,SAAS,CAAA;AAAA,EACjBC,MAAMV,MAAO,EAAA;AAAA,IAAEW,KAAAA;AAAAA,IAAOC,IAAAA;AAAAA,GAAQ,EAAA;AAC5B,IAAA,MAAMC,aAAaC,GAAI,EAAA,CAAA;AAEvB,IAAA,MAAMC,cAAcD,GAAI,CAAA;AAAA,MACtB,CAACE,uBAAwBC,CAAAA,4BAAAA,CAA6BC,MAAM,CAAC,GAAGlB,MAAMC,CAAAA,sBAAAA;AAAAA,MACtE,CAACe,uBAAwBC,CAAAA,4BAAAA,CAA6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A,UAAWU,CAAAA,KAAAA,KAAXV,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,GAAAA,CAAkBc,SAAlBd,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,EAAAA,CAAAA,IAAAA,CAAAA,GAAAA,CAAAA,CAAAA;AAEAD,cAAAA,IAAAA,CAAK,SAAW0B,EAAAA,SAAAA,CAAUvB,WAAYQ,CAAAA,KAAK,CAAC,CAAA,CAAA;AAAA,aAC9C;AAAA,WAAC,EAAA;AAAA,YAAAnB,OAAAA,EAAAA,MAAA,CAAA+B,eAAAA,CAAA,cAAA,CAAA,CAAA;AAAA,WAAA,CAAA,CAAA;AAAA,SAAA,CAAA,CAAA;AAAA,OAIR,CAAA,CAAA;AACD,MAAA,OAAAN,YAAAU,SAAA,EAAA;AAAA,QAAA,KAES1B,EAAAA,UAAAA;AAAAA,QAAU,eACF2B,MAAOC,CAAAA,SAAAA;AAAAA,QAAS,WAAA,EAAA,YAAA;AAAA,QAAA,OAAA,EAAA,aAAA;AAAA,QAAA,SAAA,EAAA,OAAA;AAAA,OAIpB,EAAA;AAAA,QACPC,SAAAA,EAAAA,CAAW/B,oCAAO+B,SAAP/B,KAAAA,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,EAAAA,CAAAA,IAAAA,CAAAA,KAAAA,CAAAA;AAAAA,QACXP,OAASwB,EAAAA,UAAAA;AAAAA,OACV,CAAA,CAAA;AAAA,KAGP,CAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PaginationProps } from 'element-plus';
|
|
2
|
+
/** 表头单元格样式 */
|
|
3
|
+
export declare const headerCellStyle: {
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
};
|
|
6
|
+
/** 列表取值字段 */
|
|
7
|
+
export declare const key = "list";
|
|
8
|
+
/** 默认每页条数 */
|
|
9
|
+
export declare const defaultPageSize = 20;
|
|
10
|
+
/** 分页器默认配置 */
|
|
11
|
+
export declare const defaultPaginationConfig: Partial<PaginationProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const headerCellStyle = {
|
|
2
|
+
backgroundColor: "#F7F9FB"
|
|
3
|
+
};
|
|
4
|
+
const key = "list";
|
|
5
|
+
const defaultPageSize = 20;
|
|
6
|
+
const defaultPaginationConfig = {
|
|
7
|
+
size: "small",
|
|
8
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
9
|
+
defaultPageSize,
|
|
10
|
+
pageSizes: [20, 30, 40, 50, 100]
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { defaultPageSize, defaultPaginationConfig, headerCellStyle, key };
|
|
14
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../../packages/components/commonTable/constants.ts"],"sourcesContent":["import type { PaginationProps } from 'element-plus'\n\n/** 表头单元格样式 */\nexport const headerCellStyle = {\n backgroundColor: '#F7F9FB',\n}\n\n/** 列表取值字段 */\nexport const key = 'list'\n\n/** 默认每页条数 */\nexport const defaultPageSize = 20\n\n/** 分页器默认配置 */\nexport const defaultPaginationConfig: Partial<PaginationProps> = {\n size: 'small',\n layout: 'total, sizes, prev, pager, next, jumper',\n defaultPageSize: defaultPageSize,\n pageSizes: [20, 30, 40, 50, 100],\n}\n"],"names":[],"mappings":"AAGO,MAAM,eAAkB,GAAA;AAAA,EAC7B,eAAiB,EAAA,SAAA;AACnB,EAAA;AAGO,MAAM,GAAM,GAAA,OAAA;AAGZ,MAAM,eAAkB,GAAA,GAAA;AAGxB,MAAM,uBAAoD,GAAA;AAAA,EAC/D,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA,yCAAA;AAAA,EACR,eAAA;AAAA,EACA,WAAW,CAAC,EAAA,EAAI,EAAI,EAAA,EAAA,EAAI,IAAI,GAAG,CAAA;AACjC;;;;"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export * from './interfaces';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
rowKey: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
columns: {
|
|
9
|
+
type: import("vue").PropType<Ref<import("element-plus").Column[]>>;
|
|
10
|
+
default: () => Ref<any[], any[]>;
|
|
11
|
+
};
|
|
12
|
+
listApi: {
|
|
13
|
+
type: import("vue").PropType<import("packages/interfaces").IListApi>;
|
|
14
|
+
default: any;
|
|
15
|
+
};
|
|
16
|
+
formatListParams: {
|
|
17
|
+
type: import("vue").PropType<(p: any) => any>;
|
|
18
|
+
default: any;
|
|
19
|
+
};
|
|
20
|
+
beforeFetch: {
|
|
21
|
+
type: import("vue").PropType<(p: Record<"formData" | "pagination", import("packages/interfaces").ICommonObj | undefined>) => Promise<void> | void>;
|
|
22
|
+
default: any;
|
|
23
|
+
};
|
|
24
|
+
selectable: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
selectOptions: {
|
|
29
|
+
type: import("vue").PropType<(row?: any, index?: number) => boolean>;
|
|
30
|
+
default: () => boolean;
|
|
31
|
+
};
|
|
32
|
+
selected: {
|
|
33
|
+
type: ArrayConstructor;
|
|
34
|
+
default: () => any[];
|
|
35
|
+
};
|
|
36
|
+
expandedRowRender: {
|
|
37
|
+
type: import("vue").PropType<(p: import("packages/keepUp").IExpandedRowRenderParams) => import("vue").VNode>;
|
|
38
|
+
default: any;
|
|
39
|
+
};
|
|
40
|
+
paginationConfig: {
|
|
41
|
+
type: ObjectConstructor;
|
|
42
|
+
default: () => {};
|
|
43
|
+
};
|
|
44
|
+
needPagination: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
class: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: any;
|
|
51
|
+
};
|
|
52
|
+
style: {
|
|
53
|
+
type: ObjectConstructor;
|
|
54
|
+
default: () => {};
|
|
55
|
+
};
|
|
56
|
+
} & {
|
|
57
|
+
key: any;
|
|
58
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:selected" | "rowClick")[], "update:selected" | "rowClick", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
59
|
+
rowKey: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
columns: {
|
|
64
|
+
type: import("vue").PropType<Ref<import("element-plus").Column[]>>;
|
|
65
|
+
default: () => Ref<any[], any[]>;
|
|
66
|
+
};
|
|
67
|
+
listApi: {
|
|
68
|
+
type: import("vue").PropType<import("packages/interfaces").IListApi>;
|
|
69
|
+
default: any;
|
|
70
|
+
};
|
|
71
|
+
formatListParams: {
|
|
72
|
+
type: import("vue").PropType<(p: any) => any>;
|
|
73
|
+
default: any;
|
|
74
|
+
};
|
|
75
|
+
beforeFetch: {
|
|
76
|
+
type: import("vue").PropType<(p: Record<"formData" | "pagination", import("packages/interfaces").ICommonObj | undefined>) => Promise<void> | void>;
|
|
77
|
+
default: any;
|
|
78
|
+
};
|
|
79
|
+
selectable: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
selectOptions: {
|
|
84
|
+
type: import("vue").PropType<(row?: any, index?: number) => boolean>;
|
|
85
|
+
default: () => boolean;
|
|
86
|
+
};
|
|
87
|
+
selected: {
|
|
88
|
+
type: ArrayConstructor;
|
|
89
|
+
default: () => any[];
|
|
90
|
+
};
|
|
91
|
+
expandedRowRender: {
|
|
92
|
+
type: import("vue").PropType<(p: import("packages/keepUp").IExpandedRowRenderParams) => import("vue").VNode>;
|
|
93
|
+
default: any;
|
|
94
|
+
};
|
|
95
|
+
paginationConfig: {
|
|
96
|
+
type: ObjectConstructor;
|
|
97
|
+
default: () => {};
|
|
98
|
+
};
|
|
99
|
+
needPagination: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: boolean;
|
|
102
|
+
};
|
|
103
|
+
class: {
|
|
104
|
+
type: StringConstructor;
|
|
105
|
+
default: any;
|
|
106
|
+
};
|
|
107
|
+
style: {
|
|
108
|
+
type: ObjectConstructor;
|
|
109
|
+
default: () => {};
|
|
110
|
+
};
|
|
111
|
+
} & {
|
|
112
|
+
key: any;
|
|
113
|
+
}>> & Readonly<{
|
|
114
|
+
"onUpdate:selected"?: (...args: any[]) => any;
|
|
115
|
+
onRowClick?: (...args: any[]) => any;
|
|
116
|
+
}>, {
|
|
117
|
+
key: any;
|
|
118
|
+
class: string;
|
|
119
|
+
style: Record<string, any>;
|
|
120
|
+
columns: Ref<import("element-plus").Column[], import("element-plus").Column[]>;
|
|
121
|
+
rowKey: string;
|
|
122
|
+
listApi: import("packages/interfaces").IListApi;
|
|
123
|
+
formatListParams: (p: any) => any;
|
|
124
|
+
beforeFetch: (p: Record<"formData" | "pagination", import("packages/interfaces").ICommonObj | undefined>) => Promise<void> | void;
|
|
125
|
+
selectable: boolean;
|
|
126
|
+
selectOptions: (row?: any, index?: number) => boolean;
|
|
127
|
+
selected: unknown[];
|
|
128
|
+
expandedRowRender: (p: import("packages/keepUp").IExpandedRowRenderParams) => import("vue").VNode;
|
|
129
|
+
paginationConfig: Record<string, any>;
|
|
130
|
+
needPagination: boolean;
|
|
131
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
132
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent, ref, inject, computed, unref, onMounted, watch, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { isEmpty } from 'lodash';
|
|
3
|
+
import { useField } from '@formily/vue';
|
|
4
|
+
import { ElEmpty, ElTable, ElTableColumn, ElPagination } from 'element-plus';
|
|
5
|
+
import Space from '../space/index.mjs';
|
|
6
|
+
import '../commonPage/index.mjs';
|
|
7
|
+
import { defaultPaginationConfig, headerCellStyle } from './constants.mjs';
|
|
8
|
+
import { setSelected } from './utils.mjs';
|
|
9
|
+
import usePagination from './usePagination.mjs';
|
|
10
|
+
import { props } from './props.mjs';
|
|
11
|
+
import stylus from './index.module.mjs';
|
|
12
|
+
import { COMMON_FILTER_INJECTION_KEY } from '../commonPage/constants.mjs';
|
|
13
|
+
|
|
14
|
+
var CommonTable = defineComponent({
|
|
15
|
+
name: "CommonTable",
|
|
16
|
+
inheritAttrs: false,
|
|
17
|
+
props,
|
|
18
|
+
emits: ["update:selected", "rowClick"],
|
|
19
|
+
setup(props2, {
|
|
20
|
+
attrs,
|
|
21
|
+
emit,
|
|
22
|
+
slots,
|
|
23
|
+
expose
|
|
24
|
+
}) {
|
|
25
|
+
var _a;
|
|
26
|
+
const fieldRef = useField();
|
|
27
|
+
const tableRef = ref();
|
|
28
|
+
const refreshKey = ref(0);
|
|
29
|
+
const currentPage = ref(1);
|
|
30
|
+
const commonFilterRef = inject(COMMON_FILTER_INJECTION_KEY, ref(null));
|
|
31
|
+
const columns = computed(() => unref(props2.columns));
|
|
32
|
+
const {
|
|
33
|
+
data,
|
|
34
|
+
pagination,
|
|
35
|
+
getList
|
|
36
|
+
} = usePagination({
|
|
37
|
+
currentPage,
|
|
38
|
+
commonFilterRef,
|
|
39
|
+
setSelected: (data2) => setSelected({
|
|
40
|
+
tableRef,
|
|
41
|
+
selected: props2.selected,
|
|
42
|
+
rowKey: props2.rowKey,
|
|
43
|
+
data: data2
|
|
44
|
+
}),
|
|
45
|
+
props: props2
|
|
46
|
+
});
|
|
47
|
+
const mergedPaginationConfig = computed(() => ({
|
|
48
|
+
...defaultPaginationConfig,
|
|
49
|
+
...props2.paginationConfig
|
|
50
|
+
}));
|
|
51
|
+
const filterEmptyTip = computed(() => isEmpty(props2.columns) ? "\u54CE\u5440\uFF0C\u81F3\u5C11\u7559\u4E00\u5217\u5427\uFF0C\u4E0D\u7136\u8868\u683C\u90FD\u6CA1\u6CD5\u770B\u5566\uFF5E" : "");
|
|
52
|
+
const dataEmptyTip = computed(() => isEmpty(data.value) ? "\u7A7A\u7A7A\u5982\u4E5F\uFF5E\u8981\u4E0D\u5148\u53BB\u52A0\u70B9\u6570\u636E\u770B\u770B\uFF1F" : "");
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
getList(1, pagination == null ? void 0 : pagination.pageSize);
|
|
55
|
+
});
|
|
56
|
+
watch(() => columns.value, () => {
|
|
57
|
+
refreshKey.value = refreshKey.value === 0 ? 1 : 0;
|
|
58
|
+
}, {
|
|
59
|
+
deep: true
|
|
60
|
+
});
|
|
61
|
+
(_a = fieldRef.value) == null ? void 0 : _a.setData({
|
|
62
|
+
reset: getList
|
|
63
|
+
});
|
|
64
|
+
expose({
|
|
65
|
+
pagination,
|
|
66
|
+
getList
|
|
67
|
+
});
|
|
68
|
+
const expandedRowTsx = () => props2.expandedRowRender && createVNode(ElTableColumn, {
|
|
69
|
+
"type": "expand"
|
|
70
|
+
}, {
|
|
71
|
+
default: (data2) => {
|
|
72
|
+
var _a2;
|
|
73
|
+
return (_a2 = props2.expandedRowRender) == null ? void 0 : _a2.call(props2, data2);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return () => createVNode(Space, {
|
|
77
|
+
"class": [stylus.container, props2.class],
|
|
78
|
+
"style": props2.style,
|
|
79
|
+
"direction": "column"
|
|
80
|
+
}, {
|
|
81
|
+
default: () => {
|
|
82
|
+
var _a2, _b;
|
|
83
|
+
return [filterEmptyTip.value ? createVNode(ElEmpty, {
|
|
84
|
+
"description": filterEmptyTip.value
|
|
85
|
+
}, null) : (_b = (_a2 = slots == null ? void 0 : slots.content) == null ? void 0 : _a2.call(slots, {
|
|
86
|
+
data,
|
|
87
|
+
height: attrs.height
|
|
88
|
+
})) != null ? _b : createVNode(ElTable, mergeProps({
|
|
89
|
+
"ref": tableRef,
|
|
90
|
+
"key": refreshKey.value,
|
|
91
|
+
"headerCellStyle": headerCellStyle,
|
|
92
|
+
"formatter": () => "-"
|
|
93
|
+
}, attrs, {
|
|
94
|
+
"rowKey": props2.rowKey,
|
|
95
|
+
"data": data.value,
|
|
96
|
+
"header-cell-style": () => ({
|
|
97
|
+
backgroundColor: "#e6e8eb!important"
|
|
98
|
+
})
|
|
99
|
+
}, isEmpty(data.value) ? {
|
|
100
|
+
height: "32p0px"
|
|
101
|
+
} : {}, {
|
|
102
|
+
"onSelectionChange": (newSelection) => emit("update:selected", newSelection)
|
|
103
|
+
}), {
|
|
104
|
+
default: () => [props2.selectable && createVNode(ElTableColumn, {
|
|
105
|
+
"type": "selection",
|
|
106
|
+
"fixed": "left",
|
|
107
|
+
"selectable": props2.selectOptions
|
|
108
|
+
}, null), expandedRowTsx(), columns.value.map((v, i) => createVNode(ElTableColumn, mergeProps(v, {
|
|
109
|
+
"key": i
|
|
110
|
+
}), {
|
|
111
|
+
default: (scope) => {
|
|
112
|
+
var _a3;
|
|
113
|
+
return ((_a3 = v == null ? void 0 : v.render) == null ? void 0 : _a3.call(v, {
|
|
114
|
+
rowData: scope.row,
|
|
115
|
+
rowIndex: scope.$index
|
|
116
|
+
})) || createVNode("div", null, [scope.row[v.prop] || "-"]);
|
|
117
|
+
}
|
|
118
|
+
}))],
|
|
119
|
+
empty: () => createVNode(ElEmpty, {
|
|
120
|
+
"description": dataEmptyTip.value
|
|
121
|
+
}, null),
|
|
122
|
+
...slots
|
|
123
|
+
}), props2.needPagination && createVNode(ElPagination, mergeProps({
|
|
124
|
+
"style": {
|
|
125
|
+
width: "calc(100% - 24px)",
|
|
126
|
+
margin: "4px 0 14px 0",
|
|
127
|
+
justifyContent: "end"
|
|
128
|
+
},
|
|
129
|
+
"currentPage": currentPage.value,
|
|
130
|
+
"onChange": getList
|
|
131
|
+
}, mergedPaginationConfig.value, {
|
|
132
|
+
"total": pagination == null ? void 0 : pagination.total
|
|
133
|
+
}), null)];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export { CommonTable as default };
|
|
140
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/commonTable/index.tsx"],"sourcesContent":["import { defineComponent, ref, unref, computed, watch, inject, onMounted } from 'vue'\nimport { isEmpty } from 'lodash'\nimport { useField } from '@formily/vue'\nimport { ElPagination, ElTable, ElTableColumn, ElEmpty } from 'element-plus'\nimport Space from '../space'\nimport { COMMON_FILTER_INJECTION_KEY } from '../commonPage'\nimport { defaultPaginationConfig, headerCellStyle } from './constants'\nimport { setSelected } from './utils'\nimport usePagination from './usePagination'\nimport { props } from './props'\nimport stylus from './index.module.scss'\n\nimport type { Ref } from 'vue'\nimport type { ICommonFilterExpose } from '../commonFilter'\n\nexport * from './interfaces'\nexport default defineComponent({\n name: 'CommonTable',\n inheritAttrs: false,\n props: props as typeof props & { key: any },\n emits: ['update:selected', 'rowClick'],\n setup(props, { attrs, emit, slots, expose }) {\n const fieldRef = useField()\n const tableRef = ref()\n const refreshKey = ref(0)\n const currentPage = ref(1)\n const commonFilterRef = inject<Ref<ICommonFilterExpose>>(COMMON_FILTER_INJECTION_KEY, ref(null))\n const columns = computed(() => unref(props.columns))\n const { data, pagination, getList } = usePagination({\n currentPage,\n commonFilterRef,\n setSelected: (data: any[]) =>\n setSelected({\n tableRef,\n selected: props.selected,\n rowKey: props.rowKey,\n data,\n }),\n props,\n })\n const mergedPaginationConfig = computed(() => ({\n ...defaultPaginationConfig,\n ...props.paginationConfig,\n }))\n const filterEmptyTip = computed<string>(() =>\n isEmpty(props.columns) ? '哎呀,至少留一列吧,不然表格都没法看啦~' : '',\n )\n const dataEmptyTip = computed<string>(() =>\n isEmpty(data.value) ? '空空如也~要不先去加点数据看看?' : '',\n )\n onMounted(() => {\n /** 需要带上筛选项数据,所以等筛选项onMounted */\n getList(1, pagination?.pageSize)\n })\n watch(\n () => columns.value,\n () => {\n refreshKey.value = refreshKey.value === 0 ? 1 : 0\n },\n { deep: true },\n )\n /** 在formily场景下使用的刷新功能 */\n fieldRef.value?.setData({ reset: getList })\n expose({ pagination, getList })\n /** 展开区域渲染器 */\n const expandedRowTsx = () =>\n props.expandedRowRender && (\n <ElTableColumn\n type='expand'\n v-slots={{\n default: (data) => props.expandedRowRender?.(data),\n }}\n />\n )\n return () => (\n <Space class={[stylus.container, props.class]} style={props.style} direction='column'>\n {filterEmptyTip.value ? (\n <ElEmpty description={filterEmptyTip.value} />\n ) : (\n slots?.content?.({ data, height: attrs.height }) ?? (\n <ElTable\n ref={tableRef}\n key={refreshKey.value}\n headerCellStyle={headerCellStyle}\n formatter={() => '-'}\n {...attrs}\n rowKey={props.rowKey}\n data={data.value}\n header-cell-style={() => ({ backgroundColor: '#e6e8eb!important' })}\n {...(isEmpty(data.value) ? { height: '32p0px' } : {})}\n // 每次查询,table重新赋值后,table触发事件去清空选中值。给checkbox的column加上reserve-selection可解。\n // @ts-ignore\n onSelectionChange={(newSelection: any[]) => emit('update:selected', newSelection)}\n v-slots={{\n empty: () => <ElEmpty description={dataEmptyTip.value} />,\n ...slots,\n }}\n >\n {props.selectable && (\n <ElTableColumn type='selection' fixed='left' selectable={props.selectOptions} />\n )}\n {expandedRowTsx()}\n {columns.value.map((v, i) => (\n <ElTableColumn\n {...v}\n key={i}\n v-slots={{\n default: (scope: { row: any; column: any; $index: number }) => {\n return (\n v?.render?.({ rowData: scope.row, rowIndex: scope.$index }) || (\n <div>{scope.row[v.prop] || '-'}</div>\n )\n )\n },\n }}\n />\n ))}\n </ElTable>\n )\n )}\n {props.needPagination && (\n <ElPagination\n style={{ width: 'calc(100% - 24px)', margin: '4px 0 14px 0', justifyContent: 'end' }}\n currentPage={currentPage.value}\n onChange={getList}\n {...mergedPaginationConfig.value}\n total={pagination?.total}\n />\n )}\n </Space>\n )\n },\n})\n"],"names":["defineComponent","name","inheritAttrs","props","emits","setup","attrs","emit","slots","expose","fieldRef","useField","tableRef","ref","refreshKey","currentPage","commonFilterRef","inject","COMMON_FILTER_INJECTION_KEY","columns","computed","unref","data","pagination","getList","usePagination","setSelected","selected","rowKey","mergedPaginationConfig","defaultPaginationConfig","paginationConfig","filterEmptyTip","isEmpty","dataEmptyTip","value","onMounted","pageSize","watch","deep","setData","reset","expandedRowTsx","expandedRowRender","_createVNode","ElTableColumn","default","_a","Space","stylus","container","class","style","ElEmpty","content","height","ElTable","_mergeProps","headerCellStyle","formatter","header-cell-style","backgroundColor","newSelection","selectable","selectOptions","map","v","i","scope","render","rowData","row","rowIndex","$index","prop","empty","needPagination","ElPagination","width","margin","justifyContent","total"],"mappings":";;;;;;;;;;;;;AAgBA,kBAAeA,eAAgB,CAAA;AAAA,EAC7BC,IAAM,EAAA,aAAA;AAAA,EACNC,YAAc,EAAA,KAAA;AAAA,EACdC,KAAAA;AAAAA,EACAC,KAAAA,EAAO,CAAC,iBAAA,EAAmB,UAAU,CAAA;AAAA,EACrCC,MAAMF,MAAO,EAAA;AAAA,IAAEG,KAAAA;AAAAA,IAAOC,IAAAA;AAAAA,IAAMC,KAAAA;AAAAA,IAAOC,MAAAA;AAAAA,GAAU,EAAA;AArB/C,IAAA,IAAA,EAAA,CAAA;AAsBI,IAAA,MAAMC,WAAWC,QAAS,EAAA,CAAA;AAC1B,IAAA,MAAMC,WAAWC,GAAI,EAAA,CAAA;AACrB,IAAMC,MAAAA,UAAAA,GAAaD,IAAI,CAAC,CAAA,CAAA;AACxB,IAAME,MAAAA,WAAAA,GAAcF,IAAI,CAAC,CAAA,CAAA;AACzB,IAAA,MAAMG,eAAkBC,GAAAA,MAAAA,CAAiCC,2BAA6BL,EAAAA,GAAAA,CAAI,IAAI,CAAC,CAAA,CAAA;AAC/F,IAAA,MAAM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KAAAA,CAAAA,GAAAA,UAAAA,CAAAA,KAAAA;AAAAA,SAEtB,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GACH;AACF,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { props } from './props';
|
|
2
|
+
import type { Ref, UnwrapNestedRefs, ExtractPropTypes } from 'vue';
|
|
3
|
+
import type { TableRefs } from 'element-plus';
|
|
4
|
+
import type { ICommonFilterExpose } from '../commonFilter';
|
|
5
|
+
/** CommonTable内获取列表方法 */
|
|
6
|
+
type IGetList = (currentPage?: number, pageSize?: number, text?: string) => Promise<void>;
|
|
7
|
+
/** usePagination入参 */
|
|
8
|
+
export interface IUsePaginationParams {
|
|
9
|
+
/** 当前页码 */
|
|
10
|
+
currentPage: Ref<number>;
|
|
11
|
+
/** commonFilterRef */
|
|
12
|
+
commonFilterRef: Ref<ICommonFilterExpose>;
|
|
13
|
+
/** 设置选中值 */
|
|
14
|
+
setSelected: (p: any[]) => void;
|
|
15
|
+
/** props */
|
|
16
|
+
props: ExtractPropTypes<typeof props>;
|
|
17
|
+
}
|
|
18
|
+
/** page信息 */
|
|
19
|
+
export interface IPagination {
|
|
20
|
+
/** 当前页码 */
|
|
21
|
+
page: number;
|
|
22
|
+
/** 每页展示的条数 */
|
|
23
|
+
pageSize: number;
|
|
24
|
+
/** 总条数 */
|
|
25
|
+
total?: number;
|
|
26
|
+
}
|
|
27
|
+
/** usePagination出参 */
|
|
28
|
+
export interface IUsePaginationRes {
|
|
29
|
+
/** table数据源 */
|
|
30
|
+
data: Ref<any[]>;
|
|
31
|
+
/** page信息 */
|
|
32
|
+
pagination: UnwrapNestedRefs<IPagination | null>;
|
|
33
|
+
/** CommonTable内获取列表方法 */
|
|
34
|
+
getList: IGetList;
|
|
35
|
+
}
|
|
36
|
+
/** 设置选中值入参 */
|
|
37
|
+
export interface ISetSelectedParams {
|
|
38
|
+
/** tableRef */
|
|
39
|
+
tableRef: Ref<TableRefs>;
|
|
40
|
+
/** 选中值 */
|
|
41
|
+
selected: any[];
|
|
42
|
+
/** 行标识 */
|
|
43
|
+
rowKey: string;
|
|
44
|
+
/** table数据源 */
|
|
45
|
+
data: any[];
|
|
46
|
+
}
|
|
47
|
+
/** commonTable出参 */
|
|
48
|
+
export interface ICommonTableExpose {
|
|
49
|
+
/** page信息 会自动解包,所以无需Ref */
|
|
50
|
+
pagination: IPagination | null;
|
|
51
|
+
/** CommonTable内获取列表方法 */
|
|
52
|
+
getList: IGetList;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PropType, Ref, VNode } from 'vue';
|
|
2
|
+
import type { Column } from 'element-plus';
|
|
3
|
+
import type { IExpandedRowRenderParams } from '../commonPage/interfaces';
|
|
4
|
+
import type { IListApi, ICommonObj } from '../../interfaces';
|
|
5
|
+
export declare const props: {
|
|
6
|
+
/** 行标识 */
|
|
7
|
+
rowKey: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
/** columns */
|
|
12
|
+
columns: {
|
|
13
|
+
type: PropType<Ref<Column[]>>;
|
|
14
|
+
default: () => Ref<any[], any[]>;
|
|
15
|
+
};
|
|
16
|
+
/** 获取列表 */
|
|
17
|
+
listApi: {
|
|
18
|
+
type: PropType<IListApi>;
|
|
19
|
+
default: any;
|
|
20
|
+
};
|
|
21
|
+
/** 格式化列表接口入参 */
|
|
22
|
+
formatListParams: {
|
|
23
|
+
type: PropType<(p: any) => any>;
|
|
24
|
+
default: any;
|
|
25
|
+
};
|
|
26
|
+
/** getList前置钩子 */
|
|
27
|
+
beforeFetch: {
|
|
28
|
+
type: PropType<(p: Record<"formData" | "pagination", ICommonObj | undefined>) => Promise<void> | void>;
|
|
29
|
+
default: any;
|
|
30
|
+
};
|
|
31
|
+
/** 可选择 */
|
|
32
|
+
selectable: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
/** 选择配置 */
|
|
37
|
+
selectOptions: {
|
|
38
|
+
type: PropType<(row?: any, index?: number) => boolean>;
|
|
39
|
+
default: () => boolean;
|
|
40
|
+
};
|
|
41
|
+
/** 选中值 */
|
|
42
|
+
selected: {
|
|
43
|
+
type: ArrayConstructor;
|
|
44
|
+
default: () => any[];
|
|
45
|
+
};
|
|
46
|
+
/** 表格展开区域渲染器 */
|
|
47
|
+
expandedRowRender: {
|
|
48
|
+
type: PropType<(p: IExpandedRowRenderParams) => VNode>;
|
|
49
|
+
default: any;
|
|
50
|
+
};
|
|
51
|
+
/** 分页配置 */
|
|
52
|
+
paginationConfig: {
|
|
53
|
+
type: ObjectConstructor;
|
|
54
|
+
default: () => {};
|
|
55
|
+
};
|
|
56
|
+
/** 需要分页 */
|
|
57
|
+
needPagination: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
default: boolean;
|
|
60
|
+
};
|
|
61
|
+
/** class */
|
|
62
|
+
class: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: any;
|
|
65
|
+
};
|
|
66
|
+
/** style */
|
|
67
|
+
style: {
|
|
68
|
+
type: ObjectConstructor;
|
|
69
|
+
default: () => {};
|
|
70
|
+
};
|
|
71
|
+
};
|