@zgfe/modules-settings 2.0.0-zhongyuan.24 → 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.
@@ -1,4 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
5
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
2
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
8
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -11,12 +15,13 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
11
15
  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; } }
12
16
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
17
  import { BizGlobalDataContext, BizTable, IconFont } from '@zgfe/business-lib';
14
- import { Input, Button, Select, message, Tooltip } from 'antd';
18
+ import { Input, Button, Select, message, Tooltip, Modal, notification } from 'antd';
15
19
  import React, { useEffect, useState, useContext } from 'react';
16
20
  import './styles/index.less';
17
21
  import apis from '../../constants/api';
18
22
  import request from '../../utils/ajax';
19
23
  import moment from 'moment';
24
+ import { demandTabList } from '../createDemand/constants';
20
25
  var sorterKey = {
21
26
  ascend: 'asc',
22
27
  descend: 'desc'
@@ -42,23 +47,26 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
42
47
  _useState4 = _slicedToArray(_useState3, 2),
43
48
  pageData = _useState4[0],
44
49
  setPageData = _useState4[1];
45
- var _useState5 = useState(route && route.query && route.query.demandKey || ''),
46
- _useState6 = _slicedToArray(_useState5, 2),
47
- demandName = _useState6[0],
48
- setDemandName = _useState6[1];
49
- // 状态:1-待处理, 2-处理中,3-已驳回,4-已结束,5-已超时
50
- var _useState7 = useState(0),
50
+ var _useState5 = useState(demandTabList),
51
+ _useState6 = _slicedToArray(_useState5, 1),
52
+ labelList = _useState6[0];
53
+ var _useState7 = useState(route && route.query && route.query.demandKey || ''),
51
54
  _useState8 = _slicedToArray(_useState7, 2),
52
- demandStatus = _useState8[0],
53
- setDemandStatus = _useState8[1];
54
- var _useState9 = useState([]),
55
+ demandName = _useState8[0],
56
+ setDemandName = _useState8[1];
57
+ // 状态:1-待处理, 2-处理中,3-已驳回,4-已结束,5-已超时
58
+ var _useState9 = useState(0),
55
59
  _useState10 = _slicedToArray(_useState9, 2),
56
- demandList = _useState10[0],
57
- setDemandList = _useState10[1];
58
- var _useState11 = useState(),
60
+ demandStatus = _useState10[0],
61
+ setDemandStatus = _useState10[1];
62
+ var _useState11 = useState([]),
59
63
  _useState12 = _slicedToArray(_useState11, 2),
60
- tableTotal = _useState12[0],
61
- setTableTotal = _useState12[1];
64
+ demandList = _useState12[0],
65
+ setDemandList = _useState12[1];
66
+ var _useState13 = useState(),
67
+ _useState14 = _slicedToArray(_useState13, 2),
68
+ tableTotal = _useState14[0],
69
+ setTableTotal = _useState14[1];
62
70
  useEffect(function () {
63
71
  getDemandStatistics();
64
72
  }, []);
@@ -181,18 +189,24 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
181
189
  dataIndex: 'demandStatus',
182
190
  width: 160,
183
191
  render: function render(demandStatus) {
184
- var status = ['', '待处理', '处理中', '已驳回', '已结束', '已超时'];
192
+ var data = labelList.filter(function (res) {
193
+ return res.value == demandStatus;
194
+ })[0] || {};
185
195
  return /*#__PURE__*/React.createElement("div", {
186
196
  style: {
187
197
  display: 'flex'
188
198
  }
189
199
  }, /*#__PURE__*/React.createElement("div", {
190
- className: "".concat(classPrefix, "-table-status").concat(demandStatus)
191
- }, status[demandStatus]));
200
+ className: "".concat(classPrefix, "-table-status"),
201
+ style: {
202
+ backgroundColor: data.color + '20',
203
+ color: data.color
204
+ }
205
+ }, data.label));
192
206
  }
193
207
  }, {
194
208
  title: '操作',
195
- width: 160,
209
+ width: 250,
196
210
  fixed: 'right',
197
211
  render: function render(record) {
198
212
  return /*#__PURE__*/React.createElement(DealDom, {
@@ -202,10 +216,10 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
202
216
  }
203
217
  }];
204
218
  var DealDom = function DealDom(props) {
205
- var _useState13 = useState(false),
206
- _useState14 = _slicedToArray(_useState13, 2),
207
- open = _useState14[0],
208
- setOpen = _useState14[1];
219
+ var _useState15 = useState(false),
220
+ _useState16 = _slicedToArray(_useState15, 2),
221
+ open = _useState16[0],
222
+ setOpen = _useState16[1];
209
223
  var hide = function hide() {
210
224
  setOpen(false);
211
225
  };
@@ -218,21 +232,7 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
218
232
  }
219
233
  }).then(function (res) {
220
234
  if (res === null || res === void 0 ? void 0 : res.data) {
221
- if (type === 'revocation') {
222
- request(apis.revocationDemand, {
223
- method: 'POST',
224
- data: {
225
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
226
- id: props.record.id
227
- }
228
- }).then(function (re) {
229
- props.onDeal && props.onDeal(type, res.data);
230
- getDemandStatistics();
231
- getDemandList();
232
- });
233
- } else {
234
- props.onDeal && props.onDeal(type, res.data);
235
- }
235
+ props.onDeal && props.onDeal(type, res.data);
236
236
  }
237
237
  // getDemandStatistics();
238
238
  // getDemandList();
@@ -241,72 +241,76 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
241
241
  var handleOpenChange = function handleOpenChange(newOpen) {
242
242
  setOpen(newOpen);
243
243
  };
244
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
245
- style: {
246
- marginRight: 16
247
- },
244
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
245
+ color: "primary",
246
+ type: "link",
248
247
  onClick: function onClick() {
249
248
  if (!authority[17228364472]) {
250
249
  message.error('无查看权限');
251
250
  return;
252
251
  }
253
252
  props.onDeal && props.onDeal('view', props.record.id);
254
- // router &&
255
- // router?.push({
256
- // name: routes.createDemand,
257
- // query: {
258
- // id: props.record.id,
259
- // },
260
- // });
261
253
  }
262
- }, "\u67E5\u770B"), !isDemo && props.record.isHandle && authority[17228364473] && (
263
- /*#__PURE__*/
264
- // <Popover
265
- // content={
266
- // <div className={`${classPrefix}-pop`}>
267
- // <div className={`${classPrefix}-pop-header`}>
268
- // 需求处理 <IconFont type="qingchu" onClick={hide} />
269
- // </div>
270
- // <div className={`${classPrefix}-pop-footer`}>
271
- // <Button
272
- // danger
273
- // type={'primary'}
274
- // onClick={() => {
275
- // submitDemand(props.record.id, 2);
276
- // }}
277
- // >
278
- // 驳回
279
- // </Button>
280
- // <Button
281
- // type={'primary'}
282
- // onClick={() => {
283
- // submitDemand(props.record.id, 1);
284
- // }}
285
- // >
286
- // 同意
287
- // </Button>
288
- // </div>
289
- // </div>
290
- // }
291
- // trigger="click"
292
- // open={open}
293
- // onOpenChange={handleOpenChange}
294
- // >
295
- React.createElement("a", {
296
- style: {
297
- marginRight: 16
298
- },
254
+ }, "\u67E5\u770B"), /*#__PURE__*/React.createElement(Button, {
255
+ color: "primary",
256
+ type: "link",
257
+ onClick: function onClick() {
258
+ Modal.confirm({
259
+ wrapClassName: "".concat(classPrefix, "-confirm"),
260
+ title: '提示',
261
+ icon: null,
262
+ closable: true,
263
+ content: '您确定要关闭当前需求?',
264
+ okText: '确定',
265
+ cancelText: '取消',
266
+ onOk: function onOk() {
267
+ disableDemand(props.record);
268
+ }
269
+ });
270
+ }
271
+ }, "\u5173\u95ED"), /*#__PURE__*/React.createElement(Button, {
272
+ color: "primary",
273
+ type: "link",
299
274
  onClick: function onClick() {
300
- getDemand('deal');
275
+ props.onDeal && props.onDeal('revocation', {
276
+ appId: props.record.id,
277
+ approvalModule: props.record.approvalModule,
278
+ businessType: props.record.businessType,
279
+ completionTime: props.record.completionTime,
280
+ demandDescribe: props.record.demandDescrib,
281
+ demandName: props.record.demandName + '复制',
282
+ fileName: props.record.fileName,
283
+ filePath: props.record.filePath
284
+ });
301
285
  }
302
- }, "\u5904\u7406")
303
- // </Popover>
304
- ), !isDemo && props.record.revocation && (/*#__PURE__*/React.createElement("a", {
286
+ }, "\u590D\u5236"), /*#__PURE__*/React.createElement(Button, {
287
+ color: "primary",
288
+ type: "link",
305
289
  onClick: function onClick() {
306
290
  getDemand('revocation');
307
291
  }
308
- }, "\u64A4\u56DE")));
292
+ }, "\u7F16\u8F91"));
309
293
  };
294
+ //关闭功能
295
+ var disableDemand = function disableDemand(data) {
296
+ request(apis.setting.disableDemand, {
297
+ method: 'post',
298
+ data: {
299
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
300
+ id: data.id,
301
+ creatorId: data.creatorId
302
+ }
303
+ }).then(function (res) {
304
+ if (res && res.code === '100000') {
305
+ notification.success({
306
+ message: '关闭成功'
307
+ });
308
+ }
309
+ }).catch(function (err) {
310
+ console.log(err);
311
+ });
312
+ };
313
+ //复制功能
310
314
  return /*#__PURE__*/React.createElement("div", {
311
315
  className: classPrefix
312
316
  }, /*#__PURE__*/React.createElement("div", {
@@ -329,67 +333,27 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
329
333
  }
330
334
  }, demandInfo ? (demandInfo === null || demandInfo === void 0 ? void 0 : demandInfo.demandAllSum) || 0 : '-'))), /*#__PURE__*/React.createElement("div", {
331
335
  className: "".concat(classPrefix, "-panel-status")
332
- }, /*#__PURE__*/React.createElement("div", {
333
- className: "".concat(classPrefix, "-panel-status-item")
334
- }, /*#__PURE__*/React.createElement("div", {
335
- className: "".concat(classPrefix, "-panel-status-item-txt"),
336
- onClick: function onClick() {
337
- return setDemandStatus(1);
338
- }
339
- }, "\u5F85\u5904\u7406"), /*#__PURE__*/React.createElement("div", {
340
- className: "".concat(classPrefix, "-panel-status-item-num"),
341
- onClick: function onClick() {
342
- return setDemandStatus(1);
343
- }
344
- }, demandInfo ? (demandInfo === null || demandInfo === void 0 ? void 0 : demandInfo.pendingSum) || 0 : '-')), /*#__PURE__*/React.createElement("div", {
345
- className: "".concat(classPrefix, "-panel-status-item")
346
- }, /*#__PURE__*/React.createElement("div", {
347
- className: "".concat(classPrefix, "-panel-status-item-txt"),
348
- onClick: function onClick() {
349
- return setDemandStatus(2);
350
- }
351
- }, "\u5904\u7406\u4E2D"), /*#__PURE__*/React.createElement("div", {
352
- className: "".concat(classPrefix, "-panel-status-item-num"),
353
- onClick: function onClick() {
354
- return setDemandStatus(2);
355
- }
356
- }, demandInfo ? (demandInfo === null || demandInfo === void 0 ? void 0 : demandInfo.beingProcessedSum) || 0 : '-')), /*#__PURE__*/React.createElement("div", {
357
- className: "".concat(classPrefix, "-panel-status-item")
358
- }, /*#__PURE__*/React.createElement("div", {
359
- className: "".concat(classPrefix, "-panel-status-item-txt"),
360
- onClick: function onClick() {
361
- return setDemandStatus(3);
362
- }
363
- }, "\u5DF2\u9A73\u56DE"), /*#__PURE__*/React.createElement("div", {
364
- className: "".concat(classPrefix, "-panel-status-item-num"),
365
- onClick: function onClick() {
366
- return setDemandStatus(3);
367
- }
368
- }, demandInfo ? (demandInfo === null || demandInfo === void 0 ? void 0 : demandInfo.rejectedSum) || 0 : '-')), /*#__PURE__*/React.createElement("div", {
369
- className: "".concat(classPrefix, "-panel-status-item")
370
- }, /*#__PURE__*/React.createElement("div", {
371
- className: "".concat(classPrefix, "-panel-status-item-txt"),
372
- onClick: function onClick() {
373
- return setDemandStatus(5);
374
- }
375
- }, "\u5DF2\u8D85\u65F6"), /*#__PURE__*/React.createElement("div", {
376
- className: "".concat(classPrefix, "-panel-status-item-num"),
377
- onClick: function onClick() {
378
- return setDemandStatus(5);
379
- }
380
- }, demandInfo ? (demandInfo === null || demandInfo === void 0 ? void 0 : demandInfo.overTimeSum) || 0 : '-')), /*#__PURE__*/React.createElement("div", {
381
- className: "".concat(classPrefix, "-panel-status-item")
382
- }, /*#__PURE__*/React.createElement("div", {
383
- className: "".concat(classPrefix, "-panel-status-item-txt"),
384
- onClick: function onClick() {
385
- return setDemandStatus(4);
386
- }
387
- }, "\u5DF2\u5B8C\u6210"), /*#__PURE__*/React.createElement("div", {
388
- className: "".concat(classPrefix, "-panel-status-item-num"),
389
- onClick: function onClick() {
390
- return setDemandStatus(4);
391
- }
392
- }, demandInfo ? (demandInfo === null || demandInfo === void 0 ? void 0 : demandInfo.finishedSum) || 0 : '-')))), /*#__PURE__*/React.createElement("div", {
336
+ }, labelList.map(function (res) {
337
+ return /*#__PURE__*/React.createElement("div", {
338
+ key: res.key,
339
+ className: "".concat(classPrefix, "-panel-status-item")
340
+ }, /*#__PURE__*/React.createElement("div", {
341
+ className: "".concat(classPrefix, "-panel-status-item-txt"),
342
+ onClick: function onClick() {
343
+ return setDemandStatus(res.value);
344
+ }
345
+ }, /*#__PURE__*/React.createElement("div", {
346
+ className: "".concat(classPrefix, "-panel-status-item-icon"),
347
+ style: {
348
+ backgroundColor: res.color
349
+ }
350
+ }), res.label), /*#__PURE__*/React.createElement("div", {
351
+ className: "".concat(classPrefix, "-panel-status-item-num"),
352
+ onClick: function onClick() {
353
+ return setDemandStatus(res.value);
354
+ }
355
+ }, demandInfo ? demandInfo[res.key] || 0 : '-'));
356
+ }))), /*#__PURE__*/React.createElement("div", {
393
357
  className: "".concat(classPrefix, "-filter")
394
358
  }, /*#__PURE__*/React.createElement("div", {
395
359
  className: "".concat(classPrefix, "-filter-left")
@@ -423,22 +387,7 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
423
387
  options: [{
424
388
  value: 0,
425
389
  label: '全部'
426
- }, {
427
- value: 1,
428
- label: '待处理'
429
- }, {
430
- value: 2,
431
- label: '处理中'
432
- }, {
433
- value: 3,
434
- label: '已驳回'
435
- }, {
436
- value: 4,
437
- label: '已结束'
438
- }, {
439
- value: 5,
440
- label: '已超时'
441
- }]
390
+ }].concat(_toConsumableArray(labelList))
442
391
  }), /*#__PURE__*/React.createElement("div", {
443
392
  className: "top-total"
444
393
  }, "\u5171", /*#__PURE__*/React.createElement("a", null, "\xA0", tableTotal || '-', "\xA0"), "\u6761")), /*#__PURE__*/React.createElement("div", {
@@ -64,13 +64,13 @@
64
64
  gap: 4px;
65
65
  align-items: center;
66
66
  cursor: pointer;
67
- &::before {
68
- display: block;
69
- width: 8px;
70
- height: 8px;
71
- border-radius: 4px;
72
- content: '';
73
- }
67
+ }
68
+ &-icon {
69
+ display: block;
70
+ width: 8px;
71
+ height: 8px;
72
+ border-radius: 4px;
73
+ content: '';
74
74
  }
75
75
  &-num {
76
76
  margin-top: 4px;
@@ -84,31 +84,6 @@
84
84
  cursor: pointer;
85
85
  }
86
86
  }
87
- &-item:nth-child(1) {
88
- .system-setting-demand-panel-status-item-txt::before {
89
- background-color: #fd9f41;
90
- }
91
- }
92
- &-item:nth-child(2) {
93
- .system-setting-demand-panel-status-item-txt::before {
94
- background-color: #165dff;
95
- }
96
- }
97
- &-item:nth-child(3) {
98
- .system-setting-demand-panel-status-item-txt::before {
99
- background-color: #fb5547;
100
- }
101
- }
102
- &-item:nth-child(4) {
103
- .system-setting-demand-panel-status-item-txt::before {
104
- background-color: #e1f703;
105
- }
106
- }
107
- &-item:nth-child(5) {
108
- .system-setting-demand-panel-status-item-txt::before {
109
- background-color: #ccd0d4;
110
- }
111
- }
112
87
  }
113
88
  }
114
89
  &-filter {
@@ -136,59 +111,13 @@
136
111
  }
137
112
 
138
113
  &-table {
139
- &-status2 {
140
- display: flex;
141
- align-items: center;
142
- padding: 1px 8px;
143
- color: var(--io-i-, #165dff);
144
- font-weight: 400;
145
- font-size: 14px;
146
- line-height: 22px; /* 157.143% */
147
- background: var(--io-i1-, #e8efff);
148
- border-radius: 2px;
149
- }
150
- &-status1 {
151
- display: flex;
152
- align-items: center;
153
- padding: 1px 8px;
154
- color: var(--io-i-, #fd9f41);
155
- font-weight: 400;
156
- font-size: 14px;
157
- line-height: 22px; /* 157.143% */
158
- background: var(--io-i1-, #ffecd9);
159
- border-radius: 2px;
160
- }
161
- &-status3 {
162
- display: flex;
163
- align-items: center;
164
- padding: 1px 8px;
165
- color: var(--io-i-, #fb5547);
166
- font-weight: 400;
167
- font-size: 14px;
168
- line-height: 22px; /* 157.143% */
169
- background: var(--io-i1-, #ffece8);
170
- border-radius: 2px;
171
- }
172
- &-status4 {
173
- display: flex;
174
- align-items: center;
175
- padding: 1px 8px;
176
- color: var(--io-i-, #5f6085);
177
- font-weight: 400;
178
- font-size: 14px;
179
- line-height: 22px; /* 157.143% */
180
- background: var(--io-i1-, #f2f3f4);
181
- border-radius: 2px;
182
- }
183
- &-status5 {
114
+ &-status {
184
115
  display: flex;
185
116
  align-items: center;
186
117
  padding: 1px 8px;
187
- color: var(--io-i-, #faad14);
188
118
  font-weight: 400;
189
119
  font-size: 14px;
190
120
  line-height: 22px; /* 157.143% */
191
- background: var(--io-i1-, #ffe58f);
192
121
  border-radius: 2px;
193
122
  }
194
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "2.0.0-zhongyuan.24",
3
+ "version": "2.0.0-zhongyuan.26",
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": "b1559ccf3344d2aa7af139bcc912db33b791177d",
70
+ "gitHead": "848555469759c362b0f069f0d8a09216c8281f7e",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }