@zgfe/modules-settings 2.1.0-zhongyuan.10 → 2.1.0-zhongyuan.12

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.
@@ -478,7 +478,7 @@ var CreateMeta = function CreateMeta(props) {
478
478
  labelType: type
479
479
  }
480
480
  }).then(function (res) {
481
- if (res.code == '100000') {
481
+ if (res && res.code == '100000') {
482
482
  switch (type) {
483
483
  case 2:
484
484
  setBizTag(res.data.map(function (res) {
@@ -914,13 +914,13 @@ var PageInfo = function PageInfo(props) {
914
914
  //拼接名称
915
915
  var sliceName = function sliceName(record) {
916
916
  var _record$businessLabel, _record$triggerLabel;
917
- var point = props.pageData.labels && props.pageData.labels.filter(function (res) {
917
+ var point = props.pageData && props.pageData.labels && props.pageData.labels.filter(function (res) {
918
918
  return res.labelType == 1;
919
919
  }).map(function (res) {
920
920
  return res.labelName;
921
921
  }).join('_') || '';
922
- var biz = record.businessLabel && ((_record$businessLabel = record.businessLabel) === null || _record$businessLabel === void 0 ? void 0 : _record$businessLabel.labelName) || '';
923
- var trig = record.triggerLabel && ((_record$triggerLabel = record.triggerLabel) === null || _record$triggerLabel === void 0 ? void 0 : _record$triggerLabel.labelName) || '' || '';
922
+ var biz = (record === null || record === void 0 ? void 0 : record.businessLabel) && ((_record$businessLabel = record.businessLabel) === null || _record$businessLabel === void 0 ? void 0 : _record$businessLabel.labelName) || '';
923
+ var trig = (record === null || record === void 0 ? void 0 : record.triggerLabel) && ((_record$triggerLabel = record.triggerLabel) === null || _record$triggerLabel === void 0 ? void 0 : _record$triggerLabel.labelName) || '' || '';
924
924
  var arr = [biz, point, trig, record.eventName].filter(function (res) {
925
925
  return res;
926
926
  }).join('-');
@@ -1,156 +1,174 @@
1
- .setting-point-map-tree {
2
- display: flex;
3
- flex-direction: column;
4
- width: 100%;
5
- height: 100%;
6
- padding: 16px 24px;
7
- overflow: hidden;
8
- background-color: #fff;
9
- border-radius: 8px;
10
- &-select {
11
- display: flex;
12
- flex-direction: row;
13
- justify-content: space-between;
14
- height: 32px;
15
- &-box {
16
- &-txt {
17
- margin-right: 8px;
18
- overflow: hidden;
19
- white-space: nowrap;
20
- text-overflow: ellipsis;
21
- }
22
- display: flex;
23
- gap: 8px;
24
- align-items: center;
25
- .transform180 {
26
- display: inline-block;
27
- transform: rotateX(180deg);
28
- }
29
- }
30
- }
31
- &-search {
32
- position: relative;
33
- display: grid;
34
- grid-gap: 16px;
35
- grid-template-columns: 88px 1fr 20px;
36
- align-items: center;
37
- margin-top: 16px;
38
- &-selectType {
39
- width: 100px;
40
- }
41
- .qrcode-img {
42
- display: inline-flex;
43
- flex-direction: column;
44
- align-items: center;
45
- width: 200px;
46
- height: 200px;
47
- padding: 20px;
48
- > div {
49
- text-align: center;
50
- > :nth-child(2) {
51
- color: #9aa1a9;
52
- font-size: 12px;
53
- }
54
- }
55
- img {
56
- width: 144px;
57
- height: 144px;
58
- margin-top: 10px;
59
- }
60
- }
61
- .ant-popover-placement-bottom .ant-popover-arrow {
62
- left: 84%;
63
- }
64
- .loading {
65
- .ant-spin-nested-loading {
66
- padding-top: 138px;
67
- }
68
- }
69
- // .ant-select-selector {
70
- // padding-left: 40px !important;
71
- // }
72
- // .ant-select-selection-search-input {
73
- // padding-left: 30px !important;
74
- // }
75
- &-popup {
76
- .ant-select-item {
77
- height: 32px !important;
78
- padding: 4px 12px !important;
79
- }
80
- }
81
- .sousuo {
82
- position: absolute;
83
- top: 6px;
84
- left: 16px;
85
- display: none;
86
- }
87
- }
88
- &-tree {
89
- display: flex;
90
- flex: 1;
91
- flex-direction: column;
92
- margin: 16px 0 0;
93
- overflow: hidden;
94
- .gengduocaozuo1 {
95
- color: #354354;
96
- }
97
- .gengduocaozuo1:hover {
98
- color: #165dff;
99
- }
100
- .ant-tree-switcher {
101
- color: #354354;
102
- }
103
- .ant-tree,
104
- .ant-tree-list,
105
- .ant-tree-list-holder {
106
- height: 100%;
107
- }
108
- .ant-tree-list-holder {
109
- overflow-x: hidden;
110
- overflow-y: auto;
111
- }
112
- .ant-tree-node-content-wrapper {
113
- width: calc(100% - 200px);
114
- }
115
- .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
116
- background-color: #e8efff;
117
- }
118
- .ant-tree-switcher {
119
- line-height: 32px;
120
- }
121
- &-item {
122
- display: flex;
123
- flex: 1 0;
124
- gap: 10px;
125
- align-items: center;
126
- justify-content: space-between;
127
- height: 32px;
128
- padding: 0px 4px;
129
- border-radius: 4px;
130
- &-title {
131
- overflow: hidden;
132
- white-space: nowrap;
133
- text-overflow: ellipsis;
134
- &-name {
135
- margin-right: 10px;
136
- }
137
- }
138
- }
139
- .ant-tree-title {
140
- display: block;
141
- }
142
- }
143
- &-empty {
144
- display: flex;
145
- flex: 1;
146
- flex-direction: column;
147
- align-items: center;
148
- justify-content: center;
149
- .ant-empty-normal {
150
- margin: 16px 0;
151
- }
152
- .zengjia:before {
153
- margin-right: 8px;
154
- }
155
- }
156
- }
1
+ .setting-point-map-tree {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ height: 100%;
6
+ padding: 16px 24px;
7
+ overflow: hidden;
8
+ background-color: #fff;
9
+ border-radius: 8px;
10
+ &-select {
11
+ display: flex;
12
+ flex-direction: row;
13
+ justify-content: space-between;
14
+ height: 32px;
15
+ &-box {
16
+ &-txt {
17
+ margin-right: 8px;
18
+ overflow: hidden;
19
+ white-space: nowrap;
20
+ text-overflow: ellipsis;
21
+ }
22
+ display: flex;
23
+ gap: 8px;
24
+ align-items: center;
25
+ .transform180 {
26
+ display: inline-block;
27
+ transform: rotateX(180deg);
28
+ }
29
+ }
30
+ }
31
+ &-search {
32
+ position: relative;
33
+ display: grid;
34
+ grid-gap: 16px;
35
+ grid-template-columns: 88px 1fr 20px;
36
+ align-items: center;
37
+ margin-top: 16px;
38
+ &-selectType {
39
+ width: 100px;
40
+ }
41
+ .qrcode-img {
42
+ display: inline-flex;
43
+ flex-direction: column;
44
+ align-items: center;
45
+ width: 200px;
46
+ height: 200px;
47
+ padding: 20px;
48
+ > div {
49
+ text-align: center;
50
+ > :nth-child(2) {
51
+ color: #9aa1a9;
52
+ font-size: 12px;
53
+ }
54
+ }
55
+ img {
56
+ width: 144px;
57
+ height: 144px;
58
+ margin-top: 10px;
59
+ }
60
+ }
61
+ .ant-popover-placement-bottom .ant-popover-arrow {
62
+ left: 84%;
63
+ }
64
+ .loading {
65
+ .ant-spin-nested-loading {
66
+ padding-top: 138px;
67
+ }
68
+ }
69
+ // .ant-select-selector {
70
+ // padding-left: 40px !important;
71
+ // }
72
+ // .ant-select-selection-search-input {
73
+ // padding-left: 30px !important;
74
+ // }
75
+ &-popup {
76
+ .ant-select-item {
77
+ height: 32px !important;
78
+ padding: 4px 12px !important;
79
+ }
80
+ }
81
+ .sousuo {
82
+ position: absolute;
83
+ top: 6px;
84
+ left: 16px;
85
+ display: none;
86
+ }
87
+ }
88
+ &-tree {
89
+ display: flex;
90
+ flex: 1;
91
+ flex-direction: column;
92
+ margin: 16px 0 0;
93
+ overflow: hidden;
94
+ .gengduocaozuo1 {
95
+ color: #354354;
96
+ transform: translateY(4px);
97
+ }
98
+ .gengduocaozuo1:hover {
99
+ color: #165dff;
100
+ }
101
+ .ant-tree-switcher {
102
+ color: #354354;
103
+ }
104
+ .ant-tree,
105
+ .ant-tree-list,
106
+ .ant-tree-list-holder {
107
+ height: 100%;
108
+ }
109
+ .ant-tree-list-holder {
110
+ overflow-x: hidden;
111
+ overflow-y: auto;
112
+ }
113
+ .ant-tree-node-content-wrapper {
114
+ width: calc(100% - 200px);
115
+ }
116
+ .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
117
+ background-color: #e8efff;
118
+ }
119
+ .ant-tree-switcher {
120
+ line-height: 32px;
121
+ }
122
+ &-item {
123
+ display: flex;
124
+ flex: 1 0;
125
+ gap: 10px;
126
+ align-items: center;
127
+ justify-content: space-between;
128
+ height: 32px;
129
+ padding: 0px 4px;
130
+ border-radius: 4px;
131
+ &-title {
132
+ overflow: hidden;
133
+ white-space: nowrap;
134
+ text-overflow: ellipsis;
135
+ &-name {
136
+ margin-right: 10px;
137
+ }
138
+ }
139
+ &-iconList {
140
+ position: absolute;
141
+ top: 0;
142
+ right: 0;
143
+ bottom: 0;
144
+ display: none;
145
+ justify-content: space-around;
146
+ width: 85px;
147
+ font-size: 16px;
148
+ background: #ffffff;
149
+ .anticon:hover {
150
+ color: #165dff;
151
+ }
152
+ }
153
+ &:hover &-iconList {
154
+ display: flex;
155
+ }
156
+ }
157
+ .ant-tree-title {
158
+ display: block;
159
+ }
160
+ }
161
+ &-empty {
162
+ display: flex;
163
+ flex: 1;
164
+ flex-direction: column;
165
+ align-items: center;
166
+ justify-content: center;
167
+ .ant-empty-normal {
168
+ margin: 16px 0;
169
+ }
170
+ .zengjia:before {
171
+ margin-right: 8px;
172
+ }
173
+ }
174
+ }
@@ -16,7 +16,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
16
16
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
17
17
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
18
18
  import { Button, Dropdown, Empty, Input, message, Modal, Select, Tree, Popover, Spin, Tag, Checkbox } from 'antd';
19
- import { QuestionCircleOutlined, EnvironmentOutlined } from '@ant-design/icons';
19
+ import { QuestionCircleOutlined, EnvironmentOutlined, PlusCircleOutlined, MinusCircleOutlined, EditOutlined } from '@ant-design/icons';
20
20
  import React, { useContext, useEffect, useRef, useState } from 'react';
21
21
  import './styles/tree.less';
22
22
  import { BizDialog, BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
@@ -193,6 +193,7 @@ var pointMap = function pointMap(props) {
193
193
  });
194
194
  };
195
195
  var getPointTree = function getPointTree() {
196
+ var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
196
197
  request(apis.getPointTree, {
197
198
  method: 'post',
198
199
  data: {
@@ -213,6 +214,7 @@ var pointMap = function pointMap(props) {
213
214
  // props.onChangePage(res?.data ? { ...res?.data[0], currentPointVersion } : undefined);
214
215
  }
215
216
  setChangeNameId(undefined);
217
+ fn();
216
218
  }
217
219
  }).catch(function (err) {
218
220
  console.log(err);
@@ -227,11 +229,12 @@ var pointMap = function pointMap(props) {
227
229
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
228
230
  }
229
231
  }).then(function (res) {
230
- if (res.code == 100000) {
232
+ if (res && res.code == 100000) {
231
233
  setPointList(res.data.map(function (res) {
232
234
  return {
233
235
  label: res.labelName,
234
- value: res.id
236
+ value: res.id,
237
+ labelType: 1
235
238
  };
236
239
  }));
237
240
  }
@@ -367,8 +370,7 @@ var pointMap = function pointMap(props) {
367
370
  }
368
371
  };
369
372
  var titleRender = function titleRender(nodeData) {
370
- var onItemClick = function onItemClick(_ref) {
371
- var key = _ref.key;
373
+ var onItemClick = function onItemClick(key) {
372
374
  switch (key) {
373
375
  case '0':
374
376
  if (nodeData.storey >= 20) {
@@ -401,16 +403,83 @@ var pointMap = function pointMap(props) {
401
403
  };
402
404
  //位置标签list
403
405
  var color = ['magenta', 'red', 'volcano', 'orange', 'gold', 'lime', 'green', 'cyan', 'blue', 'geekblue', 'purple'];
404
- var pointContent = /*#__PURE__*/React.createElement(React.Fragment, null, nodeData.labels.map(function (res, index) {
406
+ var pointContent = /*#__PURE__*/React.createElement(React.Fragment, null, nodeData.labels && nodeData.labels.map(function (res, index) {
405
407
  return /*#__PURE__*/React.createElement(Tag, {
406
408
  key: index,
407
409
  color: color[index]
408
410
  }, res.labelName);
409
411
  }));
410
- var pointIds = nodeData.labels.map(function (res) {
412
+ var pointIds = nodeData.labels && nodeData.labels.map(function (res) {
411
413
  return res.id;
412
- });
413
- return /*#__PURE__*/React.createElement("div", {
414
+ }) || [];
415
+ var menu = {
416
+ items: [{
417
+ label: '添加子页面',
418
+ icon: /*#__PURE__*/React.createElement(IconFont, {
419
+ type: "tianjia3"
420
+ }),
421
+ key: '0'
422
+ }, {
423
+ label: '上方添加页面',
424
+ icon: /*#__PURE__*/React.createElement(IconFont, {
425
+ type: "shangfangtianjia"
426
+ }),
427
+ key: '1'
428
+ }, {
429
+ label: '下方添加页面',
430
+ icon: /*#__PURE__*/React.createElement(IconFont, {
431
+ type: "xiafangtianjia"
432
+ }),
433
+ key: '2'
434
+ }, {
435
+ label: '选择位置标签',
436
+ icon: /*#__PURE__*/React.createElement(EnvironmentOutlined, null),
437
+ key: '5',
438
+ children: pointList.map(function (res) {
439
+ return {
440
+ key: '5' + res.value,
441
+ label: (/*#__PURE__*/React.createElement(Checkbox, {
442
+ defaultChecked: pointIds.indexOf(res.value) != -1,
443
+ onChange: function onChange(e) {
444
+ onChangeTag(e, nodeData, res);
445
+ },
446
+ onClick: function onClick(e) {
447
+ e.stopPropagation();
448
+ }
449
+ }, res.label)),
450
+ disabled: true
451
+ };
452
+ })
453
+ }, {
454
+ type: 'divider'
455
+ }, {
456
+ label: '重命名',
457
+ icon: /*#__PURE__*/React.createElement(IconFont, {
458
+ type: "bianji1"
459
+ }),
460
+ key: '3'
461
+ }, {
462
+ type: 'divider'
463
+ }, {
464
+ label: '删除',
465
+ icon: /*#__PURE__*/React.createElement(IconFont, {
466
+ type: "shanchu2"
467
+ }),
468
+ key: '4'
469
+ }],
470
+ onClick: function onClick(item) {
471
+ item.domEvent.stopPropagation();
472
+ onItemClick(item.key);
473
+ }
474
+ };
475
+ return /*#__PURE__*/React.createElement(Dropdown, {
476
+ disabled: !authority[1724922805],
477
+ menu: menu,
478
+ overlayStyle: {
479
+ width: 156
480
+ },
481
+ trigger: ['contextMenu']
482
+ }, /*#__PURE__*/React.createElement("div", {
414
483
  className: "".concat(classPrefix, "-tree-item")
415
484
  }, changeNameId === nodeData.id ? (/*#__PURE__*/React.createElement(Input, {
416
485
  style: {
@@ -460,73 +529,36 @@ var pointMap = function pointMap(props) {
460
529
  placement: "topLeft",
461
530
  title: "\u4F4D\u7F6E\u6807\u7B7E",
462
531
  content: pointContent
463
- }, pointContent)))), /*#__PURE__*/React.createElement(Dropdown, {
532
+ }, pointContent)))), /*#__PURE__*/React.createElement("div", {
533
+ className: "".concat(classPrefix, "-tree-item-iconList")
534
+ }, /*#__PURE__*/React.createElement(EditOutlined, {
535
+ onClick: function onClick(e) {
536
+ e.stopPropagation();
537
+ onItemClick('3');
538
+ }
539
+ }), /*#__PURE__*/React.createElement(MinusCircleOutlined, {
540
+ onClick: function onClick(e) {
541
+ e.stopPropagation();
542
+ onItemClick('4');
543
+ }
544
+ }), /*#__PURE__*/React.createElement(PlusCircleOutlined, {
545
+ onClick: function onClick(e) {
546
+ e.stopPropagation();
547
+ onItemClick('2');
548
+ }
549
+ }), /*#__PURE__*/React.createElement(Dropdown, {
464
550
  disabled: !authority[1724922805],
465
- placement: 'bottomRight',
466
- menu: {
467
- items: [{
468
- label: '添加子页面',
469
- icon: /*#__PURE__*/React.createElement(IconFont, {
470
- type: "tianjia3"
471
- }),
472
- key: '0'
473
- }, {
474
- label: '上方添加页面',
475
- icon: /*#__PURE__*/React.createElement(IconFont, {
476
- type: "shangfangtianjia"
477
- }),
478
- key: '1'
479
- }, {
480
- label: '下方添加页面',
481
- icon: /*#__PURE__*/React.createElement(IconFont, {
482
- type: "xiafangtianjia"
483
- }),
484
- key: '2'
485
- }, {
486
- label: '选择位置标签',
487
- icon: /*#__PURE__*/React.createElement(EnvironmentOutlined, null),
488
- key: '5',
489
- children: pointList.map(function (res) {
490
- return {
491
- key: '5' + res.value,
492
- label: (/*#__PURE__*/React.createElement(Checkbox, {
493
- defaultChecked: pointIds.indexOf(res.value) != -1,
494
- onChange: function onChange(e) {
495
- onChangeTag(e, nodeData, res);
496
- }
497
- }, res.label)),
498
- disabled: true
499
- };
500
- })
501
- }, {
502
- type: 'divider'
503
- }, {
504
- label: '重命名',
505
- icon: /*#__PURE__*/React.createElement(IconFont, {
506
- type: "bianji1"
507
- }),
508
- key: '3'
509
- }, {
510
- type: 'divider'
511
- }, {
512
- label: '删除',
513
- icon: /*#__PURE__*/React.createElement(IconFont, {
514
- type: "shanchu2"
515
- }),
516
- key: '4'
517
- }],
518
- onClick: onItemClick
519
- },
551
+ menu: menu,
520
552
  overlayStyle: {
521
553
  width: 156
522
554
  },
523
555
  trigger: ['click']
524
556
  }, /*#__PURE__*/React.createElement(IconFont, {
557
+ type: "gengduocaozuo1",
525
558
  onClick: function onClick(e) {
526
559
  e.stopPropagation();
527
- },
528
- type: "gengduocaozuo1"
529
- })));
560
+ }
561
+ })))));
530
562
  };
531
563
  var onChangeTag = function onChangeTag(e, node, option) {
532
564
  labelRelation(e.target.checked, node, option);
@@ -543,19 +575,20 @@ var pointMap = function pointMap(props) {
543
575
  }
544
576
  }).then(function (res) {
545
577
  if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
546
- getPointTree();
547
- setTimeout(function () {
548
- var labels = [];
578
+ getPointTree(function () {
579
+ var labels = node.labels;
549
580
  if (checked) {
550
- labels = node.labels.push(option);
581
+ labels.push(option);
551
582
  } else {
552
- labels = node.labels.filter(function (res) {
583
+ labels = labels.filter(function (res) {
553
584
  return res.id != option.value;
554
585
  });
555
586
  }
556
587
  node.labels = labels;
557
- props.onChangePage(node);
558
- }, 500);
588
+ props.onChangePage(_objectSpread(_objectSpread({}, node), {}, {
589
+ currentPointVersion: currentPointVersion
590
+ }));
591
+ });
559
592
  }
560
593
  });
561
594
  };
@@ -618,8 +651,8 @@ var pointMap = function pointMap(props) {
618
651
  key: item
619
652
  };
620
653
  }),
621
- onClick: function onClick(_ref2) {
622
- var key = _ref2.key;
654
+ onClick: function onClick(_ref) {
655
+ var key = _ref.key;
623
656
  setIsOpen(false);
624
657
  setValue('');
625
658
  setSelectedKeys(undefined);
@@ -34,7 +34,7 @@ var beforeUpload = function beforeUpload(file) {
34
34
  if (!isLt2M) {
35
35
  message.error('文件不能大于100M');
36
36
  }
37
- return isLt2M;
37
+ return false;
38
38
  };
39
39
  var downloadFile = function downloadFile(resData, name) {
40
40
  var blob = resData.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "2.1.0-zhongyuan.10",
3
+ "version": "2.1.0-zhongyuan.12",
4
4
  "private": false,
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -67,7 +67,7 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "4e42ee7e1cd188c55018cdee01dfa44b62f976a9",
70
+ "gitHead": "c32391a1f6d07acd9021b7c3af800c6728936040",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }