@zgfe/modules-settings 2.1.0-zhongyuan.5 → 2.1.0-zhongyuan.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.
@@ -132,6 +132,8 @@ declare let apis: {
132
132
  tagDownload: string;
133
133
  tagDelete: string;
134
134
  tagTemplate: string;
135
+ addLabelRelation: string;
136
+ delLabelRelation: string;
135
137
  };
136
138
  queryUserByCompanyId: string;
137
139
  flowSave: string;
@@ -160,7 +160,10 @@ var apis = {
160
160
  tagDownload: '/zg/web/v2/eventLabel/download',
161
161
  tagDelete: '/zg/web/v2/eventLabel/delete',
162
162
  //标签模板
163
- tagTemplate: '/zg/web/v2/eventLabel/template'
163
+ tagTemplate: '/zg/web/v2/eventLabel/template',
164
+ //绑定
165
+ addLabelRelation: '/zg/web/v2/eventLabel/addLabelRelation',
166
+ delLabelRelation: '/zg/web/v2/eventLabel/delLabelRelation'
164
167
  },
165
168
  // 查询公司下所有用户
166
169
  queryUserByCompanyId: '/zg/web/v2/user/queryUserByCompanyId',
@@ -23,6 +23,8 @@ import React, { useContext, useEffect, useState } from 'react';
23
23
  import _ from 'lodash';
24
24
  import BizEditText from './editTxt';
25
25
  import './styles/index.less';
