uepay-mesh 4.0.10 → 4.0.13

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.
@@ -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(_antd.Drawer, {
27
- placement: "right",
28
- closable: false,
29
- visible: props.visible,
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(_antd.Drawer, {
27
- placement: "right",
28
- closable: false,
29
- visible: props.visible,
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,
@@ -25,6 +25,12 @@ var _serverEnums = require("../config/serverEnums");
25
25
 
26
26
  var _remove = require("../crud/remove");
27
27
 
28
+ var _extension = _interopRequireDefault(require("../define/collect/extension"));
29
+
30
+ var _errorTip = _interopRequireDefault(require("../../common/model/errorTip"));
31
+
32
+ var _delayTip = _interopRequireDefault(require("../../common/model/delayTip"));
33
+
28
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
35
 
30
36
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -50,6 +56,11 @@ const InitState = {
50
56
  msg: '預覽类型Table必须設置collect結構!'
51
57
  }
52
58
  };
59
+ let id = 0;
60
+
61
+ function obtainId() {
62
+ return "tab".concat(++id);
63
+ }
53
64
  /**
54
65
  * 標準數據包裝列表
55
66
  * @param props.type {String} 列表類型 目前支持"preview"和"auto"。
@@ -92,6 +103,7 @@ const InitState = {
92
103
  * handleAction(state, pkValue, record, text) 操作cell被点击的回调
93
104
  */
94
105
 
106
+
95
107
  class QueryAbleTable extends _react.default.Component {
96
108
  constructor() {
97
109
  super(...arguments);
@@ -107,8 +119,12 @@ class QueryAbleTable extends _react.default.Component {
107
119
  _defineProperty(this, "handleQuery", params => {
108
120
  const {
109
121
  collect,
110
- collectId
122
+ collectId,
123
+ extension
111
124
  } = this,
125
+ {
126
+ pipe
127
+ } = extension,
112
128
  _this = this,
113
129
  {
114
130
  host,
@@ -136,45 +152,16 @@ class QueryAbleTable extends _react.default.Component {
136
152
  collectId,
137
153
  search,
138
154
  sorter,
139
- page
140
- }).then(this.handleResult) : (0, _request.listQueryWithClassDes)({
155
+ page,
156
+ pipe
157
+ }).then(this.handleResult(params)) : (0, _request.listQueryWithClassDes)({
141
158
  host,
142
159
  collect,
143
160
  search,
144
161
  sorter,
145
- page
146
- }).then(this.handleResult);
147
- });
148
-
149
- _defineProperty(this, "handleResult", res => {
150
- const {
151
- onResult
152
- } = this.props;
153
-
154
- if (res && 0 < res.code) {
155
- const result = {
156
- data: res.result,
157
- page: res.page,
158
- total: res.total,
159
- search: res.search,
160
- sorter: res.sorter
161
- };
162
- this.setState({
163
- loading: false,
164
- result
165
- });
166
- onResult && onResult(_objectSpread({
167
- suc: true
168
- }, result));
169
- } else {
170
- QueryAbleTable.errTip(res && res.msg ? res.msg : '網絡故障,請稍後再試!', '服務器請求錯誤!');
171
- this.setState({
172
- loading: false
173
- });
174
- onResult && onResult({
175
- suc: false
176
- });
177
- }
162
+ page,
163
+ pipe
164
+ }).then(this.handleResult(params));
178
165
  });
179
166
 
180
167
  _defineProperty(this, "handleExcel", () => {});
@@ -250,6 +237,7 @@ class QueryAbleTable extends _react.default.Component {
250
237
  } else {
251
238
  if (_collect) {
252
239
  this.collect = _collect;
240
+ this.extension = new _extension.default(_collect.extension);
253
241
  this.initState = InitState.PreView;
254
242
  } else {
255
243
  this.initState = InitState.UnCollect;
@@ -258,6 +246,8 @@ class QueryAbleTable extends _react.default.Component {
258
246
  } else {
259
247
  this.initMsg = '未指定接口host地址!';
260
248
  }
249
+
250
+ this.id = obtainId(); //當前組件的唯一標識ID
261
251
  }
262
252
 
263
253
  componentDidMount() {
@@ -288,6 +278,7 @@ class QueryAbleTable extends _react.default.Component {
288
278
  if (res && 0 < res.code) {
289
279
  if (res.data) {
290
280
  _this.collect = res.data;
281
+ _this.extension = new _extension.default(res.data.extension);
291
282
  _this.initState = InitState.InitComplete;
292
283
 
293
284
  _this.setState({
@@ -324,6 +315,67 @@ class QueryAbleTable extends _react.default.Component {
324
315
  */
325
316
 
326
317
 
318
+ /**
319
+ * 進行搜索
320
+ * @param params.search
321
+ * @param params.sorter
322
+ * @param params.page
323
+ */
324
+ handleResult(params) {
325
+ const _this = this;
326
+ /**
327
+ * 搜索结果
328
+ * @param res
329
+ */
330
+
331
+
332
+ return res => {
333
+ const {
334
+ onResult
335
+ } = this.props;
336
+
337
+ if (res && 0 < res.code) {
338
+ const result = {
339
+ data: res.result,
340
+ page: res.page,
341
+ total: res.total,
342
+ search: res.search,
343
+ sorter: res.sorter
344
+ };
345
+ this.setState({
346
+ loading: false,
347
+ result
348
+ });
349
+ onResult && onResult(_objectSpread({
350
+ suc: true
351
+ }, result));
352
+ } else if (res && -100 === res.code) {
353
+ this.setState({
354
+ loading: false
355
+ });
356
+ (0, _delayTip.default)("查詢隊列已滿", res.msg, '自動查詢', 20, () => {
357
+ _this.handleQuery(params);
358
+ });
359
+ } else {
360
+ QueryAbleTable.errTip(res && res.msg ? res.msg : '網絡故障,請稍後再試!', '服務器請求錯誤!');
361
+ this.setState({
362
+ loading: false
363
+ });
364
+ onResult && onResult({
365
+ suc: false
366
+ });
367
+ }
368
+ };
369
+ }
370
+ /**
371
+ * 处理点击Excel按钮
372
+ */
373
+
374
+
375
+ getId() {
376
+ return this.id;
377
+ }
378
+
327
379
  getContextProvider() {
328
380
  const {
329
381
  type,
@@ -377,6 +429,7 @@ class QueryAbleTable extends _react.default.Component {
377
429
  deliverAuth
378
430
  } = this.props;
379
431
  Comp = /*#__PURE__*/_react.default.createElement(_standardTable.default, {
432
+ id: this.getId(),
380
433
  onQuery: this.handleQuery,
381
434
  onExcel: this.handleExcel,
382
435
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uepay-mesh",
3
- "version": "4.0.10",
3
+ "version": "4.0.13",
4
4
  "description": "数据中心数据集设计工具前端",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -44,6 +44,6 @@
44
44
  "node-sass": "^4.13.0",
45
45
  "react": "^16.12.0",
46
46
  "react-dom": "^16.12.0",
47
- "uepay-ops2": "4.0.7"
47
+ "uepay-ops2": "4.0.8"
48
48
  }
49
49
  }
package/style.css CHANGED
@@ -31,7 +31,7 @@
31
31
  color: #000000;
32
32
  }
33
33
 
34
- .uepay-standard-table-label .ach{
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
- .uepay-standard-table-label .ach:hover{
42
+ .ach:hover{
43
43
  background-color: #40a9ff;
44
44
  color: #ffffff;
45
45
  }
@@ -136,10 +136,10 @@
136
136
  flex-wrap: wrap;
137
137
  align-content: flex-start;
138
138
  background-color: #fff;
139
+ overflow-y: auto;
139
140
  }
140
141
 
141
142
  .uepay-form {
142
- position: relative;
143
143
  display: flex;
144
144
  flex-direction: column;
145
145
  align-items: stretch;
@@ -148,6 +148,33 @@
148
148
  width: 100%;
149
149
  }
150
150
 
151
+ .uepay-form .ant-tabs{
152
+ flex-grow: 1;
153
+ }
154
+
155
+ /*右上角關聯選項的按鈕*/
156
+ .uepay-form .rl-bar{
157
+ position: absolute;
158
+ padding: .1rem .5rem 1rem .5rem;
159
+ top: 2rem;
160
+ right: 2rem;
161
+ width: 7rem;
162
+ border-left: 1px solid #cccccc;
163
+ }
164
+
165
+ .uepay-form .rl-bar a{
166
+ color: #000000;
167
+ text-decoration: none;
168
+ }
169
+
170
+ .uepay-form .rl-bar a:hover{
171
+ color:#40a9ff;
172
+ }
173
+
174
+ .uepay-form .rl-bar span{
175
+ margin-right: .2rem;
176
+ }
177
+
151
178
  .uepay-edit-empty {
152
179
  width: 100%;
153
180
  height: 100%;
@@ -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;