uepay-mesh 4.0.17 → 4.0.19
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/index.d.ts +1 -0
- package/index.js +8 -0
- package/mesh/data/localStore.js +2 -7
- package/mesh/data/sessionStore.js +41 -0
- package/mesh/form/options/extendsBtn.js +79 -71
- package/mesh/pages/page.d.ts +26 -0
- package/mesh/pages/page.js +51 -0
- package/mesh/table/standardTable/innerTable.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export {default as EditCompareForm} from './mesh/form/editCompareForm'
|
|
|
7
7
|
export {default as BpmList} from './bpm/list'
|
|
8
8
|
export {default as BpmForm} from './bpm/form'
|
|
9
9
|
export {default as CollectEntry} from './mesh/pages/collectEntry'
|
|
10
|
+
export {default as Page} from './mesh/pages/page'
|
package/index.js
CHANGED
|
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "OptionsFormQueryAbleTable", {
|
|
|
39
39
|
return _optionsFormQueryAbleTable.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "Page", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _page.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
Object.defineProperty(exports, "PopSelectQueryAbleTable", {
|
|
43
49
|
enumerable: true,
|
|
44
50
|
get: function get() {
|
|
@@ -76,4 +82,6 @@ var _list = _interopRequireDefault(require("./bpm/list"));
|
|
|
76
82
|
|
|
77
83
|
var _collectEntry = _interopRequireDefault(require("./mesh/pages/collectEntry"));
|
|
78
84
|
|
|
85
|
+
var _page = _interopRequireDefault(require("./mesh/pages/page"));
|
|
86
|
+
|
|
79
87
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/mesh/data/localStore.js
CHANGED
|
@@ -4,12 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.put = exports.get = exports.clean = void 0;
|
|
7
|
-
const
|
|
8
|
-
Prefix: 'UePay',
|
|
9
|
-
Json: '-JSON-',
|
|
10
|
-
Def: '-None-'
|
|
11
|
-
};
|
|
12
|
-
let localData = {};
|
|
7
|
+
const localData = {};
|
|
13
8
|
/**
|
|
14
9
|
*
|
|
15
10
|
* @param key
|
|
@@ -30,7 +25,7 @@ const get = key => {
|
|
|
30
25
|
data = localStorage.getItem(key);
|
|
31
26
|
|
|
32
27
|
if (data) {
|
|
33
|
-
data = JSON.parse(
|
|
28
|
+
data = JSON.parse(data);
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
31
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.put = exports.get = exports.clean = void 0;
|
|
7
|
+
const sessionData = {};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param key
|
|
11
|
+
* @param value {Object} value必須是一個對象
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const put = (key, value) => {
|
|
15
|
+
sessionData[key] = value;
|
|
16
|
+
typeof sessionStorage !== 'undefined' && sessionStorage.setItem(key, JSON.stringify(value));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.put = put;
|
|
20
|
+
|
|
21
|
+
const get = key => {
|
|
22
|
+
let data = sessionData[key];
|
|
23
|
+
|
|
24
|
+
if (!data && typeof sessionStorage !== 'undefined') {
|
|
25
|
+
data = sessionStorage.getItem(key);
|
|
26
|
+
|
|
27
|
+
if (data) {
|
|
28
|
+
data = JSON.parse(data);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.get = get;
|
|
36
|
+
|
|
37
|
+
const clean = () => {
|
|
38
|
+
localData = {};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.clean = clean;
|
|
@@ -13,27 +13,21 @@ var _antd = require("antd");
|
|
|
13
13
|
|
|
14
14
|
var _request = require("../../data/request");
|
|
15
15
|
|
|
16
|
+
var _router = require("next/router");
|
|
17
|
+
|
|
18
|
+
var _sessionStore = require("../../data/sessionStore");
|
|
19
|
+
|
|
16
20
|
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
21
|
|
|
18
22
|
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
23
|
|
|
20
24
|
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
25
|
|
|
22
|
-
function mockRequest() {
|
|
23
|
-
return new Promise(resolve => {
|
|
24
|
-
const idl = setTimeout(() => {
|
|
25
|
-
clearTimeout(idl);
|
|
26
|
-
resolve({
|
|
27
|
-
suc: true
|
|
28
|
-
});
|
|
29
|
-
}, 1000);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
26
|
function ExtendsBtn(_ref) {
|
|
34
27
|
let {
|
|
35
28
|
btn,
|
|
36
29
|
url,
|
|
30
|
+
linkType,
|
|
37
31
|
warnType,
|
|
38
32
|
warn,
|
|
39
33
|
view,
|
|
@@ -47,74 +41,88 @@ function ExtendsBtn(_ref) {
|
|
|
47
41
|
} = _ref;
|
|
48
42
|
const [loading, setLoading] = (0, _react.useState)(false),
|
|
49
43
|
[visible, setVisible] = (0, _react.useState)(false),
|
|
50
|
-
ref = (0, _react.useRef)(null)
|
|
44
|
+
ref = (0, _react.useRef)(null),
|
|
45
|
+
router = (0, _router.useRouter)();
|
|
51
46
|
|
|
52
47
|
const handleSubmit = () => {
|
|
53
|
-
|
|
48
|
+
const content = ref.current && ref.current.resizableTextArea.textArea.value || '';
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
if ('Site' === linkType) {
|
|
51
|
+
const sign = btoa("".concat(collectId || Math.ceil(Math.random() * 10000000)).concat(pkData));
|
|
52
|
+
(0, _sessionStore.put)(sign, {
|
|
53
|
+
pkData,
|
|
54
|
+
data,
|
|
55
|
+
collectId,
|
|
56
|
+
confirmType: warnType,
|
|
57
|
+
content
|
|
58
|
+
});
|
|
59
|
+
router.push("".concat(url, "?sign=").concat(sign));
|
|
60
|
+
} else {
|
|
61
|
+
setLoading(true);
|
|
62
|
+
|
|
63
|
+
_antd.message.loading({
|
|
64
|
+
content: '提交中,請勿關閉頁面...',
|
|
65
|
+
key: "".concat(collectId),
|
|
66
|
+
duration: 30
|
|
67
|
+
});
|
|
60
68
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
key: key
|
|
99
|
-
}
|
|
100
|
-
}
|
|
69
|
+
(0, _request.postFormbtns)({
|
|
70
|
+
host,
|
|
71
|
+
url,
|
|
72
|
+
collectId,
|
|
73
|
+
pkData,
|
|
74
|
+
data,
|
|
75
|
+
confirmType: warnType,
|
|
76
|
+
content
|
|
77
|
+
}).then(res => {
|
|
78
|
+
setLoading(false);
|
|
79
|
+
|
|
80
|
+
if (res && res.suc) {
|
|
81
|
+
setVisible(false);
|
|
82
|
+
fresh && fresh();
|
|
83
|
+
|
|
84
|
+
if ('SingleField' === res.viewType) {
|
|
85
|
+
_antd.message.destroy();
|
|
86
|
+
|
|
87
|
+
_antd.Modal.info({
|
|
88
|
+
title: 'SUCCESS',
|
|
89
|
+
content: res.msg || '操作成功'
|
|
90
|
+
});
|
|
91
|
+
} else if ('MultiField' === res.viewType) {
|
|
92
|
+
_antd.message.destroy();
|
|
93
|
+
|
|
94
|
+
const pojo = JSON.parse(res.msg);
|
|
95
|
+
|
|
96
|
+
_antd.Modal.info({
|
|
97
|
+
title: 'SUCCESS',
|
|
98
|
+
content: /*#__PURE__*/_react.default.createElement(_antd.Space, {
|
|
99
|
+
direction: "vertical",
|
|
100
|
+
size: "small",
|
|
101
|
+
style: {
|
|
102
|
+
display: 'flex'
|
|
103
|
+
}
|
|
104
|
+
}, Object.keys(pojo).map(key => /*#__PURE__*/_react.default.createElement(_antd.Space, {
|
|
105
|
+
key: key
|
|
106
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, key, ":"), /*#__PURE__*/_react.default.createElement("span", null, pojo[key]))))
|
|
107
|
+
});
|
|
108
|
+
} else {
|
|
109
|
+
_antd.message.success({
|
|
110
|
+
content: res.msg || '操作成功',
|
|
111
|
+
key: "".concat(collectId),
|
|
112
|
+
duration: 5
|
|
113
|
+
});
|
|
114
|
+
}
|
|
101
115
|
} else {
|
|
102
|
-
|
|
103
|
-
content: res.msg || '
|
|
116
|
+
const props = {
|
|
117
|
+
content: res.msg || '操作失敗',
|
|
104
118
|
key: "".concat(collectId),
|
|
105
119
|
duration: 5
|
|
106
|
-
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
_antd.message.error(props);
|
|
107
123
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
content: res.msg || '操作失敗',
|
|
111
|
-
key: "".concat(collectId),
|
|
112
|
-
duration: 5
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
_antd.message.error(props);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
118
126
|
};
|
|
119
127
|
|
|
120
128
|
const props = 'danger' === type ? {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* 用于页面的包装处理,比如内部跳转、框架传递数据等
|
|
4
|
+
*/
|
|
5
|
+
declare class Page {
|
|
6
|
+
/**
|
|
7
|
+
* @function 页面包装
|
|
8
|
+
* @description 对扩展按钮跳转的页面进修包装,当扩展按钮选择为页面跳转时,若需获取表单数据需要用此方法包装。
|
|
9
|
+
* @param {React.Component} PageComp 页面组件
|
|
10
|
+
* @return {React.Component}
|
|
11
|
+
* @example
|
|
12
|
+
* import {Page} from 'uepay-mesh'
|
|
13
|
+
* const MyPage = ({confirmType, content, records, pk}) => {
|
|
14
|
+
* // 参数说明:
|
|
15
|
+
* // confirmType 当前表单的提交方式'NONE'|'Warning'|'Message'
|
|
16
|
+
* // content 当confirmType为'Message'时,用户输入的提交内容
|
|
17
|
+
* // records 点击按钮时对应的表单所有数据,字典结构
|
|
18
|
+
* // pk 点击按钮时对应的表单的主键值
|
|
19
|
+
*
|
|
20
|
+
* return <span>My MyPage</span> //输出对应的页面内容,逻辑处理
|
|
21
|
+
* };
|
|
22
|
+
* export default Page.btnform(MyPage);
|
|
23
|
+
*/
|
|
24
|
+
static btnform(PageComp: React.Component): React.Component
|
|
25
|
+
}
|
|
26
|
+
export default Page
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("core-js/modules/es6.regexp.match.js");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _sessionStore = require("../data/sessionStore");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
class Page {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param {React.Component} PageComp
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
static btnform(PageComp) {
|
|
26
|
+
return function BtnForm(_ref) {
|
|
27
|
+
let {
|
|
28
|
+
pageId
|
|
29
|
+
} = _ref;
|
|
30
|
+
const params = split(pageId);
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(PageComp, params);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var _default = Page;
|
|
38
|
+
exports.default = _default;
|
|
39
|
+
|
|
40
|
+
const split = query => {
|
|
41
|
+
const match = query.match(/sign=/),
|
|
42
|
+
start = match.index,
|
|
43
|
+
sign = query.slice(start + 5),
|
|
44
|
+
data = (0, _sessionStore.get)(sign);
|
|
45
|
+
return {
|
|
46
|
+
confirmType: data.confirmType,
|
|
47
|
+
content: data.content,
|
|
48
|
+
records: data.data,
|
|
49
|
+
pk: data.pkData
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
|
|
22
22
|
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); }
|
|
23
23
|
|
|
24
|
-
const Prefixed =
|
|
24
|
+
const Prefixed = 105;
|
|
25
25
|
/**
|
|
26
26
|
* @constructor
|
|
27
27
|
* @param {boolean} multiVisible - 是否显示多选框
|