26
+ import request from '../../utils/ajax';
27
+ import apis from '../../constants/api';
26
28
  var CreateMeta = function CreateMeta(props) {
27
29
  var classPrefix = 'setting-create-meta-drawer';
28
30
  var _useContext = useContext(BizGlobalDataContext),
@@ -74,8 +76,10 @@ var CreateMeta = function CreateMeta(props) {
74
76
  form.setFieldsValue({
75
77
  aliasName: data.aliasName,
76
78
  eventName: data.eventName,
77
- triggeringOccasion: data.triggeringOccasion
79
+ businessLabelId: data.businessLabelId
78
80
  });
81
+ setTriTagInput(data.triggeringOccasion);
82
+ setTriTagId(data.triggerLabelId);
79
83
  setInputText(data.eventName);
80
84
  if (data.eventAttrList) {
81
85
  setEventAttrList(_toConsumableArray(data.eventAttrList));
@@ -111,7 +115,7 @@ var CreateMeta = function CreateMeta(props) {
111
115
  });
112
116
  return _context.abrupt("return");
113
117
  case 11:
114
- //吧参数传递给主页面
118
+ //把参数传递给主页面
115
119
  if (props.onSubmit) {
116
120
  if (props.data) {
117
121
  props.onSubmit(_objectSpread(_objectSpread({}, props.data), {}, {
@@ -121,9 +125,11 @@ var CreateMeta = function CreateMeta(props) {
121
125
  props.onSubmit({
122
126
  eventName: values.eventName,
123
127
  aliasName: values.aliasName,
124
- triggeringOccasion: values.triggeringOccasion,
128
+ triggeringOccasion: triTagInput,
125
129
  del: 1,
126
- eventAttrList: eventAttrList
130
+ eventAttrList: eventAttrList,
131
+ businessLabelId: values.businessLabelId,
132
+ triggerLabelId: triTagId
127
133
  }, 'create');
128
134
  }
129
135
  }
@@ -433,6 +439,8 @@ var CreateMeta = function CreateMeta(props) {
433
439
  useEffect(function () {
434
440
  var _Y = getTableScroll(545, 'dataManageCreateMetaTable');
435
441
  setScrollY(_Y);
442
+ getTagList(2);
443
+ getTagList(3);
436
444
  }, []);
437
445
  var onClose = function onClose() {
438
446
  if (isChange) {
@@ -461,11 +469,58 @@ var CreateMeta = function CreateMeta(props) {
461
469
  })));
462
470
  }
463
471
  };
464
- // 自定义验证规则
465
- var _useState17 = useState(''),
472
+ //标签列表数据 2:业务标签 3:触发标签
473
+ var _useState17 = useState([]),
466
474
  _useState18 = _slicedToArray(_useState17, 2),
467
- inputText = _useState18[0],
468
- setInputText = _useState18[1];
475
+ bizTag = _useState18[0],
476
+ setBizTag = _useState18[1];
477
+ var _useState19 = useState(),
478
+ _useState20 = _slicedToArray(_useState19, 2),
479
+ triTagInput = _useState20[0],
480
+ setTriTagInput = _useState20[1];
481
+ var _useState21 = useState([]),
482
+ _useState22 = _slicedToArray(_useState21, 2),
483
+ triTag = _useState22[0],
484
+ setTriTag = _useState22[1];
485
+ var _useState23 = useState(),
486
+ _useState24 = _slicedToArray(_useState23, 2),
487
+ triTagId = _useState24[0],
488
+ setTriTagId = _useState24[1];
489
+ var getTagList = function getTagList(type) {
490
+ request(apis.dict.getTagList, {
491
+ method: 'post',
492
+ data: {
493
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
494
+ labelType: type
495
+ }
496
+ }).then(function (res) {
497
+ if (res.code == '100000') {
498
+ switch (type) {
499
+ case 2:
500
+ setBizTag(res.data.map(function (res) {
501
+ return {
502
+ label: res.labelName,
503
+ value: res.id
504
+ };
505
+ }));
506
+ break;
507
+ case 3:
508
+ setTriTag(res.data.map(function (res) {
509
+ return {
510
+ label: res.labelName,
511
+ value: res.id
512
+ };
513
+ }));
514
+ break;
515
+ }
516
+ }
517
+ });
518
+ };
519
+ // 自定义验证规则
520
+ var _useState25 = useState(''),
521
+ _useState26 = _slicedToArray(_useState25, 2),
522
+ inputText = _useState26[0],
523
+ setInputText = _useState26[1];
469
524
  // true 验证通过
470
525
  var validateContainsUnderscore = function validateContainsUnderscore(value) {
471
526
  if (!isChange) {
@@ -502,7 +557,7 @@ var CreateMeta = function CreateMeta(props) {
502
557
  initialValues: {
503
558
  eventName: '',
504
559
  aliasName: '',
505
- triggeringOccasion: '',
560
+ businessLabelId: '',
506
561
  maidianID: []
507
562
  }
508
563
  }, homeType == 'create' && (/*#__PURE__*/React.createElement(Form.Item, {
@@ -567,14 +622,10 @@ var CreateMeta = function CreateMeta(props) {
567
622
  },
568
623
  disabled: homeType == 'update' || homeType == 'get',
569
624
  placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u6807\u7B7E",
570
- options: [{
571
- label: '业务标签1',
572
- value: '111'
573
- }, {
574
- label: '业务标签2',
575
- value: 'tagJson'
576
- }],
577
- onChange: function onChange() {
625
+ defaultValue: triTagId,
626
+ options: triTag,
627
+ onChange: function onChange(value) {
628
+ setTriTagId(value);
578
629
  setIsChange(true);
579
630
  }
580
631
  }), "\u6216", /*#__PURE__*/React.createElement(Input, {
@@ -585,25 +636,21 @@ var CreateMeta = function CreateMeta(props) {
585
636
  marginLeft: '10px'
586
637
  },
587
638
  placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u65F6\u673A\uFF0C\u4F8B\u5982\uFF1A\u7528\u6237\u70B9\u51FB\u786E\u8BA4\u6309\u94AE",
639
+ defaultValue: triTagInput,
588
640
  showCount: true,
589
641
  maxLength: 128,
590
642
  onChange: function onChange(e) {
643
+ setTriTagInput(e.target.value);
591
644
  setIsChange(true);
592
645
  }
593
646
  })), /*#__PURE__*/React.createElement(Form.Item, {
594
- name: "triggeringOccasion1",
647
+ name: "businessLabelId",
595
648
  label: "\u4E1A\u52A1\u6807\u7B7E"
596
649
  }, /*#__PURE__*/React.createElement(Select, {
597
650
  allowClear: true,
598
651
  disabled: homeType == 'update' || homeType == 'get',
599
652
  placeholder: "\u8BF7\u8F93\u5165\u4E1A\u52A1\u6807\u7B7E",
600
- options: [{
601
- label: '业务标签1',
602
- value: '111'
603
- }, {
604
- label: '业务标签2',
605
- value: 'tagJson'
606
- }],
653
+ options: bizTag,
607
654
  onChange: function onChange() {
608
655
  setIsChange(true);
609
656
  }
@@ -217,7 +217,10 @@ var PageInfo = function PageInfo(props) {
217
217
  index: index,
218
218
  approvalStatus: item.approvalStatus,
219
219
  operationType: item.operationType,
220
- isOnline: item.isOnline || 0
220
+ isOnline: item.isOnline || 0,
221
+ businessLabel: item.businessLabel,
222
+ triggerLabel: item.triggerLabel,
223
+ labels: item.labels
221
224
  };
222
225
  }) : []);
223
226
  //计算出当前上线和下线总合数量
@@ -519,17 +522,17 @@ var PageInfo = function PageInfo(props) {
519
522
  }, /*#__PURE__*/React.createElement("span", {
520
523
  className: "".concat(classPrefix, "-content-popoverTag-label")
521
524
  }, "\u4E1A\u52A1\u6807\u7B7E:"), record.businessLabel && /*#__PURE__*/React.createElement(Tag, {
522
- color: "blud"
525
+ color: "blue"
523
526
  }, record.businessLabel.labelName)), /*#__PURE__*/React.createElement("div", {
524
527
  className: "".concat(classPrefix, "-content-popoverTag-item")
525
528
  }, /*#__PURE__*/React.createElement("span", {
526
529
  className: "".concat(classPrefix, "-content-popoverTag-label")
527
530
  }, "\u89E6\u53D1\u6807\u7B7E:"), record.triggerLabel && /*#__PURE__*/React.createElement(Tag, {
528
- color: "blud"
531
+ color: "orange"
529
532
  }, record.triggerLabel.labelName)));
530
533
  return /*#__PURE__*/React.createElement(Popover, {
531
534
  content: content,
532
- title: eventName || ''
535
+ title: sliceName(eventName) || ''
533
536
  }, /*#__PURE__*/React.createElement("a", {
534
537
  onClick: function onClick() {
535
538
  if (!isSelect) {
@@ -918,7 +921,7 @@ var PageInfo = function PageInfo(props) {
918
921
  var sliceName = function sliceName(record) {
919
922
  var _record$businessLabel, _record$triggerLabel;
920
923
  var point = record.labels && record.labels.filter(function (res) {
921
- return res.labelType == 2;
924
+ return res.labelType == 1;
922
925
  }).map(function (res) {
923
926
  return res.labelName;
924
927
  }).join('_') || '';
@@ -1188,6 +1191,7 @@ var PageInfo = function PageInfo(props) {
1188
1191
  isEdit: true,
1189
1192
  onSubmit: function onSubmit(event, type) {
1190
1193
  setCreateMetaShow(false);
1194
+ console.log(event, '事件内容');
1191
1195
  onEventSet(event, type);
1192
1196
  },
1193
1197
  // selectTreeName={props.selectTreeName}
@@ -1,157 +1,161 @@
1
- .setting-point-map {
2
- display: flex;
3
- flex-direction: row;
4
- gap: 16px;
5
- width: 100%;
6
- height: 100%;
7
- padding: 16px;
8
- background-color: #fafafb;
9
- &-left {
10
- position: relative;
11
- min-width: 350px;
12
- max-width: 600px;
13
- &-drag {
14
- position: absolute;
15
- top: 0;
16
- right: 0;
17
- width: 6px;
18
- height: 100%;
19
- border-right: 2px solid transparent;
20
- cursor: ew-resize;
21
- }
22
- }
23
- &-right {
24
- flex: 1;
25
- overflow: hidden;
26
- }
27
- .setting-point-map-page-content-img-select {
28
- position: relative;
29
- }
30
- .ant-image {
31
- position: static;
32
- }
33
- .ant-image .ant-image-mask {
34
- color: #fff;
35
- font-size: 24px;
36
- background: rgba(2, 20, 41, 0.5) !important;
37
- }
38
- &-addListBtn {
39
- display: flex;
40
- align-items: center;
41
- justify-content: space-between;
42
- }
43
- }
44
-
45
- .setting-create-meta-drawer {
46
- .set:hover {
47
- color: #ff4d4f;
48
- }
49
- &-content {
50
- display: flex;
51
- flex: 1;
52
- flex-direction: column;
53
- gap: 24px;
54
- &-select {
55
- display: flex;
56
- align-items: center;
57
- justify-content: right;
58
- margin-right: -12px;
59
- margin-left: -16px;
60
- }
61
- .ant-table-thead > tr > th {
62
- color: var(--io-N-, #021429);
63
- font-weight: 400;
64
- font-size: 14px;
65
- font-family: 'PingFang SC';
66
- font-style: normal;
67
- line-height: normal;
68
- }
69
- }
70
- &-table {
71
- margin: 20px 0px;
72
- overflow: hidden;
73
- border-radius: 8px;
74
- }
75
-
76
- &-info {
77
- display: flex;
78
- flex-direction: row;
79
- gap: 12px;
80
- align-items: center;
81
- height: 32px;
82
- &-title {
83
- display: flex;
84
- flex-direction: row;
85
- gap: 4px;
86
- justify-content: flex-end;
87
- width: 68px;
88
- color: var(--io-N6-, #67727f);
89
- font-weight: 400;
90
- font-size: 14px;
91
- font-family: 'PingFang SC';
92
- font-style: normal;
93
- line-height: 32px;
94
- line-height: normal;
95
- text-align: right;
96
- }
97
- &-input {
98
- position: relative;
99
- flex: 1;
100
- .button:not(.disabled):not(.ant-btn-primary) {
101
- float: right;
102
- padding: 0 16px;
103
- color: #1454e5;
104
- border: 1px solid #1454e5;
105
- }
106
- &-num {
107
- position: absolute;
108
- top: 6px;
109
- right: 12px;
110
- color: var(--io-N4-, #9aa1a9);
111
- font-weight: 400;
112
- font-size: 14px;
113
- font-family: 'PingFang SC';
114
- font-style: normal;
115
- line-height: 20px;
116
- }
117
- }
118
- }
119
-
120
- &-footer {
121
- display: flex;
122
- gap: 16px;
123
- align-items: center;
124
- justify-content: flex-end;
125
- margin: 0 -24px -24px;
126
- padding: 18px 24px 18px 0px;
127
- background: #fff;
128
- border-top: 1px solid var(--io-N1-, #e6e7ea);
129
- }
130
- .ant-drawer-content-wrapper {
131
- overflow-x: hidden;
132
- }
133
- .ant-drawer-content,
134
- .ant-drawer-wrapper-body {
135
- overflow: hidden !important;
136
- }
137
- .ant-drawer-body {
138
- display: flex;
139
- flex-direction: column;
140
- }
141
- .ant-drawer-title {
142
- span {
143
- margin-left: 8px;
144
- color: #9aa1a9;
145
- font-size: 12px;
146
- }
147
- }
148
- .ant-drawer-close {
149
- display: none;
150
- }
151
- .ant-drawer-extra {
152
- .qingchu {
153
- font-size: 20px !important;
154
- cursor: pointer;
155
- }
156
- }
157
- }
1
+ .setting-point-map {
2
+ display: flex;
3
+ flex-direction: row;
4
+ gap: 16px;
5
+ width: 100%;
6
+ height: 100%;
7
+ padding: 16px;
8
+ background-color: #fafafb;
9
+ &-left {
10
+ position: relative;
11
+ min-width: 350px;
12
+ max-width: 600px;
13
+ &-drag {
14
+ position: absolute;
15
+ top: 0;
16
+ right: 0;
17
+ width: 6px;
18
+ height: 100%;
19
+ border-right: 2px solid transparent;
20
+ cursor: ew-resize;
21
+ }
22
+ }
23
+ &-right {
24
+ flex: 1;
25
+ overflow: hidden;
26
+ }
27
+ .setting-point-map-page-content-img-select {
28
+ position: relative;
29
+ }
30
+ .ant-image {
31
+ position: static;
32
+ }
33
+ .ant-image .ant-image-mask {
34
+ color: #fff;
35
+ font-size: 24px;
36
+ background: rgba(2, 20, 41, 0.5) !important;
37
+ }
38
+ &-addListBtn {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: space-between;
42
+ }
43
+ }
44
+
45
+ .setting-create-meta-drawer {
46
+ .set:hover {
47
+ color: #ff4d4f;
48
+ }
49
+ &-content {
50
+ display: flex;
51
+ flex: 1;
52
+ flex-direction: column;
53
+ gap: 24px;
54
+ &-select {
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: right;
58
+ margin-right: -12px;
59
+ margin-left: -16px;
60
+ }
61
+ .ant-table-thead > tr > th {
62
+ color: var(--io-N-, #021429);
63
+ font-weight: 400;
64
+ font-size: 14px;
65
+ font-family: 'PingFang SC';
66
+ font-style: normal;
67
+ line-height: normal;
68
+ }
69
+ }
70
+ &-table {
71
+ margin: 20px 0px;
72
+ overflow: hidden;
73
+ border-radius: 8px;
74
+ }
75
+
76
+ &-info {
77
+ display: flex;
78
+ flex-direction: row;
79
+ gap: 12px;
80
+ align-items: center;
81
+ height: 32px;
82
+ &-title {
83
+ display: flex;
84
+ flex-direction: row;
85
+ gap: 4px;
86
+ justify-content: flex-end;
87
+ width: 68px;
88
+ color: var(--io-N6-, #67727f);
89
+ font-weight: 400;
90
+ font-size: 14px;
91
+ font-family: 'PingFang SC';
92
+ font-style: normal;
93
+ line-height: 32px;
94
+ line-height: normal;
95
+ text-align: right;
96
+ }
97
+ &-input {
98
+ position: relative;
99
+ flex: 1;
100
+ .button:not(.disabled):not(.ant-btn-primary) {
101
+ float: right;
102
+ padding: 0 16px;
103
+ color: #1454e5;
104
+ border: 1px solid #1454e5;
105
+ }
106
+ &-num {
107
+ position: absolute;
108
+ top: 6px;
109
+ right: 12px;
110
+ color: var(--io-N4-, #9aa1a9);
111
+ font-weight: 400;
112
+ font-size: 14px;
113
+ font-family: 'PingFang SC';
114
+ font-style: normal;
115
+ line-height: 20px;
116
+ }
117
+ }
118
+ }
119
+
120
+ &-footer {
121
+ display: flex;
122
+ gap: 16px;
123
+ align-items: center;
124
+ justify-content: flex-end;
125
+ margin: 0 -24px -24px;
126
+ padding: 18px 24px 18px 0px;
127
+ background: #fff;
128
+ border-top: 1px solid var(--io-N1-, #e6e7ea);
129
+ }
130
+ .ant-drawer-content-wrapper {
131
+ overflow-x: hidden;
132
+ }
133
+ .ant-drawer-content,
134
+ .ant-drawer-wrapper-body {
135
+ overflow: hidden !important;
136
+ }
137
+ .ant-drawer-body {
138
+ display: flex;
139
+ flex-direction: column;
140
+ }
141
+ .ant-drawer-title {
142
+ span {
143
+ margin-left: 8px;
144
+ color: #9aa1a9;
145
+ font-size: 12px;
146
+ }
147
+ }
148
+ .ant-drawer-close {
149
+ display: none;
150
+ }
151
+ .ant-drawer-extra {
152
+ .qingchu {
153
+ font-size: 20px !important;
154
+ cursor: pointer;
155
+ }
156
+ }
157
+ .ant-form-item-control-input-content {
158
+ display: flex;
159
+ align-items: center;
160
+ }
161
+ }
@@ -58,7 +58,9 @@ var formatTreeArr = function formatTreeArr(list, arrTemp, parentName) {
58
58
  arrTemp.push({
59
59
  id: item.id,
60
60
  name: parentName ? parentName + ' / ' + item.name : item.name,
61
- tagJson: '字典标签1'
61
+ tagJson: item.labels.map(function (res) {
62
+ return res.labelName;
63
+ }).join('')
62
64
  });
63
65
  if (item.children.length > 0) {
64
66
  formatTreeArr(item.children, arrTemp, item.name);
@@ -199,7 +201,7 @@ var pointMap = function pointMap(props) {
199
201
  }
200
202
  }).then(function (res) {
201
203
  if (res && res.code === '100000') {
202
- pageNum = res === null || res === void 0 ? void 0 : res.data.length;
204
+ pageNum = ((res === null || res === void 0 ? void 0 : res.data.length) || 0) + 1;
203
205
  setTreeData(formatTreeData((res === null || res === void 0 ? void 0 : res.data) || []));
204
206
  setTreeArr(formatTreeArr((res === null || res === void 0 ? void 0 : res.data) || [], [], '') || []);
205
207
  if (!selectedKeys) {
@@ -219,8 +221,11 @@ var pointMap = function pointMap(props) {
219
221
  //查询位置标签
220
222
  var getPointList = function getPointList() {
221
223
  request(apis.dict.getTagList, {
222
- labelType: 1,
223
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
224
+ method: 'post',
225
+ data: {
226
+ labelType: 1,
227
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
228
+ }
224
229
  }).then(function (res) {
225
230
  if (res.code == 100000) {
226
231
  setPointList(res.data.map(function (res) {
@@ -364,6 +369,7 @@ var pointMap = function pointMap(props) {
364
369
  var titleRender = function titleRender(nodeData) {
365
370
  var onItemClick = function onItemClick(_ref) {
366
371
  var key = _ref.key;
372
+ console.log(key, 'key');
367
373
  switch (key) {
368
374
  case '0':
369
375
  if (nodeData.storey >= 20) {
@@ -395,17 +401,16 @@ var pointMap = function pointMap(props) {
395
401
  // message.info(`Click on item ${key}`);
396
402
  };
397
403
  //位置标签list
398
- var pointContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, {
399
- color: "magenta"
400
- }, "magenta"), /*#__PURE__*/React.createElement(Tag, {
401
- color: "red"
402
- }, "red"), /*#__PURE__*/React.createElement(Tag, {
403
- color: "volcano"
404
- }, "volcano"), /*#__PURE__*/React.createElement(Tag, {
405
- color: "orange"
406
- }, "orange"), /*#__PURE__*/React.createElement(Tag, {
407
- color: "gold"
408
- }, "gold"));
404
+ var color = ['magenta', 'red', 'volcano', 'orange', 'gold', 'lime', 'green', 'cyan', 'blue', 'geekblue', 'purple'];
405
+ var pointContent = /*#__PURE__*/React.createElement(React.Fragment, null, nodeData.labels.map(function (res, index) {
406
+ return /*#__PURE__*/React.createElement(Tag, {
407
+ key: index,
408
+ color: color[index]
409
+ }, res.labelName);
410
+ }));
411
+ var pointIds = nodeData.labels.map(function (res) {
412
+ return res.id;
413
+ });
409
414
  return /*#__PURE__*/React.createElement("div", {
410
415
  className: "".concat(classPrefix, "-tree-item")
411
416
  }, changeNameId === nodeData.id ? (/*#__PURE__*/React.createElement(Input, {
@@ -452,21 +457,11 @@ var pointMap = function pointMap(props) {
452
457
  }
453
458
  }, /*#__PURE__*/React.createElement("span", {
454
459
  className: "".concat(classPrefix, "-tree-item-title-name")
455
- }, nodeData.name, " (1) "), /*#__PURE__*/React.createElement(Popover, {
460
+ }, nodeData.name, " ", nodeData.pointSum ? "(".concat(nodeData.pointSum, ")") : ''), /*#__PURE__*/React.createElement(Popover, {
456
461
  placement: "topLeft",
457
462
  title: "\u4F4D\u7F6E\u6807\u7B7E",
458
463
  content: pointContent
459
- }, /*#__PURE__*/React.createElement(Tag, {
460
- color: "magenta"
461
- }, "magenta"), /*#__PURE__*/React.createElement(Tag, {
462
- color: "red"
463
- }, "red"), /*#__PURE__*/React.createElement(Tag, {
464
- color: "volcano"
465
- }, "volcano"), /*#__PURE__*/React.createElement(Tag, {
466
- color: "orange"
467
- }, "orange"), /*#__PURE__*/React.createElement(Tag, {
468
- color: "gold"
469
- }, "gold"))))), /*#__PURE__*/React.createElement(Dropdown, {
464
+ }, pointContent)))), /*#__PURE__*/React.createElement(Dropdown, {
470
465
  disabled: !authority[1724922805],
471
466
  placement: 'bottomRight',
472
467
  menu: {
@@ -494,10 +489,11 @@ var pointMap = function pointMap(props) {
494
489
  key: '5',
495
490
  children: pointList.map(function (res) {
496
491
  return {
497
- key: '3' + res.value,
492
+ key: '5' + res.value,
498
493
  label: (/*#__PURE__*/React.createElement(Checkbox, {
494
+ defaultChecked: pointIds.indexOf(res.value) != -1,
499
495
  onChange: function onChange(e) {
500
- onChangeTag(e, 'key');
496
+ onChangeTag(e, nodeData.id, res.value);
501
497
  }
502
498
  }, res.label)),
503
499
  disabled: true
@@ -533,8 +529,24 @@ var pointMap = function pointMap(props) {
533
529
  type: "gengduocaozuo1"
534
530
  })));
535
531
  };
536
- var onChangeTag = function onChangeTag(e, key) {
537
- console.log(e, key, 'onChangeTag');
532
+ var onChangeTag = function onChangeTag(e, nodeId, value) {
533
+ labelRelation(e.target.checked, nodeId, value);
534
+ };
535
+ //绑定和解绑标签
536
+ var labelRelation = function labelRelation(checked, nodeId, tagId) {
537
+ request(checked ? apis.dict.addLabelRelation : apis.dict.delLabelRelation, {
538
+ method: 'post',
539
+ data: {
540
+ id: tagId,
541
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
542
+ labelType: 1,
543
+ eventId: nodeId
544
+ }
545
+ }).then(function (res) {
546
+ if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
547
+ getPointTree();
548
+ }
549
+ });
538
550
  };
539
551
  var _useState37 = useState(false),
540
552
  _useState38 = _slicedToArray(_useState37, 2),
@@ -660,6 +672,7 @@ var pointMap = function pointMap(props) {
660
672
  }],
661
673
  onChange: function onChange(value) {
662
674
  setSearchType(value);
675
+ setValue(undefined);
663
676
  }
664
677
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
665
678
  value: value,
@@ -676,6 +689,7 @@ var pointMap = function pointMap(props) {
676
689
  value: 'id',
677
690
  label: 'name'
678
691
  },
692
+ allowClear: true,
679
693
  options: treeArr,
680
694
  popupClassName: "".concat(classPrefix, "-search-popup")
681
695
  })), /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "2.1.0-zhongyuan.5",
3
+ "version": "2.1.0-zhongyuan.7",
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": "15555af56920d4842b4bd5fc7c416585b975e9df",
70
+ "gitHead": "47cbe999df717a272a641007018239d5b7270922",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }