@jetlinks-web/components 2.0.32 → 2.0.33

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.
Files changed (38) hide show
  1. package/es/FullPage/FullPage.js +1 -1
  2. package/es/ProTable/Alert.js +73 -0
  3. package/es/ProTable/Content.js +122 -0
  4. package/es/ProTable/Header.js +73 -0
  5. package/es/ProTable/Pagination.js +46 -0
  6. package/es/ProTable/ProTable.js +310 -0
  7. package/es/ProTable/index.js +1 -410
  8. package/es/ProTable/setting.js +119 -0
  9. package/es/ProTable/style/ProTable.less +83 -0
  10. package/es/ProTable/style/index.js +1 -1
  11. package/es/Search/Advanced/SaveHistory.js +1 -1
  12. package/es/Search/Item.js +1 -1
  13. package/es/Search/Search.js +1 -1
  14. package/es/style/index.css +20 -20
  15. package/es/style/index.less +7 -7
  16. package/lib/FullPage/FullPage.js +1 -1
  17. package/lib/ProTable/Alert.js +73 -0
  18. package/lib/ProTable/Content.js +122 -0
  19. package/lib/ProTable/Header.js +73 -0
  20. package/lib/ProTable/Pagination.js +46 -0
  21. package/lib/ProTable/ProTable.js +310 -0
  22. package/lib/ProTable/index.js +4 -412
  23. package/lib/ProTable/setting.js +126 -0
  24. package/lib/ProTable/style/ProTable.less +83 -0
  25. package/lib/ProTable/style/index.js +1 -1
  26. package/lib/Search/Advanced/SaveHistory.js +1 -1
  27. package/lib/Search/Item.js +1 -1
  28. package/lib/Search/Search.js +1 -1
  29. package/lib/style/components.less +0 -1
  30. package/lib/style/index.css +20 -20
  31. package/lib/style/index.less +7 -7
  32. package/package.json +1 -1
  33. package/es/ProTable/proTableTypes.js +0 -11
  34. package/es/ProTable/style/index.css +0 -69
  35. package/es/ProTable/style/index.less +0 -92
  36. package/lib/ProTable/proTableTypes.js +0 -17
  37. package/lib/ProTable/style/index.css +0 -69
  38. package/lib/ProTable/style/index.less +0 -92
@@ -1,413 +1,4 @@
1
- import _typeof from "@babel/runtime/helpers/esm/typeof";
2
- import { createVNode as _createVNode, isVNode as _isVNode, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective } from "vue";
3
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
7
- import { Empty, AIcon } from '../index';
8
- import { Table, Pagination, Button, Alert, Spin, RadioGroup, RadioButton } from 'ant-design-vue';
9
- import { tableProps as _tableProps } from 'ant-design-vue/es/table';
10
- import { defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';
11
- import { ModelEnum } from './proTableTypes';
12
- import { get, debounce, isArray } from 'lodash-es';
13
- function _isSlot(s) {
14
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
15
- }
16
- var tableProps = function tableProps() {
17
- return _objectSpread(_objectSpread({}, _tableProps()), {}, {
18
- loading: {
19
- type: Boolean,
20
- default: undefined
21
- },
22
- request: {
23
- type: Function,
24
- default: undefined
25
- },
26
- cardBodyClass: {
27
- type: String,
28
- default: ''
29
- },
30
- bodyStyle: {
31
- type: Object,
32
- default: {}
33
- },
34
- columns: {
35
- type: Array,
36
- default: function _default() {
37
- return [];
38
- }
39
- },
40
- model: {
41
- type: [String, undefined],
42
- default: undefined
43
- },
44
- modelValue: {
45
- type: String,
46
- default: undefined
47
- },
48
- noPagination: {
49
- type: Boolean,
50
- default: false
51
- },
52
- rowSelection: {
53
- type: Object,
54
- default: function _default() {
55
- return undefined;
56
- }
57
- },
58
- dataSource: {
59
- type: Array,
60
- default: function _default() {
61
- return [];
62
- }
63
- },
64
- gridColumns: {
65
- type: Array,
66
- default: function _default() {
67
- return [];
68
- }
69
- },
70
- gridColumn: {
71
- type: Number,
72
- default: 4
73
- },
74
- alertRender: {
75
- type: Boolean,
76
- default: true
77
- },
78
- params: {
79
- type: Object,
80
- default: function _default() {}
81
- },
82
- type: {
83
- type: String,
84
- default: 'PAGE'
85
- },
86
- scroll: {
87
- type: Object,
88
- default: function _default() {
89
- x: 1366;
90
- }
91
- },
92
- defaultParams: {
93
- type: Object,
94
- default: function _default() {}
95
- },
96
- rowKey: {
97
- type: [String, Function],
98
- default: 'id'
99
- },
100
- pagination: {
101
- type: Object,
102
- default: function _default() {
103
- return {
104
- showSizeChanger: true,
105
- showQuickJumper: false,
106
- size: 'size',
107
- pageSizeOptions: ['12', '24', '48', '96']
108
- };
109
- }
110
- }
111
- });
112
- };
113
- var ProTable = defineComponent({
114
- name: 'JProTable',
115
- slots: ['headerTitle', 'card', 'rightExtraRender', 'paginationRender' // 分页
116
- ],
117
- props: tableProps(),
118
- emits: ['update:modelValue', 'modelChange'],
119
- setup: function setup(props, _ref) {
120
- var _props$pagination;
121
- var slots = _ref.slots,
122
- expose = _ref.expose,
123
- emit = _ref.emit;
124
- var _model = ref(props.model ? props.model : ModelEnum.CARD); // 模式切换
125
- var _dataSource = ref([]);
126
- var pageIndex = ref(0);
127
- var pageSize = ref(12);
128
- var total = ref(0);
129
- var _loading = ref(false);
130
- var column = ref(props.gridColumn || 4);
131
- if (!props.noPagination && props.pagination && isArray((_props$pagination = props.pagination) === null || _props$pagination === void 0 ? void 0 : _props$pagination.pageSizeOptions)) {
132
- pageSize.value = props.pagination.pageSizeOptions[0];
133
- }
134
- /**
135
- * 监听宽度,计算显示卡片个数
136
- */
137
- var windowChange = function windowChange() {
138
- if (window.innerWidth <= 1440) {
139
- var _props$gridColumns;
140
- var _column = props.gridColumn && props.gridColumn < 2 ? props.gridColumn : 2;
141
- column.value = ((_props$gridColumns = props.gridColumns) === null || _props$gridColumns === void 0 ? void 0 : _props$gridColumns[0]) ? props.gridColumns[0] : _column;
142
- } else if (window.innerWidth > 1440 && window.innerWidth <= 1600) {
143
- var _props$gridColumns2;
144
- var _column2 = props.gridColumn && props.gridColumn < 3 ? props.gridColumn : 3;
145
- column.value = ((_props$gridColumns2 = props.gridColumns) === null || _props$gridColumns2 === void 0 ? void 0 : _props$gridColumns2[1]) ? props.gridColumns[1] : _column2;
146
- } else if (window.innerWidth > 1600) {
147
- var _props$gridColumns3;
148
- var _column3 = props.gridColumn && props.gridColumn < 4 ? props.gridColumn : 4;
149
- column.value = ((_props$gridColumns3 = props.gridColumns) === null || _props$gridColumns3 === void 0 ? void 0 : _props$gridColumns3[2]) ? props.gridColumns[2] : _column3;
150
- }
151
- };
152
- var handleSearch = /*#__PURE__*/function () {
153
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_params) {
154
- var _props$defaultParams, resp, _resp$result, _resp$result2, _resp$result3, _resp$result4, _resp$result4$data, _resp$result5, _resp$result6, _resp$result7, _resp$result8;
155
- return _regeneratorRuntime().wrap(function _callee$(_context) {
156
- while (1) switch (_context.prev = _context.next) {
157
- case 0:
158
- _loading.value = props.loading !== undefined ? props.loading : true;
159
- if (!props.request) {
160
- _context.next = 9;
161
- break;
162
- }
163
- console.log(_params);
164
- _context.next = 5;
165
- return props.request(_objectSpread(_objectSpread(_objectSpread({
166
- pageIndex: 0,
167
- pageSize: Number(pageSize.value)
168
- }, props.defaultParams), _params), {}, {
169
- terms: [].concat(_toConsumableArray(((_props$defaultParams = props.defaultParams) === null || _props$defaultParams === void 0 ? void 0 : _props$defaultParams.terms) || []), _toConsumableArray((_params === null || _params === void 0 ? void 0 : _params.terms) || []))
170
- })).catch(function () {
171
- _loading.value = props.loading !== undefined ? props.loading : false;
172
- });
173
- case 5:
174
- resp = _context.sent;
175
- if (resp.status === 200) {
176
- if (props.type === 'PAGE') {
177
- // 判断如果是最后一页且最后一页为空,就跳转到前一页
178
- if ((resp === null || resp === void 0 ? void 0 : (_resp$result = resp.result) === null || _resp$result === void 0 ? void 0 : _resp$result.total) && (resp === null || resp === void 0 ? void 0 : (_resp$result2 = resp.result) === null || _resp$result2 === void 0 ? void 0 : _resp$result2.pageSize) && (resp === null || resp === void 0 ? void 0 : (_resp$result3 = resp.result) === null || _resp$result3 === void 0 ? void 0 : _resp$result3.pageIndex) && (resp === null || resp === void 0 ? void 0 : (_resp$result4 = resp.result) === null || _resp$result4 === void 0 ? void 0 : (_resp$result4$data = _resp$result4.data) === null || _resp$result4$data === void 0 ? void 0 : _resp$result4$data.length) === 0) {
179
- pageIndex.value = pageIndex.value > 0 ? pageIndex.value - 1 : 0;
180
- handleSearch(_objectSpread(_objectSpread({}, _params), {}, {
181
- pageSize: pageSize.value,
182
- pageIndex: pageIndex.value
183
- }));
184
- } else {
185
- _dataSource.value = (resp === null || resp === void 0 ? void 0 : (_resp$result5 = resp.result) === null || _resp$result5 === void 0 ? void 0 : _resp$result5.data) || [];
186
- pageIndex.value = (resp === null || resp === void 0 ? void 0 : (_resp$result6 = resp.result) === null || _resp$result6 === void 0 ? void 0 : _resp$result6.pageIndex) || 0;
187
- pageSize.value = (resp === null || resp === void 0 ? void 0 : (_resp$result7 = resp.result) === null || _resp$result7 === void 0 ? void 0 : _resp$result7.pageSize) || 12;
188
- total.value = (resp === null || resp === void 0 ? void 0 : (_resp$result8 = resp.result) === null || _resp$result8 === void 0 ? void 0 : _resp$result8.total) || 0;
189
- }
190
- } else {
191
- _dataSource.value = (resp === null || resp === void 0 ? void 0 : resp.result) || [];
192
- }
193
- } else {
194
- _dataSource.value = [];
195
- }
196
- _context.next = 10;
197
- break;
198
- case 9:
199
- _dataSource.value = (props === null || props === void 0 ? void 0 : props.dataSource) || [];
200
- case 10:
201
- _loading.value = props.loading !== undefined ? props.loading : false;
202
- case 11:
203
- case "end":
204
- return _context.stop();
205
- }
206
- }, _callee);
207
- }));
208
- return function handleSearch(_x) {
209
- return _ref2.apply(this, arguments);
210
- };
211
- }();
212
- var _debounceFn = debounce(handleSearch, 300);
213
- watch(function () {
214
- return props.params;
215
- }, function (newValue) {
216
- _debounceFn(newValue || {});
217
- }, {
218
- deep: true,
219
- immediate: true
220
- });
221
- watch(function () {
222
- return props.dataSource;
223
- }, function (newVal) {
224
- if (newVal && !props.request) {
225
- handleSearch(props.params);
226
- }
227
- }, {
228
- deep: true,
229
- immediate: true
230
- });
231
- watch(function () {
232
- return props.modelValue;
233
- }, function () {
234
- if (props.modelValue) {
235
- _model.value = props.modelValue;
236
- }
237
- }, {
238
- immediate: true
239
- });
240
- /**
241
- * 刷新数据
242
- * @param _params
243
- */
244
- var reload = function reload(_params) {
245
- handleSearch(_objectSpread(_objectSpread(_objectSpread({}, props.params), _params), {}, {
246
- pageSize: pageSize.value || 12,
247
- pageIndex: pageIndex.value || 0
248
- }));
249
- };
250
- onMounted(function () {
251
- windowChange(); // 初始化
252
- window.onresize = function () {
253
- windowChange();
254
- };
255
- });
256
- onUnmounted(function () {
257
- window.onresize = null;
258
- });
259
- /**
260
- * 导出方法
261
- */
262
- expose({
263
- reload: reload,
264
- _dataSource: _dataSource
265
- });
266
- return function () {
267
- var _props$rowSelection, _props$rowSelection$s, _props$rowSelection2, _props$rowSelection2$;
268
- var _slot, _slot2, _slot3;
269
- return _createVNode("div", {
270
- "class": "jtable-body-spin",
271
- "style": _objectSpread({}, props.bodyStyle)
272
- }, [_createVNode(Spin, {
273
- "spinning": _loading.value
274
- }, _isSlot(_slot3 = _createVNode("div", {
275
- "class": 'jtable-body'
276
- }, [_createVNode("div", {
277
- "class": 'jtable-body-header'
278
- }, [_createVNode("div", {
279
- "class": 'jtable-body-header-left'
280
- }, [slots.headerTitle && slots.headerTitle()]), _createVNode("div", {
281
- "class": 'jtable-body-header-right'
282
- }, [slots.rightExtraRender && slots.rightExtraRender(), !props.model && _createVNode("div", {
283
- "class": 'jtable-body-header-right-button'
284
- }, [_createVNode(RadioGroup, {
285
- "class": "jtable-body-header-right-button",
286
- "value": _model.value,
287
- "onChange": function onChange(e) {
288
- _model.value = e.target.value;
289
- emit('update:modelValue', e.target.value);
290
- emit('modelChange', e.target.value);
291
- }
292
- }, {
293
- default: function _default() {
294
- return [_createVNode(RadioButton, {
295
- "value": ModelEnum.TABLE
296
- }, _isSlot(_slot = _createVNode(AIcon, {
297
- "class": 'right-button-icon',
298
- "type": "UnorderedListOutlined"
299
- }, null)) ? _slot : {
300
- default: function _default() {
301
- return [_slot];
302
- }
303
- }), _createVNode(RadioButton, {
304
- "value": ModelEnum.CARD
305
- }, _isSlot(_slot2 = _createVNode(AIcon, {
306
- "class": 'right-button-icon',
307
- "type": "AppstoreOutlined"
308
- }, null)) ? _slot2 : {
309
- default: function _default() {
310
- return [_slot2];
311
- }
312
- })];
313
- }
314
- })])])]), _createVNode("div", {
315
- "class": 'jtable-content'
316
- }, [props.alertRender && (props === null || props === void 0 ? void 0 : props.rowSelection) && (props === null || props === void 0 ? void 0 : (_props$rowSelection = props.rowSelection) === null || _props$rowSelection === void 0 ? void 0 : _props$rowSelection.selectedRowKeys) && ((_props$rowSelection$s = props.rowSelection.selectedRowKeys) === null || _props$rowSelection$s === void 0 ? void 0 : _props$rowSelection$s.length) ? _createVNode("div", {
317
- "class": 'jtable-alert'
318
- }, [_createVNode(Alert, {
319
- "message": '已选择' + (props === null || props === void 0 ? void 0 : (_props$rowSelection2 = props.rowSelection) === null || _props$rowSelection2 === void 0 ? void 0 : (_props$rowSelection2$ = _props$rowSelection2.selectedRowKeys) === null || _props$rowSelection2$ === void 0 ? void 0 : _props$rowSelection2$.length) + '项',
320
- "type": "info",
321
- "onClose": function onClose() {
322
- var _props$rowSelection3, _props$rowSelection3$, _props$rowSelection4, _props$rowSelection4$;
323
- // if (props.rowSelection?.onSelectNone) {
324
- // // 取消选择清空被选数据
325
- // }
326
- (_props$rowSelection3 = props.rowSelection) === null || _props$rowSelection3 === void 0 ? void 0 : (_props$rowSelection3$ = _props$rowSelection3.onChange) === null || _props$rowSelection3$ === void 0 ? void 0 : _props$rowSelection3$.call(_props$rowSelection3, [], []);
327
- (_props$rowSelection4 = props.rowSelection) === null || _props$rowSelection4 === void 0 ? void 0 : (_props$rowSelection4$ = _props$rowSelection4.onSelectNone) === null || _props$rowSelection4$ === void 0 ? void 0 : _props$rowSelection4$.call(_props$rowSelection4);
328
- },
329
- "closeText": _createVNode(Button, {
330
- "type": "link"
331
- }, {
332
- default: function _default() {
333
- return [_createTextVNode("\u53D6\u6D88\u9009\u62E9")];
334
- }
335
- })
336
- }, null)]) : null, _model.value === ModelEnum.CARD ? _createVNode("div", {
337
- "class": 'jtable-card',
338
- "style": props.scroll && props.scroll.y ? {
339
- maxHeight: props.scroll.y + 'px',
340
- overflow: 'auto'
341
- } : undefined
342
- }, [_dataSource.value.length ? _createVNode("div", {
343
- "class": 'jtable-card-items',
344
- "style": {
345
- gridTemplateColumns: "repeat(".concat(column.value, ", 1fr)")
346
- }
347
- }, [_dataSource.value.map(function (item) {
348
- return slots.card ? _createVNode("div", {
349
- "class": ['jtable-card-item', props.cardBodyClass]
350
- }, [slots.card(item)]) : null;
351
- })]) : _createVNode("div", {
352
- "class": "j-table-empty"
353
- }, [_createVNode(Empty, null, null)])]) : _createVNode("div", null, [_createVNode(Table, _objectSpread(_objectSpread({}, props), {}, {
354
- "dataSource": _dataSource.value,
355
- "columns": props.columns.filter(function (i) {
356
- return !(i === null || i === void 0 ? void 0 : i.hideInTable);
357
- }),
358
- "pagination": false,
359
- "rowSelection": props.rowSelection,
360
- "scroll": props.scroll
361
- }), {
362
- headerCell: function headerCell(dt) {
363
- var column = dt.column,
364
- title = dt.title;
365
- if (column === null || column === void 0 ? void 0 : column.headerCell) {
366
- return slots === null || slots === void 0 ? void 0 : slots[column === null || column === void 0 ? void 0 : column.headerCell](column.title);
367
- } else {
368
- return title || '';
369
- }
370
- },
371
- bodyCell: function bodyCell(dt) {
372
- var column = dt.column,
373
- record = dt.record;
374
- if (((column === null || column === void 0 ? void 0 : column.key) || (column === null || column === void 0 ? void 0 : column.dataIndex)) && (column === null || column === void 0 ? void 0 : column.scopedSlots) && ((slots === null || slots === void 0 ? void 0 : slots[column === null || column === void 0 ? void 0 : column.dataIndex]) || (slots === null || slots === void 0 ? void 0 : slots[column === null || column === void 0 ? void 0 : column.key]))) {
375
- var _key = (column === null || column === void 0 ? void 0 : column.key) || (column === null || column === void 0 ? void 0 : column.dataIndex);
376
- return slots === null || slots === void 0 ? void 0 : slots[_key](record);
377
- } else {
378
- var _value = get(record, column === null || column === void 0 ? void 0 : column.dataIndex);
379
- // 获取数据
380
- return _value;
381
- }
382
- },
383
- emptyText: function emptyText() {
384
- return _createVNode(Empty, null, null);
385
- }
386
- })])]), !!_dataSource.value.length && !props.noPagination && props.type === 'PAGE' && _createVNode("div", {
387
- "class": 'jtable-pagination'
388
- }, [(slots === null || slots === void 0 ? void 0 : slots.paginationRender) ? slots.paginationRender() : _createVNode(Pagination, _objectSpread(_objectSpread({}, props.pagination), {}, {
389
- "total": total.value,
390
- "current": pageIndex.value + 1,
391
- "pageSize": pageSize.value,
392
- "showTotal": function showTotal(num) {
393
- var minSize = pageIndex.value * pageSize.value + 1;
394
- var MaxSize = (pageIndex.value + 1) * pageSize.value;
395
- return "\u7B2C ".concat(minSize, " - ").concat(MaxSize > num ? num : MaxSize, " \u6761/\u603B\u5171 ").concat(num, " \u6761");
396
- },
397
- "onChange": function onChange(page, size) {
398
- handleSearch(_objectSpread(_objectSpread({}, props.params), {}, {
399
- pageSize: size,
400
- pageIndex: pageSize.value === size ? page ? page - 1 : 0 : 0
401
- }));
402
- }
403
- }), null)])])) ? _slot3 : {
404
- default: function _default() {
405
- return [_slot3];
406
- }
407
- })]);
408
- };
409
- }
410
- });
1
+ import ProTable from './ProTable.js';
411
2
  ProTable.install = function (app) {
412
3
  app.component(ProTable.name, ProTable);
413
4
  };
@@ -0,0 +1,119 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import { tableProps } from "ant-design-vue/es/table/Table";
3
+ import "vue";
4
+ import "ant-design-vue/es/table";
5
+ export var _headerProps = {
6
+ mode: {
7
+ type: [String, undefined],
8
+ default: undefined
9
+ },
10
+ modeValue: {
11
+ type: String,
12
+ default: 'TABLE'
13
+ }
14
+ };
15
+ export var _alertProps = {
16
+ alertShow: {
17
+ type: Boolean,
18
+ default: true
19
+ },
20
+ rowSelection: {
21
+ type: Object,
22
+ default: function _default() {
23
+ return undefined;
24
+ }
25
+ }
26
+ };
27
+ export var _contentProps = _objectSpread(_objectSpread(_objectSpread({}, tableProps()), _headerProps), {}, {
28
+ cardBodyClass: {
29
+ type: String,
30
+ default: ''
31
+ },
32
+ columns: {
33
+ type: Array,
34
+ default: function _default() {
35
+ return [];
36
+ }
37
+ },
38
+ dataSource: {
39
+ type: Array,
40
+ default: undefined
41
+ },
42
+ gridColumns: {
43
+ type: Array,
44
+ default: function _default() {
45
+ return [1, 2, 3, 4];
46
+ }
47
+ },
48
+ scroll: {
49
+ type: Object,
50
+ default: function _default() {
51
+ return {
52
+ x: 1366
53
+ };
54
+ }
55
+ },
56
+ rowKey: {
57
+ type: [String, Function],
58
+ default: 'id'
59
+ }
60
+ });
61
+ export var paginationProps = {
62
+ total: {
63
+ type: Number,
64
+ default: 0
65
+ },
66
+ pageSize: {
67
+ type: Number,
68
+ default: 12
69
+ },
70
+ pageIndex: {
71
+ type: Number,
72
+ default: 0
73
+ }
74
+ };
75
+ export var proTableProps = _objectSpread(_objectSpread(_objectSpread({}, _contentProps), _alertProps), {}, {
76
+ bodyStyle: {
77
+ type: Object,
78
+ default: function _default() {
79
+ return {
80
+ padding: '16px 24px 24px'
81
+ };
82
+ }
83
+ },
84
+ request: {
85
+ type: Function,
86
+ default: undefined
87
+ },
88
+ params: {
89
+ type: Object,
90
+ default: function _default() {
91
+ return {};
92
+ }
93
+ },
94
+ type: {
95
+ type: String,
96
+ default: 'PAGE'
97
+ },
98
+ defaultParams: {
99
+ type: Object,
100
+ default: function _default() {
101
+ return {};
102
+ }
103
+ },
104
+ noPagination: {
105
+ type: Boolean,
106
+ default: false
107
+ },
108
+ pagination: {
109
+ type: Object,
110
+ default: function _default() {
111
+ return {
112
+ showSizeChanger: true,
113
+ showQuickJumper: false,
114
+ size: 'size',
115
+ pageSizeOptions: ['12', '24', '48', '96']
116
+ };
117
+ }
118
+ }
119
+ });
@@ -0,0 +1,83 @@
1
+ @import '../../style/variable.less';
2
+
3
+ .jtable-body-spin {
4
+ min-height: 100%;
5
+ width: 100%;
6
+ background-color: #fff;
7
+
8
+ .ant-spin-nested-loading {
9
+ height: 100%;
10
+
11
+ .ant-spin-container {
12
+ height: 100%;
13
+ }
14
+ }
15
+
16
+ .jtable-body {
17
+ width: 100%;
18
+ box-sizing: border-box;
19
+ height: 100%;
20
+ display: flex;
21
+ flex-direction: column;
22
+ }
23
+ }
24
+
25
+ .jtable-body-header {
26
+ display: flex;
27
+ justify-content: space-between;
28
+ align-items: center;
29
+ margin-bottom: 16px;
30
+ width: 100%;
31
+ gap: 8px;
32
+
33
+ .jtable-body-header-left {
34
+ flex: 1;
35
+ min-width: 0;
36
+ }
37
+
38
+ .jtable-body-header-right {
39
+ display: flex;
40
+ gap: 8px;
41
+ align-items: center;
42
+
43
+ .jtable-body-header-right-button {
44
+ width: 62px;
45
+
46
+ .right-button-icon {
47
+ font-size: 16px;
48
+ color: #d9d9d9;
49
+ }
50
+
51
+ .ant-radio-button-wrapper {
52
+ padding: 0 8px;
53
+ }
54
+
55
+ :deep(.ant-radio-button-wrapper-checked) {
56
+ color: @primary-color;
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ .jtable-alert {
63
+ margin-bottom: 16px;
64
+ }
65
+
66
+ .jtable-card {
67
+ .jtable-card-items {
68
+ display: grid;
69
+ grid-gap: 26px;
70
+
71
+ .jtable-card-item {
72
+ display: flex;
73
+ min-width: 0;
74
+ }
75
+ }
76
+ }
77
+
78
+ .jtable-pagination {
79
+ width: 100%;
80
+ display: flex;
81
+ justify-content: flex-end;
82
+ margin-top: 16px;
83
+ }
@@ -1 +1 @@
1
- import './index.less';
1
+ import './ProTable.less';
@@ -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-1716194139186"), n = n(), _popScopeId(), n);
24
+ const _withScopeId = n => (_pushScopeId("data-v-1716520754696"), n = n(), _popScopeId(), n);
25
25
  const _hoisted_1 = {
26
26
  key: 0,
27
27
  style: { "width": "240px" }
package/es/Search/Item.js CHANGED
@@ -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-1716194138546"), n = n(), _popScopeId(), n);
81
+ const _withScopeId = n => (_pushScopeId("data-v-1716520753826"), 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-1716194138825"), n = n(), _popScopeId(), n);
39
+ const _withScopeId = n => (_pushScopeId("data-v-1716520754058"), 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';