uepay-mesh 4.0.10 → 4.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/mesh/table/formQueryAbleTable.js +2 -0
- package/mesh/table/queryAbleTable/bridgingDrawer.js +72 -0
- package/mesh/table/queryAbleTable/excelBridging.js +8 -9
- package/mesh/table/queryAbleTable/formBridging.js +17 -10
- package/mesh/table/queryAbleTable.js +13 -0
- package/mesh/table/standardTable.js +4 -0
- package/package.json +1 -1
- package/style.css +2 -2
- package/mesh/util/validate.js +0 -17
|
@@ -95,6 +95,7 @@ class FormQueryAbleTable extends _queryAbleTable.default {
|
|
|
95
95
|
collectId
|
|
96
96
|
} = this;
|
|
97
97
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_formBridging.default, {
|
|
98
|
+
id: this.getId(),
|
|
98
99
|
onClose: this.handleFormClose,
|
|
99
100
|
deliverAuth: deliverAuth,
|
|
100
101
|
onSubmit: this.handleFormSubmit,
|
|
@@ -106,6 +107,7 @@ class FormQueryAbleTable extends _queryAbleTable.default {
|
|
|
106
107
|
insertForceValue: insertForceValue,
|
|
107
108
|
state: form.state
|
|
108
109
|
}), /*#__PURE__*/_react.default.createElement(_excelBridging.default, {
|
|
110
|
+
id: this.getId(),
|
|
109
111
|
onClose: this.handleExcelClose,
|
|
110
112
|
collect: collect,
|
|
111
113
|
collectId: collectId,
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("core-js/modules/web.dom.iterable.js");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
|
|
14
|
+
var _icons = require("@ant-design/icons");
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
const DrawerProps = {
|
|
23
|
+
placement: 'right',
|
|
24
|
+
closable: false,
|
|
25
|
+
width: '95%',
|
|
26
|
+
style: {
|
|
27
|
+
position: 'absolute'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function BridgingDrawer(_ref) {
|
|
32
|
+
let {
|
|
33
|
+
containId,
|
|
34
|
+
visible,
|
|
35
|
+
children
|
|
36
|
+
} = _ref;
|
|
37
|
+
const [fullScream, setFullScream] = (0, _react.useState)(false),
|
|
38
|
+
monoEl = (0, _react.useMemo)(() => fullScream ? document.getElementsByTagName('body') : document.getElementById(containId), [visible, fullScream]);
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Drawer, _extends({}, DrawerProps, {
|
|
40
|
+
visible: visible,
|
|
41
|
+
getContainer: monoEl
|
|
42
|
+
}), /*#__PURE__*/_react.default.createElement(ScreamOperation, {
|
|
43
|
+
fullScream: fullScream,
|
|
44
|
+
onChange: full => setFullScream(full)
|
|
45
|
+
}), visible && children);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var _default = BridgingDrawer;
|
|
49
|
+
exports.default = _default;
|
|
50
|
+
const ScreamOperationProps = {
|
|
51
|
+
className: 'ach',
|
|
52
|
+
style: {
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
top: 0,
|
|
55
|
+
left: 0
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function ScreamOperation(_ref2) {
|
|
60
|
+
let {
|
|
61
|
+
fullScream,
|
|
62
|
+
onChange
|
|
63
|
+
} = _ref2;
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement("a", _extends({}, ScreamOperationProps, {
|
|
65
|
+
onClick: () => onChange(!fullScream)
|
|
66
|
+
}), ScreenOperationBtm[fullScream]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const ScreenOperationBtm = {
|
|
70
|
+
true: /*#__PURE__*/_react.default.createElement(_icons.MenuUnfoldOutlined, null),
|
|
71
|
+
false: /*#__PURE__*/_react.default.createElement(_icons.MenuFoldOutlined, null)
|
|
72
|
+
};
|
|
@@ -15,6 +15,10 @@ var _antd = require("antd");
|
|
|
15
15
|
|
|
16
16
|
var _optionsAbleExcel = _interopRequireDefault(require("../../excel/optionsAbleExcel"));
|
|
17
17
|
|
|
18
|
+
var _editAbleForm = _interopRequireDefault(require("../../form/editAbleForm"));
|
|
19
|
+
|
|
20
|
+
var _bridgingDrawer = _interopRequireDefault(require("./bridgingDrawer"));
|
|
21
|
+
|
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
23
|
|
|
20
24
|
/**
|
|
@@ -23,15 +27,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
27
|
* @return {*}
|
|
24
28
|
* @constructor
|
|
25
29
|
*/
|
|
26
|
-
const ExcelBridging = props => /*#__PURE__*/_react.default.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
width: "85%",
|
|
31
|
-
bodyStyle: {
|
|
32
|
-
height: '100%'
|
|
33
|
-
}
|
|
34
|
-
}, props.visible && /*#__PURE__*/_react.default.createElement(_optionsAbleExcel.default, {
|
|
30
|
+
const ExcelBridging = props => /*#__PURE__*/_react.default.createElement(_bridgingDrawer.default, {
|
|
31
|
+
containId: props.id,
|
|
32
|
+
visible: props.visible
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_optionsAbleExcel.default, {
|
|
35
34
|
collect: props.collect,
|
|
36
35
|
collectId: props.collectId,
|
|
37
36
|
sorter: props.sorter,
|
|
@@ -15,23 +15,30 @@ var _editAbleForm = _interopRequireDefault(require("../../form/editAbleForm"));
|
|
|
15
15
|
|
|
16
16
|
var _serverEnums = require("../../config/serverEnums");
|
|
17
17
|
|
|
18
|
+
var _bridgingDrawer = _interopRequireDefault(require("./bridgingDrawer"));
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* table到標攤的橋接
|
|
22
|
-
* @param props
|
|
24
|
+
* @param props.id
|
|
25
|
+
* @param props.visible
|
|
26
|
+
* @param props.collectId
|
|
27
|
+
* @param props.collect
|
|
28
|
+
* @param props.deliverAuth
|
|
29
|
+
* @param props.host
|
|
30
|
+
* @param props.state
|
|
31
|
+
* @param props.pkData
|
|
32
|
+
* @param props.insertForceValue
|
|
33
|
+
* @param props.onSubmit
|
|
34
|
+
* @param props.onClose
|
|
23
35
|
* @return {*}
|
|
24
36
|
* @constructor
|
|
25
37
|
*/
|
|
26
|
-
const FormBridging = props => /*#__PURE__*/_react.default.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
width: "85%",
|
|
31
|
-
bodyStyle: {
|
|
32
|
-
height: '100%'
|
|
33
|
-
}
|
|
34
|
-
}, props.visible && /*#__PURE__*/_react.default.createElement(_editAbleForm.default, {
|
|
38
|
+
const FormBridging = props => /*#__PURE__*/_react.default.createElement(_bridgingDrawer.default, {
|
|
39
|
+
containId: props.id,
|
|
40
|
+
visible: props.visible
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_editAbleForm.default, {
|
|
35
42
|
collect: props.collect,
|
|
36
43
|
collectId: props.collectId,
|
|
37
44
|
deliverAuth: props.deliverAuth,
|
|
@@ -50,6 +50,11 @@ const InitState = {
|
|
|
50
50
|
msg: '預覽类型Table必须設置collect結構!'
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
let id = 0;
|
|
54
|
+
|
|
55
|
+
function obtainId() {
|
|
56
|
+
return "tab".concat(++id);
|
|
57
|
+
}
|
|
53
58
|
/**
|
|
54
59
|
* 標準數據包裝列表
|
|
55
60
|
* @param props.type {String} 列表類型 目前支持"preview"和"auto"。
|
|
@@ -92,6 +97,7 @@ const InitState = {
|
|
|
92
97
|
* handleAction(state, pkValue, record, text) 操作cell被点击的回调
|
|
93
98
|
*/
|
|
94
99
|
|
|
100
|
+
|
|
95
101
|
class QueryAbleTable extends _react.default.Component {
|
|
96
102
|
constructor() {
|
|
97
103
|
super(...arguments);
|
|
@@ -258,6 +264,8 @@ class QueryAbleTable extends _react.default.Component {
|
|
|
258
264
|
} else {
|
|
259
265
|
this.initMsg = '未指定接口host地址!';
|
|
260
266
|
}
|
|
267
|
+
|
|
268
|
+
this.id = obtainId(); //當前組件的唯一標識ID
|
|
261
269
|
}
|
|
262
270
|
|
|
263
271
|
componentDidMount() {
|
|
@@ -324,6 +332,10 @@ class QueryAbleTable extends _react.default.Component {
|
|
|
324
332
|
*/
|
|
325
333
|
|
|
326
334
|
|
|
335
|
+
getId() {
|
|
336
|
+
return this.id;
|
|
337
|
+
}
|
|
338
|
+
|
|
327
339
|
getContextProvider() {
|
|
328
340
|
const {
|
|
329
341
|
type,
|
|
@@ -377,6 +389,7 @@ class QueryAbleTable extends _react.default.Component {
|
|
|
377
389
|
deliverAuth
|
|
378
390
|
} = this.props;
|
|
379
391
|
Comp = /*#__PURE__*/_react.default.createElement(_standardTable.default, {
|
|
392
|
+
id: this.getId(),
|
|
380
393
|
onQuery: this.handleQuery,
|
|
381
394
|
onExcel: this.handleExcel,
|
|
382
395
|
ref: dom => {
|
|
@@ -65,6 +65,7 @@ const TableShowType = (() => {
|
|
|
65
65
|
/**
|
|
66
66
|
* 标准查询列表。用于通用的数据查询和数据操作。
|
|
67
67
|
* table的表头只能定义在组件初始化的时候定义且只能定义一次,如果需要更新表头结构或内容,需要卸载组件再装载。
|
|
68
|
+
* @param props,id {String} 分配給table容器 uepay-standard-table 的ID,用於標識DOM組件
|
|
68
69
|
* @param props.loading {Boolean} 是否处于加载状态
|
|
69
70
|
* @param props.actionColumn {Function} 列表操作按鈕
|
|
70
71
|
* @param props.options {Object|Boolean} 右上角的操作选项配置,结构
|
|
@@ -502,6 +503,7 @@ class StandardTable extends _react.default.Component {
|
|
|
502
503
|
|
|
503
504
|
render() {
|
|
504
505
|
const {
|
|
506
|
+
id,
|
|
505
507
|
result,
|
|
506
508
|
loading,
|
|
507
509
|
collectId,
|
|
@@ -532,6 +534,7 @@ class StandardTable extends _react.default.Component {
|
|
|
532
534
|
onRow && (extParams.onRow = onRow);
|
|
533
535
|
rowClassName && (extParams.rowClassName = rowClassName);
|
|
534
536
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
537
|
+
id: id,
|
|
535
538
|
className: "uepay-standard-table",
|
|
536
539
|
ref: div => {
|
|
537
540
|
this.table = div;
|
|
@@ -602,6 +605,7 @@ class StandardTable extends _react.default.Component {
|
|
|
602
605
|
}
|
|
603
606
|
|
|
604
607
|
StandardTable.propTypes = {
|
|
608
|
+
id: _propTypes.default.string.isRequired,
|
|
605
609
|
options: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
606
610
|
loading: _propTypes.default.bool.isRequired,
|
|
607
611
|
collectId: _propTypes.default.number,
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
color: #000000;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
.ach{
|
|
35
35
|
display: block;
|
|
36
36
|
padding: .2rem .2rem;
|
|
37
37
|
color: #40a9ff;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
border-radius: .1rem;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
42
|
+
.ach:hover{
|
|
43
43
|
background-color: #40a9ff;
|
|
44
44
|
color: #ffffff;
|
|
45
45
|
}
|
package/mesh/util/validate.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isNotBlank = void 0;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 检查是否为无效内容
|
|
10
|
-
* @param val
|
|
11
|
-
* @return {boolean}
|
|
12
|
-
*/
|
|
13
|
-
const isNotBlank = val => {
|
|
14
|
-
return typeof val !== 'undefined' && val !== '' && val !== 'null';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.isNotBlank = isNotBlank;
|