@zgfe/modules-settings 2.1.0-zhongyuan.5 → 2.1.0-zhongyuan.6
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/es/constants/api.d.ts
CHANGED
package/es/constants/api.js
CHANGED
|
@@ -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),
|
|
@@ -123,7 +125,8 @@ var CreateMeta = function CreateMeta(props) {
|
|
|
123
125
|
aliasName: values.aliasName,
|
|
124
126
|
triggeringOccasion: values.triggeringOccasion,
|
|
125
127
|
del: 1,
|
|
126
|
-
eventAttrList: eventAttrList
|
|
128
|
+
eventAttrList: eventAttrList,
|
|
129
|
+
bizTagId: bizTagId
|
|
127
130
|
}, 'create');
|
|
128
131
|
}
|
|
129
132
|
}
|
|
@@ -433,6 +436,8 @@ var CreateMeta = function CreateMeta(props) {
|
|
|
433
436
|
useEffect(function () {
|
|
434
437
|
var _Y = getTableScroll(545, 'dataManageCreateMetaTable');
|
|
435
438
|
setScrollY(_Y);
|
|
439
|
+
getTagList(2);
|
|
440
|
+
getTagList(3);
|
|
436
441
|
}, []);
|
|
437
442
|
var onClose = function onClose() {
|
|
438
443
|
if (isChange) {
|
|
@@ -461,11 +466,58 @@ var CreateMeta = function CreateMeta(props) {
|
|
|
461
466
|
})));
|
|
462
467
|
}
|
|
463
468
|
};
|
|
464
|
-
|
|
465
|
-
var _useState17 = useState(
|
|
469
|
+
//标签列表数据 2:业务标签 3:触发标签
|
|
470
|
+
var _useState17 = useState([]),
|
|
466
471
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
467
|
-
|
|
468
|
-
|
|
472
|
+
bizTag = _useState18[0],
|
|
473
|
+
setBizTag = _useState18[1];
|
|
474
|
+
var _useState19 = useState(),
|
|
475
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
476
|
+
bizTagId = _useState20[0],
|
|
477
|
+
setBizTagId = _useState20[1];
|
|
478
|
+
var _useState21 = useState([]),
|
|
479
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
480
|
+
triTag = _useState22[0],
|
|
481
|
+
setTriTag = _useState22[1];
|
|
482
|
+
var _useState23 = useState(),
|
|
483
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
484
|
+
triTagId = _useState24[0],
|
|
485
|
+
setTriTagId = _useState24[1];
|
|
486
|
+
var getTagList = function getTagList(type) {
|
|
487
|
+
request(apis.dict.getTagList, {
|
|
488
|
+
method: 'post',
|
|
489
|
+
data: {
|
|
490
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
491
|
+
labelType: type
|
|
492
|
+
}
|
|
493
|
+
}).then(function (res) {
|
|
494
|
+
if (res.code == '100000') {
|
|
495
|
+
switch (type) {
|
|
496
|
+
case 2:
|
|
497
|
+
setBizTag(res.data.map(function (res) {
|
|
498
|
+
return {
|
|
499
|
+
label: res.name,
|
|
500
|
+
value: res.id
|
|
501
|
+
};
|
|
502
|
+
}));
|
|
503
|
+
break;
|
|
504
|
+
case 3:
|
|
505
|
+
setTriTag(res.data.map(function (res) {
|
|
506
|
+
return {
|
|
507
|
+
label: res.name,
|
|
508
|
+
value: res.id
|
|
509
|
+
};
|
|
510
|
+
}));
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
};
|
|
516
|
+
// 自定义验证规则
|
|
517
|
+
var _useState25 = useState(''),
|
|
518
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
519
|
+
inputText = _useState26[0],
|
|
520
|
+
setInputText = _useState26[1];
|
|
469
521
|
// true 验证通过
|
|
470
522
|
var validateContainsUnderscore = function validateContainsUnderscore(value) {
|
|
471
523
|
if (!isChange) {
|
|
@@ -567,14 +619,9 @@ var CreateMeta = function CreateMeta(props) {
|
|
|
567
619
|
},
|
|
568
620
|
disabled: homeType == 'update' || homeType == 'get',
|
|
569
621
|
placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u6807\u7B7E",
|
|
570
|
-
options:
|
|
571
|
-
|
|
572
|
-
value
|
|
573
|
-
}, {
|
|
574
|
-
label: '业务标签2',
|
|
575
|
-
value: 'tagJson'
|
|
576
|
-
}],
|
|
577
|
-
onChange: function onChange() {
|
|
622
|
+
options: triTag,
|
|
623
|
+
onChange: function onChange(value) {
|
|
624
|
+
setBizTagId(value);
|
|
578
625
|
setIsChange(true);
|
|
579
626
|
}
|
|
580
627
|
}), "\u6216", /*#__PURE__*/React.createElement(Input, {
|
|
@@ -591,19 +638,13 @@ var CreateMeta = function CreateMeta(props) {
|
|
|
591
638
|
setIsChange(true);
|
|
592
639
|
}
|
|
593
640
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
594
|
-
name: "
|
|
641
|
+
name: "businessLabelId",
|
|
595
642
|
label: "\u4E1A\u52A1\u6807\u7B7E"
|
|
596
643
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
597
644
|
allowClear: true,
|
|
598
645
|
disabled: homeType == 'update' || homeType == 'get',
|
|
599
646
|
placeholder: "\u8BF7\u8F93\u5165\u4E1A\u52A1\u6807\u7B7E",
|
|
600
|
-
options:
|
|
601
|
-
label: '业务标签1',
|
|
602
|
-
value: '111'
|
|
603
|
-
}, {
|
|
604
|
-
label: '业务标签2',
|
|
605
|
-
value: 'tagJson'
|
|
606
|
-
}],
|
|
647
|
+
options: bizTag,
|
|
607
648
|
onChange: function onChange() {
|
|
608
649
|
setIsChange(true);
|
|
609
650
|
}
|
|
@@ -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: "
|
|
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: "
|
|
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 ==
|
|
924
|
+
return res.labelType == 1;
|
|
922
925
|
}).map(function (res) {
|
|
923
926
|
return res.labelName;
|
|
924
927
|
}).join('_') || '';
|
|
@@ -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:
|
|
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) + 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
|
-
|
|
223
|
-
|
|
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
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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, " (
|
|
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(
|
|
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: '
|
|
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,
|
|
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,
|
|
537
|
-
|
|
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.
|
|
3
|
+
"version": "2.1.0-zhongyuan.6",
|
|
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": "
|
|
70
|
+
"gitHead": "d683909a541176c20d6bc50e315559251fa362a3",
|
|
71
71
|
"gitHooks": {
|
|
72
72
|
"pre-commit": "lint-staged"
|
|
73
73
|
}
|