uepay-mesh 3.0.3 → 3.0.7
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/cell/view/picker/timestampDatePickerView.js +21 -4
- package/mesh/cell/view/select/standardSelectView.js +22 -11
- package/mesh/config/serverEnums.js +33 -2
- package/mesh/data/request.js +23 -16
- package/mesh/excel/optionsAbleExcel.js +3 -1
- package/mesh/excel/processor.js +74 -19
- package/mesh/excel/standardExcel.js +1 -0
- package/mesh/form/editAbleForm.js +1 -1
- package/mesh/table/queryAbleTable.js +4 -1
- package/mesh/table/standardTable/thColumn/rowEditAbleCell.js +2 -2
- package/mesh/table/standardTable/thColumn.js +51 -15
- package/package.json +2 -2
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
require("core-js/modules/es6.symbol");
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/web.dom.iterable");
|
|
11
|
+
|
|
8
12
|
var _react = _interopRequireDefault(require("react"));
|
|
9
13
|
|
|
10
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -15,6 +19,12 @@ var _antd = require("antd");
|
|
|
15
19
|
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
18
28
|
const DateFormat = 'YYYY-MM-DD',
|
|
19
29
|
TimeFormat = "".concat(DateFormat, " HH:mm:ss");
|
|
20
30
|
/**
|
|
@@ -30,10 +40,7 @@ const DateFormat = 'YYYY-MM-DD',
|
|
|
30
40
|
*/
|
|
31
41
|
|
|
32
42
|
const TimestampDatePickerView = props => {
|
|
33
|
-
const
|
|
34
|
-
value = stringTime ? String(props.value) : Number(props.value),
|
|
35
|
-
date = (0, _moment.default)(value),
|
|
36
|
-
formatDate = date.format(props.showTime ? TimeFormat : DateFormat);
|
|
43
|
+
const formatDate = TimestampDatePickerView.format(_objectSpread({}, props));
|
|
37
44
|
return /*#__PURE__*/_react.default.createElement(_antd.Popover, {
|
|
38
45
|
content: formatDate
|
|
39
46
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -42,6 +49,16 @@ const TimestampDatePickerView = props => {
|
|
|
42
49
|
}, formatDate));
|
|
43
50
|
};
|
|
44
51
|
|
|
52
|
+
TimestampDatePickerView.format = function (_ref) {
|
|
53
|
+
let {
|
|
54
|
+
value,
|
|
55
|
+
showTime,
|
|
56
|
+
stringTime
|
|
57
|
+
} = _ref;
|
|
58
|
+
const date = (0, _moment.default)(stringTime ? String(value) : Number(value));
|
|
59
|
+
return date.format(showTime ? TimeFormat : DateFormat);
|
|
60
|
+
};
|
|
61
|
+
|
|
45
62
|
TimestampDatePickerView.propTypes = {
|
|
46
63
|
style: _propTypes.default.object,
|
|
47
64
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
@@ -5,12 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
require("core-js/modules/es6.symbol");
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/web.dom.iterable");
|
|
11
|
+
|
|
8
12
|
var _react = _interopRequireDefault(require("react"));
|
|
9
13
|
|
|
10
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
15
|
|
|
12
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
17
|
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
14
24
|
/**
|
|
15
25
|
* 标准选择器的演示框
|
|
16
26
|
* @param props.value {String|Number} 当前选择数值
|
|
@@ -21,22 +31,23 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
31
|
* @constructor
|
|
22
32
|
*/
|
|
23
33
|
const StandardSelectView = props => {
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
+
style: props.style,
|
|
36
|
+
className: props.className
|
|
37
|
+
}, StandardSelectView.format(_objectSpread({}, props)));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
StandardSelectView.format = function (_ref) {
|
|
41
|
+
let {
|
|
42
|
+
value,
|
|
26
43
|
options
|
|
27
|
-
} =
|
|
44
|
+
} = _ref;
|
|
28
45
|
|
|
29
46
|
for (let opt of options) {
|
|
30
|
-
if (opt.value === String(
|
|
31
|
-
|
|
32
|
-
break;
|
|
47
|
+
if (opt.value === String(value)) {
|
|
48
|
+
return opt.label;
|
|
33
49
|
}
|
|
34
50
|
}
|
|
35
|
-
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
37
|
-
style: props.style,
|
|
38
|
-
className: props.className
|
|
39
|
-
}, curLabel);
|
|
40
51
|
};
|
|
41
52
|
|
|
42
53
|
StandardSelectView.propTypes = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.UpdateState = exports.QueryType = exports.AlisaFlag = exports.OptionsState = exports.OptionsDict = exports.OptionsFlag = exports.EditTypeDict = exports.EditType = exports.ShowType = exports.TableOrderTypeMapping = exports.OrderType = exports.BETWEENCondMapping = exports.RelationType = exports.DefaultCondValue = exports.CondType = void 0;
|
|
6
|
+
exports.ColumnSecurityOptions = exports.ColumnSecurity = exports.UpdateState = exports.QueryType = exports.AlisaFlag = exports.OptionsState = exports.OptionsDict = exports.OptionsFlag = exports.EditTypeDict = exports.EditType = exports.ShowType = exports.TableOrderTypeMapping = exports.OrderType = exports.BETWEENCondMapping = exports.RelationType = exports.DefaultCondValue = exports.CondType = void 0;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 搜索匹配模式,對應數據庫的對等模式
|
|
@@ -222,4 +222,35 @@ const UpdateState = {
|
|
|
222
222
|
SUC_BATCH_ANY: 20000,
|
|
223
223
|
SUC_BPM_PROCESS: 30000
|
|
224
224
|
};
|
|
225
|
-
|
|
225
|
+
/**
|
|
226
|
+
* 字段顯示替換法則
|
|
227
|
+
* @type {{None: string, Virginia: string, BKDHash: string}}
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
exports.UpdateState = UpdateState;
|
|
231
|
+
const ColumnSecurity = {
|
|
232
|
+
None: 'NONE',
|
|
233
|
+
Sensitive: 'Sensitive',
|
|
234
|
+
BKDHash: 'BKDHash',
|
|
235
|
+
Virginia: 'Virginia'
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* 字段替換顯示內容
|
|
239
|
+
* @type {({label: string, value: string}|{label: string, value: string}|{label: string, value: string})[]}
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
exports.ColumnSecurity = ColumnSecurity;
|
|
243
|
+
const ColumnSecurityOptions = [{
|
|
244
|
+
value: 'None',
|
|
245
|
+
label: '無'
|
|
246
|
+
}, {
|
|
247
|
+
value: 'Sensitive',
|
|
248
|
+
label: '四位脫敏'
|
|
249
|
+
}, {
|
|
250
|
+
value: 'BKDHash',
|
|
251
|
+
label: '哈希表示法'
|
|
252
|
+
}, {
|
|
253
|
+
value: 'Virginia',
|
|
254
|
+
label: '字母表替換(維吉尼娜密碼)'
|
|
255
|
+
}];
|
|
256
|
+
exports.ColumnSecurityOptions = ColumnSecurityOptions;
|
package/mesh/data/request.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.batchAddWithClassDes = exports.batchAddWithId = exports.addWithClassDes = exports.addWithId = exports.
|
|
6
|
+
exports.batchAddWithClassDes = exports.batchAddWithId = exports.addWithClassDes = exports.addWithId = exports.batchUpdateWithId = exports.batchUpdateWithClassDes = exports.updateWithId = exports.updateWithClassDes = exports.formWithId = exports.formWithClassDes = exports.downloadWithId = exports.downloadWithClassDes = exports.listQueryWithId = exports.listQueryWithClassDes = exports.getCollectById = void 0;
|
|
7
7
|
|
|
8
8
|
require("core-js/modules/es6.regexp.search");
|
|
9
9
|
|
|
@@ -197,7 +197,7 @@ const formWithId = (_ref7) => {
|
|
|
197
197
|
|
|
198
198
|
exports.formWithId = formWithId;
|
|
199
199
|
|
|
200
|
-
const
|
|
200
|
+
const updateWithClassDes = (_ref8) => {
|
|
201
201
|
let {
|
|
202
202
|
host,
|
|
203
203
|
collect,
|
|
@@ -229,9 +229,9 @@ const formSubmitWithClassDes = (_ref8) => {
|
|
|
229
229
|
*/
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
exports.
|
|
232
|
+
exports.updateWithClassDes = updateWithClassDes;
|
|
233
233
|
|
|
234
|
-
const
|
|
234
|
+
const updateWithId = (_ref9) => {
|
|
235
235
|
let {
|
|
236
236
|
host,
|
|
237
237
|
collectId,
|
|
@@ -266,21 +266,24 @@ const formSubmitWithId = (_ref9) => {
|
|
|
266
266
|
* @param host
|
|
267
267
|
* @param collect
|
|
268
268
|
* @param dataList {Array}
|
|
269
|
+
* @param bpm
|
|
269
270
|
* @return {Promise<Response>}
|
|
270
271
|
*/
|
|
271
272
|
|
|
272
273
|
|
|
273
|
-
exports.
|
|
274
|
+
exports.updateWithId = updateWithId;
|
|
274
275
|
|
|
275
|
-
const
|
|
276
|
+
const batchUpdateWithClassDes = (_ref10) => {
|
|
276
277
|
let {
|
|
277
278
|
host,
|
|
278
279
|
collect,
|
|
279
|
-
|
|
280
|
+
dataList,
|
|
281
|
+
bpm
|
|
280
282
|
} = _ref10;
|
|
281
|
-
return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/
|
|
283
|
+
return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/update"), {
|
|
282
284
|
collect,
|
|
283
|
-
dataList
|
|
285
|
+
dataList,
|
|
286
|
+
bpm
|
|
284
287
|
});
|
|
285
288
|
};
|
|
286
289
|
/**
|
|
@@ -293,23 +296,27 @@ const updateBatchWithClassDes = (_ref10) => {
|
|
|
293
296
|
* @param host
|
|
294
297
|
* @param collectId
|
|
295
298
|
* @param dataList {Array}
|
|
299
|
+
* @param bpm
|
|
296
300
|
* @return {Promise<Response>}
|
|
297
301
|
*/
|
|
298
302
|
|
|
299
303
|
|
|
300
|
-
exports.
|
|
304
|
+
exports.batchUpdateWithClassDes = batchUpdateWithClassDes;
|
|
301
305
|
|
|
302
|
-
const
|
|
306
|
+
const batchUpdateWithId = (_ref11) => {
|
|
303
307
|
let {
|
|
304
308
|
host,
|
|
305
309
|
collectId,
|
|
306
|
-
dataList
|
|
310
|
+
dataList,
|
|
311
|
+
bpm
|
|
307
312
|
} = _ref11;
|
|
308
|
-
return (0, _net.post)("".concat(host, "/data/mesh/execute/
|
|
313
|
+
return (0, _net.post)("".concat(host, "/data/mesh/execute/update"), {
|
|
309
314
|
collectId,
|
|
310
|
-
dataList
|
|
315
|
+
dataList,
|
|
316
|
+
bpm
|
|
311
317
|
});
|
|
312
|
-
};
|
|
318
|
+
}; // Add
|
|
319
|
+
|
|
313
320
|
/**
|
|
314
321
|
* 提交新增的数据
|
|
315
322
|
* @param host
|
|
@@ -320,7 +327,7 @@ const updateBatchWithId = (_ref11) => {
|
|
|
320
327
|
*/
|
|
321
328
|
|
|
322
329
|
|
|
323
|
-
exports.
|
|
330
|
+
exports.batchUpdateWithId = batchUpdateWithId;
|
|
324
331
|
|
|
325
332
|
const addWithId = (_ref12) => {
|
|
326
333
|
let {
|
|
@@ -19,6 +19,8 @@ var _standardExcel = _interopRequireDefault(require("./standardExcel"));
|
|
|
19
19
|
|
|
20
20
|
var _serverEnums = require("../config/serverEnums");
|
|
21
21
|
|
|
22
|
+
var _cell = _interopRequireDefault(require("../cell"));
|
|
23
|
+
|
|
22
24
|
var _request = require("../data/request");
|
|
23
25
|
|
|
24
26
|
var _processor = require("./processor");
|
|
@@ -38,7 +40,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
38
40
|
const {
|
|
39
41
|
confirm
|
|
40
42
|
} = _antd.Modal;
|
|
41
|
-
const ConfirmTotal =
|
|
43
|
+
const ConfirmTotal = 2000;
|
|
42
44
|
const PageSize = 300;
|
|
43
45
|
const Dict = Object.assign({}, _serverEnums.EditTypeDict);
|
|
44
46
|
Dict.NONE = '不可编辑';
|
package/mesh/excel/processor.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.add = exports.modify = exports.modifyAbleDownload = exports.addAbleHeaderRow = exports.modifyAbleHeaderRow = void 0;
|
|
7
7
|
|
|
8
|
+
require("core-js/modules/es6.symbol");
|
|
9
|
+
|
|
8
10
|
require("core-js/modules/web.dom.iterable");
|
|
9
11
|
|
|
10
12
|
var _serverEnums = require("../config/serverEnums");
|
|
@@ -13,6 +15,16 @@ var _request = require("../data/request");
|
|
|
13
15
|
|
|
14
16
|
var _antd = require("antd");
|
|
15
17
|
|
|
18
|
+
var _cell = _interopRequireDefault(require("../cell"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
16
28
|
const ModifyHeaderRegularRowCount = 2; //可编辑Excel有三行固定列,第一列为字段label数值,第二列数据解释,第三列字段显示名称
|
|
17
29
|
|
|
18
30
|
const PageSize = 100; //下載或上傳單個批次的數量
|
|
@@ -21,12 +33,38 @@ const Dict = {
|
|
|
21
33
|
NONE: '不可编辑',
|
|
22
34
|
EDIT: '可编辑'
|
|
23
35
|
};
|
|
36
|
+
|
|
37
|
+
function format(_ref) {
|
|
38
|
+
let {
|
|
39
|
+
value
|
|
40
|
+
} = _ref;
|
|
41
|
+
return value ? "".concat(value) : '';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 获取format工具
|
|
45
|
+
* @param json
|
|
46
|
+
* @return {{format: (*|(function({value: *}): string)), config: *}}
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
function obtainFormat(json) {
|
|
51
|
+
const defined = json ? JSON.parse(json) : {
|
|
52
|
+
type: "NONE",
|
|
53
|
+
config: {}
|
|
54
|
+
},
|
|
55
|
+
cell = _cell.default[defined.type];
|
|
56
|
+
return {
|
|
57
|
+
format: cell && cell.view && cell.view.format || format,
|
|
58
|
+
config: defined.config || {}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
24
61
|
/**
|
|
25
62
|
* 生成下载行的头描述数据
|
|
26
63
|
* @param collect
|
|
27
64
|
* @return {{colsOptions: *, rows: [*, *, *]}} colsOptions: 行數據定義
|
|
28
65
|
*/
|
|
29
66
|
|
|
67
|
+
|
|
30
68
|
const modifyAbleHeaderRow = collect => {
|
|
31
69
|
const indexHeaderRow = [],
|
|
32
70
|
explainHeaderRow = [],
|
|
@@ -34,6 +72,7 @@ const modifyAbleHeaderRow = collect => {
|
|
|
34
72
|
colsOptions = [],
|
|
35
73
|
NONE = _serverEnums.ShowType[0].value,
|
|
36
74
|
fieldLabelDict = {},
|
|
75
|
+
formatDict = {},
|
|
37
76
|
rowsOptions = [{
|
|
38
77
|
hidden: true
|
|
39
78
|
}, {
|
|
@@ -42,6 +81,7 @@ const modifyAbleHeaderRow = collect => {
|
|
|
42
81
|
|
|
43
82
|
for (let field of collect.fieldList) {
|
|
44
83
|
fieldLabelDict[field.label] = field;
|
|
84
|
+
formatDict[field.label] = obtainFormat(field.component);
|
|
45
85
|
}
|
|
46
86
|
|
|
47
87
|
for (let field of collect.fieldList) {
|
|
@@ -58,6 +98,7 @@ const modifyAbleHeaderRow = collect => {
|
|
|
58
98
|
return {
|
|
59
99
|
colsOptions,
|
|
60
100
|
rowsOptions,
|
|
101
|
+
formatDict,
|
|
61
102
|
rows: [indexHeaderRow, explainHeaderRow, displayHeaderRow]
|
|
62
103
|
};
|
|
63
104
|
};
|
|
@@ -163,7 +204,7 @@ const checkAliasForAdd = (fieldNameDict, field) => {
|
|
|
163
204
|
*/
|
|
164
205
|
|
|
165
206
|
|
|
166
|
-
const modifyAbleDownload = (
|
|
207
|
+
const modifyAbleDownload = (_ref2) => {
|
|
167
208
|
let {
|
|
168
209
|
host,
|
|
169
210
|
collect,
|
|
@@ -173,7 +214,7 @@ const modifyAbleDownload = (_ref) => {
|
|
|
173
214
|
total,
|
|
174
215
|
cb,
|
|
175
216
|
processCb
|
|
176
|
-
} =
|
|
217
|
+
} = _ref2;
|
|
177
218
|
|
|
178
219
|
let index = 0,
|
|
179
220
|
_page,
|
|
@@ -184,7 +225,8 @@ const modifyAbleDownload = (_ref) => {
|
|
|
184
225
|
const {
|
|
185
226
|
rows,
|
|
186
227
|
colsOptions,
|
|
187
|
-
rowsOptions
|
|
228
|
+
rowsOptions,
|
|
229
|
+
formatDict
|
|
188
230
|
} = modifyAbleHeaderRow(collect),
|
|
189
231
|
//生成頭列表
|
|
190
232
|
labels = rows[0],
|
|
@@ -194,7 +236,7 @@ const modifyAbleDownload = (_ref) => {
|
|
|
194
236
|
present
|
|
195
237
|
} = getPageAndPresent(total),
|
|
196
238
|
//生成分頁和進度信息
|
|
197
|
-
request = collectId ? _request.
|
|
239
|
+
request = collectId ? _request.listQueryWithId : _request.listQueryWithClassDes,
|
|
198
240
|
//獲取後台請求方法
|
|
199
241
|
download = () => {
|
|
200
242
|
//下載功能
|
|
@@ -213,7 +255,15 @@ const modifyAbleDownload = (_ref) => {
|
|
|
213
255
|
}).then(res => {
|
|
214
256
|
if (res && 0 < res.code) {
|
|
215
257
|
for (let row of res.result) {
|
|
216
|
-
rows.push(labels.map(label =>
|
|
258
|
+
rows.push(labels.map(label => {
|
|
259
|
+
const {
|
|
260
|
+
format,
|
|
261
|
+
config
|
|
262
|
+
} = formatDict[label];
|
|
263
|
+
return format(_objectSpread({
|
|
264
|
+
value: row[label]
|
|
265
|
+
}, config));
|
|
266
|
+
}));
|
|
217
267
|
}
|
|
218
268
|
|
|
219
269
|
processCb('end', _present, _from, _to);
|
|
@@ -310,7 +360,7 @@ const getPageAndPresent = total => {
|
|
|
310
360
|
*/
|
|
311
361
|
|
|
312
362
|
|
|
313
|
-
const modify = (
|
|
363
|
+
const modify = (_ref3) => {
|
|
314
364
|
let {
|
|
315
365
|
host,
|
|
316
366
|
collect,
|
|
@@ -318,7 +368,7 @@ const modify = (_ref2) => {
|
|
|
318
368
|
dataList,
|
|
319
369
|
cb,
|
|
320
370
|
processCb
|
|
321
|
-
} =
|
|
371
|
+
} = _ref3;
|
|
322
372
|
processCb('start', 0, 0, 0);
|
|
323
373
|
|
|
324
374
|
const {
|
|
@@ -328,10 +378,11 @@ const modify = (_ref2) => {
|
|
|
328
378
|
} = collect,
|
|
329
379
|
//獲取數據集相關數據
|
|
330
380
|
{
|
|
331
|
-
tableColumnList
|
|
381
|
+
tableColumnList,
|
|
382
|
+
pkLabel
|
|
332
383
|
} = (() => {
|
|
333
384
|
//構建主鍵信息和表字段映射關係
|
|
334
|
-
let
|
|
385
|
+
let pkLabel,
|
|
335
386
|
fieldNameDict = {},
|
|
336
387
|
tableColumnList = [],
|
|
337
388
|
field;
|
|
@@ -340,7 +391,7 @@ const modify = (_ref2) => {
|
|
|
340
391
|
fieldNameDict[field.name] = field;
|
|
341
392
|
|
|
342
393
|
if (pkName === field.name) {
|
|
343
|
-
|
|
394
|
+
pkLabel = field.label;
|
|
344
395
|
}
|
|
345
396
|
}
|
|
346
397
|
|
|
@@ -355,7 +406,8 @@ const modify = (_ref2) => {
|
|
|
355
406
|
}
|
|
356
407
|
|
|
357
408
|
return {
|
|
358
|
-
tableColumnList
|
|
409
|
+
tableColumnList,
|
|
410
|
+
pkLabel
|
|
359
411
|
};
|
|
360
412
|
})(); //分頁和百分比
|
|
361
413
|
|
|
@@ -363,12 +415,14 @@ const modify = (_ref2) => {
|
|
|
363
415
|
進行數據格式轉換。將單行數據格式轉換為[{
|
|
364
416
|
data:[{label:String,value:Any],
|
|
365
417
|
pkValue:[column:String, table:String, value:Any]}]
|
|
418
|
+
pkData: String
|
|
366
419
|
*/
|
|
367
420
|
|
|
368
421
|
|
|
369
422
|
dataList = dataList.map(i => {
|
|
370
423
|
//進行格式轉換,生成提交數據
|
|
371
|
-
const
|
|
424
|
+
const pkData = i[pkLabel],
|
|
425
|
+
pkValue = tableColumnList.map(t => {
|
|
372
426
|
const value = i[t.label];
|
|
373
427
|
delete i[t.label];
|
|
374
428
|
return {
|
|
@@ -389,7 +443,8 @@ const modify = (_ref2) => {
|
|
|
389
443
|
|
|
390
444
|
return {
|
|
391
445
|
data,
|
|
392
|
-
pkValue
|
|
446
|
+
pkValue,
|
|
447
|
+
pkData
|
|
393
448
|
};
|
|
394
449
|
}); //上傳數據
|
|
395
450
|
|
|
@@ -398,7 +453,7 @@ const modify = (_ref2) => {
|
|
|
398
453
|
collect,
|
|
399
454
|
collectId,
|
|
400
455
|
dataList,
|
|
401
|
-
request: collectId ? _request.
|
|
456
|
+
request: collectId ? _request.batchUpdateWithId : _request.batchUpdateWithClassDes,
|
|
402
457
|
cb,
|
|
403
458
|
processCb
|
|
404
459
|
});
|
|
@@ -416,7 +471,7 @@ const modify = (_ref2) => {
|
|
|
416
471
|
|
|
417
472
|
exports.modify = modify;
|
|
418
473
|
|
|
419
|
-
const add = (
|
|
474
|
+
const add = (_ref4) => {
|
|
420
475
|
let {
|
|
421
476
|
host,
|
|
422
477
|
collect,
|
|
@@ -424,7 +479,7 @@ const add = (_ref3) => {
|
|
|
424
479
|
dataList,
|
|
425
480
|
cb,
|
|
426
481
|
processCb
|
|
427
|
-
} =
|
|
482
|
+
} = _ref4;
|
|
428
483
|
processCb('start', 0, 0, 0);
|
|
429
484
|
const pkValue = [],
|
|
430
485
|
total = dataList.length,
|
|
@@ -484,7 +539,7 @@ const add = (_ref3) => {
|
|
|
484
539
|
|
|
485
540
|
exports.add = add;
|
|
486
541
|
|
|
487
|
-
const doSubmit = (
|
|
542
|
+
const doSubmit = (_ref5) => {
|
|
488
543
|
let {
|
|
489
544
|
host,
|
|
490
545
|
collect,
|
|
@@ -493,7 +548,7 @@ const doSubmit = (_ref4) => {
|
|
|
493
548
|
request,
|
|
494
549
|
cb,
|
|
495
550
|
processCb
|
|
496
|
-
} =
|
|
551
|
+
} = _ref5;
|
|
497
552
|
|
|
498
553
|
let index = 0,
|
|
499
554
|
_page,
|
|
@@ -525,7 +580,7 @@ const doSubmit = (_ref4) => {
|
|
|
525
580
|
}
|
|
526
581
|
}).then(res => {
|
|
527
582
|
if (res && 0 < res.code) {
|
|
528
|
-
if (res.
|
|
583
|
+
if (res.pkDatas && res.pkDatas.length === _to - _from) {
|
|
529
584
|
_type = 'end';
|
|
530
585
|
} else {
|
|
531
586
|
_type = 'warn';
|
|
@@ -46,6 +46,7 @@ const StandardExcel = props => {
|
|
|
46
46
|
}), /*#__PURE__*/_react.default.createElement(ProcessInfo, props.info), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
47
47
|
orientation: "left"
|
|
48
48
|
}, "\u8655\u7406\u8A73\u7D30\u4FE1\u606F"), items.map(item => /*#__PURE__*/_react.default.createElement(Line, {
|
|
49
|
+
key: item.count,
|
|
49
50
|
state: item.state,
|
|
50
51
|
type: item.type,
|
|
51
52
|
from: item.from,
|
|
@@ -313,7 +313,7 @@ class EditAbleForm extends _react.default.Component {
|
|
|
313
313
|
} = this.props,
|
|
314
314
|
defData = this.state.data,
|
|
315
315
|
pkDict = {},
|
|
316
|
-
request = collectId ? _request.
|
|
316
|
+
request = collectId ? _request.updateWithId : _request.updateWithClassDes;
|
|
317
317
|
|
|
318
318
|
for (let table of collect.tableList) {
|
|
319
319
|
pkDict[table.pkName] = table.name;
|
|
@@ -356,13 +356,13 @@ function EditComp(_ref6) {
|
|
|
356
356
|
pkValue,
|
|
357
357
|
data
|
|
358
358
|
} = obtainUpdateData(record, collect, name, label, value);
|
|
359
|
-
'auto' === type ? (0, _request.
|
|
359
|
+
'auto' === type ? (0, _request.updateWithId)({
|
|
360
360
|
host,
|
|
361
361
|
collectId,
|
|
362
362
|
pkData,
|
|
363
363
|
pkValue,
|
|
364
364
|
data
|
|
365
|
-
}).then(submitRes) : (0, _request.
|
|
365
|
+
}).then(submitRes) : (0, _request.updateWithClassDes)({
|
|
366
366
|
host,
|
|
367
367
|
collect,
|
|
368
368
|
pkData,
|
|
@@ -15,6 +15,8 @@ var _antd = require("antd");
|
|
|
15
15
|
|
|
16
16
|
var _rowEditAbleCell = _interopRequireDefault(require("./thColumn/rowEditAbleCell"));
|
|
17
17
|
|
|
18
|
+
var _serverEnums = require("../../config/serverEnums");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
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); }
|
|
@@ -66,24 +68,23 @@ const thColumn = (_ref) => {
|
|
|
66
68
|
View = component.view,
|
|
67
69
|
Edit = component.edit,
|
|
68
70
|
config = component.config || {};
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(Column, {
|
|
70
|
-
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(Column, _extends({
|
|
72
|
+
key: label,
|
|
71
73
|
title: /*#__PURE__*/_react.default.createElement(Title, {
|
|
72
74
|
display: display,
|
|
73
75
|
value: value
|
|
74
76
|
}),
|
|
75
77
|
dataIndex: label,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
filterIcon: /*#__PURE__*/_react.default.createElement(_icons.SearchOutlined, null),
|
|
78
|
+
ellipsis: true
|
|
79
|
+
}, columnProperties({
|
|
80
|
+
collect,
|
|
81
|
+
field,
|
|
82
|
+
value,
|
|
83
|
+
condValue,
|
|
84
|
+
onSearch,
|
|
85
|
+
onChange,
|
|
86
|
+
onCond
|
|
87
|
+
}), {
|
|
87
88
|
render: (text, record, index) => {
|
|
88
89
|
return /*#__PURE__*/_react.default.createElement(_rowEditAbleCell.default, {
|
|
89
90
|
collect: collect,
|
|
@@ -96,7 +97,7 @@ const thColumn = (_ref) => {
|
|
|
96
97
|
View: View
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
});
|
|
100
|
+
}));
|
|
100
101
|
};
|
|
101
102
|
|
|
102
103
|
var _default = thColumn;
|
|
@@ -107,4 +108,39 @@ const Title = props => {
|
|
|
107
108
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
108
109
|
className: className
|
|
109
110
|
}, props.display);
|
|
110
|
-
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
function columnProperties(_ref2) {
|
|
114
|
+
let {
|
|
115
|
+
collect,
|
|
116
|
+
field,
|
|
117
|
+
value,
|
|
118
|
+
condValue,
|
|
119
|
+
onSearch,
|
|
120
|
+
onChange,
|
|
121
|
+
onCond
|
|
122
|
+
} = _ref2;
|
|
123
|
+
|
|
124
|
+
if ((_serverEnums.QueryType.Fast.value === collect.queryType || _serverEnums.QueryType.LazyFast === collect.queryType) && !field.isCanUpdate) {
|
|
125
|
+
return {};
|
|
126
|
+
} else {
|
|
127
|
+
const {
|
|
128
|
+
component,
|
|
129
|
+
label
|
|
130
|
+
} = field,
|
|
131
|
+
Search = component.search,
|
|
132
|
+
config = component.config || {};
|
|
133
|
+
return {
|
|
134
|
+
sorter: true,
|
|
135
|
+
filterDropdown: /*#__PURE__*/_react.default.createElement(Search, _extends({
|
|
136
|
+
column: label,
|
|
137
|
+
value: value,
|
|
138
|
+
condValue: condValue,
|
|
139
|
+
onSearch: onSearch,
|
|
140
|
+
onChange: onChange,
|
|
141
|
+
onCond: onCond
|
|
142
|
+
}, config)),
|
|
143
|
+
filterIcon: /*#__PURE__*/_react.default.createElement(_icons.SearchOutlined, null)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uepay-mesh",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "数据中心数据集设计工具前端",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"node-sass": "^4.13.0",
|
|
44
44
|
"react": "^16.12.0",
|
|
45
45
|
"react-dom": "^16.12.0",
|
|
46
|
-
"uepay-mesh": "^3.0.
|
|
46
|
+
"uepay-mesh": "^3.0.7",
|
|
47
47
|
"uepay-ops2": "^3.0.2"
|
|
48
48
|
}
|
|
49
49
|
}
|