@zgfe/modules-settings 2.0.0-zhongyuan.25 → 2.0.0-zhongyuan.26

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.
@@ -17,17 +17,15 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
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
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19
19
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
20
- import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
20
+ import { BizGlobalDataContext, IconFont, BizDialog, BizSelect } from '@zgfe/business-lib';
21
21
  import { Input, Button,
22
22
  // Select,
23
- Table, message,
24
- // Modal,
25
- Upload,
23
+ Table, message, Modal, Upload,
26
24
  // Popover,
27
- DatePicker, Empty } from 'antd';
25
+ DatePicker, Empty, notification } from 'antd';
28
26
  import React, { useEffect, useState, useContext } from 'react';
29
27
  import './styles/index.less';
30
- import { columnsEvent } from './constants';
28
+ import { columnsEvent, demandTabList } from './constants';
31
29
  import ProcessCanvas from './../../components/processCanvas';
32
30
  import request from '../../utils/ajax';
33
31
  import apis from '../../constants/api';
@@ -44,6 +42,7 @@ var getImgUrl = function getImgUrl(src, pageId) {
44
42
  // : `${'https://test01.zhugeapi.com'}/web/img/report/${pageId}/${src}`;
45
43
  };
46
44
  var CreateDemand = function CreateDemand(props) {
45
+ var _props$data, _props$data3, _props$data4, _props$data5, _props$data6;
47
46
  var classPrefix = 'system-setting-create-demand';
48
47
  var _useContext = useContext(BizGlobalDataContext),
49
48
  currentApp = _useContext.currentApp,
@@ -53,89 +52,145 @@ var CreateDemand = function CreateDemand(props) {
53
52
  router = _useContext.router;
54
53
  // 属性列表加载中
55
54
  // const [loading, setLoading] = useState(true);
56
- var _useState = useState(0),
55
+ var _useState = useState([]),
57
56
  _useState2 = _slicedToArray(_useState, 2),
58
- tabIndex = _useState2[0],
59
- setTabIndex = _useState2[1];
60
- var _useState3 = useState([]),
57
+ nodeData = _useState2[0],
58
+ setNodeData = _useState2[1];
59
+ var _useState3 = useState(''),
61
60
  _useState4 = _slicedToArray(_useState3, 2),
62
- nodeData = _useState4[0],
63
- setNodeData = _useState4[1];
64
- var _useState5 = useState(''),
61
+ demandName = _useState4[0],
62
+ setDemandName = _useState4[1];
63
+ var _useState5 = useState(moment()),
65
64
  _useState6 = _slicedToArray(_useState5, 2),
66
- demandName = _useState6[0],
67
- setDemandName = _useState6[1];
68
- var _useState7 = useState(moment()),
65
+ completionTime = _useState6[0],
66
+ setCompletionTime = _useState6[1];
67
+ var _useState7 = useState(''),
69
68
  _useState8 = _slicedToArray(_useState7, 2),
70
- completionTime = _useState8[0],
71
- setCompletionTime = _useState8[1];
69
+ demandDescribe = _useState8[0],
70
+ setDemandDescribe = _useState8[1];
72
71
  var _useState9 = useState(''),
73
72
  _useState10 = _slicedToArray(_useState9, 2),
74
- demandDescribe = _useState10[0],
75
- setDemandDescribe = _useState10[1];
73
+ eventKey = _useState10[0],
74
+ setEventKey = _useState10[1];
76
75
  var _useState11 = useState(''),
77
76
  _useState12 = _slicedToArray(_useState11, 2),
78
- eventKey = _useState12[0],
79
- setEventKey = _useState12[1];
80
- var _useState13 = useState(''),
77
+ attrKey = _useState12[0],
78
+ setAttrKey = _useState12[1];
79
+ var _useState13 = useState(),
81
80
  _useState14 = _slicedToArray(_useState13, 2),
82
- attrKey = _useState14[0],
83
- setAttrKey = _useState14[1];
81
+ demandFile = _useState14[0],
82
+ setDemandFile = _useState14[1];
84
83
  var _useState15 = useState(),
85
84
  _useState16 = _slicedToArray(_useState15, 2),
86
- demandFile = _useState16[0],
87
- setDemandFile = _useState16[1];
88
- var _useState17 = useState(),
85
+ pointEventInfo = _useState16[0],
86
+ setPointEventInfo = _useState16[1];
87
+ var _useState17 = useState(false),
89
88
  _useState18 = _slicedToArray(_useState17, 2),
90
- pointEventInfo = _useState18[0],
91
- setPointEventInfo = _useState18[1];
89
+ isHandle = _useState18[0],
90
+ setIsHandle = _useState18[1];
92
91
  var _useState19 = useState(false),
93
92
  _useState20 = _slicedToArray(_useState19, 2),
94
- isHandle = _useState20[0],
95
- setIsHandle = _useState20[1];
93
+ isWithdraw = _useState20[0],
94
+ setIsWithdraw = _useState20[1];
96
95
  var _useState21 = useState(false),
97
96
  _useState22 = _slicedToArray(_useState21, 2),
98
- isWithdraw = _useState22[0],
99
- setIsWithdraw = _useState22[1];
100
- var _useState23 = useState(false),
97
+ eventAttrListShow = _useState22[0],
98
+ setEventAttrListShow = _useState22[1];
99
+ var _useState23 = useState(void 0),
101
100
  _useState24 = _slicedToArray(_useState23, 2),
102
- eventAttrListShow = _useState24[0],
103
- setEventAttrListShow = _useState24[1];
104
- var _useState25 = useState(void 0),
101
+ currentNodenumber = _useState24[0],
102
+ setCurrentNodenumber = _useState24[1];
103
+ var _useState25 = useState(),
105
104
  _useState26 = _slicedToArray(_useState25, 2),
106
- currentNodenumber = _useState26[0],
107
- setCurrentNodenumber = _useState26[1];
108
- var _useState27 = useState(),
105
+ eventProp = _useState26[0],
106
+ setEventProp = _useState26[1];
107
+ var _useState27 = useState(0),
109
108
  _useState28 = _slicedToArray(_useState27, 2),
110
- eventProp = _useState28[0],
111
- setEventProp = _useState28[1];
112
- var _useState29 = useState(0),
109
+ propType = _useState28[0],
110
+ setPropType = _useState28[1];
111
+ var _useState29 = useState(-1),
113
112
  _useState30 = _slicedToArray(_useState29, 2),
114
- propType = _useState30[0],
115
- setPropType = _useState30[1];
116
- var _useState31 = useState(-1),
117
- _useState32 = _slicedToArray(_useState31, 2),
118
- encryptionType = _useState32[0],
119
- setEncryptionType = _useState32[1];
120
- var _useState33 = useState(props.isRead),
121
- _useState34 = _slicedToArray(_useState33, 1),
122
- isRead = _useState34[0];
113
+ encryptionType = _useState30[0],
114
+ setEncryptionType = _useState30[1];
115
+ var _useState31 = useState(props.isRead),
116
+ _useState32 = _slicedToArray(_useState31, 1),
117
+ isRead = _useState32[0];
118
+ var _useState33 = useState(false),
119
+ _useState34 = _slicedToArray(_useState33, 2),
120
+ isShowBackConfirm = _useState34[0],
121
+ setIsShowBackConfirm = _useState34[1];
123
122
  var _useState35 = useState(false),
124
123
  _useState36 = _slicedToArray(_useState35, 2),
125
- isShowBackConfirm = _useState36[0],
126
- setIsShowBackConfirm = _useState36[1];
127
- var _useState37 = useState(false),
124
+ isEdit = _useState36[0],
125
+ setIsEdit = _useState36[1];
126
+ var _useState37 = useState(),
128
127
  _useState38 = _slicedToArray(_useState37, 2),
129
- isEdit = _useState38[0],
130
- setIsEdit = _useState38[1];
128
+ processingNode = _useState38[0],
129
+ setProcessingNode = _useState38[1];
131
130
  var _useState39 = useState(),
132
131
  _useState40 = _slicedToArray(_useState39, 2),
133
- processingNode = _useState40[0],
134
- setProcessingNode = _useState40[1];
135
- var _useState41 = useState(),
136
- _useState42 = _slicedToArray(_useState41, 2),
137
- demandData = _useState42[0],
138
- setDemandData = _useState42[1];
132
+ demandData = _useState40[0],
133
+ setDemandData = _useState40[1];
134
+ var _useState41 = useState(((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.demand.demandStatus) || 0),
135
+ _useState42 = _slicedToArray(_useState41, 1),
136
+ demandStatus = _useState42[0];
137
+ //埋点列表选择key
138
+ var _useState43 = useState([]),
139
+ _useState44 = _slicedToArray(_useState43, 2),
140
+ selectedRowKeys = _useState44[0],
141
+ setSelectedRowKeys = _useState44[1];
142
+ //公司用户列表
143
+ var _useState45 = useState([]),
144
+ _useState46 = _slicedToArray(_useState45, 2),
145
+ userList = _useState46[0],
146
+ setUserList = _useState46[1];
147
+ var _useState47 = useState(false),
148
+ _useState48 = _slicedToArray(_useState47, 2),
149
+ showUser = _useState48[0],
150
+ setShowUser = _useState48[1];
151
+ var _useState49 = useState({}),
152
+ _useState50 = _slicedToArray(_useState49, 2),
153
+ userSelect = _useState50[0],
154
+ setUserSelect = _useState50[1];
155
+ var _useState51 = useState(''),
156
+ _useState52 = _slicedToArray(_useState51, 2),
157
+ userSelectType = _useState52[0],
158
+ setUserSelectType = _useState52[1];
159
+ //评论参数列表
160
+ var _useState53 = useState('comment'),
161
+ _useState54 = _slicedToArray(_useState53, 2),
162
+ tabKey = _useState54[0],
163
+ setTabKey = _useState54[1];
164
+ var _useState55 = useState([]),
165
+ _useState56 = _slicedToArray(_useState55, 2),
166
+ comments = _useState56[0],
167
+ setComments = _useState56[1];
168
+ var _useState57 = useState(''),
169
+ _useState58 = _slicedToArray(_useState57, 2),
170
+ commentText = _useState58[0],
171
+ setCommentText = _useState58[1];
172
+ var _useState59 = useState([]),
173
+ _useState60 = _slicedToArray(_useState59, 2),
174
+ operateList = _useState60[0],
175
+ setOperateList = _useState60[1];
176
+ var _useState61 = useState(false),
177
+ _useState62 = _slicedToArray(_useState61, 2),
178
+ showComment = _useState62[0],
179
+ setShowComment = _useState62[1];
180
+ //上线时间
181
+ var _useState63 = useState(false),
182
+ _useState64 = _slicedToArray(_useState63, 2),
183
+ showOnlineTime = _useState64[0],
184
+ setShowOnlineTime = _useState64[1];
185
+ var _useState65 = useState(),
186
+ _useState66 = _slicedToArray(_useState65, 2),
187
+ onlineTime = _useState66[0],
188
+ setOnlineTime = _useState66[1];
189
+ //设置时间
190
+ var _useState67 = useState(1),
191
+ _useState68 = _slicedToArray(_useState67, 2),
192
+ tabIndex = _useState68[0],
193
+ setTabIndex = _useState68[1];
139
194
  useEffect(function () {
140
195
  if (props.demandId) {
141
196
  getDemand();
@@ -143,10 +198,10 @@ var CreateDemand = function CreateDemand(props) {
143
198
  getNode();
144
199
  }
145
200
  }, [props.demandId]);
146
- var _useState43 = useState(false),
147
- _useState44 = _slicedToArray(_useState43, 2),
148
- isControl = _useState44[0],
149
- setIsControl = _useState44[1];
201
+ var _useState69 = useState(false),
202
+ _useState70 = _slicedToArray(_useState69, 2),
203
+ isControl = _useState70[0],
204
+ setIsControl = _useState70[1];
150
205
  var getAppAutoEvent = function getAppAutoEvent() {
151
206
  request(apis.getAppAutoEvent, {
152
207
  method: 'post',
@@ -179,6 +234,15 @@ var CreateDemand = function CreateDemand(props) {
179
234
  }) : []);
180
235
  }
181
236
  getAppAutoEvent();
237
+ //0为无状态及创建
238
+ if (demandStatus > 0) {
239
+ //获取当前评论
240
+ getComments();
241
+ //获取历史记录
242
+ getOperateList();
243
+ //获取公司列表
244
+ getUserList();
245
+ }
182
246
  }, []);
183
247
  // useEffect(() => {
184
248
  // setIsEdit(true);
@@ -283,6 +347,7 @@ var CreateDemand = function CreateDemand(props) {
283
347
  }
284
348
  };
285
349
  var onCreate = function onCreate() {
350
+ var back = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
286
351
  if (!demandName) {
287
352
  message.warning('请填写需求名称');
288
353
  return;
@@ -305,12 +370,15 @@ var CreateDemand = function CreateDemand(props) {
305
370
  completionTime: completionTime * 1,
306
371
  pointEventIds: pointEventInfo === null || pointEventInfo === void 0 ? void 0 : pointEventInfo.map(function (item) {
307
372
  return item.id;
308
- })
373
+ }),
374
+ onlineTime: onlineTime
309
375
  })
310
376
  }).then(function (res) {
311
377
  if ((res === null || res === void 0 ? void 0 : res.code) === '100000') {
312
- message.success('保存成功');
313
- props.onBack && props.onBack();
378
+ if (back) {
379
+ message.success('保存成功');
380
+ props.onBack && props.onBack();
381
+ }
314
382
  // props.onSubmit && props.onSubmit()
315
383
  } else {
316
384
  message.error('保存失败');
@@ -344,23 +412,6 @@ var CreateDemand = function CreateDemand(props) {
344
412
  a.click();
345
413
  });
346
414
  };
347
- var submitDemand = function submitDemand(approveStatus) {
348
- request(apis.submitApproval, {
349
- method: 'post',
350
- data: {
351
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
352
- id: props.demandId,
353
- approveStatus: approveStatus
354
- }
355
- }).then(function (res) {
356
- if (res && res.code === '100000') {
357
- message.success('操作成功');
358
- getDemand();
359
- }
360
- }).catch(function (err) {
361
- console.log(err);
362
- });
363
- };
364
415
  var gotoPage = function gotoPage(type, data) {
365
416
  // console.log('data', data);
366
417
  switch (type) {
@@ -564,6 +615,279 @@ var CreateDemand = function CreateDemand(props) {
564
615
  props.onDemand && props.onDemand(type, demandData);
565
616
  }
566
617
  };
618
+ //埋点状态样式
619
+ //status 0 待开始 1 完成 2 失败
620
+ var statusDiv = function statusDiv(status) {
621
+ //设计中
622
+ if (demandStatus == 2) {
623
+ if (status == 0) {
624
+ return /*#__PURE__*/React.createElement("div", {
625
+ style: {
626
+ color: '#fda145'
627
+ }
628
+ }, "\u5F85\u8BBE\u8BA1");
629
+ } else {
630
+ return /*#__PURE__*/React.createElement("div", {
631
+ style: {
632
+ color: '#2cbe54'
633
+ }
634
+ }, "\u8BBE\u8BA1\u5B8C\u6210");
635
+ }
636
+ } else if (demandStatus == 3 || demandStatus == 4) {
637
+ if (status == 0) {
638
+ return /*#__PURE__*/React.createElement("div", {
639
+ style: {
640
+ color: '#fda145'
641
+ }
642
+ }, "\u5F85\u5BA1\u6838");
643
+ } else if (status == 1) {
644
+ return /*#__PURE__*/React.createElement("div", {
645
+ style: {
646
+ color: '#2cbe54'
647
+ }
648
+ }, "\u5BA1\u6838\u901A\u8FC7");
649
+ } else {
650
+ return /*#__PURE__*/React.createElement("div", {
651
+ style: {
652
+ color: '#fb5547'
653
+ }
654
+ }, "\u5BA1\u6838\u672A\u901A\u8FC7");
655
+ }
656
+ } else if (demandStatus == 5) {
657
+ if (status == 0) {
658
+ return /*#__PURE__*/React.createElement("div", {
659
+ style: {
660
+ color: '#fda145'
661
+ }
662
+ }, "\u5F00\u53D1\u4E2D");
663
+ } else {
664
+ return /*#__PURE__*/React.createElement("div", {
665
+ style: {
666
+ color: '#2cbe54'
667
+ }
668
+ }, "\u5F00\u53D1\u5B8C\u6210");
669
+ }
670
+ } else if (demandStatus == 6) {
671
+ if (status == 0) {
672
+ return /*#__PURE__*/React.createElement("div", {
673
+ style: {
674
+ color: '#fda145'
675
+ }
676
+ }, "\u6D4B\u8BD5\u4E2D");
677
+ } else {
678
+ return /*#__PURE__*/React.createElement("div", {
679
+ style: {
680
+ color: '#2cbe54'
681
+ }
682
+ }, "\u6D4B\u8BD5\u5B8C\u6210");
683
+ }
684
+ } else if (demandStatus == 101) {
685
+ if (status == 0) {
686
+ return /*#__PURE__*/React.createElement("div", {
687
+ style: {
688
+ color: '#fda145'
689
+ }
690
+ }, "\u672A\u4E0A\u7EBF");
691
+ } else {
692
+ return /*#__PURE__*/React.createElement("div", {
693
+ style: {
694
+ color: '#2cbe54'
695
+ }
696
+ }, "\u5DF2\u4E0A\u7EBF");
697
+ }
698
+ } else if (demandStatus == 102) {
699
+ if (status == 0) {
700
+ return /*#__PURE__*/React.createElement("div", {
701
+ style: {
702
+ color: '#fb5547'
703
+ }
704
+ }, "\u9700\u6C42\u5173\u95ED");
705
+ }
706
+ }
707
+ };
708
+ // 新的埋点表格列表
709
+ var newColumns = function newColumns() {
710
+ //埋点列表label数据
711
+ return [].concat(_toConsumableArray(columnsEvent(gotoPage, isControl)), [{
712
+ title: '状态',
713
+ width: 120,
714
+ dataIndex: 'status',
715
+ render: function render(status) {
716
+ return statusDiv(status);
717
+ }
718
+ }]);
719
+ };
720
+ //埋点需求列表选择
721
+ var onSelectChange = function onSelectChange(val) {
722
+ setSelectedRowKeys(val);
723
+ };
724
+ //获取评论
725
+ var getComments = function getComments() {
726
+ request(apis.setting.getComments, {
727
+ method: 'POST',
728
+ data: {
729
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
730
+ id: props.demandId
731
+ }
732
+ }).then(function (res) {
733
+ if (res && res.code == '101000') {
734
+ setComments(res.data);
735
+ }
736
+ });
737
+ };
738
+ //新增评论
739
+ var onCreateComment = function onCreateComment() {
740
+ request(apis.setting.addComments, {
741
+ method: 'POST',
742
+ data: {
743
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
744
+ id: props.demandId,
745
+ comments: commentText
746
+ }
747
+ }).then(function (res) {
748
+ if (res && res.code == '101000') {
749
+ setShowComment(false);
750
+ getComments();
751
+ }
752
+ });
753
+ };
754
+ //获取历史记录
755
+ var getOperateList = function getOperateList() {
756
+ request(apis.setting.operateList, {
757
+ method: 'POST',
758
+ data: {
759
+ id: props.demandId
760
+ }
761
+ }).then(function (res) {
762
+ if (res && res.code == '101000') {
763
+ setOperateList(res.data);
764
+ }
765
+ });
766
+ };
767
+ //获取公司所有人员列表
768
+ var getUserList = function getUserList() {
769
+ request(apis.queryUserByCompanyId, {
770
+ method: 'get'
771
+ }).then(function (res) {
772
+ if (res === null || res === void 0 ? void 0 : res.data) {
773
+ setUserList(res.data.map(function (item) {
774
+ item.userName = item.userName || item.email;
775
+ return item;
776
+ }));
777
+ }
778
+ });
779
+ };
780
+ //修改转办人
781
+ var designateProcessor = function designateProcessor() {
782
+ var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'click';
783
+ request(apis.setting.designateProcessor, {
784
+ method: 'POST',
785
+ data: {
786
+ id: props.demandId,
787
+ processorId: userSelect.id,
788
+ processorName: userSelect.userName
789
+ }
790
+ }).then(function (res) {
791
+ if (res === null || res === void 0 ? void 0 : res.data) {
792
+ setShowUser(false);
793
+ if (type == 'click') {
794
+ notification.success({
795
+ message: '修改成功'
796
+ });
797
+ onBack();
798
+ } else {
799
+ submitApproval(demandStatus + 1);
800
+ }
801
+ }
802
+ });
803
+ };
804
+ //关闭功能
805
+ var disableDemand = function disableDemand() {
806
+ var _props$data2;
807
+ request(apis.setting.disableDemand, {
808
+ method: 'post',
809
+ data: {
810
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
811
+ id: props.demandId,
812
+ creatorId: (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2.demand.creatorName
813
+ }
814
+ }).then(function (res) {
815
+ if (res && res.code === '100000') {
816
+ notification.success({
817
+ message: '关闭成功'
818
+ });
819
+ onBack();
820
+ }
821
+ }).catch(function (err) {
822
+ console.log(err);
823
+ });
824
+ };
825
+ //下一个流程按钮
826
+ var submitMethod = function submitMethod() {
827
+ //当流程为待设时需要选择转办人
828
+ if (demandStatus == 6) {
829
+ //选择上线时间
830
+ setOnlineTime(moment());
831
+ setShowOnlineTime(true);
832
+ } else {
833
+ setUserSelect({});
834
+ setUserSelectType('submit');
835
+ setShowUser(true);
836
+ }
837
+ };
838
+ //提交进入下一个流程
839
+ var submitApproval = function submitApproval(status) {
840
+ //先保存当前设置
841
+ onCreate(false);
842
+ //提交进入下一个流程
843
+ request(apis.submitApproval, {
844
+ method: 'post',
845
+ data: {
846
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
847
+ id: props.demandId,
848
+ approveStatus: status
849
+ }
850
+ }).then(function (res) {
851
+ if (res && res.code === '100000') {
852
+ notification.success({
853
+ message: '提交成功'
854
+ });
855
+ onBack();
856
+ }
857
+ }).catch(function (err) {
858
+ console.log(err);
859
+ });
860
+ };
861
+ //批量完成设计
862
+ var setStatusMethod = function setStatusMethod(status) {
863
+ setPointEventInfo(pointEventInfo === null || pointEventInfo === void 0 ? void 0 : pointEventInfo.map(function (item) {
864
+ if (selectedRowKeys.indexOf(item.id) != -1) {
865
+ item.status = status;
866
+ }
867
+ return item;
868
+ }));
869
+ };
870
+ //埋点地图列表
871
+ var getPointEventInfo = function getPointEventInfo() {
872
+ return (pointEventInfo || []).filter(function (item) {
873
+ return new RegExp(_.escapeRegExp(eventKey), 'i').test((item.eventName || '') + (item.pageName || ''));
874
+ });
875
+ };
876
+ //查询当前节点信息数据
877
+ var getLableValue = function getLableValue(status, key) {
878
+ var data = demandTabList.filter(function (res) {
879
+ return res.value == status;
880
+ })[0];
881
+ return data[key];
882
+ };
883
+ //埋点列表按钮
884
+ // const tabListButton = (record:any)=>{
885
+ // if(demandStatus == 2){
886
+ // return <a onClick={() => { removeInfo('event', record)}} >移除</a>
887
+ // }else if(demandStatus == 3 || demandStatus == 4){
888
+ // return <a onClick={() => { removeInfo('event', record)}} >驳回</a>
889
+ // }
890
+ // }
567
891
  return /*#__PURE__*/React.createElement("div", {
568
892
  className: classPrefix
569
893
  }, /*#__PURE__*/React.createElement("div", {
@@ -582,7 +906,31 @@ var CreateDemand = function CreateDemand(props) {
582
906
  }, /*#__PURE__*/React.createElement("div", {
583
907
  id: "system-setting-demand-info",
584
908
  className: "".concat(classPrefix, "-info-img")
909
+ }, props.data && (/*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
910
+ className: "".concat(classPrefix, "-info-item")
585
911
  }, /*#__PURE__*/React.createElement("div", {
912
+ className: "".concat(classPrefix, "-info-item-txt")
913
+ }, "\u9700\u6C42ID"), /*#__PURE__*/React.createElement("div", {
914
+ className: "".concat(classPrefix, "-info-item-content")
915
+ }, /*#__PURE__*/React.createElement("span", {
916
+ className: "".concat(classPrefix, "-info-item-content-tip")
917
+ }, props.data && ((_props$data3 = props.data) === null || _props$data3 === void 0 ? void 0 : _props$data3.demand.id)))), /*#__PURE__*/React.createElement("div", {
918
+ className: "".concat(classPrefix, "-info-item")
919
+ }, /*#__PURE__*/React.createElement("div", {
920
+ className: "".concat(classPrefix, "-info-item-txt")
921
+ }, "\u521B\u5EFA\u4EBA"), /*#__PURE__*/React.createElement("div", {
922
+ className: "".concat(classPrefix, "-info-item-content")
923
+ }, props.data && ((_props$data4 = props.data) === null || _props$data4 === void 0 ? void 0 : _props$data4.demand.creatorName), /*#__PURE__*/React.createElement("span", {
924
+ className: "".concat(classPrefix, "-info-item-content-tip")
925
+ }))), /*#__PURE__*/React.createElement("div", {
926
+ className: "".concat(classPrefix, "-info-item")
927
+ }, /*#__PURE__*/React.createElement("div", {
928
+ className: "".concat(classPrefix, "-info-item-txt")
929
+ }, "\u5904\u7406\u4EBA"), /*#__PURE__*/React.createElement("div", {
930
+ className: "".concat(classPrefix, "-info-item-content")
931
+ }, /*#__PURE__*/React.createElement("span", {
932
+ className: "".concat(classPrefix, "-info-item-content-tip")
933
+ }, props.data && ((_props$data5 = props.data) === null || _props$data5 === void 0 ? void 0 : _props$data5.demand.currentProcessorName)))))), /*#__PURE__*/React.createElement("div", {
586
934
  className: "".concat(classPrefix, "-info-item")
587
935
  }, /*#__PURE__*/React.createElement("div", {
588
936
  className: "".concat(classPrefix, "-info-item-txt")
@@ -680,7 +1028,19 @@ var CreateDemand = function CreateDemand(props) {
680
1028
  type: "tianjia1"
681
1029
  }), "\u6DFB\u52A0\u6587\u4EF6")), /*#__PURE__*/React.createElement("div", {
682
1030
  className: "".concat(classPrefix, "-info-item-content-tip")
683
- }, "\uFF08\u652F\u6301 ZIP\u3001RAR \u683C\u5F0F\u300110M\u4EE5\u5185\uFF09")))))), !!(processingNode === 0 || pointEventInfo && pointEventInfo.length) && (/*#__PURE__*/React.createElement("div", {
1031
+ }, "\uFF08\u652F\u6301 ZIP\u3001RAR \u683C\u5F0F\u300110M\u4EE5\u5185\uFF09"))))), demandStatus == 101 || demandStatus == 102 && (/*#__PURE__*/React.createElement("div", {
1032
+ className: "".concat(classPrefix, "-info-item")
1033
+ }, /*#__PURE__*/React.createElement("div", {
1034
+ className: "".concat(classPrefix, "-info-item-txt")
1035
+ }, "\u4E0A\u7EBF\u65F6\u95F4"), /*#__PURE__*/React.createElement("div", {
1036
+ className: "".concat(classPrefix, "-info-item-content")
1037
+ }, /*#__PURE__*/React.createElement(DatePicker, {
1038
+ className: "".concat(classPrefix, "-info-item-content-picker"),
1039
+ value: (_props$data6 = props.data) === null || _props$data6 === void 0 ? void 0 : _props$data6.demand.onlineTime,
1040
+ disabledDate: disabledDate,
1041
+ showTime: true,
1042
+ disabled: true
1043
+ }))))), demandStatus > 1 && (/*#__PURE__*/React.createElement("div", {
684
1044
  className: "".concat(classPrefix, "-info-item"),
685
1045
  style: {
686
1046
  paddingLeft: 24,
@@ -692,7 +1052,7 @@ var CreateDemand = function CreateDemand(props) {
692
1052
  className: "".concat(classPrefix, "-info-item-content")
693
1053
  }, /*#__PURE__*/React.createElement("div", {
694
1054
  className: "".concat(classPrefix, "-info-item-content-filter")
695
- }, /*#__PURE__*/React.createElement(Input, {
1055
+ }, demandStatus != 101 && (/*#__PURE__*/React.createElement(Input, {
696
1056
  style: {
697
1057
  width: 256
698
1058
  },
@@ -704,42 +1064,103 @@ var CreateDemand = function CreateDemand(props) {
704
1064
  onChange: function onChange(e) {
705
1065
  return setEventKey(e.target.value);
706
1066
  }
707
- }), isRead ? null : (/*#__PURE__*/React.createElement(Button, {
1067
+ })), demandStatus == 101 && (/*#__PURE__*/React.createElement("div", {
1068
+ className: "".concat(classPrefix, "-info-tabList")
1069
+ }, /*#__PURE__*/React.createElement("div", {
1070
+ className: "".concat(classPrefix, "-info-tabList-item ").concat(tabIndex == 1 && "".concat(classPrefix, "-info-tabList-active")),
1071
+ onClick: function onClick() {
1072
+ setTabIndex(1);
1073
+ }
1074
+ }, "\u5DF2\u4E0A\u7EBF"), /*#__PURE__*/React.createElement("div", {
1075
+ className: "".concat(classPrefix, "-info-tabList-item ").concat(tabIndex == 0 && "".concat(classPrefix, "-info-tabList-active")),
1076
+ onClick: function onClick() {
1077
+ setTabIndex(0);
1078
+ }
1079
+ }, "\u672A\u4E0A\u7EBF"))), isRead ? null : demandStatus == 2 && (/*#__PURE__*/React.createElement(Button, {
708
1080
  disabled: isRead,
709
1081
  shape: "round",
710
1082
  className: "button",
711
1083
  onClick: function onClick() {
712
1084
  setIsEdit(true);
713
- props.setIsShowSelectList && props.setIsShowSelectList(setPointEventInfo, pointEventInfo);
1085
+ props.setIsShowSelectList && props.setIsShowSelectList(function (val) {
1086
+ setPointEventInfo(val.map(function (val) {
1087
+ return _objectSpread(_objectSpread({}, val), {}, {
1088
+ status: 0
1089
+ });
1090
+ }));
1091
+ }, pointEventInfo);
1092
+ }
1093
+ }, "\u57CB\u70B9\u8BBE\u8BA1")), /*#__PURE__*/React.createElement("div", {
1094
+ className: "".concat(classPrefix, "-info-right")
1095
+ }, isRead ? null : (/*#__PURE__*/React.createElement(Button, {
1096
+ className: "button",
1097
+ shape: "round",
1098
+ onClick: function onClick() {
1099
+ setStatusMethod(1);
1100
+ }
1101
+ }, getLableValue(demandStatus, 'buttonName'))), isRead ? null : demandStatus == 2 && (/*#__PURE__*/React.createElement(Button, {
1102
+ className: "".concat(classPrefix, "-info-right-button forbiddenColor"),
1103
+ onClick: function onClick() {
1104
+ setPointEventInfo(pointEventInfo ? pointEventInfo.filter(function (item) {
1105
+ return selectedRowKeys.indexOf(item.id) == -1;
1106
+ }) : []);
1107
+ }
1108
+ }, "\u79FB\u9664")), isRead ? null : (demandStatus == 3 || demandStatus == 4) && (/*#__PURE__*/React.createElement(Button, {
1109
+ className: "".concat(classPrefix, "-info-right-button forbiddenColor"),
1110
+ onClick: function onClick() {
1111
+ setStatusMethod(2);
714
1112
  }
715
- }, "\u57CB\u70B9\u7BA1\u7406"))), /*#__PURE__*/React.createElement(Table, {
1113
+ }, "\u9A73\u56DE")))), /*#__PURE__*/React.createElement(Table, {
716
1114
  style: {
717
1115
  width: '100%',
718
1116
  borderRadius: 8,
719
1117
  overflow: 'hidden'
720
1118
  },
721
- columns: isRead ? columnsEvent(gotoPage, isControl) : [].concat(_toConsumableArray(columnsEvent(gotoPage, isControl)), [{
722
- title: '操作',
723
- width: 72,
724
- fixed: 'right',
725
- render: function render(text, record) {
726
- return /*#__PURE__*/React.createElement("a", {
727
- onClick: function onClick() {
728
- removeInfo('event', record);
729
- }
730
- }, "\u79FB\u9664");
731
- }
732
- }]),
733
- rowKey: "event_name",
1119
+ columns: isRead ? newColumns() : _toConsumableArray(newColumns()),
1120
+ rowKey: "id",
1121
+ rowSelection: {
1122
+ selectedRowKeys: selectedRowKeys,
1123
+ onChange: onSelectChange
1124
+ },
734
1125
  scroll: {
735
1126
  x: 755,
736
1127
  y: window.innerHeight - 312
737
1128
  },
738
1129
  pagination: false,
739
- dataSource: (pointEventInfo || []).filter(function (item) {
740
- return new RegExp(_.escapeRegExp(eventKey), 'i').test((item.eventName || '') + (item.pageName || ''));
1130
+ dataSource: demandStatus != 101 ? getPointEventInfo() : getPointEventInfo().filter(function (res) {
1131
+ return res.status == tabIndex;
741
1132
  })
742
- }))))), /*#__PURE__*/React.createElement("div", {
1133
+ })))), demandStatus > 0 && (/*#__PURE__*/React.createElement("div", {
1134
+ className: "".concat(classPrefix, "-comment")
1135
+ }, /*#__PURE__*/React.createElement("div", {
1136
+ className: "".concat(classPrefix, "-comment-tab")
1137
+ }, /*#__PURE__*/React.createElement("div", {
1138
+ className: "".concat(classPrefix, "-comment-tab-btn ").concat(tabKey == 'comment' ? "".concat(classPrefix, "-comment-tab-btnActive") : ''),
1139
+ onClick: function onClick() {
1140
+ setTabKey('comment');
1141
+ }
1142
+ }, "\u8BC4\u8BBA"), /*#__PURE__*/React.createElement("div", {
1143
+ className: "".concat(classPrefix, "-comment-tab-btn ").concat(tabKey == 'history' ? "".concat(classPrefix, "-comment-tab-btnActive") : ''),
1144
+ onClick: function onClick() {
1145
+ setTabKey('history');
1146
+ }
1147
+ }, "\u64CD\u4F5C\u5386\u53F2")), tabKey == 'comment' && comments.map(function (item) {
1148
+ return /*#__PURE__*/React.createElement("div", {
1149
+ className: "".concat(classPrefix, "-comment-list"),
1150
+ key: item.id
1151
+ }, /*#__PURE__*/React.createElement("div", {
1152
+ className: "".concat(classPrefix, "-comment-list-name")
1153
+ }, item.creator_name, ' ', /*#__PURE__*/React.createElement("span", {
1154
+ className: "".concat(classPrefix, "-comment-list-time")
1155
+ }, item.create_time)), /*#__PURE__*/React.createElement("div", {
1156
+ className: "".concat(classPrefix, "-comment-list-text")
1157
+ }, item.comments));
1158
+ }), tabKey == 'history' && operateList.map(function (item) {
1159
+ return /*#__PURE__*/React.createElement("div", {
1160
+ className: "".concat(classPrefix, "-history-list"),
1161
+ key: item.id
1162
+ }, /*#__PURE__*/React.createElement("span", null, item.operator_name), item.operator_desc);
1163
+ })))), /*#__PURE__*/React.createElement("div", {
743
1164
  className: "".concat(classPrefix, "-right"),
744
1165
  id: "xsd4"
745
1166
  }, nodeData.length ? (/*#__PURE__*/React.createElement(ProcessCanvas, {
@@ -758,36 +1179,152 @@ var CreateDemand = function CreateDemand(props) {
758
1179
  className: "".concat(classPrefix, "-right-title")
759
1180
  }, "\u8282\u70B9\u9884\u89C8"))), /*#__PURE__*/React.createElement("div", {
760
1181
  className: "".concat(classPrefix, "-footer")
761
- }, !isRead && /*#__PURE__*/React.createElement(Button, {
762
- onClick: onBack
763
- }, "\u53D6\u6D88"), !isDemo && !isRead && (/*#__PURE__*/React.createElement(Button, {
764
- type: 'primary',
765
- onClick: onCreate
766
- }, "\u786E\u5B9A")), !isDemo && isRead && isHandle && authority[17228364473] && (/*#__PURE__*/React.createElement(Button, {
767
- type: 'primary',
768
- onClick: function onClick() {
769
- onDemand('deal');
770
- }
771
- }, "\u5904\u7406")), !isDemo && isRead && isWithdraw && authority[17228364473] && (/*#__PURE__*/React.createElement(Button, {
772
- type: 'primary',
1182
+ }, !isDemo && authority[1724922574] && [1, 2, 3, 4, 5, 6, 101].indexOf(demandStatus) != -1 && (/*#__PURE__*/React.createElement(Button, {
1183
+ shape: "round",
1184
+ className: "forbiddenColor",
773
1185
  onClick: function onClick() {
774
- onDemand('revocation');
1186
+ Modal.confirm({
1187
+ wrapClassName: "".concat(classPrefix, "-confirm"),
1188
+ title: '提示',
1189
+ icon: null,
1190
+ closable: true,
1191
+ content: '您确定要关闭当前需求?',
1192
+ okText: '确定',
1193
+ cancelText: '取消',
1194
+ onOk: function onOk() {
1195
+ disableDemand();
1196
+ }
1197
+ });
775
1198
  }
776
- }, "\u64A4\u56DE")), !isDemo && isRead && authority[1724922574] && (/*#__PURE__*/React.createElement(Button, {
1199
+ }, "\u5173\u95ED\u9700\u6C42")), !isRead && demandStatus == 0 && /*#__PURE__*/React.createElement(Button, {
1200
+ onClick: onBack
1201
+ }, "\u53D6\u6D88"), !isDemo && authority[1724922574] && demandStatus > 0 && (/*#__PURE__*/React.createElement(Button, {
777
1202
  shape: "round",
778
1203
  className: "button",
779
1204
  onClick: exportPDF
780
- }, "\u5BFC\u51FA\u9700\u6C42PDF")), !isDemo && isRead && authority[1724922705] && pointEventInfo && !!pointEventInfo.length && (/*#__PURE__*/React.createElement(Button, {
1205
+ }, "\u5BFC\u51FA\u9700\u6C42PDF")), !isDemo && authority[1724922705] && pointEventInfo && !!pointEventInfo.length && (/*#__PURE__*/React.createElement(Button, {
781
1206
  shape: "round",
782
1207
  className: "button",
783
1208
  onClick: downloadData
784
- }, "\u5BFC\u51FA\u57CB\u70B9\u8BBE\u8BA1"))), isShowBackConfirm ? (/*#__PURE__*/React.createElement(BackConfirm, {
1209
+ }, "\u5BFC\u51FA\u57CB\u70B9\u8BBE\u8BA1")), /*#__PURE__*/React.createElement("div", {
1210
+ className: "".concat(classPrefix, "-footer-btnRight")
1211
+ }, !isDemo && !isRead && [2, 3, 4, 5, 6].indexOf(demandStatus) != -1 && (/*#__PURE__*/React.createElement(Button, {
1212
+ type: 'default',
1213
+ className: "commentBtn",
1214
+ onClick: function onClick() {
1215
+ setUserSelectType('click');
1216
+ setUserSelect({});
1217
+ setShowUser(true);
1218
+ }
1219
+ }, "\u8F6C\u529E")), !isDemo && !isRead && demandStatus > 0 && (/*#__PURE__*/React.createElement(Button, {
1220
+ type: 'default',
1221
+ className: "commentBtn",
1222
+ onClick: function onClick() {
1223
+ setCommentText('');
1224
+ setShowComment(true);
1225
+ }
1226
+ }, "\u6DFB\u52A0\u8BC4\u8BBA")), !isDemo && !isRead && [0, 1, 2, 3, 4, 5, 6].indexOf(demandStatus) != -1 && (/*#__PURE__*/React.createElement(Button, {
1227
+ type: 'primary',
1228
+ className: "commentBtn",
1229
+ onClick: function onClick() {
1230
+ return onCreate();
1231
+ }
1232
+ }, props.data ? '保存' : '提交')), !isDemo && !isRead && demandStatus > 0 && demandStatus <= 6 && (/*#__PURE__*/React.createElement(Button, {
1233
+ type: 'primary',
1234
+ className: "commentBtn",
1235
+ disabled: demandStatus > 1 ? !Boolean(pointEventInfo === null || pointEventInfo === void 0 ? void 0 : pointEventInfo.length) || Boolean(pointEventInfo === null || pointEventInfo === void 0 ? void 0 : pointEventInfo.filter(function (res) {
1236
+ return [0, 2].indexOf(res.status) != -1;
1237
+ }).length) : false,
1238
+ onClick: submitMethod
1239
+ }, getLableValue(demandStatus, 'buttonName'))), !isDemo && !isRead && demandStatus > 2 && demandStatus <= 4 && (/*#__PURE__*/React.createElement(Button, {
1240
+ type: 'primary',
1241
+ className: "commentBtn",
1242
+ onClick: function onClick() {
1243
+ return submitApproval(2);
1244
+ }
1245
+ }, "\u91CD\u65B0\u8BBE\u8BA1")))), isShowBackConfirm ? (/*#__PURE__*/React.createElement(BackConfirm, {
785
1246
  onOk: function onOk() {
786
1247
  props.onBack && props.onBack();
787
1248
  },
788
1249
  onCancel: function onCancel() {
789
1250
  setIsShowBackConfirm(false);
790
1251
  }
791
- })) : null);
1252
+ })) : null, /*#__PURE__*/React.createElement(BizDialog, {
1253
+ title: "\u8BF7\u8F93\u5165\u8BC4\u8BBA",
1254
+ open: showComment,
1255
+ width: 520,
1256
+ className: "setting-bizDialog",
1257
+ closable: true,
1258
+ onOk: function onOk() {
1259
+ onCreateComment();
1260
+ },
1261
+ onCancel: function onCancel() {
1262
+ setShowComment(false);
1263
+ }
1264
+ }, /*#__PURE__*/React.createElement(Input.TextArea, {
1265
+ value: commentText,
1266
+ showCount: true,
1267
+ maxLength: 100,
1268
+ onChange: function onChange(val) {
1269
+ setCommentText(val.currentTarget.value);
1270
+ },
1271
+ placeholder: "\u8BC4\u8BBA\u5185\u5BB9.....",
1272
+ style: {
1273
+ height: 120,
1274
+ resize: 'none'
1275
+ }
1276
+ })), /*#__PURE__*/React.createElement(BizDialog, {
1277
+ title: "\u8BF7\u9009\u62E9\u5904\u7406\u4EBA",
1278
+ open: showUser,
1279
+ width: 520,
1280
+ className: "setting-bizDialog",
1281
+ closable: true,
1282
+ onOk: function onOk() {
1283
+ if (userSelect.id) {
1284
+ designateProcessor(userSelectType);
1285
+ setShowUser(false);
1286
+ }
1287
+ },
1288
+ onCancel: function onCancel() {
1289
+ setShowUser(false);
1290
+ }
1291
+ }, /*#__PURE__*/React.createElement(BizSelect, {
1292
+ placeholder: "\u8BF7\u9009\u62E9\u5904\u7406\u4EBA",
1293
+ value: userSelect,
1294
+ options: userList || [],
1295
+ enableSearch: true,
1296
+ onChange: function onChange(e) {
1297
+ setUserSelect(e);
1298
+ },
1299
+ labelField: "userName",
1300
+ keyField: "id"
1301
+ })), /*#__PURE__*/React.createElement(BizDialog, {
1302
+ title: "\u8BF7\u9009\u62E9\u4E0A\u7EBF\u65F6\u95F4",
1303
+ open: showOnlineTime,
1304
+ width: 520,
1305
+ className: "setting-bizDialog",
1306
+ closable: true,
1307
+ onOk: function onOk() {
1308
+ if (onlineTime) {
1309
+ onCreate(false);
1310
+ submitApproval(demandStatus + 1);
1311
+ setShowOnlineTime(false);
1312
+ }
1313
+ },
1314
+ onCancel: function onCancel() {
1315
+ setOnlineTime(null);
1316
+ setShowOnlineTime(false);
1317
+ }
1318
+ }, /*#__PURE__*/React.createElement(DatePicker, {
1319
+ className: "".concat(classPrefix, "-info-item-content-picker"),
1320
+ value: onlineTime,
1321
+ disabledDate: disabledDate,
1322
+ onChange: function onChange(e) {
1323
+ setIsEdit(true);
1324
+ setOnlineTime(e);
1325
+ },
1326
+ showTime: true,
1327
+ disabled: isRead
1328
+ })));
792
1329
  };
793
1330
  export default CreateDemand;