@dfsj/components 3.7.2 → 4.0.0-alpha.2
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/CHANGELOG.md +57 -449
- package/README.md +101 -24
- package/dist/_virtual/_rollupPluginBabelHelpers.js +13 -0
- package/dist/components/Boards/src/Boards.vue.js +10 -4
- package/dist/components/Boards/src/Boards.vue2.js +10 -147
- package/dist/components/Boards/src/hooKs/useStyle.d.ts +16 -4
- package/dist/components/Boards/src/hooKs/useStyle.js +10 -99
- package/dist/components/Boards/src/props.d.ts +6 -22
- package/dist/components/Boards/src/props.js +10 -55
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.js +10 -4
- package/dist/components/ClickOutSide/src/ClickOutSide.vue2.js +10 -25
- package/dist/components/Descriptions/src/Descriptions.vue.js +10 -4
- package/dist/components/Descriptions/src/Descriptions.vue2.js +10 -150
- package/dist/components/Editor/src/Editor.vue.js +10 -4
- package/dist/components/Editor/src/Editor.vue2.js +10 -137
- package/dist/components/Form/src/Form.vue.js +10 -4
- package/dist/components/Form/src/Form.vue2.js +10 -388
- package/dist/components/Form/src/components/useRenderCheckbox.js +10 -32
- package/dist/components/Form/src/components/useRenderRadio.js +10 -32
- package/dist/components/Form/src/components/useRenderSelect.js +10 -51
- package/dist/components/Form/src/helper/componentMap.js +10 -34
- package/dist/components/Form/src/helper/index.js +10 -108
- package/dist/components/Form/src/types/index.d.ts +80 -84
- package/dist/components/Form/src/types/index.js +10 -30
- package/dist/components/Form/src/useForm.js +10 -289
- package/dist/components/Highlight/src/Highlight.vue.js +10 -4
- package/dist/components/Highlight/src/Highlight.vue2.js +10 -61
- package/dist/components/Icon/src/Icon.vue.js +10 -4
- package/dist/components/Icon/src/Icon.vue2.js +10 -122
- package/dist/components/Icon/src/SvgIcon.vue.js +10 -6
- package/dist/components/Icon/src/SvgIcon.vue2.js +10 -44
- package/dist/components/Icon/src/SvgIcon.vue3.js +10 -13
- package/dist/components/InputPassword/src/InputPassword.vue.js +10 -4
- package/dist/components/InputPassword/src/InputPassword.vue2.js +10 -57
- package/dist/components/Modal/src/BasicModal.vue.js +10 -4
- package/dist/components/Modal/src/BasicModal.vue2.js +10 -154
- package/dist/components/Modal/src/components/ModalFooter.vue.js +10 -4
- package/dist/components/Modal/src/components/ModalFooter.vue2.js +10 -39
- package/dist/components/Modal/src/components/ModalHeader.vue.js +10 -4
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +10 -80
- package/dist/components/Modal/src/config.d.ts +3 -2
- package/dist/components/Modal/src/config.js +10 -28
- package/dist/components/Modal/src/hooks/useModalDrag.js +10 -109
- package/dist/components/Modal/src/hooks/useTimeout.js +10 -52
- package/dist/components/Modal/src/props.d.ts +16 -56
- package/dist/components/Modal/src/props.js +10 -130
- package/dist/components/Modal/src/utils/index.js +10 -85
- package/dist/components/NodeAxis/src/AbstractNodeProvider.js +10 -21
- package/dist/components/NodeAxis/src/CanvasNodeRender.d.ts +3 -12
- package/dist/components/NodeAxis/src/CanvasNodeRender.js +10 -411
- package/dist/components/NodeAxis/src/NodeAxis.vue.js +10 -4
- package/dist/components/NodeAxis/src/NodeAxis.vue2.js +10 -68
- package/dist/components/NodeAxis/src/NodeModel.js +10 -62
- package/dist/components/NodeAxis/src/NodeRender.js +10 -28
- package/dist/components/NodeAxis/src/NullLayerProvider.js +10 -86
- package/dist/components/NodeAxis/src/NullProvider.js +10 -65
- package/dist/components/NodeAxis/src/TimerNodePlayer.js +10 -148
- package/dist/components/NodeAxis/src/config/node-axis.options.js +10 -55
- package/dist/components/NodeAxis/src/enum/index.js +10 -19
- package/dist/components/NodeAxis/src/utils/assign.js +10 -42
- package/dist/components/Stateful/src/State.js +10 -78
- package/dist/components/Stateful/src/Stateful.vue.js +10 -4
- package/dist/components/Stateful/src/Stateful.vue2.js +10 -52
- package/dist/components/Stateful/src/props.d.ts +2 -6
- package/dist/components/Stateful/src/props.js +10 -28
- package/dist/components/Table/index.d.ts +3 -3
- package/dist/components/Table/src/Table.vue.js +10 -4
- package/dist/components/Table/src/Table.vue2.js +10 -583
- package/dist/components/Table/src/components/ColumnSetting.vue.js +10 -4
- package/dist/components/Table/src/components/ColumnSetting.vue2.js +10 -263
- package/dist/components/Table/src/components/TableActions.vue.js +10 -4
- package/dist/components/Table/src/components/TableActions.vue2.js +10 -107
- package/dist/components/Table/src/helper/index.js +10 -10
- package/dist/components/Table/src/types/index.d.ts +11 -13
- package/dist/components/Table/src/useTable.d.ts +36 -1
- package/dist/components/Table/src/useTable.js +10 -283
- package/dist/components/UnifyChart/src/ChartToolbox.vue.js +10 -4
- package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +10 -82
- package/dist/components/UnifyChart/src/UnifyChart.vue.js +10 -4
- package/dist/components/UnifyChart/src/UnifyChart.vue2.js +10 -57
- package/dist/components/UnifyChart/src/hooks/useLoader.js +10 -92
- package/dist/components/UnifyChart/src/hooks/useRender.d.ts +8 -13
- package/dist/components/UnifyChart/src/hooks/useRender.js +10 -49
- package/dist/components/UnifyChart/src/props.d.ts +13 -59
- package/dist/components/UnifyChart/src/props.js +10 -32
- package/dist/components/UnifyChart/src/useDownLoad.js +10 -26
- package/dist/components/Visual/src/BufferLayerPlayer.d.ts +9 -5
- package/dist/components/Visual/src/BufferLayerPlayer.js +10 -288
- package/dist/components/Visual/src/ResolvableLayerProvider.js +10 -252
- package/dist/components/Visual/src/config/default.manager.js +10 -6
- package/dist/components/Visual/src/config/default.provider.js +10 -17
- package/dist/components/Visual/src/mapping.js +10 -6
- package/dist/components/Visual/src/resolvers/IntervalResolver.js +10 -168
- package/dist/components/Visual/src/resolvers/tools.resolver.js +10 -151
- package/dist/components/Visual/src/utils/NodeMath.js +10 -99
- package/dist/components/Windows/src/ModalWrap.vue.js +10 -4
- package/dist/components/Windows/src/ModalWrap.vue2.js +10 -132
- package/dist/components/Windows/src/Windows.vue.js +10 -6
- package/dist/components/Windows/src/Windows.vue2.js +10 -55
- package/dist/components/Windows/src/Windows.vue3.js +10 -24
- package/dist/components/Windows/src/props.js +10 -8
- package/dist/directives/clickOutside.js +10 -70
- package/dist/directives/repeatClick.js +10 -28
- package/dist/directives/resizable.js +10 -195
- package/dist/index.d.ts +0 -2
- package/dist/index.js +11 -53
- package/dist/index.min.css +3 -3
- package/dist/themes/index.js +9 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.js +10 -23
- package/package.json +93 -66
- package/dist/components/Boards/src/Boards.vue.d.ts +0 -102
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.d.ts +0 -7
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/DatePicker/src/composables/use-month-range-header.d.ts +0 -16
- package/dist/components/DatePicker/src/composables/use-month-range-header.js +0 -52
- package/dist/components/DatePicker/src/composables/use-range-picker.d.ts +0 -173
- package/dist/components/DatePicker/src/composables/use-range-picker.js +0 -99
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue.d.ts +0 -19
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue.js +0 -5
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue2.js +0 -564
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue.d.ts +0 -16
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue.js +0 -5
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue2.js +0 -210
- package/dist/components/DatePicker/src/index.d.ts +0 -224
- package/dist/components/DatePicker/src/index.js +0 -87
- package/dist/components/DatePicker/src/panel-utils.d.ts +0 -2
- package/dist/components/DatePicker/src/panel-utils.js +0 -25
- package/dist/components/Descriptions/src/Descriptions.vue.d.ts +0 -97
- package/dist/components/Editor/src/Editor.vue.d.ts +0 -51
- package/dist/components/Form/src/Form.vue.d.ts +0 -838
- package/dist/components/Highlight/src/Highlight.vue.d.ts +0 -41
- package/dist/components/Icon/src/Icon.vue.d.ts +0 -49
- package/dist/components/Icon/src/SvgIcon.vue.d.ts +0 -45
- package/dist/components/InputPassword/src/InputPassword.vue.d.ts +0 -27
- package/dist/components/Modal/src/BasicModal.vue.d.ts +0 -419
- package/dist/components/Modal/src/components/ModalFooter.vue.d.ts +0 -86
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +0 -241
- package/dist/components/NodeAxis/src/BCanvasNodeRender.d.ts +0 -19
- package/dist/components/NodeAxis/src/NodeAxis.vue.d.ts +0 -17
- package/dist/components/Stateful/src/Stateful.vue.d.ts +0 -22
- package/dist/components/Table/src/Table.vue.d.ts +0 -1535
- package/dist/components/Table/src/components/ColumnSetting.vue.d.ts +0 -30
- package/dist/components/Table/src/components/TableActions.vue.d.ts +0 -229
- package/dist/components/UnifyChart/src/ChartToolbox.vue.d.ts +0 -46
- package/dist/components/UnifyChart/src/UnifyChart.vue.d.ts +0 -95
- package/dist/components/Video/index.d.ts +0 -2
- package/dist/components/Video/src/VideoPlayer.vue.d.ts +0 -60
- package/dist/components/Video/src/VideoPlayer.vue.js +0 -5
- package/dist/components/Video/src/VideoPlayer.vue2.js +0 -107
- package/dist/components/Video/src/VideoPlayerToolbar.vue.d.ts +0 -34
- package/dist/components/Video/src/VideoPlayerToolbar.vue.js +0 -5
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +0 -65
- package/dist/components/Video/src/abstract/AbstractVideoControl.d.ts +0 -7
- package/dist/components/Video/src/abstract/Observable.d.ts +0 -6
- package/dist/components/Video/src/abstract/Observable.js +0 -89
- package/dist/components/Video/src/abstract/VideoControl.d.ts +0 -32
- package/dist/components/Video/src/abstract/VideoControl.js +0 -48
- package/dist/components/Video/src/control/DaHua.d.ts +0 -12
- package/dist/components/Video/src/control/DaHua.js +0 -154
- package/dist/components/Video/src/control/Hikvision.d.ts +0 -28
- package/dist/components/Video/src/control/Hikvision.js +0 -249
- package/dist/components/Video/src/control/VideoFactory.d.ts +0 -3
- package/dist/components/Video/src/control/VideoFactory.js +0 -31
- package/dist/components/Video/src/enums/CommonEnum.d.ts +0 -26
- package/dist/components/Video/src/enums/CommonEnum.js +0 -31
- package/dist/components/Windows/src/ModalWrap.vue.d.ts +0 -14
- package/dist/components/Windows/src/Windows.vue.d.ts +0 -21
- package/dist/components/src/components/Boards/src/hooKs/useStyle.d.ts +0 -9
- package/dist/components/src/components/DatePicker/src/composables/use-month-range-header.d.ts +0 -16
- package/dist/components/src/components/DatePicker/src/composables/use-range-picker.d.ts +0 -173
- package/dist/components/src/components/DatePicker/src/date-picker-com/panel-date-range.vue.d.ts +0 -19
- package/dist/components/src/components/DatePicker/src/date-picker-com/panel-month-range.vue.d.ts +0 -16
- package/dist/components/src/components/Descriptions/src/Descriptions.vue.d.ts +0 -97
- package/dist/components/src/components/Form/src/components/useRenderCheckbox.d.ts +0 -4
- package/dist/components/src/components/Form/src/components/useRenderRadio.d.ts +0 -4
- package/dist/components/src/components/Form/src/components/useRenderSelect.d.ts +0 -4
- package/dist/components/src/components/Form/src/helper/componentMap.d.ts +0 -5
- package/dist/components/src/components/Form/src/helper/index.d.ts +0 -7
- package/dist/components/src/components/InputPassword/src/InputPassword.vue.d.ts +0 -27
- package/dist/components/src/components/Modal/src/hooks/useTimeout.d.ts +0 -15
- package/dist/components/src/components/Modal/src/utils/index.d.ts +0 -3
- package/dist/components/src/components/NodeAxis/src/BCanvasNodeRender.d.ts +0 -19
- package/dist/components/src/components/NodeAxis/src/NodeAxis.d.ts +0 -12
- package/dist/components/src/components/NodeAxis/src/NodeAxis.vue.d.ts +0 -17
- package/dist/components/src/components/NodeAxis/src/TimerNodePlayer.d.ts +0 -19
- package/dist/components/src/components/NodeAxis/src/interface/NodePlayer.d.ts +0 -9
- package/dist/components/src/components/Table/src/components/ColumnSetting.vue.d.ts +0 -30
- package/dist/components/src/components/Table/src/components/TableActions.vue.d.ts +0 -96
- package/dist/components/src/components/Table/src/helper/index.d.ts +0 -2
- package/dist/components/src/components/Video/src/VideoPlayerToolbar.vue.d.ts +0 -34
- package/dist/components/src/components/Video/src/abstract/AbstractVideoControl.d.ts +0 -7
- package/dist/components/src/components/Video/src/abstract/Observable.d.ts +0 -6
- package/dist/components/src/components/Video/src/abstract/VideoControl.d.ts +0 -32
- package/dist/components/src/components/Video/src/control/DaHua.d.ts +0 -12
- package/dist/components/src/components/Video/src/control/Hikvision.d.ts +0 -28
- package/dist/components/src/components/Video/src/control/VideoFactory.d.ts +0 -3
- package/dist/components/src/components/Video/src/enums/CommonEnum.d.ts +0 -26
- package/dist/components/src/helper/lang.d.ts +0 -1
- package/dist/components/src/themes/index.d.ts +0 -1
- package/dist/components/src/utils/index.d.ts +0 -11
- package/dist/helper/lang.d.ts +0 -1
- package/dist/helper/lang.js +0 -546
- package/dist/node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.13_typescript@5.7.3_/node_modules/@vueuse/core/index.js +0 -335
- package/dist/node_modules/.pnpm/@vueuse_core@13.7.0_vue@3.5.19_typescript@5.9.2_/node_modules/@vueuse/core/index.js +0 -393
- package/dist/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.13_typescript@5.7.3_/node_modules/@vueuse/shared/index.js +0 -40
- package/dist/node_modules/.pnpm/@vueuse_shared@13.7.0_vue@3.5.19_typescript@5.9.2_/node_modules/@vueuse/shared/index.js +0 -53
|
@@ -1,584 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import script$1 from './components/TableActions.vue2.js';
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.2
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-10 11:00:57
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
function _isSlot(s) {
|
|
18
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
19
|
-
}
|
|
20
|
-
var script = defineComponent({
|
|
21
|
-
name: 'Table',
|
|
22
|
-
components: {
|
|
23
|
-
ElImage: ElImage,
|
|
24
|
-
ElPagination: ElPagination,
|
|
25
|
-
ElTable: ElTable,
|
|
26
|
-
ElTableColumn: ElTableColumn,
|
|
27
|
-
TableActions: script$1,
|
|
28
|
-
ElConfigProvider: ElConfigProvider
|
|
29
|
-
},
|
|
30
|
-
props: {
|
|
31
|
-
pageSize: propTypes.number.def(10),
|
|
32
|
-
currentPage: propTypes.number.def(1),
|
|
33
|
-
showAction: propTypes.bool.def(false),
|
|
34
|
-
showOverflowTooltip: propTypes.bool.def(true),
|
|
35
|
-
columns: {
|
|
36
|
-
type: Array,
|
|
37
|
-
"default": function _default() {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
pagination: {
|
|
42
|
-
type: Object,
|
|
43
|
-
"default": function _default() {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
reserveSelection: propTypes.bool.def(false),
|
|
48
|
-
loading: propTypes.bool.def(false),
|
|
49
|
-
reserveIndex: propTypes.bool.def(false),
|
|
50
|
-
align: propTypes.string.validate(function (v) {
|
|
51
|
-
return ['left', 'center', 'right'].includes(v);
|
|
52
|
-
}).def('left'),
|
|
53
|
-
headerAlign: propTypes.string.validate(function (v) {
|
|
54
|
-
return ['left', 'center', 'right'].includes(v);
|
|
55
|
-
}).def('left'),
|
|
56
|
-
data: {
|
|
57
|
-
type: Array,
|
|
58
|
-
"default": function _default() {
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
preview: {
|
|
63
|
-
type: Array,
|
|
64
|
-
"default": function _default() {
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
height: propTypes.oneOfType([Number, String]),
|
|
69
|
-
maxHeight: propTypes.oneOfType([Number, String]),
|
|
70
|
-
stripe: propTypes.bool.def(false),
|
|
71
|
-
border: propTypes.bool.def(true),
|
|
72
|
-
size: {
|
|
73
|
-
type: String,
|
|
74
|
-
validator: function validator(v) {
|
|
75
|
-
return ['default', 'small', 'large'].includes(v);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
fit: propTypes.bool.def(true),
|
|
79
|
-
showHeader: propTypes.bool.def(true),
|
|
80
|
-
highlightCurrentRow: propTypes.bool.def(false),
|
|
81
|
-
currentRowKey: propTypes.oneOfType([Number, String]),
|
|
82
|
-
rowClassName: {
|
|
83
|
-
type: [Function, String],
|
|
84
|
-
"default": ''
|
|
85
|
-
},
|
|
86
|
-
rowStyle: {
|
|
87
|
-
type: [Function, Object],
|
|
88
|
-
"default": function _default() {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
cellClassName: {
|
|
93
|
-
type: [Function, String],
|
|
94
|
-
"default": ''
|
|
95
|
-
},
|
|
96
|
-
cellStyle: {
|
|
97
|
-
type: [Function, Object],
|
|
98
|
-
"default": function _default() {
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
headerRowClassName: {
|
|
103
|
-
type: [Function, String],
|
|
104
|
-
"default": ''
|
|
105
|
-
},
|
|
106
|
-
headerRowStyle: {
|
|
107
|
-
type: [Function, Object],
|
|
108
|
-
"default": function _default() {
|
|
109
|
-
return undefined;
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
headerCellClassName: {
|
|
113
|
-
type: [Function, String],
|
|
114
|
-
"default": ''
|
|
115
|
-
},
|
|
116
|
-
headerCellStyle: {
|
|
117
|
-
type: [Function, Object],
|
|
118
|
-
"default": function _default() {
|
|
119
|
-
return undefined;
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
rowKey: propTypes.string.def('id'),
|
|
123
|
-
emptyText: propTypes.string.def('No Data'),
|
|
124
|
-
defaultExpandAll: propTypes.bool.def(false),
|
|
125
|
-
expandRowKeys: {
|
|
126
|
-
type: Array,
|
|
127
|
-
"default": function _default() {
|
|
128
|
-
return [];
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
defaultSort: {
|
|
132
|
-
type: Object,
|
|
133
|
-
"default": function _default() {
|
|
134
|
-
return {};
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
tooltipEffect: {
|
|
138
|
-
type: String,
|
|
139
|
-
"default": 'dark'
|
|
140
|
-
},
|
|
141
|
-
tooltipOptions: {
|
|
142
|
-
type: Object,
|
|
143
|
-
"default": function _default() {
|
|
144
|
-
return {
|
|
145
|
-
enterable: true,
|
|
146
|
-
placement: 'top',
|
|
147
|
-
showArrow: true,
|
|
148
|
-
hideAfter: 200,
|
|
149
|
-
popperOptions: {
|
|
150
|
-
strategy: 'fixed'
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
showSummary: propTypes.bool.def(false),
|
|
156
|
-
sumText: propTypes.string.def('Sum'),
|
|
157
|
-
summaryMethod: {
|
|
158
|
-
type: Function,
|
|
159
|
-
"default": function _default() {
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
spanMethod: {
|
|
164
|
-
type: Function,
|
|
165
|
-
"default": function _default() {
|
|
166
|
-
return undefined;
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
selectOnIndeterminate: propTypes.bool.def(true),
|
|
170
|
-
indent: propTypes.number.def(16),
|
|
171
|
-
lazy: propTypes.bool.def(false),
|
|
172
|
-
load: {
|
|
173
|
-
type: Function,
|
|
174
|
-
"default": function _default() {
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
treeProps: {
|
|
179
|
-
type: Object,
|
|
180
|
-
"default": function _default() {
|
|
181
|
-
return {
|
|
182
|
-
hasChildren: 'hasChildren',
|
|
183
|
-
children: 'children',
|
|
184
|
-
label: 'label'
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
tableLayout: {
|
|
189
|
-
type: String,
|
|
190
|
-
"default": 'fixed'
|
|
191
|
-
},
|
|
192
|
-
scrollbarAlwaysOn: propTypes.bool.def(false),
|
|
193
|
-
flexible: propTypes.bool.def(false),
|
|
194
|
-
customContent: propTypes.bool.def(false),
|
|
195
|
-
cardBodyStyle: {
|
|
196
|
-
type: Object,
|
|
197
|
-
"default": function _default() {
|
|
198
|
-
return {};
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
cardBodyClass: {
|
|
202
|
-
type: String,
|
|
203
|
-
"default": ''
|
|
204
|
-
},
|
|
205
|
-
cardWrapStyle: {
|
|
206
|
-
type: Object,
|
|
207
|
-
"default": function _default() {
|
|
208
|
-
return {};
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
cardWrapClass: {
|
|
212
|
-
type: String,
|
|
213
|
-
"default": ''
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
emits: ['update:pageSize', 'update:currentPage', 'register', 'refresh'],
|
|
217
|
-
setup: function setup(props, _ref) {
|
|
218
|
-
var attrs = _ref.attrs,
|
|
219
|
-
emit = _ref.emit,
|
|
220
|
-
slots = _ref.slots,
|
|
221
|
-
expose = _ref.expose;
|
|
222
|
-
var elTableRef = ref();
|
|
223
|
-
onMounted(function () {
|
|
224
|
-
var tableRef = unref(elTableRef);
|
|
225
|
-
emit('register', tableRef === null || tableRef === void 0 ? void 0 : tableRef.$parent, elTableRef);
|
|
226
|
-
});
|
|
227
|
-
var pageSizeRef = ref(props.pageSize);
|
|
228
|
-
var currentPageRef = ref(props.currentPage);
|
|
229
|
-
var outsideProps = ref({});
|
|
230
|
-
var mergeProps$1 = ref({});
|
|
231
|
-
var getProps = computed(function () {
|
|
232
|
-
var propsObj = _objectSpread({}, props);
|
|
233
|
-
Object.assign(propsObj, unref(mergeProps$1));
|
|
234
|
-
return propsObj;
|
|
235
|
-
});
|
|
236
|
-
var setProps = function setProps() {
|
|
237
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
238
|
-
mergeProps$1.value = Object.assign(unref(mergeProps$1), props);
|
|
239
|
-
outsideProps.value = _objectSpread({}, props);
|
|
240
|
-
};
|
|
241
|
-
var _setColumn = function setColumn(columnProps, columnsChildren) {
|
|
242
|
-
var _unref = unref(getProps),
|
|
243
|
-
columns = _unref.columns;
|
|
244
|
-
var _iterator = _createForOfIteratorHelper(columnsChildren || columns),
|
|
245
|
-
_step;
|
|
246
|
-
try {
|
|
247
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
248
|
-
var v = _step.value;
|
|
249
|
-
var _iterator2 = _createForOfIteratorHelper(columnProps),
|
|
250
|
-
_step2;
|
|
251
|
-
try {
|
|
252
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
253
|
-
var _v$children;
|
|
254
|
-
var item = _step2.value;
|
|
255
|
-
if (v.field === item.field) {
|
|
256
|
-
set(v, item.path, item.value);
|
|
257
|
-
} else if ((_v$children = v.children) !== null && _v$children !== void 0 && _v$children.length) {
|
|
258
|
-
_setColumn(columnProps, v.children);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
} catch (err) {
|
|
262
|
-
_iterator2.e(err);
|
|
263
|
-
} finally {
|
|
264
|
-
_iterator2.f();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
} catch (err) {
|
|
268
|
-
_iterator.e(err);
|
|
269
|
-
} finally {
|
|
270
|
-
_iterator.f();
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
var addColumn = function addColumn(column, index) {
|
|
274
|
-
var _unref2 = unref(getProps),
|
|
275
|
-
columns = _unref2.columns;
|
|
276
|
-
if (index || index === 0) {
|
|
277
|
-
columns.splice(index, 0, column);
|
|
278
|
-
} else {
|
|
279
|
-
columns.push(column);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
var delColumn = function delColumn(field) {
|
|
283
|
-
var _unref3 = unref(getProps),
|
|
284
|
-
columns = _unref3.columns;
|
|
285
|
-
var index = columns.findIndex(function (item) {
|
|
286
|
-
return item.field === field;
|
|
287
|
-
});
|
|
288
|
-
if (index > -1) {
|
|
289
|
-
columns.splice(index, 1);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
var refresh = function refresh() {
|
|
293
|
-
emit('refresh');
|
|
294
|
-
};
|
|
295
|
-
var changSize = function changSize(size) {
|
|
296
|
-
setProps({
|
|
297
|
-
size: size
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
var confirmSetColumn = function confirmSetColumn(columns) {
|
|
301
|
-
setProps({
|
|
302
|
-
columns: columns
|
|
303
|
-
});
|
|
304
|
-
};
|
|
305
|
-
expose({
|
|
306
|
-
setProps: setProps,
|
|
307
|
-
setColumn: _setColumn,
|
|
308
|
-
delColumn: delColumn,
|
|
309
|
-
addColumn: addColumn,
|
|
310
|
-
elTableRef: elTableRef
|
|
311
|
-
});
|
|
312
|
-
var pagination = computed(function () {
|
|
313
|
-
return Object.assign({
|
|
314
|
-
small: false,
|
|
315
|
-
background: false,
|
|
316
|
-
pagerCount: 7,
|
|
317
|
-
layout: 'sizes, prev, pager, next, jumper, ->, total',
|
|
318
|
-
pageSizes: [10, 20, 30, 40, 50, 100],
|
|
319
|
-
disabled: false,
|
|
320
|
-
hideOnSinglePage: false,
|
|
321
|
-
total: 10
|
|
322
|
-
}, unref(getProps).pagination);
|
|
323
|
-
});
|
|
324
|
-
watch(function () {
|
|
325
|
-
return unref(getProps).pageSize;
|
|
326
|
-
}, function (val) {
|
|
327
|
-
pageSizeRef.value = val;
|
|
328
|
-
});
|
|
329
|
-
watch(function () {
|
|
330
|
-
return unref(getProps).currentPage;
|
|
331
|
-
}, function (val) {
|
|
332
|
-
currentPageRef.value = val;
|
|
333
|
-
});
|
|
334
|
-
watch(function () {
|
|
335
|
-
return pageSizeRef.value;
|
|
336
|
-
}, function (val) {
|
|
337
|
-
emit('update:pageSize', val);
|
|
338
|
-
});
|
|
339
|
-
watch(function () {
|
|
340
|
-
return currentPageRef.value;
|
|
341
|
-
}, function (val) {
|
|
342
|
-
emit('update:currentPage', val);
|
|
343
|
-
});
|
|
344
|
-
var getBindValue = computed(function () {
|
|
345
|
-
var bindValue = _objectSpread(_objectSpread({}, attrs), unref(getProps));
|
|
346
|
-
delete bindValue.columns;
|
|
347
|
-
delete bindValue.data;
|
|
348
|
-
delete bindValue.align;
|
|
349
|
-
return bindValue;
|
|
350
|
-
});
|
|
351
|
-
var _renderTreeTableColumn = function renderTreeTableColumn(columnsChildren) {
|
|
352
|
-
var _unref4 = unref(getProps),
|
|
353
|
-
align = _unref4.align,
|
|
354
|
-
headerAlign = _unref4.headerAlign,
|
|
355
|
-
showOverflowTooltip = _unref4.showOverflowTooltip,
|
|
356
|
-
preview = _unref4.preview;
|
|
357
|
-
return columnsChildren.map(function (v) {
|
|
358
|
-
var _props$slots3;
|
|
359
|
-
if (v.hidden) return null;
|
|
360
|
-
var props = _objectSpread({}, v);
|
|
361
|
-
if (props.children) delete props.children;
|
|
362
|
-
var children = v.children;
|
|
363
|
-
var slots = {
|
|
364
|
-
"default": function _default() {
|
|
365
|
-
var _props$slots, _props$slots2, _v$formatter;
|
|
366
|
-
var data = arguments.length <= 0 ? undefined : arguments[0];
|
|
367
|
-
var isImageUrl = false;
|
|
368
|
-
if (preview.length) {
|
|
369
|
-
isImageUrl = preview.some(function (item) {
|
|
370
|
-
return item === v.field;
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
return children && children.length ? _renderTreeTableColumn(children) : props !== null && props !== void 0 && (_props$slots = props.slots) !== null && _props$slots !== void 0 && _props$slots["default"] ? (_props$slots2 = props.slots)["default"].apply(_props$slots2, arguments) : v !== null && v !== void 0 && v.formatter ? v === null || v === void 0 || (_v$formatter = v.formatter) === null || _v$formatter === void 0 ? void 0 : _v$formatter.call(v, data.row, data.column, get(data.row, v.field), data.$index) : isImageUrl ? renderPreview(get(data.row, v.field)) : get(data.row, v.field);
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
if (props !== null && props !== void 0 && (_props$slots3 = props.slots) !== null && _props$slots3 !== void 0 && _props$slots3.header) {
|
|
377
|
-
slots['header'] = function () {
|
|
378
|
-
var _props$slots4;
|
|
379
|
-
return (_props$slots4 = props.slots).header.apply(_props$slots4, arguments);
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
return createVNode(ElTableColumn, mergeProps({
|
|
383
|
-
"showOverflowTooltip": showOverflowTooltip,
|
|
384
|
-
"align": align,
|
|
385
|
-
"headerAlign": headerAlign
|
|
386
|
-
}, props, {
|
|
387
|
-
"prop": v.field
|
|
388
|
-
}), _isSlot(slots) ? slots : {
|
|
389
|
-
"default": function _default() {
|
|
390
|
-
return [slots];
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
|
-
var renderPreview = function renderPreview(url) {
|
|
396
|
-
return createVNode("div", {
|
|
397
|
-
"class": "flex items-center"
|
|
398
|
-
}, [createVNode(ElImage, {
|
|
399
|
-
"src": url,
|
|
400
|
-
"fit": "cover",
|
|
401
|
-
"class": "w-[100%] h-100px",
|
|
402
|
-
"lazy": true,
|
|
403
|
-
"preview-src-list": [url],
|
|
404
|
-
"preview-teleported": true
|
|
405
|
-
}, null)]);
|
|
406
|
-
};
|
|
407
|
-
var renderTableColumn = function renderTableColumn(columnsChildren) {
|
|
408
|
-
var _unref5 = unref(getProps),
|
|
409
|
-
columns = _unref5.columns,
|
|
410
|
-
reserveIndex = _unref5.reserveIndex,
|
|
411
|
-
pageSize = _unref5.pageSize,
|
|
412
|
-
currentPage = _unref5.currentPage,
|
|
413
|
-
align = _unref5.align,
|
|
414
|
-
headerAlign = _unref5.headerAlign,
|
|
415
|
-
showOverflowTooltip = _unref5.showOverflowTooltip,
|
|
416
|
-
reserveSelection = _unref5.reserveSelection,
|
|
417
|
-
preview = _unref5.preview;
|
|
418
|
-
return (columnsChildren || columns).map(function (v) {
|
|
419
|
-
if (v.hidden) return null;
|
|
420
|
-
if (v.type === 'index') {
|
|
421
|
-
return createVNode(ElTableColumn, {
|
|
422
|
-
"type": "index",
|
|
423
|
-
"index": v.index ? v.index : function (index) {
|
|
424
|
-
return setIndex(reserveIndex, index, pageSize, currentPage);
|
|
425
|
-
},
|
|
426
|
-
"align": v.align || align,
|
|
427
|
-
"headerAlign": v.headerAlign || headerAlign,
|
|
428
|
-
"label": v.label,
|
|
429
|
-
"width": "65px"
|
|
430
|
-
}, null);
|
|
431
|
-
} else if (v.type === 'selection') {
|
|
432
|
-
return createVNode(ElTableColumn, {
|
|
433
|
-
"type": "selection",
|
|
434
|
-
"reserveSelection": reserveSelection,
|
|
435
|
-
"align": align,
|
|
436
|
-
"headerAlign": headerAlign,
|
|
437
|
-
"selectable": v.selectable,
|
|
438
|
-
"width": "50"
|
|
439
|
-
}, null);
|
|
440
|
-
} else {
|
|
441
|
-
var _props$slots7;
|
|
442
|
-
var _props = _objectSpread({}, v);
|
|
443
|
-
if (_props.children) delete _props.children;
|
|
444
|
-
var children = v.children;
|
|
445
|
-
var columSlots = {
|
|
446
|
-
"default": function _default() {
|
|
447
|
-
var _props$slots5, _props$slots6, _v$formatter2;
|
|
448
|
-
var data = arguments.length <= 0 ? undefined : arguments[0];
|
|
449
|
-
var isImageUrl = false;
|
|
450
|
-
if (preview.length) {
|
|
451
|
-
isImageUrl = preview.some(function (item) {
|
|
452
|
-
return item === v.field;
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
var _slots = getSlot(slots, v.field, {
|
|
456
|
-
row: data.row,
|
|
457
|
-
field: v.field,
|
|
458
|
-
index: data.$index
|
|
459
|
-
});
|
|
460
|
-
return children && children.length ? _renderTreeTableColumn(children) : _slots ? _slots : _props !== null && _props !== void 0 && (_props$slots5 = _props.slots) !== null && _props$slots5 !== void 0 && _props$slots5["default"] ? (_props$slots6 = _props.slots)["default"].apply(_props$slots6, arguments) : v !== null && v !== void 0 && v.formatter ? v === null || v === void 0 || (_v$formatter2 = v.formatter) === null || _v$formatter2 === void 0 ? void 0 : _v$formatter2.call(v, data.row, data.column, get(data.row, v.field), data.$index) : isImageUrl ? renderPreview(get(data.row, v.field)) : get(data.row, v.field);
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
if (getSlot(slots, "".concat(v.field, "-header"))) {
|
|
464
|
-
columSlots['header'] = function () {
|
|
465
|
-
var data = arguments.length <= 0 ? undefined : arguments[0];
|
|
466
|
-
var _slots = getSlot(slots, "".concat(v.field, "-header"), {
|
|
467
|
-
row: data.row,
|
|
468
|
-
field: v.field,
|
|
469
|
-
index: data.$index
|
|
470
|
-
});
|
|
471
|
-
return _slots;
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
if (_props !== null && _props !== void 0 && (_props$slots7 = _props.slots) !== null && _props$slots7 !== void 0 && _props$slots7.header) {
|
|
475
|
-
columSlots['header'] = function () {
|
|
476
|
-
var _props$slots8;
|
|
477
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
478
|
-
args[_key] = arguments[_key];
|
|
479
|
-
}
|
|
480
|
-
return (_props$slots8 = _props.slots) === null || _props$slots8 === void 0 ? void 0 : _props$slots8.header.apply(_props$slots8, args);
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
return createVNode(ElTableColumn, mergeProps({
|
|
484
|
-
"showOverflowTooltip": showOverflowTooltip,
|
|
485
|
-
"align": align,
|
|
486
|
-
"headerAlign": headerAlign
|
|
487
|
-
}, _props, {
|
|
488
|
-
"prop": v.field
|
|
489
|
-
}), _isSlot(columSlots) ? columSlots : {
|
|
490
|
-
"default": function _default() {
|
|
491
|
-
return [columSlots];
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
};
|
|
497
|
-
return function () {
|
|
498
|
-
var _unref6, _unref7;
|
|
499
|
-
var tableSlots = {};
|
|
500
|
-
if (getSlot(slots, 'empty')) {
|
|
501
|
-
tableSlots['empty'] = function () {
|
|
502
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
503
|
-
args[_key2] = arguments[_key2];
|
|
504
|
-
}
|
|
505
|
-
return getSlot(slots, 'empty', args);
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
if (getSlot(slots, 'append')) {
|
|
509
|
-
tableSlots['append'] = function () {
|
|
510
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
511
|
-
args[_key3] = arguments[_key3];
|
|
512
|
-
}
|
|
513
|
-
return getSlot(slots, 'append', args);
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
return withDirectives(createVNode("div", {
|
|
517
|
-
"class": "h-full w-full overflow-hidden flex flex-col box-border"
|
|
518
|
-
}, [unref(getProps).customContent ? createVNode("div", {
|
|
519
|
-
"class": "flex flex-wrap"
|
|
520
|
-
}, [(_unref6 = unref(getProps)) !== null && _unref6 !== void 0 && (_unref6 = _unref6.data) !== null && _unref6 !== void 0 && _unref6.length ? (_unref7 = unref(getProps)) === null || _unref7 === void 0 ? void 0 : _unref7.data.map(function (item) {
|
|
521
|
-
var cardSlots = {
|
|
522
|
-
"default": function _default() {
|
|
523
|
-
return getSlot(slots, 'content', item);
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
if (getSlot(slots, 'content-header')) {
|
|
527
|
-
cardSlots['header'] = function () {
|
|
528
|
-
return getSlot(slots, 'content-header', item);
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
if (getSlot(slots, 'content-footer')) {
|
|
532
|
-
cardSlots['footer'] = function () {
|
|
533
|
-
return getSlot(slots, 'content-footer', item);
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
return createVNode(ElCard, {
|
|
537
|
-
"shadow": "hover",
|
|
538
|
-
"class": unref(getProps).cardWrapClass,
|
|
539
|
-
"style": unref(getProps).cardWrapStyle,
|
|
540
|
-
"bodyClass": unref(getProps).cardBodyClass,
|
|
541
|
-
"bodyStyle": unref(getProps).cardBodyStyle
|
|
542
|
-
}, _isSlot(cardSlots) ? cardSlots : {
|
|
543
|
-
"default": function _default() {
|
|
544
|
-
return [cardSlots];
|
|
545
|
-
}
|
|
546
|
-
});
|
|
547
|
-
}) : createVNode("div", {
|
|
548
|
-
"class": "flex flex-1 justify-center"
|
|
549
|
-
}, [createVNode(ElEmpty, {
|
|
550
|
-
"description": "\u6682\u65E0\u6570\u636E"
|
|
551
|
-
}, null)])]) : createVNode(Fragment, null, [unref(getProps).showAction ? createVNode(script$1, {
|
|
552
|
-
"columns": unref(getProps).columns,
|
|
553
|
-
"onChangSize": changSize,
|
|
554
|
-
"onRefresh": refresh,
|
|
555
|
-
"onConfirm": confirmSetColumn
|
|
556
|
-
}, null) : null, createVNode(ElTable, mergeProps({
|
|
557
|
-
"ref": elTableRef,
|
|
558
|
-
"data": unref(getProps).data
|
|
559
|
-
}, unref(getBindValue)), _objectSpread({
|
|
560
|
-
"default": function _default() {
|
|
561
|
-
return renderTableColumn();
|
|
562
|
-
}
|
|
563
|
-
}, tableSlots))]), unref(getProps).pagination ? createVNode(ElConfigProvider, {
|
|
564
|
-
"locale": zhCn
|
|
565
|
-
}, {
|
|
566
|
-
"default": function _default() {
|
|
567
|
-
return [createVNode(ElPagination, mergeProps({
|
|
568
|
-
"pageSize": pageSizeRef.value,
|
|
569
|
-
"onUpdate:pageSize": function onUpdatePageSize($event) {
|
|
570
|
-
return pageSizeRef.value = $event;
|
|
571
|
-
},
|
|
572
|
-
"currentPage": currentPageRef.value,
|
|
573
|
-
"onUpdate:currentPage": function onUpdateCurrentPage($event) {
|
|
574
|
-
return currentPageRef.value = $event;
|
|
575
|
-
},
|
|
576
|
-
"class": "mt-10px"
|
|
577
|
-
}, unref(pagination)), null)];
|
|
578
|
-
}
|
|
579
|
-
}) : undefined]), [[resolveDirective("loading"), unref(getProps).loading]]);
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
|
|
584
|
-
export { script as default };
|
|
11
|
+
import{defineComponent as e,ref as t,onMounted as n,unref as l,computed as r,watch as o,withDirectives as a,createVNode as i,Fragment as u,mergeProps as d,resolveDirective as f,isVNode as c}from"vue";import{objectSpread2 as s,createForOfIteratorHelper as p}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{ElImage as v,ElPagination as g,ElTable as h,ElTableColumn as m,ElConfigProvider as y,ElCard as b,ElEmpty as w}from"element-plus";import S from"element-plus/dist/locale/zh-cn.mjs";import{getSlot as x}from"@dfsj/utils";import O from"vue-types";import{setIndex as j}from"./helper/index.js";import{set as A,get as C}from"lodash-es";import"./components/TableActions.vue.js";import T from"./components/TableActions.vue2.js";function z(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!c(e)}var P=e({name:"Table",components:{ElImage:v,ElPagination:g,ElTable:h,ElTableColumn:m,TableActions:T,ElConfigProvider:y},props:{pageSize:O.number.def(10),currentPage:O.number.def(1),showAction:O.bool.def(!1),showOverflowTooltip:O.bool.def(!0),columns:{type:Array,default:function(){return[]}},pagination:{type:Object,default:function(){}},reserveSelection:O.bool.def(!1),loading:O.bool.def(!1),reserveIndex:O.bool.def(!1),align:O.string.validate(function(e){return["left","center","right"].includes(e)}).def("left"),headerAlign:O.string.validate(function(e){return["left","center","right"].includes(e)}).def("left"),data:{type:Array,default:function(){return[]}},preview:{type:Array,default:function(){return[]}},height:O.oneOfType([Number,String]),maxHeight:O.oneOfType([Number,String]),stripe:O.bool.def(!1),border:O.bool.def(!0),size:{type:String,validator:function(e){return["default","small","large"].includes(e)}},fit:O.bool.def(!0),showHeader:O.bool.def(!0),highlightCurrentRow:O.bool.def(!1),currentRowKey:O.oneOfType([Number,String]),rowClassName:{type:[Function,String],default:""},rowStyle:{type:[Function,Object],default:function(){}},cellClassName:{type:[Function,String],default:""},cellStyle:{type:[Function,Object],default:function(){}},headerRowClassName:{type:[Function,String],default:""},headerRowStyle:{type:[Function,Object],default:function(){}},headerCellClassName:{type:[Function,String],default:""},headerCellStyle:{type:[Function,Object],default:function(){}},rowKey:O.string.def("id"),emptyText:O.string.def("No Data"),defaultExpandAll:O.bool.def(!1),expandRowKeys:{type:Array,default:function(){return[]}},defaultSort:{type:Object,default:function(){return{}}},tooltipEffect:{type:String,default:"dark"},tooltipOptions:{type:Object,default:function(){return{enterable:!0,placement:"top",showArrow:!0,hideAfter:200,popperOptions:{strategy:"fixed"}}}},showSummary:O.bool.def(!1),sumText:O.string.def("Sum"),summaryMethod:{type:Function,default:function(){}},spanMethod:{type:Function,default:function(){}},selectOnIndeterminate:O.bool.def(!0),indent:O.number.def(16),lazy:O.bool.def(!1),load:{type:Function,default:function(){}},treeProps:{type:Object,default:function(){return{hasChildren:"hasChildren",children:"children",label:"label"}}},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:O.bool.def(!1),flexible:O.bool.def(!1),customContent:O.bool.def(!1),cardBodyStyle:{type:Object,default:function(){return{}}},cardBodyClass:{type:String,default:""},cardWrapStyle:{type:Object,default:function(){return{}}},cardWrapClass:{type:String,default:""}},emits:["update:pageSize","update:currentPage","register","refresh"],setup:function(e,c){var O=c.attrs,P=c.emit,F=c.slots,N=c.expose,E=t();n(function(){var e=l(E);P("register",null==e?void 0:e.$parent,E)});var R=t(e.pageSize),I=t(e.currentPage),B=t({}),$=t({}),H=r(function(){var t=s({},e);return Object.assign(t,l($)),t}),W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$.value=Object.assign(l($),e),B.value=s({},e)},K=function(e,t){var n,r=l(H).columns,o=p(t||r);try{for(o.s();!(n=o.n()).done;){var a,i=n.value,u=p(e);try{for(u.s();!(a=u.n()).done;){var d,f=a.value;i.field===f.field?A(i,f.path,f.value):null!==(d=i.children)&&void 0!==d&&d.length&&K(e,i.children)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){o.e(e)}finally{o.f()}},k=function(){P("refresh")},M=function(e){W({size:e})},U=function(e){W({columns:e})};N({setProps:W,setColumn:K,delColumn:function(e){var t=l(H).columns,n=t.findIndex(function(t){return t.field===e});n>-1&&t.splice(n,1)},addColumn:function(e,t){var n=l(H).columns;t||0===t?n.splice(t,0,e):n.push(e)},elTableRef:E});var _=r(function(){return Object.assign({small:!1,background:!1,pagerCount:7,layout:"sizes, prev, pager, next, jumper, ->, total",pageSizes:[10,20,30,40,50,100],disabled:!1,hideOnSinglePage:!1,total:10},l(H).pagination)});o(function(){return l(H).pageSize},function(e){R.value=e}),o(function(){return l(H).currentPage},function(e){I.value=e}),o(function(){return R.value},function(e){P("update:pageSize",e)}),o(function(){return I.value},function(e){P("update:currentPage",e)});var D=r(function(){var e=s(s({},O),l(H));return delete e.columns,delete e.data,delete e.align,e}),L=function(e){var t=l(H),n=t.align,r=t.headerAlign,o=t.showOverflowTooltip,a=t.preview;return e.map(function(e){var t;if(e.hidden)return null;var l=s({},e);l.children&&delete l.children;var u=e.children,f={default:function(){var t,n,r,o=arguments.length<=0?void 0:arguments[0],i=!1;return a.length&&(i=a.some(function(t){return t===e.field})),u&&u.length?L(u):null!=l&&null!==(t=l.slots)&&void 0!==t&&t.default?(n=l.slots).default.apply(n,arguments):null!=e&&e.formatter?null==e||null===(r=e.formatter)||void 0===r?void 0:r.call(e,o.row,o.column,C(o.row,e.field),o.$index):i?q(C(o.row,e.field)):C(o.row,e.field)}};return null!=l&&null!==(t=l.slots)&&void 0!==t&&t.header&&(f.header=function(){var e;return(e=l.slots).header.apply(e,arguments)}),i(m,d({showOverflowTooltip:o,align:n,headerAlign:r},l,{prop:e.field}),z(f)?f:{default:function(){return[f]}})})},q=function(e){return i("div",{class:"flex items-center"},[i(v,{src:e,fit:"cover",class:"w-[100%] h-100px",lazy:!0,"preview-src-list":[e],"preview-teleported":!0},null)])};return function(){var e,t,n={};return x(F,"empty")&&(n.empty=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x(F,"empty",t)}),x(F,"append")&&(n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x(F,"append",t)}),a(i("div",{class:"h-full w-full overflow-hidden flex flex-col box-border"},[l(H).customContent?i("div",{class:"flex flex-wrap"},[null!==(e=l(H))&&void 0!==e&&null!==(e=e.data)&&void 0!==e&&e.length?null===(t=l(H))||void 0===t?void 0:t.data.map(function(e){var t={default:function(){return x(F,"content",e)}};return x(F,"content-header")&&(t.header=function(){return x(F,"content-header",e)}),x(F,"content-footer")&&(t.footer=function(){return x(F,"content-footer",e)}),i(b,{shadow:"hover",class:l(H).cardWrapClass,style:l(H).cardWrapStyle,bodyClass:l(H).cardBodyClass,bodyStyle:l(H).cardBodyStyle},z(t)?t:{default:function(){return[t]}})}):i("div",{class:"flex flex-1 justify-center"},[i(w,{description:"暂无数据"},null)])]):i(u,null,[l(H).showAction?i(T,{columns:l(H).columns,onChangSize:M,onRefresh:k,onConfirm:U},null):null,i(h,d({ref:E,data:l(H).data},l(D)),s({default:function(){return t=l(H),n=t.columns,r=t.reserveIndex,o=t.pageSize,a=t.currentPage,u=t.align,f=t.headerAlign,c=t.showOverflowTooltip,p=t.reserveSelection,v=t.preview,(e||n).map(function(e){if(e.hidden)return null;if("index"===e.type)return i(m,{type:"index",index:e.index?e.index:function(e){return j(r,e,o,a)},align:e.align||u,headerAlign:e.headerAlign||f,label:e.label,width:"65px"},null);if("selection"===e.type)return i(m,{type:"selection",reserveSelection:p,align:u,headerAlign:f,selectable:e.selectable,width:"50"},null);var t,n=s({},e);n.children&&delete n.children;var l=e.children,g={default:function(){var t,r,o,a=arguments.length<=0?void 0:arguments[0],i=!1;v.length&&(i=v.some(function(t){return t===e.field}));var u=x(F,e.field,{row:a.row,field:e.field,index:a.$index});return l&&l.length?L(l):u||(null!=n&&null!==(t=n.slots)&&void 0!==t&&t.default?(r=n.slots).default.apply(r,arguments):null!=e&&e.formatter?null==e||null===(o=e.formatter)||void 0===o?void 0:o.call(e,a.row,a.column,C(a.row,e.field),a.$index):i?q(C(a.row,e.field)):C(a.row,e.field))}};return x(F,"".concat(e.field,"-header"))&&(g.header=function(){var t=arguments.length<=0?void 0:arguments[0];return x(F,"".concat(e.field,"-header"),{row:t.row,field:e.field,index:t.$index})}),null!=n&&null!==(t=n.slots)&&void 0!==t&&t.header&&(g.header=function(){for(var e,t=arguments.length,l=new Array(t),r=0;r<t;r++)l[r]=arguments[r];return null===(e=n.slots)||void 0===e?void 0:e.header.apply(e,l)}),i(m,d({showOverflowTooltip:c,align:u,headerAlign:f},n,{prop:e.field}),z(g)?g:{default:function(){return[g]}})});var e,t,n,r,o,a,u,f,c,p,v}},n))]),l(H).pagination?i(y,{locale:S},{default:function(){return[i(g,d({pageSize:R.value,"onUpdate:pageSize":function(e){return R.value=e},currentPage:I.value,"onUpdate:currentPage":function(e){return I.value=e},class:"mt-10px"},l(_)),null)]}}):void 0]),[[f("loading"),l(H).loading]])}}});export{P as default};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.2
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-10 11:00:57
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { script as default };
|
|
11
|
+
import e from"./ColumnSetting.vue2.js";e.__file="src/components/Table/src/components/ColumnSetting.vue";export{e as default};
|