@quansitech/antd-admin 1.2.9 → 1.3.1
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/dist/components/Layout/New.js +5 -3
- package/dist/components/Layout/New.scss +4 -0
- package/dist/components/Layout.js +16 -13
- package/dist/components/Table/Action/Button.d.ts +1 -0
- package/dist/components/Table/Action/Button.js +132 -66
- package/dist/components/Table/Action/StartEditable.js +30 -24
- package/dist/components/Table.d.ts +1 -0
- package/dist/components/Table.js +27 -9
- package/dist/components/TableContext.d.ts +2 -1
- package/dist/lib/helpers.d.ts +1 -0
- package/dist/lib/helpers.js +32 -13
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +663 -3
package/dist/lib/helpers.js
CHANGED
|
@@ -73,39 +73,47 @@ export function modalShow(_x) {
|
|
|
73
73
|
}
|
|
74
74
|
function _modalShow() {
|
|
75
75
|
_modalShow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
76
|
-
var props, res, _options$content, Component, _afterClose, modal;
|
|
76
|
+
var props, r, res, _options$content, Component, _afterClose, modal;
|
|
77
77
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
78
78
|
while (1) switch (_context.prev = _context.next) {
|
|
79
79
|
case 0:
|
|
80
80
|
props = options.content.props;
|
|
81
|
-
if (
|
|
82
|
-
|
|
81
|
+
if (options.content.url) {
|
|
82
|
+
options.content.request = {
|
|
83
|
+
method: 'get',
|
|
84
|
+
url: options.content.url
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (!options.content.request) {
|
|
88
|
+
_context.next = 10;
|
|
83
89
|
break;
|
|
84
90
|
}
|
|
85
|
-
|
|
91
|
+
r = options.content.request;
|
|
92
|
+
_context.next = 6;
|
|
86
93
|
return http({
|
|
87
|
-
method:
|
|
88
|
-
url:
|
|
94
|
+
method: r.method,
|
|
95
|
+
url: r.url,
|
|
96
|
+
data: r.data,
|
|
89
97
|
headers: {
|
|
90
98
|
'X-Modal': '1'
|
|
91
99
|
}
|
|
92
100
|
});
|
|
93
|
-
case
|
|
101
|
+
case 6:
|
|
94
102
|
res = _context.sent;
|
|
95
103
|
if (!(typeof res.data === 'string')) {
|
|
96
|
-
_context.next =
|
|
104
|
+
_context.next = 9;
|
|
97
105
|
break;
|
|
98
106
|
}
|
|
99
107
|
throw new Error('modal response is not vail');
|
|
100
|
-
case
|
|
108
|
+
case 9:
|
|
101
109
|
props = res.data;
|
|
102
|
-
case
|
|
110
|
+
case 10:
|
|
103
111
|
if (props) {
|
|
104
|
-
_context.next =
|
|
112
|
+
_context.next = 12;
|
|
105
113
|
break;
|
|
106
114
|
}
|
|
107
115
|
throw new Error('modal props is empty');
|
|
108
|
-
case
|
|
116
|
+
case 12:
|
|
109
117
|
if (props.type === 'table') {
|
|
110
118
|
if (typeof props.ajaxRequest === 'undefined') {
|
|
111
119
|
props.ajaxRequest = true;
|
|
@@ -141,7 +149,7 @@ function _modalShow() {
|
|
|
141
149
|
destroy: modal.destroy,
|
|
142
150
|
update: modal.update
|
|
143
151
|
});
|
|
144
|
-
case
|
|
152
|
+
case 17:
|
|
145
153
|
case "end":
|
|
146
154
|
return _context.stop();
|
|
147
155
|
}
|
|
@@ -250,6 +258,17 @@ export function diffTree(tree1, tree2, childKey) {
|
|
|
250
258
|
}
|
|
251
259
|
return res;
|
|
252
260
|
}
|
|
261
|
+
export function treeToList(tree, childKey) {
|
|
262
|
+
var res = [];
|
|
263
|
+
for (var key in tree) {
|
|
264
|
+
var item = tree[key];
|
|
265
|
+
res.push(filterObjectKeys(item, ['children']));
|
|
266
|
+
if (item[childKey]) {
|
|
267
|
+
res.push.apply(res, _toConsumableArray(treeToList(item[childKey], childKey)));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return res;
|
|
271
|
+
}
|
|
253
272
|
export function findValuePath(obj, target) {
|
|
254
273
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
255
274
|
for (var key in obj) {
|
package/dist/types.d.ts
CHANGED