@meethive/components 0.0.9 → 0.0.11
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/EditTable/props.js +1 -1
- package/es/ProLayout/SiderMenu/SiderMenu.js +133 -147
- package/es/ProLayout/TopHeader/index.js +91 -99
- package/es/ProTable/Alert.js +30 -15
- package/es/ProTable/Content.js +118 -30
- package/es/ProTable/Header.js +47 -14
- package/es/ProTable/Pagination.js +25 -14
- package/es/ProTable/ProTable.js +77 -30
- package/es/ProTable/setting.js +1 -1
- package/es/Search/Advanced/History.js +142 -0
- package/es/Search/Advanced/SaveHistory.js +124 -0
- package/es/Search/Advanced/index.js +369 -0
- package/es/Search/Item.js +70 -21
- package/es/Search/Search.js +81 -24
- package/es/Search/index.js +3 -3
- package/es/VirtualTable/VirtualTable.js +4 -4
- package/es/components.js +1 -1
- package/lib/EditTable/props.js +1 -1
- package/lib/ProLayout/SiderMenu/SiderMenu.js +133 -147
- package/lib/ProLayout/TopHeader/index.js +91 -99
- package/lib/ProTable/Alert.js +30 -15
- package/lib/ProTable/Content.js +118 -30
- package/lib/ProTable/Header.js +47 -14
- package/lib/ProTable/Pagination.js +25 -14
- package/lib/ProTable/ProTable.js +77 -30
- package/lib/ProTable/setting.js +1 -1
- package/lib/Search/Advanced/History.js +142 -0
- package/lib/Search/Advanced/SaveHistory.js +124 -0
- package/lib/Search/Advanced/index.js +369 -0
- package/lib/Search/Item.js +70 -21
- package/lib/Search/Search.js +81 -24
- package/lib/Search/index.js +3 -3
- package/lib/VirtualTable/VirtualTable.js +4 -4
- package/lib/components.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref,
|
|
1
|
+
import { computed, ref, createVNode as _createVNode, mergeProps as _mergeProps } from 'vue';
|
|
2
2
|
import { default as ResizeObserver } from 'ant-design-vue/es/vc-resize-observer';
|
|
3
3
|
import { defaultRenderLogoAndTitle, siderMenuProps } from '../SiderMenu/SiderMenu';
|
|
4
4
|
import PropTypes from 'ant-design-vue/es/_util/vue-types';
|
|
@@ -75,104 +75,96 @@ const RightContent = ({
|
|
|
75
75
|
})]) : rightContentRender]
|
|
76
76
|
})])]);
|
|
77
77
|
};
|
|
78
|
-
export const TopNavHeader =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
[hashId.value]: true,
|
|
115
|
-
'light': props.theme === 'light',
|
|
116
|
-
'dark': props.theme === 'dark'
|
|
117
|
-
}));
|
|
118
|
-
const paddingLeft = computed(() => {
|
|
119
|
-
return context.layoutType === LayoutType.PAD && props.collapsed ? context.headerLeftWidth + 'px' : 0;
|
|
78
|
+
export const TopNavHeader = props => {
|
|
79
|
+
const headerRef = ref();
|
|
80
|
+
const {
|
|
81
|
+
prefixCls: propPrefixCls,
|
|
82
|
+
onMenuHeaderClick,
|
|
83
|
+
onOpenKeys,
|
|
84
|
+
onSelect,
|
|
85
|
+
contentWidth,
|
|
86
|
+
rightContentRender,
|
|
87
|
+
topHeaderMenuRender,
|
|
88
|
+
layout,
|
|
89
|
+
menuData,
|
|
90
|
+
mode
|
|
91
|
+
} = props;
|
|
92
|
+
const context = useRouteContext();
|
|
93
|
+
const prefixCls = `${propPrefixCls || defaultPrefixCls}-top-nav-header`;
|
|
94
|
+
const stylePrefixCls = computed(() => 'pro-layout');
|
|
95
|
+
const [wrapSSR, hashId] = useProLayoutStyle(stylePrefixCls);
|
|
96
|
+
const headerDom = defaultRenderLogoAndTitle({
|
|
97
|
+
...props,
|
|
98
|
+
collapsed: false
|
|
99
|
+
},
|
|
100
|
+
// REMARK:: Any time render header title
|
|
101
|
+
// layout === 'mix' ? 'headerTitleRender' : undefined,
|
|
102
|
+
// layout !== 'side' ? 'headerTitleRender' : undefined,
|
|
103
|
+
'headerTitleRender');
|
|
104
|
+
|
|
105
|
+
//
|
|
106
|
+
let MenusData = props.layout === 'side' ? [] : menuData;
|
|
107
|
+
if (props.layout === 'mix' && props.splitMenus) {
|
|
108
|
+
const noChildrenMenuData = (menuData || []).map(item => {
|
|
109
|
+
return {
|
|
110
|
+
...item,
|
|
111
|
+
children: undefined,
|
|
112
|
+
component: undefined
|
|
113
|
+
};
|
|
120
114
|
});
|
|
121
|
-
|
|
122
|
-
const headerDom = defaultRenderLogoAndTitle({
|
|
123
|
-
...props,
|
|
124
|
-
collapsed: false
|
|
125
|
-
}, 'headerTitleRender');
|
|
126
|
-
const {
|
|
127
|
-
prefixCls: propPrefixCls,
|
|
128
|
-
onMenuHeaderClick,
|
|
129
|
-
onOpenKeys,
|
|
130
|
-
onSelect,
|
|
131
|
-
contentWidth,
|
|
132
|
-
rightContentRender,
|
|
133
|
-
topHeaderMenuRender
|
|
134
|
-
} = props;
|
|
135
|
-
return _createVNode("div", {
|
|
136
|
-
"class": className.value,
|
|
137
|
-
"style": {
|
|
138
|
-
paddingLeft: paddingLeft.value
|
|
139
|
-
}
|
|
140
|
-
}, [_createVNode("div", {
|
|
141
|
-
"ref": headerRef,
|
|
142
|
-
"class": `${prefixCls.value}-main ${contentWidth === 'Fixed' ? 'wide' : ''}`
|
|
143
|
-
}, [headerDom && _createVNode("div", {
|
|
144
|
-
"class": `${prefixCls.value}-main-left`,
|
|
145
|
-
"onClick": onMenuHeaderClick
|
|
146
|
-
}, [_createVNode("div", {
|
|
147
|
-
"class": `${prefixCls.value}-logo`,
|
|
148
|
-
"key": "logo",
|
|
149
|
-
"id": "logo"
|
|
150
|
-
}, [headerDom])]), _createVNode("div", {
|
|
151
|
-
"style": {
|
|
152
|
-
flex: 1
|
|
153
|
-
},
|
|
154
|
-
"class": `${prefixCls.value}-menu`
|
|
155
|
-
}, [topHeaderMenuRender ? topHeaderMenuRender() : _createVNode(BaseMenu, {
|
|
156
|
-
"prefixCls": propPrefixCls,
|
|
157
|
-
"locale": menuLocale.value,
|
|
158
|
-
"theme": props.theme,
|
|
159
|
-
"mode": _mode.value,
|
|
160
|
-
"collapsed": props.collapsed,
|
|
161
|
-
"iconfontUrl": props.iconfontUrl,
|
|
162
|
-
"menuData": MenusData.value,
|
|
163
|
-
"menuItemRender": props.menuItemRender,
|
|
164
|
-
"subMenuItemRender": props.subMenuItemRender,
|
|
165
|
-
"openKeys": context.openKeys,
|
|
166
|
-
"selectedKeys": context.selectedKeys,
|
|
167
|
-
"class": {
|
|
168
|
-
'top-nav-menu': props.mode === 'horizontal'
|
|
169
|
-
},
|
|
170
|
-
"onUpdate:openKeys": $event => onOpenKeys && onOpenKeys($event),
|
|
171
|
-
"onUpdate:selectedKeys": $event => onSelect && onSelect($event)
|
|
172
|
-
}, null)]), rightContentRender && _createVNode(RightContent, _mergeProps({
|
|
173
|
-
"rightContentRender": rightContentRender
|
|
174
|
-
}, props), null)])]);
|
|
175
|
-
};
|
|
115
|
+
MenusData = clearMenuItem(noChildrenMenuData);
|
|
176
116
|
}
|
|
177
|
-
|
|
117
|
+
const _mode = computed(() => {
|
|
118
|
+
return props.layout === 'mix' && props.splitMenus ? 'horizontal' : mode;
|
|
119
|
+
});
|
|
120
|
+
const className = computed(() => ({
|
|
121
|
+
[prefixCls]: true,
|
|
122
|
+
[hashId.value]: true,
|
|
123
|
+
'light': props.theme === 'light',
|
|
124
|
+
'dark': props.theme === 'dark'
|
|
125
|
+
}));
|
|
126
|
+
const paddingLeft = computed(() => {
|
|
127
|
+
return context.layoutType === LayoutType.PAD && props.collapsed ? context.headerLeftWidth + 'px' : 0;
|
|
128
|
+
});
|
|
129
|
+
return _createVNode("div", {
|
|
130
|
+
"class": className.value,
|
|
131
|
+
"style": {
|
|
132
|
+
paddingLeft: paddingLeft.value
|
|
133
|
+
}
|
|
134
|
+
}, [_createVNode("div", {
|
|
135
|
+
"ref": headerRef,
|
|
136
|
+
"class": `${prefixCls}-main ${contentWidth === 'Fixed' ? 'wide' : ''}`
|
|
137
|
+
}, [headerDom && _createVNode("div", {
|
|
138
|
+
"class": `${prefixCls}-main-left`,
|
|
139
|
+
"onClick": onMenuHeaderClick
|
|
140
|
+
}, [_createVNode("div", {
|
|
141
|
+
"class": `${prefixCls}-logo`,
|
|
142
|
+
"key": "logo",
|
|
143
|
+
"id": "logo"
|
|
144
|
+
}, [headerDom])]), _createVNode("div", {
|
|
145
|
+
"style": {
|
|
146
|
+
flex: 1
|
|
147
|
+
},
|
|
148
|
+
"class": `${prefixCls}-menu`
|
|
149
|
+
}, [topHeaderMenuRender ? topHeaderMenuRender() : _createVNode(BaseMenu, {
|
|
150
|
+
"prefixCls": propPrefixCls,
|
|
151
|
+
"locale": props.locale || context.locale,
|
|
152
|
+
"theme": props.theme,
|
|
153
|
+
"mode": _mode.value,
|
|
154
|
+
"collapsed": props.collapsed,
|
|
155
|
+
"iconfontUrl": props.iconfontUrl,
|
|
156
|
+
"menuData": MenusData,
|
|
157
|
+
"menuItemRender": props.menuItemRender,
|
|
158
|
+
"subMenuItemRender": props.subMenuItemRender,
|
|
159
|
+
"openKeys": context.openKeys,
|
|
160
|
+
"selectedKeys": context.selectedKeys,
|
|
161
|
+
"class": {
|
|
162
|
+
'top-nav-menu': props.mode === 'horizontal'
|
|
163
|
+
},
|
|
164
|
+
"onUpdate:openKeys": $event => onOpenKeys && onOpenKeys($event),
|
|
165
|
+
"onUpdate:selectedKeys": $event => onSelect && onSelect($event)
|
|
166
|
+
}, null)]), rightContentRender && _createVNode(RightContent, _mergeProps({
|
|
167
|
+
"rightContentRender": rightContentRender
|
|
168
|
+
}, props), null)])]);
|
|
169
|
+
};
|
|
178
170
|
export default TopNavHeader;
|
package/lib/ProTable/Alert.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
3
|
+
import { computed } from 'vue';
|
|
2
4
|
import { Alert, Button } from 'ant-design-vue';
|
|
3
5
|
import { _alertProps } from './setting';
|
|
4
6
|
import { useLocaleReceiver } from '../LocaleReciver';
|
|
5
7
|
import useProTableStyle from './style';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Alert,
|
|
10
|
-
Button
|
|
8
|
+
const __sfc_main__ = _defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: 'Alert'
|
|
11
11
|
},
|
|
12
|
+
__name: 'Alert',
|
|
12
13
|
props: {
|
|
13
14
|
..._alertProps
|
|
14
15
|
},
|
|
15
16
|
emits: ['close'],
|
|
16
|
-
setup(
|
|
17
|
-
emit
|
|
17
|
+
setup(__props, {
|
|
18
|
+
emit: __emit
|
|
18
19
|
}) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const emit = __emit;
|
|
19
22
|
const [contextLocale] = useLocaleReceiver('ProTable');
|
|
20
23
|
const prefixCls = computed(() => 'pro-table');
|
|
21
24
|
const [wrapSSR, hashId] = useProTableStyle(prefixCls);
|
|
22
|
-
const
|
|
25
|
+
const alertMessage = computed(() => {
|
|
23
26
|
let locale = contextLocale.value?.alert?.selectItem || '';
|
|
24
27
|
[props.rowSelection?.selectedRowKeys?.length || 0].forEach((item, index) => {
|
|
25
28
|
locale = locale.replace(`{${index}}`, item);
|
|
@@ -29,11 +32,23 @@ export default defineComponent({
|
|
|
29
32
|
const onClose = () => {
|
|
30
33
|
emit('close');
|
|
31
34
|
};
|
|
32
|
-
return {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return _openBlock(), _createElementBlock("div", {
|
|
37
|
+
class: _normalizeClass(['jtable-alert', _unref(hashId)])
|
|
38
|
+
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_unref(Alert), {
|
|
39
|
+
type: "info",
|
|
40
|
+
message: alertMessage.value
|
|
41
|
+
}, {
|
|
42
|
+
closeText: _withCtx(() => [_createVNode(_unref(Button), {
|
|
43
|
+
type: "link",
|
|
44
|
+
onClick: onClose
|
|
45
|
+
}, {
|
|
46
|
+
default: _withCtx(() => [_createTextVNode(_toDisplayString(_unref(contextLocale).alert?.cancelChoose), 1 /* TEXT */)]),
|
|
47
|
+
_: 1 /* STABLE */
|
|
48
|
+
})]),
|
|
49
|
+
_: 1 /* STABLE */
|
|
50
|
+
}, 8 /* PROPS */, ["message"])])], 2 /* CLASS */);
|
|
37
51
|
};
|
|
38
52
|
}
|
|
39
|
-
});
|
|
53
|
+
});
|
|
54
|
+
export default __sfc_main__;
|
package/lib/ProTable/Content.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, mergeProps as _mergeProps, renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, createSlots as _createSlots, createBlock as _createBlock } from "vue";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "jtable-card"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
style: {
|
|
10
|
+
"margin-bottom": "10px"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_3 = ["onClick"];
|
|
14
|
+
const _hoisted_4 = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "j-table-empty"
|
|
17
|
+
};
|
|
18
|
+
import { computed, useSlots } from 'vue';
|
|
2
19
|
import { Table, Checkbox as ACheckbox } from 'ant-design-vue';
|
|
3
20
|
import { get, omit } from 'lodash-es';
|
|
4
21
|
import Empty from '../Empty';
|
|
@@ -7,14 +24,11 @@ import useProTableStyle from './style';
|
|
|
7
24
|
import { useLocaleReceiver } from '../LocaleReciver';
|
|
8
25
|
import JVirtualTable from '../VirtualTable';
|
|
9
26
|
import { _contentProps } from './setting';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Table,
|
|
14
|
-
ACheckbox,
|
|
15
|
-
Empty,
|
|
16
|
-
JVirtualTable
|
|
27
|
+
const __sfc_main__ = _defineComponent({
|
|
28
|
+
...{
|
|
29
|
+
name: 'Content'
|
|
17
30
|
},
|
|
31
|
+
__name: 'Content',
|
|
18
32
|
props: {
|
|
19
33
|
..._contentProps,
|
|
20
34
|
column: {
|
|
@@ -22,17 +36,18 @@ export default defineComponent({
|
|
|
22
36
|
default: 4
|
|
23
37
|
}
|
|
24
38
|
},
|
|
25
|
-
setup(
|
|
39
|
+
setup(__props) {
|
|
40
|
+
const props = __props;
|
|
26
41
|
const slots = useSlots();
|
|
27
42
|
const [contextLocale] = useLocaleReceiver('ProTable');
|
|
28
43
|
const prefixCls = computed(() => 'pro-table');
|
|
29
44
|
const [wrapSSR, hashId] = useProTableStyle(prefixCls);
|
|
30
45
|
const _rowSelection = useTableInject();
|
|
31
|
-
const
|
|
32
|
-
const
|
|
46
|
+
const tableColumns = computed(() => props.columns.filter(i => !i?.hideInTable));
|
|
47
|
+
const tableSlots = computed(() => {
|
|
33
48
|
return omit(slots, ['emptyText', 'bodyCell']);
|
|
34
49
|
});
|
|
35
|
-
const
|
|
50
|
+
const tableScroll = computed(() => {
|
|
36
51
|
if (props.scroll === false) {
|
|
37
52
|
return {
|
|
38
53
|
x: undefined,
|
|
@@ -47,14 +62,14 @@ export default defineComponent({
|
|
|
47
62
|
const gridTemplateColumns = computed(() => {
|
|
48
63
|
return `repeat(${props.column}, 1fr)`;
|
|
49
64
|
});
|
|
50
|
-
const
|
|
65
|
+
const mergedRowSelection = computed(() => {
|
|
51
66
|
return props.rowSelection || _rowSelection?.value;
|
|
52
67
|
});
|
|
53
68
|
const indeterminate = computed(() => {
|
|
54
|
-
return
|
|
69
|
+
return mergedRowSelection.value?.selectedRowKeys?.length > 0 && mergedRowSelection.value?.selectedRowKeys?.length < props.dataSource.length;
|
|
55
70
|
});
|
|
56
71
|
const checkedAll = computed(() => {
|
|
57
|
-
return
|
|
72
|
+
return mergedRowSelection.value?.selectedRowKeys?.length > 0 && mergedRowSelection.value?.selectedRowKeys?.length === props.dataSource.length;
|
|
58
73
|
});
|
|
59
74
|
const onClick = item => {
|
|
60
75
|
if (_rowSelection && _rowSelection.value) {
|
|
@@ -64,21 +79,94 @@ export default defineComponent({
|
|
|
64
79
|
};
|
|
65
80
|
const handleCheckedAllChange = e => {
|
|
66
81
|
const flag = e.target.checked;
|
|
67
|
-
|
|
82
|
+
mergedRowSelection.value?.onSelectAll?.(flag, props.dataSource, props.dataSource);
|
|
68
83
|
};
|
|
69
|
-
return {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
return (_ctx, _cache) => {
|
|
85
|
+
return _openBlock(), _createElementBlock("div", {
|
|
86
|
+
class: _normalizeClass(['jtable-box', _unref(hashId)])
|
|
87
|
+
}, [_createCommentVNode(" 卡片模式 "), _ctx.mode === 'CARD' ? (_openBlock(), _createElementBlock("div", _hoisted_1, [mergedRowSelection.value && mergedRowSelection.value.type === 'checkbox' ? (_openBlock(), _createElementBlock("div", _hoisted_2, [_createVNode(_unref(ACheckbox), {
|
|
88
|
+
indeterminate: indeterminate.value,
|
|
89
|
+
checked: checkedAll.value,
|
|
90
|
+
onChange: handleCheckedAllChange
|
|
91
|
+
}, {
|
|
92
|
+
default: _withCtx(() => [_createTextVNode(_toDisplayString(_unref(contextLocale).select.all), 1 /* TEXT */)]),
|
|
93
|
+
_: 1 /* STABLE */
|
|
94
|
+
}, 8 /* PROPS */, ["indeterminate", "checked"])])) : _createCommentVNode("v-if", true), _ctx.dataSource.length ? (_openBlock(), _createElementBlock("div", {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "jtable-card-items",
|
|
97
|
+
style: _normalizeStyle({
|
|
98
|
+
gridTemplateColumns: gridTemplateColumns.value
|
|
99
|
+
})
|
|
100
|
+
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.dataSource, item => {
|
|
101
|
+
return _openBlock(), _createElementBlock("div", {
|
|
102
|
+
key: item[_ctx.rowKey],
|
|
103
|
+
class: _normalizeClass(['jtable-card-item', _ctx.cardBodyClass]),
|
|
104
|
+
onClick: $event => onClick(item)
|
|
105
|
+
}, [_renderSlot(_ctx.$slots, "card", _mergeProps({
|
|
106
|
+
ref_for: true
|
|
107
|
+
}, item))], 10 /* CLASS, PROPS */, _hoisted_3);
|
|
108
|
+
}), 128 /* KEYED_FRAGMENT */))], 4 /* STYLE */)) : (_openBlock(), _createElementBlock("div", _hoisted_4, [_renderSlot(_ctx.$slots, "emptyText", {}, () => [_createVNode(_unref(Empty))])]))])) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
109
|
+
key: 1
|
|
110
|
+
}, [_createCommentVNode(" 表格模式 "), _createCommentVNode(" 虚拟表格模式 "), _ctx.type === 'TREE' ? (_openBlock(), _createBlock(_unref(JVirtualTable), {
|
|
111
|
+
key: 0,
|
|
112
|
+
rowKey: _ctx.rowKey,
|
|
113
|
+
"row-selection": mergedRowSelection.value,
|
|
114
|
+
dataSource: _ctx.dataSource,
|
|
115
|
+
columns: tableColumns.value,
|
|
116
|
+
height: _ctx.height
|
|
117
|
+
}, _createSlots({
|
|
118
|
+
bodyCell: _withCtx(({
|
|
119
|
+
column: col,
|
|
120
|
+
record,
|
|
121
|
+
index
|
|
122
|
+
}) => [(col?.key || col?.dataIndex) && col?.scopedSlots && (tableSlots.value[col?.dataIndex] || tableSlots.value[col?.key]) ? _renderSlot(_ctx.$slots, col?.key || col?.dataIndex, _mergeProps({
|
|
123
|
+
key: 0
|
|
124
|
+
}, record, {
|
|
125
|
+
index: index,
|
|
126
|
+
column: col
|
|
127
|
+
})) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
128
|
+
key: 1
|
|
129
|
+
}, [_createTextVNode(_toDisplayString(_unref(get)(record, col?.dataIndex || col?.key) || '--'), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))]),
|
|
130
|
+
emptyText: _withCtx(() => [_renderSlot(_ctx.$slots, "emptyText", {}, () => [_createVNode(_unref(Empty))])]),
|
|
131
|
+
_: 2 /* DYNAMIC */
|
|
132
|
+
}, [_renderList(tableSlots.value, (_, slotKey) => {
|
|
133
|
+
return {
|
|
134
|
+
name: slotKey,
|
|
135
|
+
fn: _withCtx(slotProps => [_renderSlot(_ctx.$slots, slotKey, _normalizeProps(_guardReactiveProps(slotProps)))])
|
|
136
|
+
};
|
|
137
|
+
})]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["rowKey", "row-selection", "dataSource", "columns", "height"])) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
138
|
+
key: 1
|
|
139
|
+
}, [_createCommentVNode(" 普通表格模式 "), _createVNode(_unref(Table), _mergeProps(props, {
|
|
140
|
+
"row-selection": mergedRowSelection.value,
|
|
141
|
+
dataSource: _ctx.dataSource,
|
|
142
|
+
columns: tableColumns.value,
|
|
143
|
+
pagination: false,
|
|
144
|
+
scroll: tableScroll.value,
|
|
145
|
+
class: {
|
|
146
|
+
'j-table-scroll': !_ctx.scroll?.y
|
|
147
|
+
}
|
|
148
|
+
}), _createSlots({
|
|
149
|
+
bodyCell: _withCtx(({
|
|
150
|
+
column: col,
|
|
151
|
+
record,
|
|
152
|
+
index
|
|
153
|
+
}) => [(col?.key || col?.dataIndex) && col?.scopedSlots && (tableSlots.value[col?.dataIndex] || tableSlots.value[col?.key]) ? _renderSlot(_ctx.$slots, col?.key || col?.dataIndex, _mergeProps({
|
|
154
|
+
key: 0
|
|
155
|
+
}, record, {
|
|
156
|
+
index: index,
|
|
157
|
+
column: col
|
|
158
|
+
})) : (_openBlock(), _createElementBlock(_Fragment, {
|
|
159
|
+
key: 1
|
|
160
|
+
}, [_createTextVNode(_toDisplayString(_unref(get)(record, col?.dataIndex || col?.key) || '--'), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))]),
|
|
161
|
+
emptyText: _withCtx(() => [_renderSlot(_ctx.$slots, "emptyText", {}, () => [_createVNode(_unref(Empty))])]),
|
|
162
|
+
_: 2 /* DYNAMIC */
|
|
163
|
+
}, [_renderList(tableSlots.value, (_, slotKey) => {
|
|
164
|
+
return {
|
|
165
|
+
name: slotKey,
|
|
166
|
+
fn: _withCtx(slotProps => [_renderSlot(_ctx.$slots, slotKey, _normalizeProps(_guardReactiveProps(slotProps)))])
|
|
167
|
+
};
|
|
168
|
+
})]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["row-selection", "dataSource", "columns", "scroll", "class"])], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))], 64 /* STABLE_FRAGMENT */))], 2 /* CLASS */);
|
|
82
169
|
};
|
|
83
170
|
}
|
|
84
|
-
});
|
|
171
|
+
});
|
|
172
|
+
export default __sfc_main__;
|
package/lib/ProTable/Header.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from "vue";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
class: "jtable-body-header-left"
|
|
5
|
+
};
|
|
6
|
+
const _hoisted_2 = {
|
|
7
|
+
class: "jtable-body-header-right"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "table-body-header-right-button"
|
|
12
|
+
};
|
|
13
|
+
import { computed } from 'vue';
|
|
2
14
|
import { RadioGroup, RadioButton } from 'ant-design-vue';
|
|
3
15
|
import AIcon from '../Icon';
|
|
4
16
|
import { _headerProps } from './setting';
|
|
5
17
|
import useProTableStyle from './style';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
RadioGroup,
|
|
10
|
-
RadioButton,
|
|
11
|
-
AIcon
|
|
18
|
+
const __sfc_main__ = _defineComponent({
|
|
19
|
+
...{
|
|
20
|
+
name: 'Header'
|
|
12
21
|
},
|
|
22
|
+
__name: 'Header',
|
|
13
23
|
props: {
|
|
14
24
|
..._headerProps,
|
|
15
25
|
initMode: {
|
|
@@ -18,15 +28,38 @@ export default defineComponent({
|
|
|
18
28
|
}
|
|
19
29
|
},
|
|
20
30
|
emits: ['change'],
|
|
21
|
-
setup(
|
|
22
|
-
emit
|
|
31
|
+
setup(__props, {
|
|
32
|
+
emit: __emit
|
|
23
33
|
}) {
|
|
24
|
-
const
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
25
36
|
const prefixCls = computed(() => 'pro-table');
|
|
26
37
|
const [wrapSSR, hashId] = useProTableStyle(prefixCls);
|
|
27
|
-
return {
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return _openBlock(), _createElementBlock("div", {
|
|
40
|
+
class: _normalizeClass(['jtable-body-header', _unref(hashId)])
|
|
41
|
+
}, [_createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "headerLeftRender")]), _createElementVNode("div", _hoisted_2, [_renderSlot(_ctx.$slots, "headerRightRender"), !__props.initMode ? (_openBlock(), _createElementBlock("div", _hoisted_3, [_createVNode(_unref(RadioGroup), {
|
|
42
|
+
value: _ctx.mode,
|
|
43
|
+
onChange: _cache[0] || (_cache[0] = e => emit('change', e))
|
|
44
|
+
}, {
|
|
45
|
+
default: _withCtx(() => [_createVNode(_unref(RadioButton), {
|
|
46
|
+
value: "TABLE"
|
|
47
|
+
}, {
|
|
48
|
+
default: _withCtx(() => [_createVNode(_unref(AIcon), {
|
|
49
|
+
type: "UnorderedListOutlined"
|
|
50
|
+
})]),
|
|
51
|
+
_: 1 /* STABLE */
|
|
52
|
+
}), _createVNode(_unref(RadioButton), {
|
|
53
|
+
value: "CARD"
|
|
54
|
+
}, {
|
|
55
|
+
default: _withCtx(() => [_createVNode(_unref(AIcon), {
|
|
56
|
+
type: "AppstoreOutlined"
|
|
57
|
+
})]),
|
|
58
|
+
_: 1 /* STABLE */
|
|
59
|
+
})]),
|
|
60
|
+
_: 1 /* STABLE */
|
|
61
|
+
}, 8 /* PROPS */, ["value"])])) : _createCommentVNode("v-if", true)])], 2 /* CLASS */);
|
|
30
62
|
};
|
|
31
63
|
}
|
|
32
|
-
});
|
|
64
|
+
});
|
|
65
|
+
export default __sfc_main__;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, renderSlot as _renderSlot, mergeProps as _mergeProps, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
3
|
+
import { computed, h } from 'vue';
|
|
2
4
|
import { Pagination, Spin } from 'ant-design-vue';
|
|
3
5
|
import { _paginationProps } from './setting';
|
|
4
6
|
import { useLocaleReceiver } from '../LocaleReciver';
|
|
5
7
|
import useProTableStyle from './style';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Pagination
|
|
8
|
+
const __sfc_main__ = _defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: 'JPagination'
|
|
10
11
|
},
|
|
12
|
+
__name: 'Pagination',
|
|
11
13
|
props: {
|
|
12
14
|
..._paginationProps
|
|
13
15
|
},
|
|
14
16
|
emits: ['change'],
|
|
15
|
-
setup(
|
|
16
|
-
emit
|
|
17
|
+
setup(__props, {
|
|
18
|
+
emit: __emit
|
|
17
19
|
}) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const emit = __emit;
|
|
18
22
|
const [contextLocale] = useLocaleReceiver('ProTable');
|
|
19
23
|
const prefixCls = computed(() => 'pro-table');
|
|
20
24
|
const [wrapSSR, hashId] = useProTableStyle(prefixCls);
|
|
@@ -23,7 +27,7 @@ export default defineComponent({
|
|
|
23
27
|
'hide-content': !props.isShowContent
|
|
24
28
|
};
|
|
25
29
|
});
|
|
26
|
-
const
|
|
30
|
+
const showTotal = num => {
|
|
27
31
|
const minSize = props.pageIndex * props.pageSize + 1;
|
|
28
32
|
const MaxSize = (props.pageIndex + 1) * props.pageSize;
|
|
29
33
|
let localePage = contextLocale.value.pagination?.page || '';
|
|
@@ -46,11 +50,18 @@ export default defineComponent({
|
|
|
46
50
|
const onChange = (page, size) => {
|
|
47
51
|
emit('change', page, size);
|
|
48
52
|
};
|
|
49
|
-
return {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
return (_ctx, _cache) => {
|
|
54
|
+
return _openBlock(), _createElementBlock("div", {
|
|
55
|
+
class: _normalizeClass(['jtable-pagination', _unref(hashId)])
|
|
56
|
+
}, [_renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_unref(Pagination), _mergeProps(props, {
|
|
57
|
+
total: _ctx.total,
|
|
58
|
+
pageSize: _ctx.pageSize,
|
|
59
|
+
current: _ctx.pageIndex + 1,
|
|
60
|
+
"show-total": num => showTotal(num),
|
|
61
|
+
class: className.value,
|
|
62
|
+
onChange: onChange
|
|
63
|
+
}), null, 16 /* FULL_PROPS */, ["total", "pageSize", "current", "show-total", "class"])])], 2 /* CLASS */);
|
|
54
64
|
};
|
|
55
65
|
}
|
|
56
|
-
});
|
|
66
|
+
});
|
|
67
|
+
export default __sfc_main__;
|