@zgfe/modules-dm 1.0.1 → 1.0.2-dm.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.
@@ -150,6 +150,11 @@ var CollectionEventList = function CollectionEventList(props) {
150
150
 
151
151
 
152
152
  var createEventGroup = function createEventGroup() {
153
+ if (eventNameInput.length > 20) {
154
+ message.error('名称不可超过20字符');
155
+ return;
156
+ }
157
+
153
158
  request(apis.upsertEventGroup, {
154
159
  method: 'post',
155
160
  data: {
@@ -82,6 +82,7 @@
82
82
  }
83
83
  }
84
84
  .alias_name {
85
+ background: #fff !important;
85
86
  border: none;
86
87
  }
87
88
  .ant-input:focus,
@@ -163,6 +164,7 @@
163
164
  display: none;
164
165
  margin-left: 10px;
165
166
  font-size: 16px !important;
167
+ cursor: pointer;
166
168
  }
167
169
  .copy-text:hover {
168
170
  color: @primary-color;
@@ -171,6 +173,7 @@
171
173
  .collect-icon-active {
172
174
  margin: 0 4px;
173
175
  font-size: 16px !important;
176
+ cursor: pointer;
174
177
  }
175
178
  .collect-icon {
176
179
  color: #999;
@@ -220,9 +223,22 @@
220
223
  &:hover {
221
224
  .fuzhi {
222
225
  display: inline-block;
226
+ cursor: pointer;
223
227
  }
224
228
  }
225
229
  }
230
+ .alias_name {
231
+ background: #fff !important;
232
+ border: none;
233
+ cursor: pointer;
234
+ }
235
+ .ant-input:focus,
236
+ .ant-input-focused {
237
+ background-color: #fff !important;
238
+ border-bottom: 1px solid @primary-color;
239
+ border-radius: 0 !important;
240
+ box-shadow: none !important;
241
+ }
226
242
  .attr_alias_name {
227
243
  cursor: pointer;
228
244
  user-select: none;
@@ -66,7 +66,7 @@ var TablePlus = function TablePlus(props) {
66
66
  }; // 表格class处理
67
67
 
68
68
 
69
- var rowClassNameHandle = function rowClassNameHandle(record, index) {
69
+ var rowClassNameHandle = function rowClassNameHandle(record) {
70
70
  if (record.groupId != undefined) {
71
71
  return 'group-row';
72
72
  } else {
@@ -348,7 +348,9 @@ var TablePlus = function TablePlus(props) {
348
348
  placement: "bottom"
349
349
  }, /*#__PURE__*/React.createElement("span", {
350
350
  className: "group-handle"
351
- }, "\u79FB\u52A8\u5230\u7EC4")), record.groupId != -1 && /*#__PURE__*/React.createElement(React.Fragment, null, groupPopoverContent(record, 'copy') != null && /*#__PURE__*/React.createElement(Popover, {
351
+ }, /*#__PURE__*/React.createElement(IconFont, {
352
+ type: "yidong"
353
+ }), "\u79FB\u52A8\u5230\u7EC4")), record.groupId != -1 && /*#__PURE__*/React.createElement(React.Fragment, null, groupPopoverContent(record, 'copy') != null && /*#__PURE__*/React.createElement(Popover, {
352
354
  content: function content() {
353
355
  return groupPopoverContent(record, 'copy');
354
356
  },
@@ -356,12 +358,16 @@ var TablePlus = function TablePlus(props) {
356
358
  placement: "bottom"
357
359
  }, /*#__PURE__*/React.createElement("span", {
358
360
  className: "group-handle"
359
- }, "\u590D\u5236\u5230\u7EC4")), /*#__PURE__*/React.createElement("span", {
361
+ }, /*#__PURE__*/React.createElement(IconFont, {
362
+ type: "yidong"
363
+ }), "\u590D\u5236\u5230\u7EC4")), /*#__PURE__*/React.createElement("span", {
360
364
  className: "group-handle",
361
365
  onClick: function onClick() {
362
366
  return groupHandle('move-out', record);
363
367
  }
364
- }, "\u79FB\u51FA\u5206\u7EC4"))));
368
+ }, /*#__PURE__*/React.createElement(IconFont, {
369
+ type: "yidong"
370
+ }), "\u79FB\u51FA\u5206\u7EC4"))));
365
371
  } else {
366
372
  return /*#__PURE__*/React.createElement("div", {
367
373
  className: "event_name"
@@ -421,7 +427,7 @@ var TablePlus = function TablePlus(props) {
421
427
  key: 'last_insert_time',
422
428
  width: 187,
423
429
  render: function render(text, record, index) {
424
- return /*#__PURE__*/React.createElement("div", null, record.insert_time);
430
+ return /*#__PURE__*/React.createElement("div", null, record.last_insert_time);
425
431
  }
426
432
  }, {
427
433
  title: /*#__PURE__*/React.createElement(Select, {
@@ -456,6 +462,7 @@ var TablePlus = function TablePlus(props) {
456
462
  style: {
457
463
  width: 150
458
464
  },
465
+ disabled: rowClassNameHandle(record) == 'error-row' ? true : false,
459
466
  onChange: function onChange(e) {
460
467
  return eventHiddenChange(e, 'event_hidden', record.event_id);
461
468
  },
@@ -501,6 +508,7 @@ var TablePlus = function TablePlus(props) {
501
508
  style: {
502
509
  width: 150
503
510
  },
511
+ disabled: rowClassNameHandle(record) == 'error-row' ? true : false,
504
512
  onChange: function onChange(e) {
505
513
  return eventHiddenChange(e, 'is_stop', record.event_id);
506
514
  },
@@ -573,7 +581,7 @@ var TablePlus = function TablePlus(props) {
573
581
  loading: props.loading,
574
582
  dataSource: tableHandleData,
575
583
  rowClassName: function rowClassName(record, index) {
576
- return rowClassNameHandle(record, index);
584
+ return rowClassNameHandle(record);
577
585
  },
578
586
  scroll: {
579
587
  x: 1300,
@@ -22,7 +22,7 @@ import DataCollection from '../dataCollection';
22
22
  var DataManage = function DataManage(props) {
23
23
  var classPrefix = 'data-manage';
24
24
 
25
- var _useState = useState('1'),
25
+ var _useState = useState('0'),
26
26
  _useState2 = _slicedToArray(_useState, 2),
27
27
  menuTab = _useState2[0],
28
28
  setMenuTab = _useState2[1];
@@ -49,7 +49,7 @@ var DataManage = function DataManage(props) {
49
49
  }, /*#__PURE__*/React.createElement("div", {
50
50
  className: "".concat(classPrefix, "-menu")
51
51
  }, /*#__PURE__*/React.createElement(Menu, {
52
- defaultSelectedKeys: ['1'],
52
+ defaultSelectedKeys: ['0'],
53
53
  onSelect: onSelect,
54
54
  items: items
55
55
  })), menuTab == '0' && /*#__PURE__*/React.createElement(DataCollection, null), menuTab == '1' && /*#__PURE__*/React.createElement(PlanList, null));
@@ -21,7 +21,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
21
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
 
23
23
  import { IconFont } from '@zgfe/business-lib';
24
- import { Input, Button, Select, Table, Modal, Form } from 'antd';
24
+ import { Input, Button, Select, Table, Modal, Form, message } from 'antd';
25
25
  var Option = Select.Option;
26
26
  import React, { useEffect, useState } from 'react';
27
27
  import './styles/index.less';
@@ -93,11 +93,21 @@ var addEventOrUser = function addEventOrUser(props) {
93
93
  var handleRow = function handleRow(type, data) {
94
94
  // console.log(type, data, tableRowData);
95
95
  if (type == 'add') {
96
+ if (tableRowData.length >= 50) {
97
+ message.error('不可添加,最多添加50条数据');
98
+ return;
99
+ }
100
+
96
101
  var newRows = {
97
102
  key: tableRowData[tableRowData.length - 1].key + 1
98
103
  };
99
104
  setTableRowData([].concat(_toConsumableArray(tableRowData), [newRows]));
100
105
  } else {
106
+ if (tableRowData.length <= 1) {
107
+ message.error('不可删除,最少保留1条数据');
108
+ return;
109
+ }
110
+
101
111
  var _arr = Object.assign([], tableRowData).filter(function (item) {
102
112
  if (item.key != (data === null || data === void 0 ? void 0 : data.key)) return item;
103
113
  });
@@ -257,6 +267,9 @@ var addEventOrUser = function addEventOrUser(props) {
257
267
  autoComplete: "off",
258
268
  onFinish: onFinish
259
269
  }, /*#__PURE__*/React.createElement(Table, {
270
+ scroll: {
271
+ y: 400
272
+ },
260
273
  className: "".concat(classPrefix, "-table"),
261
274
  columns: columns,
262
275
  dataSource: tableRowData,
@@ -145,6 +145,19 @@ var AddPlan = function AddPlan(props) {
145
145
  maxCount: 1,
146
146
  showUploadList: false,
147
147
  beforeUpload: function beforeUpload(file) {
148
+ console.log(file);
149
+ var fileType = file.name.split('.');
150
+
151
+ if (fileType[fileType.length - 1] != 'xlsx' && fileType[fileType.length - 1] != 'xsl') {
152
+ message.error('上传仅支持xlsx或xsl格式的文件');
153
+ return;
154
+ }
155
+
156
+ if (file.size > 5 * 1024 * 1024) {
157
+ message.error('最大支持上传5M的文件');
158
+ return;
159
+ }
160
+
148
161
  var formData = new FormData();
149
162
  formData.append('file', file, file.name);
150
163
  var data = new FormData();
@@ -597,7 +610,7 @@ var AddPlan = function AddPlan(props) {
597
610
  }, /*#__PURE__*/React.createElement(IconFont, {
598
611
  type: "xiazai1"
599
612
  }), "\u4E0B\u8F7D\u6A21\u677F"), /*#__PURE__*/React.createElement(Upload, _objectSpread({}, uploadProps), /*#__PURE__*/React.createElement(Button, null, /*#__PURE__*/React.createElement(IconFont, {
600
- type: "xiazai1"
613
+ type: "daochu"
601
614
  }), "\u6587\u4EF6\u4E0A\u4F20")))), /*#__PURE__*/React.createElement(Search, {
602
615
  type: listTab == '1' ? 'event' : 'user',
603
616
  total: searchTotal,
@@ -197,7 +197,7 @@ var PlanList = function PlanList(props) {
197
197
  }, !drawerShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
198
198
  className: "".concat(classPrefix, "-switchbox clearfix")
199
199
  }, /*#__PURE__*/React.createElement("div", {
200
- className: "switch"
200
+ className: "switch-div"
201
201
  }, /*#__PURE__*/React.createElement("span", null, "\u57CB\u70B9\u65B9\u6848\u63A7\u5236"), /*#__PURE__*/React.createElement(Switch, {
202
202
  onChange: isOpenChang,
203
203
  checkedChildren: "\u5F00",
@@ -40,7 +40,7 @@
40
40
  // margin-top: 26px;
41
41
  // padding-top: 26px;
42
42
  // border-top: 1px solid #e8efff;
43
- .switch {
43
+ .switch-div {
44
44
  float: left;
45
45
  span {
46
46
  margin-right: 20px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-dm",
3
- "version": "1.0.1",
3
+ "version": "1.0.2-dm.1",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "license": "ISC",
@@ -41,7 +41,7 @@
41
41
  "@types/lodash": "^4.14.182",
42
42
  "@umijs/fabric": "^2.8.1",
43
43
  "@umijs/test": "^3.0.5",
44
- "@zgfe/business-lib": "1.1.7-dmd.0",
44
+ "@zgfe/business-lib": "1.1.7-dmd.1",
45
45
  "antd": "4.22.6",
46
46
  "dumi": "^1.1.0",
47
47
  "father-build": "^1.17.2",
@@ -53,7 +53,7 @@
53
53
  "umi-request": "^1.4.0",
54
54
  "yorkie": "^2.0.0"
55
55
  },
56
- "gitHead": "9320512c29932b5faeb56719862c27aa22a9e52c",
56
+ "gitHead": "21b241c8db6f499daff43a19cbea9bdae598bd2f",
57
57
  "gitHooks": {
58
58
  "pre-commit": "lint-staged"
59
59
  }