@jetlinks-web/components 2.0.2-4 → 2.0.2-6
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/CheckButton/CheckButton.js +1 -1
- package/es/ConfigProvider/index.js +1 -1
- package/es/FullPage/FullPage.js +1 -1
- package/es/Icon/icon.js +1 -2
- package/es/ProLayout/Basic/BasicLayout.js +11 -7
- package/es/ProLayout/Basic/Header.js +7 -3
- package/es/ProLayout/PageContainer/index.js +14 -8
- package/es/ProLayout/SiderMenu/BaseMenu.js +37 -14
- package/es/ProLayout/SiderMenu/SiderMenu.js +34 -14
- package/es/ProLayout/TopHeader/index.js +10 -2
- package/es/ProLayout/util.js +5 -5
- package/es/ProTable/index.js +140 -135
- package/es/Scrollbar/Scrollbar.js +212 -100
- package/es/Scrollbar/Thumb.js +189 -10
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/Search/Search.js +1 -1
- package/lib/CheckButton/CheckButton.js +1 -1
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/Icon/icon.js +1 -1
- package/lib/ProLayout/Basic/BasicLayout.js +10 -6
- package/lib/ProLayout/Basic/Header.js +6 -2
- package/lib/ProLayout/PageContainer/index.js +11 -7
- package/lib/ProLayout/SiderMenu/BaseMenu.js +36 -14
- package/lib/ProLayout/SiderMenu/SiderMenu.js +34 -14
- package/lib/ProLayout/TopHeader/index.js +8 -1
- package/lib/ProLayout/util.js +5 -5
- package/lib/ProTable/index.js +139 -134
- package/lib/Scrollbar/Scrollbar.js +211 -105
- package/lib/Scrollbar/Thumb.js +188 -15
- package/lib/Scrollbar/scrollbarProps.js +106 -0
- package/lib/Scrollbar/thumbProps.js +16 -0
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/Search/Search.js +1 -1
- package/package.json +4 -4
package/es/ProTable/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
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";
|
|
1
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
|
|
5
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
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; }
|
|
6
7
|
import { Empty, AIcon } from '../index';
|
|
7
8
|
import { Table, Pagination, Button, Alert, Spin, RadioGroup, RadioButton } from 'ant-design-vue';
|
|
8
9
|
import { tableProps as _tableProps } from 'ant-design-vue/es/table';
|
|
9
10
|
import { defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
10
11
|
import { ModelEnum } from './proTableTypes';
|
|
11
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
|
+
}
|
|
12
16
|
var tableProps = function tableProps() {
|
|
13
17
|
return _objectSpread(_objectSpread({}, _tableProps()), {}, {
|
|
14
18
|
loading: {
|
|
@@ -134,21 +138,21 @@ var ProTable = defineComponent({
|
|
|
134
138
|
if (window.innerWidth <= 1440) {
|
|
135
139
|
var _props$gridColumns;
|
|
136
140
|
var _column = props.gridColumn && props.gridColumn < 2 ? props.gridColumn : 2;
|
|
137
|
-
column.value = (_props$gridColumns = props.gridColumns)
|
|
141
|
+
column.value = ((_props$gridColumns = props.gridColumns) === null || _props$gridColumns === void 0 ? void 0 : _props$gridColumns[0]) ? props.gridColumns[0] : _column;
|
|
138
142
|
} else if (window.innerWidth > 1440 && window.innerWidth <= 1600) {
|
|
139
143
|
var _props$gridColumns2;
|
|
140
144
|
var _column2 = props.gridColumn && props.gridColumn < 3 ? props.gridColumn : 3;
|
|
141
|
-
column.value = (_props$gridColumns2 = props.gridColumns)
|
|
145
|
+
column.value = ((_props$gridColumns2 = props.gridColumns) === null || _props$gridColumns2 === void 0 ? void 0 : _props$gridColumns2[1]) ? props.gridColumns[1] : _column2;
|
|
142
146
|
} else if (window.innerWidth > 1600) {
|
|
143
147
|
var _props$gridColumns3;
|
|
144
148
|
var _column3 = props.gridColumn && props.gridColumn < 4 ? props.gridColumn : 4;
|
|
145
|
-
column.value = (_props$gridColumns3 = props.gridColumns)
|
|
149
|
+
column.value = ((_props$gridColumns3 = props.gridColumns) === null || _props$gridColumns3 === void 0 ? void 0 : _props$gridColumns3[2]) ? props.gridColumns[2] : _column3;
|
|
146
150
|
}
|
|
147
151
|
};
|
|
148
152
|
var handleSearch = /*#__PURE__*/function () {
|
|
149
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_params) {
|
|
153
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_params) {
|
|
150
154
|
var _props$defaultParams, resp, _resp$result, _resp$result2, _resp$result3, _resp$result4, _resp$result4$data, _resp$result5, _resp$result6, _resp$result7, _resp$result8;
|
|
151
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
155
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
152
156
|
while (1) switch (_context.prev = _context.next) {
|
|
153
157
|
case 0:
|
|
154
158
|
_loading.value = props.loading !== undefined ? props.loading : true;
|
|
@@ -171,7 +175,7 @@ var ProTable = defineComponent({
|
|
|
171
175
|
if (resp.status === 200) {
|
|
172
176
|
if (props.type === 'PAGE') {
|
|
173
177
|
// 判断如果是最后一页且最后一页为空,就跳转到前一页
|
|
174
|
-
if (resp
|
|
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) {
|
|
175
179
|
pageIndex.value = pageIndex.value > 0 ? pageIndex.value - 1 : 0;
|
|
176
180
|
handleSearch(_objectSpread(_objectSpread({}, _params), {}, {
|
|
177
181
|
pageSize: pageSize.value,
|
|
@@ -261,143 +265,144 @@ var ProTable = defineComponent({
|
|
|
261
265
|
});
|
|
262
266
|
return function () {
|
|
263
267
|
var _props$rowSelection, _props$rowSelection$s, _props$rowSelection2, _props$rowSelection2$;
|
|
268
|
+
var _slot, _slot2, _slot3;
|
|
264
269
|
return _createVNode("div", {
|
|
265
270
|
"class": "jtable-body-spin",
|
|
266
271
|
"style": _objectSpread({}, props.bodyStyle)
|
|
267
272
|
}, [_createVNode(Spin, {
|
|
268
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
|
+
}
|
|
269
292
|
}, {
|
|
270
293
|
default: function _default() {
|
|
271
|
-
return [_createVNode(
|
|
272
|
-
"
|
|
273
|
-
},
|
|
274
|
-
"class": '
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}, [slots.headerTitle && slots.headerTitle()]), _createVNode("div", {
|
|
278
|
-
"class": 'jtable-body-header-right'
|
|
279
|
-
}, [slots.rightExtraRender && slots.rightExtraRender(), !props.model && _createVNode("div", {
|
|
280
|
-
"class": 'jtable-body-header-right-button'
|
|
281
|
-
}, [_createVNode(RadioGroup, {
|
|
282
|
-
"class": "jtable-body-header-right-button",
|
|
283
|
-
"value": _model.value,
|
|
284
|
-
"onChange": function onChange(e) {
|
|
285
|
-
_model.value = e.target.value;
|
|
286
|
-
emit('update:modelValue', e.target.value);
|
|
287
|
-
emit('modelChange', e.target.value);
|
|
288
|
-
}
|
|
289
|
-
}, {
|
|
294
|
+
return [_createVNode(RadioButton, {
|
|
295
|
+
"value": ModelEnum.TABLE
|
|
296
|
+
}, _isSlot(_slot = _createVNode(AIcon, {
|
|
297
|
+
"class": 'right-button-icon',
|
|
298
|
+
"type": "UnorderedListOutlined"
|
|
299
|
+
}, null)) ? _slot : {
|
|
290
300
|
default: function _default() {
|
|
291
|
-
return [
|
|
292
|
-
"value": ModelEnum.TABLE
|
|
293
|
-
}, {
|
|
294
|
-
default: function _default() {
|
|
295
|
-
return [_createVNode(AIcon, {
|
|
296
|
-
"class": 'right-button-icon',
|
|
297
|
-
"type": "UnorderedListOutlined"
|
|
298
|
-
}, null)];
|
|
299
|
-
}
|
|
300
|
-
}), _createVNode(RadioButton, {
|
|
301
|
-
"value": ModelEnum.CARD
|
|
302
|
-
}, {
|
|
303
|
-
default: function _default() {
|
|
304
|
-
return [_createVNode(AIcon, {
|
|
305
|
-
"class": 'right-button-icon',
|
|
306
|
-
"type": "AppstoreOutlined"
|
|
307
|
-
}, null)];
|
|
308
|
-
}
|
|
309
|
-
})];
|
|
310
|
-
}
|
|
311
|
-
})])])]), _createVNode("div", {
|
|
312
|
-
"class": 'jtable-content'
|
|
313
|
-
}, [props.alertRender && props !== null && props !== void 0 && props.rowSelection && props !== null && props !== void 0 && (_props$rowSelection = props.rowSelection) !== null && _props$rowSelection !== void 0 && _props$rowSelection.selectedRowKeys && (_props$rowSelection$s = props.rowSelection.selectedRowKeys) !== null && _props$rowSelection$s !== void 0 && _props$rowSelection$s.length ? _createVNode("div", {
|
|
314
|
-
"class": 'jtable-alert'
|
|
315
|
-
}, [_createVNode(Alert, {
|
|
316
|
-
"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) + '项',
|
|
317
|
-
"type": "info",
|
|
318
|
-
"onClose": function onClose() {
|
|
319
|
-
var _props$rowSelection3, _props$rowSelection3$, _props$rowSelection4, _props$rowSelection4$;
|
|
320
|
-
// if (props.rowSelection?.onSelectNone) {
|
|
321
|
-
// // 取消选择清空被选数据
|
|
322
|
-
// }
|
|
323
|
-
(_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, [], []);
|
|
324
|
-
(_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);
|
|
325
|
-
},
|
|
326
|
-
"closeText": _createVNode(Button, {
|
|
327
|
-
"type": "link"
|
|
328
|
-
}, {
|
|
329
|
-
default: function _default() {
|
|
330
|
-
return [_createTextVNode("\u53D6\u6D88\u9009\u62E9")];
|
|
331
|
-
}
|
|
332
|
-
})
|
|
333
|
-
}, null)]) : null, _model.value === ModelEnum.CARD ? _createVNode("div", {
|
|
334
|
-
"class": 'jtable-card',
|
|
335
|
-
"style": props.scroll && props.scroll.y ? {
|
|
336
|
-
maxHeight: props.scroll.y + 'px',
|
|
337
|
-
overflow: 'auto'
|
|
338
|
-
} : undefined
|
|
339
|
-
}, [_dataSource.value.length ? _createVNode("div", {
|
|
340
|
-
"class": 'jtable-card-items',
|
|
341
|
-
"style": {
|
|
342
|
-
gridTemplateColumns: "repeat(".concat(column.value, ", 1fr)")
|
|
343
|
-
}
|
|
344
|
-
}, [_dataSource.value.map(function (item) {
|
|
345
|
-
return slots.card ? _createVNode("div", {
|
|
346
|
-
"class": ['jtable-card-item', props.cardBodyClass]
|
|
347
|
-
}, [slots.card(item)]) : null;
|
|
348
|
-
})]) : _createVNode("div", {
|
|
349
|
-
"class": "j-table-empty"
|
|
350
|
-
}, [_createVNode(Empty, null, null)])]) : _createVNode("div", null, [_createVNode(Table, _objectSpread(_objectSpread({}, props), {}, {
|
|
351
|
-
"dataSource": _dataSource.value,
|
|
352
|
-
"columns": props.columns.filter(function (i) {
|
|
353
|
-
return !(i !== null && i !== void 0 && i.hideInTable);
|
|
354
|
-
}),
|
|
355
|
-
"pagination": false,
|
|
356
|
-
"rowSelection": props.rowSelection,
|
|
357
|
-
"scroll": props.scroll
|
|
358
|
-
}), {
|
|
359
|
-
headerCell: function headerCell(dt) {
|
|
360
|
-
var column = dt.column,
|
|
361
|
-
title = dt.title;
|
|
362
|
-
if (column !== null && column !== void 0 && column.headerCell) {
|
|
363
|
-
return slots === null || slots === void 0 ? void 0 : slots[column === null || column === void 0 ? void 0 : column.headerCell](column.title);
|
|
364
|
-
} else {
|
|
365
|
-
return title || '';
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
bodyCell: function bodyCell(dt) {
|
|
369
|
-
var column = dt.column,
|
|
370
|
-
record = dt.record;
|
|
371
|
-
if ((column !== null && column !== void 0 && column.key || column !== null && column !== void 0 && column.dataIndex) && column !== null && column !== void 0 && column.scopedSlots && (slots !== null && slots !== void 0 && slots[column === null || column === void 0 ? void 0 : column.dataIndex] || slots !== null && slots !== void 0 && slots[column === null || column === void 0 ? void 0 : column.key])) {
|
|
372
|
-
var _key = (column === null || column === void 0 ? void 0 : column.key) || (column === null || column === void 0 ? void 0 : column.dataIndex);
|
|
373
|
-
return slots === null || slots === void 0 ? void 0 : slots[_key](record);
|
|
374
|
-
} else {
|
|
375
|
-
var _value = get(record, column === null || column === void 0 ? void 0 : column.dataIndex);
|
|
376
|
-
// 获取数据
|
|
377
|
-
return _value;
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
emptyText: function emptyText() {
|
|
381
|
-
return _createVNode(Empty, null, null);
|
|
301
|
+
return [_slot];
|
|
382
302
|
}
|
|
383
|
-
})
|
|
384
|
-
"
|
|
385
|
-
},
|
|
386
|
-
"
|
|
387
|
-
"
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
var MaxSize = (pageIndex.value + 1) * pageSize.value;
|
|
392
|
-
return "\u7B2C ".concat(minSize, " - ").concat(MaxSize > num ? num : MaxSize, " \u6761/\u603B\u5171 ").concat(num, " \u6761");
|
|
393
|
-
},
|
|
394
|
-
"onChange": function onChange(page, size) {
|
|
395
|
-
handleSearch(_objectSpread(_objectSpread({}, props.params), {}, {
|
|
396
|
-
pageSize: size,
|
|
397
|
-
pageIndex: pageSize.value === size ? page ? page - 1 : 0 : 0
|
|
398
|
-
}));
|
|
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];
|
|
399
311
|
}
|
|
400
|
-
})
|
|
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];
|
|
401
406
|
}
|
|
402
407
|
})]);
|
|
403
408
|
};
|