@zgfe/modules-settings 2.0.0-zhongyuan.2 → 2.0.0-zhongyuan.21

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.
@@ -25,15 +25,16 @@ var Dragger = Upload.Dragger;
25
25
  var pageName = 'DocumentSetting';
26
26
  var confirm = Modal.confirm;
27
27
  var beforeUpload = function beforeUpload(file) {
28
- var isJpgOrPng = file.type == 'application/x-zip-compressed' || file.type == 'application/x-compressed';
29
- if (!isJpgOrPng) {
30
- message.error('只能传入是ZIP或者RAR文件');
31
- }
28
+ // const isJpgOrPng =
29
+ // file.type == 'application/x-zip-compressed' || file.type == 'application/x-compressed';
30
+ // if (!isJpgOrPng) {
31
+ // message.error('只能传入是ZIP或者RAR文件');
32
+ // }
32
33
  var isLt2M = file.size / 1024 / 1024 < 100;
33
34
  if (!isLt2M) {
34
35
  message.error('文件不能大于100M');
35
36
  }
36
- return isJpgOrPng && isLt2M;
37
+ return isLt2M;
37
38
  };
38
39
  var downloadFile = function downloadFile(resData, name) {
39
40
  var blob = resData.data;
@@ -66,6 +67,7 @@ var DocumentSetting = function DocumentSetting() {
66
67
  title: '序号',
67
68
  dataIndex: 'index',
68
69
  key: 'index',
70
+ width: 80,
69
71
  render: function render(_, obj, index) {
70
72
  return index + 1;
71
73
  }
@@ -77,6 +79,7 @@ var DocumentSetting = function DocumentSetting() {
77
79
  title: '创建时间',
78
80
  dataIndex: 'createdTime',
79
81
  key: 'createdTime',
82
+ width: 200,
80
83
  sorter: function sorter(a, b) {
81
84
  return moment(b.createdTime).valueOf() - moment(a.createdTime).valueOf();
82
85
  },
@@ -86,6 +89,7 @@ var DocumentSetting = function DocumentSetting() {
86
89
  }, {
87
90
  title: '操作',
88
91
  key: 'operation',
92
+ width: 170,
89
93
  render: function render(_, record) {
90
94
  return /*#__PURE__*/React.createElement(Space, {
91
95
  size: "middle"
@@ -179,6 +183,7 @@ var DocumentSetting = function DocumentSetting() {
179
183
  isOpenUploadModal = _useState10[0],
180
184
  setIsOpenUploadModal = _useState10[1];
181
185
  var handleValueCancel = function handleValueCancel() {
186
+ setFileList(undefined);
182
187
  setIsOpenUploadModal(false);
183
188
  setDocumentFlagLoading(false);
184
189
  };
@@ -188,24 +193,33 @@ var DocumentSetting = function DocumentSetting() {
188
193
  setFileList = _useState12[1];
189
194
  var props = {
190
195
  name: 'file',
191
- multiple: true,
196
+ maxCount: 1,
197
+ accept: '.zip,.rar,.7z',
192
198
  beforeUpload: beforeUpload,
193
199
  onChange: function onChange(info) {
194
200
  var status = info.file.status;
195
201
  if (status !== 'uploading') {
196
- console.log(info.file, info.fileList);
202
+ if (info.fileList.length > 0) {
203
+ setFileList(info.fileList[0].originFileObj);
204
+ }
197
205
  }
198
- if (status === 'done') {
199
- setFileList(info.fileList[0].originFileObj);
200
- } else if (status === 'error') {
201
- message.error("".concat(info.file.name, " file upload failed."));
206
+ if (status == 'removed') {
207
+ setFileList(undefined);
202
208
  }
209
+ // if (status === 'done') {
210
+ // } else if (status === 'error') {
211
+ // message.error(`${info.file.name} file upload failed.`);
212
+ // }
203
213
  },
204
214
  onDrop: function onDrop(e) {
205
215
  console.log('Dropped files', e.dataTransfer.files);
206
216
  }
207
217
  };
208
218
  var saveFile = function saveFile() {
219
+ if (!fileList) {
220
+ message.error('请选择上传的文件');
221
+ return;
222
+ }
209
223
  var formData = new FormData();
210
224
  formData.append('file', fileList);
211
225
  request(apis.setting.uploadDocumentFile, {
@@ -297,16 +311,30 @@ var DocumentSetting = function DocumentSetting() {
297
311
  };
298
312
  var saveShare = function saveShare() {
299
313
  var _currentObj$current4;
314
+ var currentId = undefined;
315
+ if (currentShareType == 1) {
316
+ // 应用
317
+ var a = projectList.filter(function (o) {
318
+ return currentAppArr.includes(o.projectId);
319
+ });
320
+ currentId = a.map(function (o) {
321
+ var _o$appList, _o$appList$;
322
+ return (_o$appList = o.appList) === null || _o$appList === void 0 ? void 0 : (_o$appList$ = _o$appList[0]) === null || _o$appList$ === void 0 ? void 0 : _o$appList$.appId;
323
+ });
324
+ } else if (currentShareType == 2) {
325
+ // 用户
326
+ currentId = currentUserArr;
327
+ }
300
328
  request(apis.setting.shareAPP, {
301
329
  method: 'post',
302
330
  data: {
303
331
  type: currentShareType,
304
332
  id: (_currentObj$current4 = currentObj.current) === null || _currentObj$current4 === void 0 ? void 0 : _currentObj$current4.id,
305
- shareIds: currentShareType == 1 ? currentAppArr : currentUserArr
333
+ shareIds: currentId
306
334
  }
307
335
  }).then(function (res) {
308
336
  if (res && (res === null || res === void 0 ? void 0 : res.code) == '100000') {
309
- message.error('分享成功!');
337
+ message.success('分享成功!');
310
338
  handleShareCancel();
311
339
  } else {
312
340
  message.error('查询失败,联系管理员');
@@ -374,6 +402,7 @@ var DocumentSetting = function DocumentSetting() {
374
402
  title: "\u4E0A\u4F20",
375
403
  okText: "\u786E\u5B9A",
376
404
  cancelText: "\u53D6\u6D88",
405
+ destroyOnClose: true,
377
406
  open: isOpenUploadModal,
378
407
  onCancel: handleValueCancel,
379
408
  onOk: saveFile
@@ -416,9 +445,9 @@ var DocumentSetting = function DocumentSetting() {
416
445
  size: 20
417
446
  }, /*#__PURE__*/React.createElement(Radio, {
418
447
  value: 4
419
- }, "\u6240\u4EE5\u6210\u5458"), /*#__PURE__*/React.createElement(Radio, {
448
+ }, "\u6240\u6709\u6210\u5458"), /*#__PURE__*/React.createElement(Radio, {
420
449
  value: 1
421
- }, "\u6307\u5B9A\u5E94\u7528\uFF08\u6240\u6709\u62E5\u6709\u8BE5\u5E94\u7528\u6743\u9650\u7684\u89D2\u8272\uFF09"), currentShareType == 1 ? (/*#__PURE__*/React.createElement(React.Fragment, null, currentAppArr.length > 2 ? (/*#__PURE__*/React.createElement(Tooltip, {
450
+ }, "\u6307\u5B9A\u5E94\u7528\uFF08\u6240\u6709\u62E5\u6709\u8BE5\u5E94\u7528\u6743\u9650\u7684\u89D2\u8272\uFF09"), currentShareType == 1 ? (/*#__PURE__*/React.createElement(React.Fragment, null, currentAppArr.length > 0 ? (/*#__PURE__*/React.createElement(Tooltip, {
422
451
  title: function title() {
423
452
  return projectList.filter(function (o) {
424
453
  return currentAppArr.includes(o.projectId);
@@ -1,161 +1,161 @@
1
- .system-setting-approval-process-create-bg {
2
- position: absolute;
3
- top: 0;
4
- right: 0;
5
- bottom: 0;
6
- left: 0;
7
- z-index: 10;
8
- background: #fafafb;
9
- }
10
- .authUrlPageClass-search {
11
- display: flex;
12
- align-items: center;
13
- justify-content: space-between;
14
- margin: 0px 0px 16px;
15
- }
16
- .DictionaryPage-emptyDom {
17
- margin: 50px 0px 0px;
18
- text-align: center;
19
- }
20
- .DictionaryPage-emptyDom-img {
21
- display: block;
22
- width: 248px;
23
- height: 200px;
24
- margin: auto;
25
- background-image: url('img/empty-data.png');
26
- background-size: 100%;
27
- }
28
- .DictionaryPage-emptyDom-tip {
29
- margin: 0px 0px 10px;
30
- color: #999;
31
- }
32
- .DictionaryPage .ant-tabs-nav {
33
- padding-right: 10%;
34
- }
35
- .DictionaryPage-header {
36
- position: relative;
37
- }
38
- .DictionaryPage-header-search {
39
- display: flex;
40
- align-items: center;
41
- justify-content: space-between;
42
- margin: 0px 0px 16px;
43
- }
44
- .DictionaryPage-header-search .ant-btn {
45
- color: #407fff;
46
- border-color: #407fff;
47
- }
48
- .DictionaryPage-tabsRight-text {
49
- position: absolute;
50
- top: 13%;
51
- right: 0;
52
- width: 10%;
53
- color: #165dff;
54
- text-align: center;
55
- vertical-align: middle;
56
- border-left: 1px solid #ccc;
57
- cursor: pointer;
58
- }
59
- .DictionaryPage-modal {
60
- color: #021429;
61
- }
62
- .DictionaryPage-modal-header {
63
- height: 50px;
64
- padding: 0px 16px;
65
- line-height: 50px;
66
- background-color: #f2f3f4;
67
- }
68
- .DictionaryPage-modal-header-left {
69
- display: inline-block;
70
- width: 80%;
71
- vertical-align: middle;
72
- }
73
- .DictionaryPage-modal-header-operation {
74
- display: inline-block;
75
- width: 20%;
76
- text-align: center;
77
- vertical-align: middle;
78
- }
79
- .DictionaryPage-modal .ant-input-affix-wrapper {
80
- vertical-align: middle;
81
- }
82
- .DictionaryPage-modal .DictionaryPage-modal-content {
83
- padding: 10px 16px 0px;
84
- }
85
- .DictionaryPage-modal-content {
86
- height: 292px;
87
- overflow-y: auto;
88
- }
89
- .DictionaryPage-modal-content-item {
90
- display: flex;
91
- align-items: center;
92
- height: 50px;
93
- line-height: 50px;
94
- border-bottom: 1px solid #f2f3f4;
95
- }
96
- .DictionaryPage-modal-content-itemLeft {
97
- position: relative;
98
- display: inline-block;
99
- flex: 1;
100
- height: 100%;
101
- }
102
- .DictionaryPage-modal-content-itemLeft .error-tip {
103
- position: absolute;
104
- bottom: -28px;
105
- left: 3px;
106
- width: 100%;
107
- color: red;
108
- font-size: 14px;
109
- letter-spacing: 1px;
110
- }
111
- .DictionaryPage-modal-content-itemRight {
112
- display: inline-block;
113
- width: 40px;
114
- color: #165dff;
115
- text-align: center;
116
- cursor: pointer;
117
- }
118
- .DictionaryPage-modal-content .ant-typography.ant-typography-ellipsis.ant-typography-single-line {
119
- height: 50px;
120
- margin-bottom: 0px;
121
- line-height: 50px;
122
- border-bottom: 1px solid #f2f3f4;
123
- }
124
- .DictionaryPage-modal-content .ant-typography-edit {
125
- float: right;
126
- width: 20%;
127
- text-align: center;
128
- }
129
- .DictionaryPage-modal-footer {
130
- display: flex;
131
- align-items: center;
132
- justify-content: space-between;
133
- margin: 16px 0px;
134
- }
135
- .DocumentSetting-header {
136
- height: 48px;
137
- line-height: 48px;
138
- border-bottom: 1px solid #e8efff;
139
- }
140
- .DocumentSetting-search {
141
- display: flex;
142
- align-items: center;
143
- justify-content: space-between;
144
- margin: 16px 0px 16px;
145
- }
146
- .DocumentSetting-emptyDom {
147
- margin: 50px 0px 0px;
148
- text-align: center;
149
- }
150
- .DocumentSetting-emptyDom-img {
151
- display: block;
152
- width: 248px;
153
- height: 200px;
154
- margin: auto;
155
- background-image: url('img/empty-data.png');
156
- background-size: 100%;
157
- }
158
- .DocumentSetting-emptyDom-tip {
159
- margin: 0px 0px 10px;
160
- color: #999;
161
- }
1
+ .system-setting-approval-process-create-bg {
2
+ position: absolute;
3
+ top: 0;
4
+ right: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ z-index: 10;
8
+ background: #fafafb;
9
+ }
10
+ .authUrlPageClass-search {
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: space-between;
14
+ margin: 0px 0px 16px;
15
+ }
16
+ .DictionaryPage-emptyDom {
17
+ margin: 50px 0px 0px;
18
+ text-align: center;
19
+ }
20
+ .DictionaryPage-emptyDom-img {
21
+ display: block;
22
+ width: 248px;
23
+ height: 200px;
24
+ margin: auto;
25
+ background-image: url('img/empty-data.png');
26
+ background-size: 100%;
27
+ }
28
+ .DictionaryPage-emptyDom-tip {
29
+ margin: 0px 0px 10px;
30
+ color: #999;
31
+ }
32
+ .DictionaryPage .ant-tabs-nav {
33
+ padding-right: 10%;
34
+ }
35
+ .DictionaryPage-header {
36
+ position: relative;
37
+ }
38
+ .DictionaryPage-header-search {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: space-between;
42
+ margin: 0px 0px 16px;
43
+ }
44
+ .DictionaryPage-header-search .ant-btn {
45
+ color: #407fff;
46
+ border-color: #407fff;
47
+ }
48
+ .DictionaryPage-tabsRight-text {
49
+ position: absolute;
50
+ top: 13%;
51
+ right: 0;
52
+ width: 10%;
53
+ color: #165dff;
54
+ text-align: center;
55
+ vertical-align: middle;
56
+ border-left: 1px solid #ccc;
57
+ cursor: pointer;
58
+ }
59
+ .DictionaryPage-modal {
60
+ color: #021429;
61
+ }
62
+ .DictionaryPage-modal-header {
63
+ height: 50px;
64
+ padding: 0px 16px;
65
+ line-height: 50px;
66
+ background-color: #f2f3f4;
67
+ }
68
+ .DictionaryPage-modal-header-left {
69
+ display: inline-block;
70
+ width: 80%;
71
+ vertical-align: middle;
72
+ }
73
+ .DictionaryPage-modal-header-operation {
74
+ display: inline-block;
75
+ width: 20%;
76
+ text-align: center;
77
+ vertical-align: middle;
78
+ }
79
+ .DictionaryPage-modal .ant-input-affix-wrapper {
80
+ vertical-align: middle;
81
+ }
82
+ .DictionaryPage-modal .DictionaryPage-modal-content {
83
+ padding: 10px 16px 0px;
84
+ }
85
+ .DictionaryPage-modal-content {
86
+ height: 292px;
87
+ overflow-y: auto;
88
+ }
89
+ .DictionaryPage-modal-content-item {
90
+ display: flex;
91
+ align-items: center;
92
+ height: 50px;
93
+ line-height: 50px;
94
+ border-bottom: 1px solid #f2f3f4;
95
+ }
96
+ .DictionaryPage-modal-content-itemLeft {
97
+ position: relative;
98
+ display: inline-block;
99
+ flex: 1;
100
+ height: 100%;
101
+ }
102
+ .DictionaryPage-modal-content-itemLeft .error-tip {
103
+ position: absolute;
104
+ bottom: -28px;
105
+ left: 3px;
106
+ width: 100%;
107
+ color: red;
108
+ font-size: 14px;
109
+ letter-spacing: 1px;
110
+ }
111
+ .DictionaryPage-modal-content-itemRight {
112
+ display: inline-block;
113
+ width: 40px;
114
+ color: #165dff;
115
+ text-align: center;
116
+ cursor: pointer;
117
+ }
118
+ .DictionaryPage-modal-content .ant-typography.ant-typography-ellipsis.ant-typography-single-line {
119
+ height: 50px;
120
+ margin-bottom: 0px;
121
+ line-height: 50px;
122
+ border-bottom: 1px solid #f2f3f4;
123
+ }
124
+ .DictionaryPage-modal-content .ant-typography-edit {
125
+ float: right;
126
+ width: 20%;
127
+ text-align: center;
128
+ }
129
+ .DictionaryPage-modal-footer {
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: space-between;
133
+ margin: 16px 0px;
134
+ }
135
+ .DocumentSetting-header {
136
+ height: 48px;
137
+ line-height: 48px;
138
+ border-bottom: 1px solid #e8efff;
139
+ }
140
+ .DocumentSetting-search {
141
+ display: flex;
142
+ align-items: center;
143
+ justify-content: space-between;
144
+ margin: 16px 0px 16px;
145
+ }
146
+ .DocumentSetting-emptyDom {
147
+ margin: 50px 0px 0px;
148
+ text-align: center;
149
+ }
150
+ .DocumentSetting-emptyDom-img {
151
+ display: block;
152
+ width: 248px;
153
+ height: 200px;
154
+ margin: auto;
155
+ background-image: url('img/empty-data.png');
156
+ background-size: 100%;
157
+ }
158
+ .DocumentSetting-emptyDom-tip {
159
+ margin: 0px 0px 10px;
160
+ color: #999;
161
+ }