@jetlinks-web/components 2.0.33 → 2.0.35

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.
@@ -21,25 +21,28 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
21
21
  "_contentProps": "setup-maybe-ref",
22
22
  "Table": "setup-maybe-ref",
23
23
  "get": "setup-maybe-ref",
24
- "isString": "setup-maybe-ref",
25
24
  "Empty": "setup-maybe-ref",
26
25
  "props": "setup-reactive-const",
27
26
  "slots": "setup-maybe-ref",
28
27
  "_columns": "setup-ref",
29
- "cardStyle": "setup-ref",
28
+ "_scroll": "setup-ref",
30
29
  "gridTemplateColumns": "setup-ref"
31
30
  } */
32
31
  import { defineComponent as _defineComponent } from 'vue';
33
32
  import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, unref as _unref, createVNode as _createVNode, mergeProps as _mergeProps, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock } from "vue";
34
33
  const _hoisted_1 = { class: "jtable-box" };
35
34
  const _hoisted_2 = {
35
+ key: 0,
36
+ class: "jtable-card"
37
+ };
38
+ const _hoisted_3 = {
36
39
  key: 1,
37
40
  class: "j-table-empty"
38
41
  };
39
42
  import { useSlots, computed } from 'vue';
40
43
  import { _contentProps } from "./setting";
41
44
  import { Table } from 'ant-design-vue';
42
- import { get, isString } from 'lodash-es';
45
+ import { get } from 'lodash-es';
43
46
  import Empty from '../Empty';
44
47
  const __sfc_main__ = _defineComponent({
45
48
  ...{
@@ -56,22 +59,20 @@ const __sfc_main__ = _defineComponent({
56
59
  const props = __props;
57
60
  const slots = useSlots();
58
61
  const _columns = computed(() => props.columns.filter((i) => !_optionalChain([i, 'optionalAccess', _2 => _2.hideInTable])));
59
- const cardStyle = computed(() => props.scroll && props.scroll.y ? {
60
- maxHeight: isString(props.scroll.y) ? props.scroll.y : props.scroll.y + 'px',
61
- overflow: 'auto',
62
- }
63
- : undefined);
62
+ const _scroll = computed(() => {
63
+ let y = _optionalChain([props, 'access', _3 => _3.scroll, 'optionalAccess', _4 => _4.y]) || '100%';
64
+ return {
65
+ x: _optionalChain([props, 'access', _5 => _5.scroll, 'optionalAccess', _6 => _6.x]) || '100%',
66
+ y
67
+ };
68
+ });
64
69
  const gridTemplateColumns = computed(() => {
65
70
  return `repeat(${props.column}, 1fr)`;
66
71
  });
67
72
  return (_ctx, _cache) => {
68
73
  return (_openBlock(), _createElementBlock("div", _hoisted_1, [
69
74
  (_ctx.mode === 'CARD')
70
- ? (_openBlock(), _createElementBlock("div", {
71
- key: 0,
72
- class: "jtable-card",
73
- style: _normalizeStyle(cardStyle.value)
74
- }, [
75
+ ? (_openBlock(), _createElementBlock("div", _hoisted_2, [
75
76
  (_ctx.dataSource.length)
76
77
  ? (_openBlock(), _createElementBlock("div", {
77
78
  key: 0,
@@ -81,31 +82,33 @@ const __sfc_main__ = _defineComponent({
81
82
  (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.dataSource, (item) => {
82
83
  return (_openBlock(), _createElementBlock("div", {
83
84
  class: _normalizeClass(['jtable-card-item', props.cardBodyClass]),
84
- key: item[_ctx.rowKey]
85
+ key: item[props.rowKey]
85
86
  }, [
86
87
  _renderSlot(_ctx.$slots, "card", _normalizeProps(_guardReactiveProps(item)))
87
88
  ], 2 /* CLASS */));
88
89
  }), 128 /* KEYED_FRAGMENT */))
89
90
  ], 4 /* STYLE */))
90
- : (_openBlock(), _createElementBlock("div", _hoisted_2, [
91
+ : (_openBlock(), _createElementBlock("div", _hoisted_3, [
91
92
  _renderSlot(_ctx.$slots, "emptyText", {}, () => [
92
93
  _createVNode(_unref(Empty))
93
94
  ])
94
95
  ]))
95
- ], 4 /* STYLE */))
96
+ ]))
96
97
  : (_openBlock(), _createBlock(_unref(Table), _mergeProps({ key: 1 }, props, {
97
98
  dataSource: _ctx.dataSource,
98
99
  columns: _columns.value,
99
- pagination: false
100
+ pagination: false,
101
+ scroll: _scroll.value,
102
+ class: { 'j-table-scroll': !_optionalChain([props, 'access', _7 => _7.scroll, 'optionalAccess', _8 => _8.y]) }
100
103
  }), {
101
104
  headerCell: _withCtx(({ column, title }) => [
102
105
  _renderSlot(_ctx.$slots, "headerCell", _normalizeProps(_guardReactiveProps({ column, title })))
103
106
  ]),
104
107
  bodyCell: _withCtx(({ column, record }) => [
105
- ((_optionalChain([column, 'optionalAccess', _3 => _3.key]) || _optionalChain([column, 'optionalAccess', _4 => _4.dataIndex])) && _optionalChain([column, 'optionalAccess', _5 => _5.scopedSlots]) && (_optionalChain([_unref, 'call', _6 => _6(slots), 'optionalAccess', _7 => _7[_optionalChain([column, 'optionalAccess', _8 => _8.dataIndex])]]) || _optionalChain([_unref, 'call', _9 => _9(slots), 'optionalAccess', _10 => _10[_optionalChain([column, 'optionalAccess', _11 => _11.key])]])))
106
- ? _renderSlot(_ctx.$slots, _optionalChain([column, 'optionalAccess', _12 => _12.key]) || _optionalChain([column, 'optionalAccess', _13 => _13.dataIndex]), _normalizeProps(_mergeProps({ key: 0 }, record)))
108
+ ((_optionalChain([column, 'optionalAccess', _9 => _9.key]) || _optionalChain([column, 'optionalAccess', _10 => _10.dataIndex])) && _optionalChain([column, 'optionalAccess', _11 => _11.scopedSlots]) && (_optionalChain([_unref, 'call', _12 => _12(slots), 'optionalAccess', _13 => _13[_optionalChain([column, 'optionalAccess', _14 => _14.dataIndex])]]) || _optionalChain([_unref, 'call', _15 => _15(slots), 'optionalAccess', _16 => _16[_optionalChain([column, 'optionalAccess', _17 => _17.key])]])))
109
+ ? _renderSlot(_ctx.$slots, _optionalChain([column, 'optionalAccess', _18 => _18.key]) || _optionalChain([column, 'optionalAccess', _19 => _19.dataIndex]), _normalizeProps(_mergeProps({ key: 0 }, record)))
107
110
  : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
108
- _createTextVNode(_toDisplayString(_unref(get)(record, _optionalChain([column, 'optionalAccess', _14 => _14.dataIndex]) || _optionalChain([column, 'optionalAccess', _15 => _15.key]))), 1 /* TEXT */)
111
+ _createTextVNode(_toDisplayString(_unref(get)(record, _optionalChain([column, 'optionalAccess', _20 => _20.dataIndex]) || _optionalChain([column, 'optionalAccess', _21 => _21.key]))), 1 /* TEXT */)
109
112
  ], 64 /* STABLE_FRAGMENT */))
110
113
  ]),
111
114
  emptyText: _withCtx(() => [
@@ -114,7 +117,7 @@ const __sfc_main__ = _defineComponent({
114
117
  ])
115
118
  ]),
116
119
  _: 3 /* FORWARDED */
117
- }, 16 /* FULL_PROPS */, ["dataSource", "columns"]))
120
+ }, 16 /* FULL_PROPS */, ["dataSource", "columns", "scroll", "class"]))
118
121
  ]));
119
122
  };
120
123
  }
@@ -1,25 +1,33 @@
1
1
  /* Analyzed bindings: {
2
2
  "Pagination": "setup-maybe-ref",
3
- "paginationProps": "setup-maybe-ref",
3
+ "_paginationProps": "setup-maybe-ref",
4
+ "computed": "setup-const",
4
5
  "props": "setup-reactive-const",
5
6
  "emits": "setup-const",
7
+ "className": "setup-ref",
6
8
  "_showTotal": "setup-const",
7
9
  "onChange": "setup-const"
8
10
  } */
9
11
  import { defineComponent as _defineComponent } from 'vue';
10
- import { renderSlot as _renderSlot, unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
12
+ import { renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
11
13
  const _hoisted_1 = { class: "jtable-pagination" };
12
14
  import { Pagination } from 'ant-design-vue';
13
- import { paginationProps } from "./setting";
15
+ import { _paginationProps } from "./setting";
16
+ import { computed } from 'vue';
14
17
  const __sfc_main__ = _defineComponent({
15
18
  ...{
16
19
  name: 'Pagination'
17
20
  },
18
- props: { ...paginationProps },
21
+ props: { ..._paginationProps },
19
22
  emits: ['change'],
20
23
  setup(__props, { emit: __emit }) {
21
24
  const props = __props;
22
25
  const emits = __emit;
26
+ const className = computed(() => {
27
+ return {
28
+ 'show-content': !props.isShowContent,
29
+ };
30
+ });
23
31
  const _showTotal = (num) => {
24
32
  const minSize = props.pageIndex * props.pageSize + 1;
25
33
  const MaxSize = (props.pageIndex + 1) * props.pageSize;
@@ -31,13 +39,14 @@ const __sfc_main__ = _defineComponent({
31
39
  return (_ctx, _cache) => {
32
40
  return (_openBlock(), _createElementBlock("div", _hoisted_1, [
33
41
  _renderSlot(_ctx.$slots, "default", {}, () => [
34
- _createVNode(_unref(Pagination), {
42
+ _createVNode(_unref(Pagination), _mergeProps(props, {
35
43
  total: _ctx.total,
36
44
  pageSize: _ctx.pageSize,
37
45
  current: _ctx.pageIndex + 1,
38
46
  "show-total": (num) => _showTotal(num),
39
- onChange: onChange
40
- }, null, 8 /* PROPS */, ["total", "pageSize", "current", "show-total"])
47
+ onChange: onChange,
48
+ class: className.value
49
+ }), null, 16 /* FULL_PROPS */, ["total", "pageSize", "current", "show-total", "class"])
41
50
  ])
42
51
  ]));
43
52
  };
@@ -281,13 +281,14 @@ const __sfc_main__ = _defineComponent({
281
281
  })
282
282
  ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["mode", "dataSource", "column"]),
283
283
  (showPagination.value)
284
- ? (_openBlock(), _createBlock(Pagination, {
284
+ ? (_openBlock(), _createBlock(Pagination, _mergeProps({
285
285
  key: 1,
286
- onChange: onPageChange,
286
+ onChange: onPageChange
287
+ }, props.pagination, {
287
288
  total: page.total,
288
289
  pageIndex: page.pageIndex,
289
290
  pageSize: page.pageSize
290
- }, {
291
+ }), {
291
292
  default: _withCtx(() => [
292
293
  _renderSlot(_ctx.$slots, "paginationRender", {
293
294
  total: page.total,
@@ -297,7 +298,7 @@ const __sfc_main__ = _defineComponent({
297
298
  })
298
299
  ]),
299
300
  _: 3 /* FORWARDED */
300
- }, 8 /* PROPS */, ["total", "pageIndex", "pageSize"]))
301
+ }, 16 /* FULL_PROPS */, ["total", "pageIndex", "pageSize"]))
301
302
  : _createCommentVNode("v-if", true)
302
303
  ])
303
304
  ]),
@@ -4,11 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.proTableProps = exports.paginationProps = exports._headerProps = exports._contentProps = exports._alertProps = void 0;
7
+ exports.proTableProps = exports._paginationProps = exports._headerProps = exports._contentProps = exports._alertProps = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _Table = require("ant-design-vue/es/table/Table");
10
10
  require("vue");
11
11
  require("ant-design-vue/es/table");
12
+ var _Pagination = require("ant-design-vue/es/pagination/Pagination");
12
13
  var _headerProps = exports._headerProps = {
13
14
  mode: {
14
15
  type: [String, undefined],
@@ -55,17 +56,15 @@ var _contentProps = exports._contentProps = (0, _objectSpread2.default)((0, _obj
55
56
  scroll: {
56
57
  type: Object,
57
58
  default: function _default() {
58
- return {
59
- x: 1366
60
- };
61
- }
59
+ return {};
60
+ } // x: 1366
62
61
  },
63
62
  rowKey: {
64
63
  type: [String, Function],
65
64
  default: 'id'
66
65
  }
67
66
  });
68
- var paginationProps = exports.paginationProps = {
67
+ var _paginationProps = exports._paginationProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _Pagination.paginationProps)()), {}, {
69
68
  total: {
70
69
  type: Number,
71
70
  default: 0
@@ -77,8 +76,15 @@ var paginationProps = exports.paginationProps = {
77
76
  pageIndex: {
78
77
  type: Number,
79
78
  default: 0
79
+ },
80
+ /**
81
+ * 是否显示分页内容
82
+ */
83
+ isShowContent: {
84
+ type: Boolean,
85
+ default: false
80
86
  }
81
- };
87
+ });
82
88
  var proTableProps = exports.proTableProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _contentProps), _alertProps), {}, {
83
89
  bodyStyle: {
84
90
  type: Object,
@@ -1,7 +1,8 @@
1
1
  @import '../../style/variable.less';
2
+ @import 'ant-design-vue/lib/pagination/style/index.less';
2
3
 
3
4
  .jtable-body-spin {
4
- min-height: 100%;
5
+ height: 100%;
5
6
  width: 100%;
6
7
  background-color: #fff;
7
8
 
@@ -59,25 +60,75 @@
59
60
  }
60
61
  }
61
62
 
62
- .jtable-alert {
63
- margin-bottom: 16px;
64
- }
63
+ .jtable-box {
64
+ flex: 1;
65
+ min-height: 0;
66
+
67
+ .jtable-card {
68
+ height: 100%;
69
+ overflow-y: auto;
70
+
71
+ .jtable-card-items {
72
+ display: grid;
73
+ grid-gap: 26px;
74
+
75
+ .jtable-card-item {
76
+ display: flex;
77
+ min-width: 0;
78
+ }
79
+ }
80
+
81
+ .j-table-empty {
82
+ margin-top: 100px;
83
+ }
84
+ }
85
+
86
+ .ant-table-wrapper {
87
+ height: 100%;
88
+ .ant-table {
89
+ height: 100%;
65
90
 
66
- .jtable-card {
67
- .jtable-card-items {
68
- display: grid;
69
- grid-gap: 26px;
91
+ .ant-table-container {
92
+ height: 100%;
70
93
 
71
- .jtable-card-item {
94
+ .ant-table-content {
95
+ height: 100%;
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+ .j-table-scroll {
102
+ background-color: red;
103
+ .ant-table-container {
72
104
  display: flex;
73
- min-width: 0;
105
+ flex-direction: column;
106
+
107
+ .ant-table-body {
108
+ flex: 1;
109
+ min-height: 0;
110
+ overflow-y: auto;
111
+ }
74
112
  }
75
113
  }
76
114
  }
77
115
 
116
+ .jtable-alert {
117
+ margin-bottom: 16px;
118
+ }
119
+
78
120
  .jtable-pagination {
79
121
  width: 100%;
80
122
  display: flex;
81
123
  justify-content: flex-end;
82
124
  margin-top: 16px;
125
+
126
+ .show-content {
127
+ .@{ant-prefix}-pagination-item,
128
+ & .@{ant-prefix}-pagination-jump-prev,
129
+ & .@{ant-prefix}-pagination-jump-next {
130
+ display: none;
131
+ }
132
+ }
83
133
  }
134
+
@@ -21,7 +21,7 @@
21
21
  } */
22
22
  import { defineComponent as _defineComponent } from 'vue';
23
23
  import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
24
- const _withScopeId = n => (_pushScopeId("data-v-1716520754723"), n = n(), _popScopeId(), n);
24
+ const _withScopeId = n => (_pushScopeId("data-v-1716887937833"), n = n(), _popScopeId(), n);
25
25
  const _hoisted_1 = {
26
26
  key: 0,
27
27
  style: { "width": "240px" }
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
78
78
  } */
79
79
  import { defineComponent as _defineComponent } from 'vue';
80
80
  import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
81
- const _withScopeId = n => (_pushScopeId("data-v-1716520753930"), n = n(), _popScopeId(), n);
81
+ const _withScopeId = n => (_pushScopeId("data-v-1716887935892"), n = n(), _popScopeId(), n);
82
82
  const _hoisted_1 = { class: "JSearch-item" };
83
83
  const _hoisted_2 = {
84
84
  key: 0,
@@ -36,7 +36,7 @@
36
36
  } */
37
37
  import { defineComponent as _defineComponent } from 'vue';
38
38
  import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
39
- const _withScopeId = n => (_pushScopeId("data-v-1716520754118"), n = n(), _popScopeId(), n);
39
+ const _withScopeId = n => (_pushScopeId("data-v-1716887936060"), n = n(), _popScopeId(), n);
40
40
  const _hoisted_1 = { class: "JSearch-content simple" };
41
41
  const _hoisted_2 = { class: "JSearch-items" };
42
42
  import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';