venus-design 1.0.30 → 1.0.32

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.
@@ -8,6 +8,12 @@ export declare const getUrlSearchStr: (params: any) => string;
8
8
  export declare const renderMillion: (num: any) => any;
9
9
  export declare const isNotNullVenus: (str: string) => boolean;
10
10
  export declare const renderFileNameAndIds: (fileList: any) => string | undefined;
11
+ /**
12
+ * 处理密级上传值
13
+ * @param data
14
+ * @returns
15
+ */
16
+ export declare const handleSecLevelUploadValue: (fileList: any, formData: any) => string | undefined;
11
17
  export declare const renderFileNameAndIdsNew: (fileList: any) => string | undefined;
12
18
  export declare const renderTableFileNameAndIds: (data: any) => {
13
19
  fileId: any;
@@ -95,9 +95,14 @@ export var renderFileNameAndIds = function renderFileNameAndIds(fileList) {
95
95
  }
96
96
  return fileIds.length > 0 ? JSON.stringify(fileIds) : undefined;
97
97
  };
98
- //处理附件名称
99
- export var renderFileNameAndIdsNew = function renderFileNameAndIdsNew(fileList) {
100
- var fileIds = [];
98
+
99
+ /**
100
+ * 处理密级上传值
101
+ * @param data
102
+ * @returns
103
+ */
104
+ export var handleSecLevelUploadValue = function handleSecLevelUploadValue(fileList, formData) {
105
+ var result = [];
101
106
  if (fileList.length > 0) {
102
107
  var _iterator2 = _createForOfIteratorHelper(fileList),
103
108
  _step2;
@@ -105,6 +110,39 @@ export var renderFileNameAndIdsNew = function renderFileNameAndIdsNew(fileList)
105
110
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
106
111
  var con = _step2.value;
107
112
  var resp = con.response;
113
+ if (resp && resp.data != undefined) {
114
+ var fileId = resp != undefined ? resp.data.fileId : con.fileId;
115
+ result.push({
116
+ name: resp != undefined ? resp.data.name : con.name,
117
+ fileId: fileId,
118
+ secId: formData[fileId] != undefined ? formData[fileId].secId : undefined
119
+ });
120
+ } else {
121
+ result.push({
122
+ name: con.name,
123
+ fileId: con.fileId,
124
+ secId: formData[con.fileId] != undefined ? formData[con.fileId].secId : undefined
125
+ });
126
+ }
127
+ }
128
+ } catch (err) {
129
+ _iterator2.e(err);
130
+ } finally {
131
+ _iterator2.f();
132
+ }
133
+ }
134
+ return result.length > 0 ? JSON.stringify(result) : undefined;
135
+ };
136
+ //处理附件名称
137
+ export var renderFileNameAndIdsNew = function renderFileNameAndIdsNew(fileList) {
138
+ var fileIds = [];
139
+ if (fileList.length > 0) {
140
+ var _iterator3 = _createForOfIteratorHelper(fileList),
141
+ _step3;
142
+ try {
143
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
144
+ var con = _step3.value;
145
+ var resp = con.response;
108
146
  if (resp && resp.data != undefined) {
109
147
  fileIds.push({
110
148
  name: resp != undefined ? resp.data.name : con.name,
@@ -114,9 +152,9 @@ export var renderFileNameAndIdsNew = function renderFileNameAndIdsNew(fileList)
114
152
  }
115
153
  }
116
154
  } catch (err) {
117
- _iterator2.e(err);
155
+ _iterator3.e(err);
118
156
  } finally {
119
- _iterator2.f();
157
+ _iterator3.f();
120
158
  }
121
159
  }
122
160
  return fileIds.length > 0 ? JSON.stringify(fileIds) : undefined;
@@ -130,20 +168,20 @@ export var renderTableFileNameAndIds = function renderTableFileNameAndIds(data)
130
168
  if (data != null && data != "") {
131
169
  var fileInfo = JSON.parse(data);
132
170
  if (fileInfo.length > 0) {
133
- var _iterator3 = _createForOfIteratorHelper(fileInfo),
134
- _step3;
171
+ var _iterator4 = _createForOfIteratorHelper(fileInfo),
172
+ _step4;
135
173
  try {
136
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
137
- var con = _step3.value;
174
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
175
+ var con = _step4.value;
138
176
  fileList.push({
139
177
  fileId: con.fileId,
140
178
  fileName: con.name
141
179
  });
142
180
  }
143
181
  } catch (err) {
144
- _iterator3.e(err);
182
+ _iterator4.e(err);
145
183
  } finally {
146
- _iterator3.f();
184
+ _iterator4.f();
147
185
  }
148
186
  }
149
187
  }
@@ -169,11 +207,11 @@ export var haveSecLevel = function haveSecLevel(data) {
169
207
  var formData = data;
170
208
  var fileList = [];
171
209
  if (data && data.fileName && data.fileName.length > 0) {
172
- var _iterator4 = _createForOfIteratorHelper(data.fileName),
173
- _step4;
210
+ var _iterator5 = _createForOfIteratorHelper(data.fileName),
211
+ _step5;
174
212
  try {
175
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
176
- var file = _step4.value;
213
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
214
+ var file = _step5.value;
177
215
  if (file.secId != undefined) {
178
216
  if (file.response != undefined && file.response.code == 200) {
179
217
  fileList.push(file.id);
@@ -185,9 +223,9 @@ export var haveSecLevel = function haveSecLevel(data) {
185
223
  }
186
224
  }
187
225
  } catch (err) {
188
- _iterator4.e(err);
226
+ _iterator5.e(err);
189
227
  } finally {
190
- _iterator4.f();
228
+ _iterator5.f();
191
229
  }
192
230
  }
193
231
  formData["fileList"] = fileList;
@@ -200,11 +238,11 @@ export var haveSecLevel = function haveSecLevel(data) {
200
238
  export var haveSecLevelNew = function haveSecLevelNew(data) {
201
239
  var formData = data;
202
240
  if (data.fileName != undefined && data.fileName.length > 0) {
203
- var _iterator5 = _createForOfIteratorHelper(data.fileName),
204
- _step5;
241
+ var _iterator6 = _createForOfIteratorHelper(data.fileName),
242
+ _step6;
205
243
  try {
206
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
207
- var file = _step5.value;
244
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
245
+ var file = _step6.value;
208
246
  if (file.secId != undefined) {
209
247
  return true;
210
248
  } else {
@@ -212,9 +250,9 @@ export var haveSecLevelNew = function haveSecLevelNew(data) {
212
250
  }
213
251
  }
214
252
  } catch (err) {
215
- _iterator5.e(err);
253
+ _iterator6.e(err);
216
254
  } finally {
217
- _iterator5.f();
255
+ _iterator6.f();
218
256
  }
219
257
  } else {
220
258
  return true;
@@ -132,4 +132,8 @@ export declare const VenusFormSlider: (props: any) => React.JSX.Element;
132
132
  * @returns
133
133
  */
134
134
  export declare const VenusFormUploadPro: (props: any) => React.JSX.Element;
135
+ /**
136
+ * 新上传组件
137
+ */
138
+ export declare const VenusFormUploadSecLevel: (props: any) => React.JSX.Element;
135
139
  export default ProForm;
@@ -65,13 +65,14 @@ var _excluded = ["children", "pageLoading", "pageFormClassName", "submitter", "s
65
65
  _excluded37 = ["comAttr", "request", "fieldNames", "otherKeys", "placeholder", "disabled"],
66
66
  _excluded38 = ["comAttr", "placeholder", "disabled", "isDuo"],
67
67
  _excluded39 = ["comAttr", "placeholder", "disabled", "isDuo"],
68
- _excluded40 = ["comAttr", "placeholder", "disabled", "isDuo"];
68
+ _excluded40 = ["comAttr", "placeholder", "disabled", "isDuo"],
69
+ _excluded41 = ["comAttr", "placeholder", "disabled", "isDuo"];
69
70
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
70
71
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
71
72
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
72
73
  import React from 'react';
73
74
  import classnames from 'classnames';
74
- import { CheckBoxInput, NumberPercent, NumberUnit, RadioAndInput, Search, TreeSelect, UploadImage, VenusUploadSecLevelForm, Upload } from "./..";
75
+ import { CheckBoxInput, NumberPercent, NumberUnit, RadioAndInput, Search, TreeSelect, UploadImage, VenusUploadSecLevelForm, Upload, VenusUploadSecLevel } from "./..";
75
76
  import "./styles.less";
76
77
  import { StyleProvider, legacyLogicalPropertiesTransformer } from "@ant-design/cssinjs";
77
78
  var ProForm = function ProForm(props) {
@@ -553,7 +554,8 @@ export var VenusFormSelect = function VenusFormSelect(props) {
553
554
  }
554
555
  return Object.keys(valueEnum).map(function (ls) {
555
556
  return /*#__PURE__*/React.createElement(_Select.Option, {
556
- value: ls
557
+ value: ls,
558
+ key: ls
557
559
  }, valueEnum[ls]);
558
560
  });
559
561
  };
@@ -903,6 +905,23 @@ export var VenusFormUploadPro = function VenusFormUploadPro(props) {
903
905
  disabled: disabled
904
906
  }, comAttr)));
905
907
  };
908
+
909
+ /**
910
+ * 新上传组件
911
+ */
912
+ export var VenusFormUploadSecLevel = function VenusFormUploadSecLevel(props) {
913
+ var _props$comAttr36 = props.comAttr,
914
+ comAttr = _props$comAttr36 === void 0 ? {} : _props$comAttr36,
915
+ placeholder = props.placeholder,
916
+ disabled = props.disabled,
917
+ isDuo = props.isDuo,
918
+ others = _objectWithoutProperties(props, _excluded41);
919
+ return /*#__PURE__*/React.createElement(FormItem2, others, /*#__PURE__*/React.createElement(VenusUploadSecLevel, _extends({
920
+ placeholder: placeholder,
921
+ isDuo: isDuo,
922
+ disabled: disabled
923
+ }, comAttr)));
924
+ };
906
925
  ProForm.Group = FormGroup;
907
926
  ProForm.Item = FormItem;
908
927
  export default ProForm;
@@ -13,7 +13,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import React, { useState, useEffect } from 'react';
16
+ import React, { useState } from 'react';
17
17
  import lodash from 'lodash';
18
18
  import { getSecLevelDataList } from "../..";
19
19
  import { StyleProvider, legacyLogicalPropertiesTransformer } from "@ant-design/cssinjs";
@@ -32,9 +32,6 @@ var SelectKYSeclevel = function SelectKYSeclevel(props) {
32
32
  _useState6 = _slicedToArray(_useState5, 2),
33
33
  data = _useState6[0],
34
34
  saveData = _useState6[1];
35
- useEffect(function () {
36
- saveValue(props.value);
37
- }, [props.value]);
38
35
  var request = /*#__PURE__*/function () {
39
36
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
40
37
  var list, res, _data;
@@ -100,7 +97,7 @@ var SelectKYSeclevel = function SelectKYSeclevel(props) {
100
97
  },
101
98
  showSearch: true,
102
99
  disabled: props.disabled || false,
103
- value: value,
100
+ value: props.value,
104
101
  placeholder: "\u8BF7\u9009\u62E9\u5BC6\u7EA7",
105
102
  showArrow: false,
106
103
  filterOption: false,
@@ -151,7 +151,7 @@ export var setVenusFormFormate = function setVenusFormFormate(formItemData, val)
151
151
  var handleFormValueType = VENUS_FORM_ITEM_VALUE[con.formUnitType] || function () {
152
152
  return {};
153
153
  };
154
- var data = handleFormValueType(val[handleDataIndex(con.fieldId, con)], con);
154
+ var data = handleFormValueType(val[handleDataIndex(con.fieldId, con)], con, val);
155
155
  valData = _objectSpread(_objectSpread({}, valData), data);
156
156
  if (con.parameterSource.haveSec) {
157
157
  //附件带密级组件
@@ -4,40 +4,43 @@ import React from "react";
4
4
  * 保存时表单项值的处理
5
5
  */
6
6
  export declare const VENUS_FORM_ITEM_VALUE: {
7
- Select: (data: any, formItem: VenusFormItemInterface) => {
7
+ Select: (data: any, formItem: VenusFormItemInterface, val: any) => {
8
8
  [x: string]: string;
9
9
  };
10
- UserPicker: (data: any, formItem: VenusFormItemInterface) => {
10
+ UserPicker: (data: any, formItem: VenusFormItemInterface, val: any) => {
11
11
  [x: string]: any;
12
12
  } | undefined;
13
- DeptPicker: (data: any, formItem: VenusFormItemInterface) => {
13
+ DeptPicker: (data: any, formItem: VenusFormItemInterface, val: any) => {
14
14
  [x: string]: any;
15
15
  };
16
- TimePicker: (data: any, formItem: VenusFormItemInterface) => {
16
+ TimePicker: (data: any, formItem: VenusFormItemInterface, val: any) => {
17
17
  [x: string]: number | undefined;
18
18
  };
19
- DatePicker: (data: any, formItem: VenusFormItemInterface) => {
19
+ DatePicker: (data: any, formItem: VenusFormItemInterface, val: any) => {
20
20
  [x: string]: any;
21
21
  };
22
- SecurityLevel: (data: any, formItem: VenusFormItemInterface) => {
22
+ SecurityLevel: (data: any, formItem: VenusFormItemInterface, val: any) => {
23
23
  [x: string]: any;
24
24
  };
25
- Radio: (data: any, formItem: VenusFormItemInterface) => {
25
+ Radio: (data: any, formItem: VenusFormItemInterface, val: any) => {
26
26
  [x: string]: any;
27
27
  };
28
- Checkbox: (data: any, formItem: VenusFormItemInterface) => {
28
+ Checkbox: (data: any, formItem: VenusFormItemInterface, val: any) => {
29
29
  [x: string]: any;
30
30
  };
31
- CheckBoxInput: (data: any, formItem: VenusFormItemInterface) => {
31
+ CheckBoxInput: (data: any, formItem: VenusFormItemInterface, val: any) => {
32
32
  [x: string]: string;
33
33
  };
34
- upload: (data: any, formItem: VenusFormItemInterface) => {
34
+ upload: (data: any, formItem: VenusFormItemInterface, val: any) => {
35
35
  [x: string]: any;
36
36
  };
37
- CustomComponent: (data: any, formItem: VenusFormItemInterface) => {
37
+ uploadSecLevel: (data: any, formItem: VenusFormItemInterface, val: any) => {
38
+ [x: string]: string | undefined;
39
+ };
40
+ CustomComponent: (data: any, formItem: VenusFormItemInterface, val: any) => {
38
41
  [x: string]: any;
39
42
  };
40
- uploadImage: (data: any, formItem: VenusFormItemInterface) => void;
43
+ uploadImage: (data: any, formItem: VenusFormItemInterface, val: any) => void;
41
44
  };
42
45
  export declare const handleDatePickerData: (data: any, picker: any) => any;
43
46
  /**
@@ -79,6 +82,7 @@ export declare const VENUS_FORM_EDIT_ITEM_VALUE: {
79
82
  upload: (data: any, formItem: VenusFormItemInterface) => {
80
83
  [x: string]: any;
81
84
  };
85
+ uploadSecLevel: (data: any, formItem: VenusFormItemInterface) => {};
82
86
  CustomComponent: (data: any, formItem: VenusFormItemInterface) => {
83
87
  [x: string]: {
84
88
  value: any;
@@ -10,7 +10,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- import { FormItem2, SelectKYSeclevel, SelectUserBySecLevelId, VenusFormRate, VenusFormCheckBoxGroup, VenusFormCheckBoxInputGroup, VenusFormDatePicker, VenusFormNumberPercent, VenusFormNumberUnit, VenusFormRadioGroup, VenusFormSearch, VenusFormSelect, VenusFormSwitch, VenusFormText, VenusFormTextarea, VenusFormTreeSelect, VenusFormUpload, VenusFormUploadImage, VenusFormUploadPro, VenusFormNumber, VenusFormSlider } from "./..";
13
+ import { FormItem2, SelectKYSeclevel, SelectUserBySecLevelId, VenusFormRate, VenusFormCheckBoxGroup, VenusFormCheckBoxInputGroup, VenusFormDatePicker, VenusFormNumberPercent, VenusFormNumberUnit, VenusFormRadioGroup, VenusFormSearch, VenusFormSelect, VenusFormSwitch, VenusFormText, VenusFormTextarea, VenusFormTreeSelect, VenusFormUpload, VenusFormUploadImage, VenusFormUploadPro, VenusFormNumber, VenusFormSlider, VenusFormUploadSecLevel, handleSecLevelUploadValue } from "./..";
14
14
  import React from "react";
15
15
  import { handleTreeSelectOptions, haveQt, radioEnumData, validatorListToValidator, zeroAndOneToTrueOrFalse } from "./handleVenusFormFunctions";
16
16
  import { dataToEnum } from "./..";
@@ -37,6 +37,7 @@ var VENUS_FORM_PLACHOLDER_TYPE = {
37
37
  "upload": "请选择",
38
38
  "treeSelect": "请选择",
39
39
  "search": "请输入",
40
+ "uploadSecLevel": "请选择",
40
41
  "captcha": "请输入",
41
42
  "password": "请输入",
42
43
  "digit": "请输入",
@@ -52,10 +53,10 @@ var VENUS_FORM_PLACHOLDER_TYPE = {
52
53
  * 保存时表单项值的处理
53
54
  */
54
55
  export var VENUS_FORM_ITEM_VALUE = {
55
- "Select": function Select(data, formItem) {
56
+ "Select": function Select(data, formItem, val) {
56
57
  return _defineProperty({}, formItem.fieldId, [].concat(data !== null && data !== void 0 ? data : []).filter(Boolean).join(',') || '');
57
58
  },
58
- "UserPicker": function UserPicker(data, formItem) {
59
+ "UserPicker": function UserPicker(data, formItem, val) {
59
60
  var nameAndId = handleNameAndIdSplit(formItem.fieldId);
60
61
  if (formItem.parameterSource.oldUser != undefined && formItem.parameterSource.oldUser) {
61
62
  if (data == undefined) {
@@ -89,7 +90,7 @@ export var VENUS_FORM_ITEM_VALUE = {
89
90
  return setUserFormate(data, nameAndId[0], nameAndId[1]);
90
91
  }
91
92
  },
92
- "DeptPicker": function DeptPicker(data, formItem) {
93
+ "DeptPicker": function DeptPicker(data, formItem, val) {
93
94
  var nameAndId = handleNameAndIdSplit(formItem.fieldId);
94
95
  if (data != undefined) {
95
96
  var orgVal = _typeof(data[0]) === 'object' ? data[0] : {};
@@ -117,20 +118,20 @@ export var VENUS_FORM_ITEM_VALUE = {
117
118
  return _defineProperty(_defineProperty({}, nameAndId[0], undefined), nameAndId[1], undefined);
118
119
  }
119
120
  },
120
- "TimePicker": function TimePicker(data, formItem) {
121
+ "TimePicker": function TimePicker(data, formItem, val) {
121
122
  var dataVal = data != null && data != undefined ? new Date(data).getTime() : undefined;
122
123
  return _defineProperty({}, formItem.fieldId, dataVal);
123
124
  },
124
- "DatePicker": function DatePicker(data, formItem) {
125
+ "DatePicker": function DatePicker(data, formItem, val) {
125
126
  var dataVal = data != null && data != undefined ? formItem.parameterSource.picker != undefined ? handleDatePickerData(data, formItem.parameterSource.picker) : new Date(data).getTime() : undefined;
126
127
  return _defineProperty({}, formItem.fieldId, dataVal);
127
128
  },
128
- "SecurityLevel": function SecurityLevel(data, formItem) {
129
+ "SecurityLevel": function SecurityLevel(data, formItem, val) {
129
130
  var dataVal = data != null && data != undefined ? data : {};
130
131
  var secLevelVal = _typeof(dataVal) === 'object' ? dataVal : {};
131
132
  return _defineProperty({}, formItem.fieldId, secLevelVal.value);
132
133
  },
133
- "Radio": function Radio(data, formItem) {
134
+ "Radio": function Radio(data, formItem, val) {
134
135
  var dataVal = data != null && data != undefined ? data : {};
135
136
  var valueData = dataVal;
136
137
  if (dataVal.value != undefined && dataVal.input != undefined && dataVal.input != "") {
@@ -141,7 +142,7 @@ export var VENUS_FORM_ITEM_VALUE = {
141
142
  console.log(valueData);
142
143
  return _defineProperty({}, formItem.fieldId, valueData);
143
144
  },
144
- "Checkbox": function Checkbox(data, formItem) {
145
+ "Checkbox": function Checkbox(data, formItem, val) {
145
146
  var dataVal = data != null && data != undefined ? data : {};
146
147
  var valueData = dataVal;
147
148
  if (dataVal != undefined && dataVal.length > 0) {
@@ -155,7 +156,7 @@ export var VENUS_FORM_ITEM_VALUE = {
155
156
  }
156
157
  return _defineProperty({}, formItem.fieldId, valueData);
157
158
  },
158
- "CheckBoxInput": function CheckBoxInput(data, formItem) {
159
+ "CheckBoxInput": function CheckBoxInput(data, formItem, val) {
159
160
  var dataVal = data != null && data != undefined ? data : {};
160
161
  var dataValue = JSON.stringify(dataVal);
161
162
  var dataSave = dataValue;
@@ -167,13 +168,16 @@ export var VENUS_FORM_ITEM_VALUE = {
167
168
  }
168
169
  return _defineProperty({}, formItem.fieldId, dataSave);
169
170
  },
170
- "upload": function upload(data, formItem) {
171
+ "upload": function upload(data, formItem, val) {
171
172
  var secName = formItem.fieldId + "Sec";
172
173
  return _defineProperty(_defineProperty({}, formItem.fieldId, data != undefined && data.length > 0 ? renderFileNameAndIds(data) : ""), secName, haveSecLevel({
173
174
  fileName: data
174
175
  }));
175
176
  },
176
- "CustomComponent": function CustomComponent(data, formItem) {
177
+ "uploadSecLevel": function uploadSecLevel(data, formItem, val) {
178
+ return _defineProperty({}, formItem.fieldId, data != undefined && data.length > 0 ? handleSecLevelUploadValue(data, val) : "");
179
+ },
180
+ "CustomComponent": function CustomComponent(data, formItem, val) {
177
181
  if (data == undefined) {
178
182
  data = {
179
183
  id: undefined,
@@ -184,7 +188,7 @@ export var VENUS_FORM_ITEM_VALUE = {
184
188
  var nameAndId = handleNameAndIdSplit(formItem.fieldId);
185
189
  return _defineProperty(_defineProperty({}, nameAndId[0], data.value || data.id), nameAndId[1], data.label || data.name);
186
190
  },
187
- "uploadImage": function uploadImage(data, formItem) {}
191
+ "uploadImage": function uploadImage(data, formItem, val) {}
188
192
  };
189
193
  //处理日期
190
194
  export var handleDatePickerData = function handleDatePickerData(data, picker) {
@@ -336,6 +340,26 @@ export var VENUS_FORM_EDIT_ITEM_VALUE = {
336
340
  }
337
341
  return _defineProperty({}, formItem.fieldId, dataJson);
338
342
  },
343
+ "uploadSecLevel": function uploadSecLevel(data, formItem) {
344
+ var dataJson = undefined;
345
+ if (isVenusStrNotNull(data[formItem.fieldId])) {
346
+ try {
347
+ dataJson = JSON.parse(data[formItem.fieldId]);
348
+ } catch (e) {
349
+ console.log("附件转换失败!");
350
+ }
351
+ }
352
+ var dataSec = {};
353
+ if (dataJson != undefined) {
354
+ dataJson.forEach(function (item) {
355
+ //@ts-ignore
356
+ dataSec[item.fileId] = {
357
+ secId: item.secId
358
+ };
359
+ });
360
+ }
361
+ return _objectSpread(_defineProperty({}, formItem.fieldId, dataJson), dataSec);
362
+ },
339
363
  "CustomComponent": function CustomComponent(data, formItem) {
340
364
  var nameAndId = handleNameAndIdSplit(formItem.fieldId);
341
365
  var dataIndex = nameAndId[1];
@@ -723,10 +747,10 @@ export var VENUS_FORM_ITEM_TYPE = {
723
747
  "CustomComponent": function CustomComponent(column, type, disabled, formData) {
724
748
  try {
725
749
  //@ts-ignore
726
- var handleFormCustomType = VENUS_FORM_CUSTOMCOM_TYPE[column.parameterSource.compName || "Demo"] || function (props) {
750
+ var handleFormCustomType = VENUS_FORM_CUSTOMCOM_TYPE[column.parameterSource.compName] || function (props) {
727
751
  return /*#__PURE__*/React.createElement(_Input, _extends({
728
752
  //@ts-ignore
729
- placeholder: VENUS_FORM_PLACHOLDER_TYPE[column.formUnitType] + column.fieldName,
753
+ placeholder: "请输入" + column.fieldName,
730
754
  disabled: disabled
731
755
  }, column.parameterSource));
732
756
  };
@@ -817,6 +841,36 @@ export var VENUS_FORM_ITEM_TYPE = {
817
841
  },
818
842
  //带后缀的文本输入框(暂不实现)
819
843
  "textUnit": function textUnit() {},
844
+ "uploadSecLevel": function uploadSecLevel(column, type, disabled, formData) {
845
+ return /*#__PURE__*/React.createElement(VenusFormUploadSecLevel, {
846
+ width: "md",
847
+ className: column.formItemClassName,
848
+ labelAlign: column.labelAlign || "left",
849
+ isDuo: column.parameterSource.uploadMultiple || false,
850
+ name: column.fieldId,
851
+ key: column.fieldId,
852
+ label: column.fieldName,
853
+ style: column.formWidth != null ? null : {
854
+ width: column.formWidth
855
+ },
856
+ disabled: disabled ? disabled : isNotEditScene(type, column.nonEditableScene),
857
+ span: column.formWidth || 8 //@ts-ignore
858
+ ,
859
+ placeholder: VENUS_FORM_PLACHOLDER_TYPE[column.formUnitType] + column.fieldName
860
+ //附件密级根据某个字段变化时配置uploadSecField:“字段名”
861
+ //@ts-ignore
862
+ ,
863
+ comAttr: column.parameterSource.uploadSecField && {
864
+ secId: formData[column.parameterSource.uploadSecField]
865
+ },
866
+ rules: [{
867
+ //是否必填通过其他字段判断时可使用required:{label:string,fieldName:string,value:any}
868
+ required: column.parameterSource.required ? getOperatorByLabel(column.parameterSource.required, formData, column) : zeroAndOneToTrueOrFalse(column.formRequiredFlag),
869
+ //@ts-ignore
870
+ message: VENUS_FORM_PLACHOLDER_TYPE[column.formUnitType] + column.fieldName
871
+ }]
872
+ });
873
+ },
820
874
  "upload": function upload(column, type, disabled, formData) {
821
875
  return column.parameterSource.haveSec ? /*#__PURE__*/React.createElement(VenusFormUploadPro, {
822
876
  width: "md",
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Demo: React.FC;
3
+ export default Demo;
@@ -0,0 +1,61 @@
1
+ import "antd/es/button/style";
2
+ import _Button from "antd/es/button";
3
+ import "antd/es/form/style";
4
+ import _Form from "antd/es/form";
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import { VenusUploadSecLevel } from "./..";
12
+ import React, { useState, useRef } from 'react';
13
+ var Demo = function Demo() {
14
+ var _useState = useState([{
15
+ fileId: "sdfs",
16
+ name: "5555.txt"
17
+ }, {
18
+ fileId: "asdfasd",
19
+ name: "5555.docx"
20
+ }]),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ files = _useState2[0],
23
+ setFiles = _useState2[1];
24
+ var ref = useRef(null);
25
+ var _Form$useForm = _Form.useForm(),
26
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
27
+ form = _Form$useForm2[0];
28
+ form.setFieldsValue({
29
+ file1: [{
30
+ fileId: "sdfs",
31
+ name: "5555.txt"
32
+ }, {
33
+ fileId: "asdfasd",
34
+ name: "5555.docx"
35
+ }],
36
+ sdfs: {
37
+ secId: {
38
+ label: "内部",
39
+ value: 6
40
+ }
41
+ }
42
+ });
43
+ return /*#__PURE__*/React.createElement(_Form, {
44
+ form: form,
45
+ onFinish: function onFinish(v) {
46
+ console.log(v);
47
+ },
48
+ scrollToFirstError: true
49
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
50
+ label: "\u9644\u4EF6",
51
+ name: "file1",
52
+ rules: [{
53
+ required: true,
54
+ message: '请上传至少一个文件'
55
+ }]
56
+ }, /*#__PURE__*/React.createElement(VenusUploadSecLevel, null)), /*#__PURE__*/React.createElement(_Button, {
57
+ type: "primary",
58
+ htmlType: "submit"
59
+ }, "\u63D0\u4EA4"));
60
+ };
61
+ export default Demo;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ declare const VenusUploadSecLevel: (props: any) => React.JSX.Element;
4
+ export default VenusUploadSecLevel;
@@ -0,0 +1,313 @@
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
+ import "antd/es/spin/style";
3
+ import _Spin from "antd/es/spin";
4
+ import "antd/es/button/style";
5
+ import _Button from "antd/es/button";
6
+ import "antd/es/tooltip/style";
7
+ import _Tooltip from "antd/es/tooltip";
8
+ import "antd/es/message/style";
9
+ import _message from "antd/es/message";
10
+ import "antd/es/upload/style";
11
+ import _Upload from "antd/es/upload";
12
+ import "antd/es/form/style";
13
+ import _Form from "antd/es/form";
14
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
15
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
18
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
19
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
20
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
21
+ 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; }
22
+ 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; }
23
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
25
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
26
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
28
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
30
+ 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; } }
31
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
+ import React, { useState, useEffect, useRef } from 'react';
33
+ import { UploadOutlined, DownloadOutlined, DeleteOutlined } from '@ant-design/icons';
34
+ import styled from '@emotion/styled';
35
+ import { DownLoad, storage, deleteNewFile, downloadFile, uploadFile, SelectKYSeclevel, MAX_SIZE } from "./..";
36
+ import "./styles.less";
37
+ var Item = _Form.Item;
38
+ import { updateFileSecLevelNew } from "./service";
39
+ var Dragger = _Upload.Dragger;
40
+ var VenusUploadSecLevel = function VenusUploadSecLevel(props) {
41
+ var _useState = useState([]),
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ fileList = _useState2[0],
44
+ setFileList = _useState2[1];
45
+ var downNode = useRef(null);
46
+ var _useState3 = useState(false),
47
+ _useState4 = _slicedToArray(_useState3, 2),
48
+ isup = _useState4[0],
49
+ setisup = _useState4[1];
50
+ var _useState5 = useState(false),
51
+ _useState6 = _slicedToArray(_useState5, 2),
52
+ load = _useState6[0],
53
+ setload = _useState6[1];
54
+ var _useState7 = useState(undefined),
55
+ _useState8 = _slicedToArray(_useState7, 2),
56
+ level = _useState8[0],
57
+ setLevel = _useState8[1];
58
+ useEffect(function () {
59
+ var value = (props.value || []).map(function (ls) {
60
+ return _objectSpread(_objectSpread({
61
+ fileId: ls.response != undefined && ls.response.data != undefined && ls.response.data.fileId != undefined ? ls.response.data.fileId : ls.fileId
62
+ }, ls), {}, {
63
+ status: 'done',
64
+ uid: ls.uid || ls.fileId
65
+ });
66
+ });
67
+ setFileList(value);
68
+ if (props.isDuo != undefined && props.isDuo == false) {
69
+ if (fileList.length > 0) {
70
+ setisup(true);
71
+ }
72
+ if (fileList.length < 1) {
73
+ setisup(false);
74
+ }
75
+ }
76
+ }, [props.value]);
77
+ /**
78
+ * 上传文件
79
+ */
80
+ var onChange = function onChange(info) {
81
+ var files = [];
82
+ var dataLevel = [];
83
+ (props.value || []).map(function (v, n) {
84
+ dataLevel[v.id] = v.secId;
85
+ });
86
+ var _iterator = _createForOfIteratorHelper(info.fileList),
87
+ _step;
88
+ try {
89
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
+ var file = _step.value;
91
+ if (file.response && file.response.success) {
92
+ file.id = file.response.data.id;
93
+ file.secId = dataLevel[file.uid] != undefined ? {
94
+ label: dataLevel[file.uid].label,
95
+ value: dataLevel[file.uid].value
96
+ } : level && level[file.uid] != undefined ? {
97
+ label: level[file.uid].label,
98
+ value: level[file.uid].value
99
+ } : undefined;
100
+ files.push(file);
101
+ }
102
+ if (file.response == undefined) {
103
+ files.push(file);
104
+ }
105
+ if (file.response && !file.response.success) {
106
+ _message.warning("文件上传失败!请重新上传!");
107
+ }
108
+ }
109
+ } catch (err) {
110
+ _iterator.e(err);
111
+ } finally {
112
+ _iterator.f();
113
+ }
114
+ setFileList(files);
115
+ propsOnChange(files);
116
+ };
117
+ var propsOnChange = function propsOnChange(files) {
118
+ if (props.onChange) {
119
+ props.onChange(files);
120
+ }
121
+ };
122
+ var onRemove = /*#__PURE__*/function () {
123
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
124
+ var res;
125
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
126
+ while (1) switch (_context.prev = _context.next) {
127
+ case 0:
128
+ _context.next = 2;
129
+ return deleteNewFile(file.fileId);
130
+ case 2:
131
+ res = _context.sent;
132
+ if (res && res.success) {
133
+ _message.success(res.message);
134
+ }
135
+ case 4:
136
+ case "end":
137
+ return _context.stop();
138
+ }
139
+ }, _callee);
140
+ }));
141
+ return function onRemove(_x) {
142
+ return _ref.apply(this, arguments);
143
+ };
144
+ }();
145
+ /*
146
+ * 选择密级改变
147
+ * @param info
148
+ */
149
+ var onSelectLevelChange = function onSelectLevelChange() {
150
+ var files = [];
151
+ var dataLevel = [];
152
+ (props.value || []).map(function (v, n) {
153
+ dataLevel[v.id] = v.secId;
154
+ });
155
+ var _iterator2 = _createForOfIteratorHelper(fileList),
156
+ _step2;
157
+ try {
158
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
159
+ var file = _step2.value;
160
+ file.secId = dataLevel[file.uid] != undefined ? {
161
+ label: dataLevel[file.uid].label,
162
+ value: dataLevel[file.uid].value
163
+ } : level && level[file.uid] != undefined ? {
164
+ label: level[file.uid].label,
165
+ value: level[file.uid].value
166
+ } : undefined;
167
+ files.push(file);
168
+ }
169
+ } catch (err) {
170
+ _iterator2.e(err);
171
+ } finally {
172
+ _iterator2.f();
173
+ }
174
+ setFileList(files);
175
+ propsOnChange(files);
176
+ };
177
+ // 密级改变时,更新文件密级
178
+ useEffect(function () {
179
+ if (level != undefined) {
180
+ onSelectLevelChange();
181
+ }
182
+ }, [level]);
183
+
184
+ /**
185
+ * 选择密级
186
+ */
187
+ var onSelectLevel = /*#__PURE__*/function () {
188
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(v, file) {
189
+ var fileId;
190
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
191
+ while (1) switch (_context2.prev = _context2.next) {
192
+ case 0:
193
+ //设置表单属性
194
+ setLevel(_objectSpread(_objectSpread({}, level), {}, _defineProperty({}, file.uid, v)));
195
+ if (!(file.fileId || file.response != undefined && file.response.code == 200)) {
196
+ _context2.next = 5;
197
+ break;
198
+ }
199
+ fileId = file.fileId || file.response.data.fileId;
200
+ _context2.next = 5;
201
+ return updateFileSecLevelNew(fileId, v.value);
202
+ case 5:
203
+ case "end":
204
+ return _context2.stop();
205
+ }
206
+ }, _callee2);
207
+ }));
208
+ return function onSelectLevel(_x2, _x3) {
209
+ return _ref2.apply(this, arguments);
210
+ };
211
+ }();
212
+ //上传前的控制
213
+ var handleBeforeUpload = function handleBeforeUpload(file) {
214
+ if (file.size > MAX_SIZE) {
215
+ _message.error('文件大小不能超过 100MB');
216
+ return _Upload.LIST_IGNORE; // Ant Design 中阻止上传
217
+ // 或者 return false; // 原生 input 阻止上传
218
+ }
219
+ return true;
220
+ };
221
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Spin, {
222
+ spinning: load
223
+ }, /*#__PURE__*/React.createElement(_Upload, _extends({
224
+ beforeUpload: handleBeforeUpload,
225
+ disabled: props.disabled,
226
+ showUploadList: {
227
+ showDownloadIcon: true,
228
+ downloadIcon: function downloadIcon(file) {
229
+ return /*#__PURE__*/React.createElement(DownLoad, {
230
+ hideProgress: true,
231
+ params: {
232
+ method: 'get'
233
+ },
234
+ fileName: function fileName() {
235
+ return file.name;
236
+ },
237
+ text: /*#__PURE__*/React.createElement("a", {
238
+ rel: "noopener noreferrer"
239
+ }, /*#__PURE__*/React.createElement(DownloadOutlined, null)),
240
+ loadUrl: downloadFile(file.fileId)
241
+ });
242
+ }
243
+ },
244
+ itemRender: function itemRender(originNode, file, fileList, actions) {
245
+ return /*#__PURE__*/React.createElement(FileCard, {
246
+ key: file.uid,
247
+ status: file.status
248
+ }, /*#__PURE__*/React.createElement(FileInfo, null, /*#__PURE__*/React.createElement("span", {
249
+ className: "name",
250
+ title: file.name
251
+ }, file.name)), /*#__PURE__*/React.createElement(Actions, null, /*#__PURE__*/React.createElement(Item, {
252
+ layout: "horizontal"
253
+ // 关键:让表单知道这是 fileList[index].secId
254
+ ,
255
+ name: [file.uid, 'secId'],
256
+ rules: [{
257
+ required: true,
258
+ message: '请选择密级'
259
+ }],
260
+ style: {
261
+ margin: 0
262
+ } // 去掉默认 margin,保持紧凑
263
+ }, /*#__PURE__*/React.createElement(SelectKYSeclevel, {
264
+ secId: props.secId,
265
+ value: file.secId,
266
+ onChange: function onChange(v) {
267
+ return onSelectLevel(v, file);
268
+ },
269
+ style: {
270
+ width: 120
271
+ }
272
+ })), /*#__PURE__*/React.createElement(_Tooltip, {
273
+ title: "\u4E0B\u8F7D"
274
+ }, /*#__PURE__*/React.createElement("a", {
275
+ href: downloadFile(file.fileId),
276
+ download: file.name
277
+ }, /*#__PURE__*/React.createElement(DownloadOutlined, null))), /*#__PURE__*/React.createElement(_Tooltip, {
278
+ title: "\u5220\u9664"
279
+ }, /*#__PURE__*/React.createElement(DeleteOutlined, {
280
+ onClick: function onClick() {
281
+ return onRemove(file);
282
+ }
283
+ }))));
284
+ }
285
+ }, props, {
286
+ fileList: fileList
287
+ // onDownload={onDownload}
288
+ ,
289
+ onRemove: onRemove,
290
+ onChange: onChange,
291
+ headers: {
292
+ Authorization: storage.getAccessToken()
293
+ },
294
+ action: uploadFile()
295
+ }), /*#__PURE__*/React.createElement(_Button, {
296
+ icon: /*#__PURE__*/React.createElement(UploadOutlined, null),
297
+ size: "small",
298
+ disabled: isup
299
+ }, props.text ? props.text : "upload")), /*#__PURE__*/React.createElement(DownLoad, {
300
+ ref: downNode,
301
+ text: " "
302
+ })));
303
+ };
304
+
305
+ // ---------------- 样式区域 ----------------
306
+ var DragArea = styled(_Upload.Dragger)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n"])));
307
+ var FileCardList = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));
308
+ var FileCard = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 4px;\n padding: 4px 10px;\n border: 1px solid #f0f0f0;\n border-radius: 6px;\n background: ", ";\n transition: all 0.2s;\n &:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);\n }\n"])), function (p) {
309
+ return p.status === 'error' ? '#fff1f0' : '#fff';
310
+ });
311
+ var FileInfo = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n align-items: center;\n gap: 8px;\n .name {\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])));
312
+ var Actions = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 12px;\n a {\n color: #666;\n &:hover {\n color: #1890ff;\n }\n }\n"])));
313
+ export default VenusUploadSecLevel;
@@ -0,0 +1,2 @@
1
+ export declare function updateFileSecLevel(id: string, secId: string): Promise<any>;
2
+ export declare function updateFileSecLevelNew(id: string, secId: string): Promise<any>;
@@ -0,0 +1,57 @@
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import { request } from "./..";
6
+
7
+ /*
8
+ * 修改附件密级
9
+ */
10
+ export function updateFileSecLevel(_x, _x2) {
11
+ return _updateFileSecLevel.apply(this, arguments);
12
+ }
13
+
14
+ /*
15
+ * 修改附件密级
16
+ */
17
+ function _updateFileSecLevel() {
18
+ _updateFileSecLevel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, secId) {
19
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
20
+ while (1) switch (_context.prev = _context.next) {
21
+ case 0:
22
+ return _context.abrupt("return", request("/file/updateSecLevelId/".concat(id, "/").concat(secId), {
23
+ method: 'get',
24
+ prefix: '/fileApi'
25
+ }));
26
+ case 1:
27
+ case "end":
28
+ return _context.stop();
29
+ }
30
+ }, _callee);
31
+ }));
32
+ return _updateFileSecLevel.apply(this, arguments);
33
+ }
34
+ export function updateFileSecLevelNew(_x3, _x4) {
35
+ return _updateFileSecLevelNew.apply(this, arguments);
36
+ }
37
+ function _updateFileSecLevelNew() {
38
+ _updateFileSecLevelNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(id, secId) {
39
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
40
+ while (1) switch (_context2.prev = _context2.next) {
41
+ case 0:
42
+ return _context2.abrupt("return", request("/file/updateSecLevelId", {
43
+ method: 'post',
44
+ data: {
45
+ fileId: id,
46
+ secId: secId
47
+ },
48
+ prefix: '/fileApi'
49
+ }));
50
+ case 1:
51
+ case "end":
52
+ return _context2.stop();
53
+ }
54
+ }, _callee2);
55
+ }));
56
+ return _updateFileSecLevelNew.apply(this, arguments);
57
+ }
@@ -0,0 +1 @@
1
+ export declare function uploadUrl(prefix: string): string;
@@ -0,0 +1,10 @@
1
+ import { hostMap } from "./..";
2
+
3
+ /*
4
+ * 导入
5
+ */
6
+ export function uploadUrl(prefix) {
7
+ var host = hostMap[prefix][process.env.BUILD_ENV || "production"];
8
+ var prefixStr = process.env.ENV === 'production' ? host : "/" + prefix || "/workhour";
9
+ return "".concat(prefixStr, "/system/tools/excel/import");
10
+ }
@@ -0,0 +1,51 @@
1
+ @import '~@/common';
2
+
3
+ .uploadList{
4
+ width: 300px;
5
+ box-sizing: border-box;
6
+ margin: 0;
7
+ padding: 0;
8
+ color: rgba(0,0,0,.85);
9
+ font-size: 14px;
10
+ font-variant: tabular-nums;
11
+ list-style: none;
12
+ -webkit-font-feature-settings: "tnum";
13
+ font-feature-settings: "tnum";
14
+ line-height: 1.5715;
15
+ .container{
16
+ transition: opacity .3s,height .3s;
17
+ .listItem{
18
+ position: relative;
19
+ height: 22.001px;
20
+ margin-top: 8px;
21
+ font-size: 14px;
22
+ .listItemInfo{
23
+ height: 100%;
24
+ padding: 0 4px;
25
+ transition: background-color .3s;
26
+ display: flex;
27
+ flex-flow: row;
28
+ .Prewload{
29
+ margin-left: 10px;
30
+ }
31
+ .uploadSpan{
32
+ display: flex;
33
+ align-items: center;
34
+ .uploadLinkIcon{
35
+ flex: none;
36
+ margin-right: 5px;
37
+
38
+ }
39
+ }
40
+ }
41
+ }
42
+ .listItem:hover{
43
+ background-color: @tableHoverBgColor;
44
+ }
45
+ }
46
+ }
47
+ .showList:hover{
48
+ background-color: @tableHoverBgColor;
49
+ }
50
+ .showList{
51
+ }
@@ -14,6 +14,7 @@ interface VenusWorkDetailType {
14
14
  loader?: any;
15
15
  procInstId?: string;
16
16
  height?: any;
17
+ otherProps?: any;
17
18
  }
18
19
  declare const VenusWorkDetail: (props: VenusWorkDetailType) => React.JSX.Element;
19
20
  export default VenusWorkDetail;
@@ -193,7 +193,7 @@ var VenusWorkDetail = function VenusWorkDetail(props) {
193
193
  }, isNotNullVenus(props.componentUrl) && props.actionId != "adjust" ?
194
194
  /*#__PURE__*/
195
195
  //@ts-ignore
196
- React.createElement(LoadableSub, _extends({}, props, {
196
+ React.createElement(LoadableSub, _extends({}, props, props.otherProps, {
197
197
  innerId: getInnerIdByBusinessKey(props.businessKey)
198
198
  })) : props.actionId == "adjust" ? props.batchFlag == true ? /*#__PURE__*/React.createElement(VenusAdjustBatch, {
199
199
  actionRef: adjustActionRef,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as ProForm, FormItem, FormText, FormGroup, FormItem2, FormItemSE, FormItemCust, FormDependency, FormText2, FormTextER, FormTextCust, VenusFormSlider, VenusFormRate, FormTextarea, FormSelect, FormSelect2, FormSelectER, FormRadioGroup, FormNumber, FormNumberPercent, FormNumberUnit, FormDatePicker, FormDatePickerDesign, FormUpload, FormSearch, FormTreeSelect, VenusFormSelect, VenusFormText, VenusFormDatePicker, VenusFormRadioGroup, VenusFormCheckBoxInputGroup, VenusFormCheckBoxGroup, VenusFormTextarea, VenusFormNumber, VenusFormNumberUnit, VenusFormNumberPercent, VenusFormUpload, VenusFormTreeSelect, VenusFormSearch, VenusFormSwitch, VenusFormUploadPro, VenusFormUploadImage } from './ProForm';
1
+ export { default as ProForm, FormItem, FormText, FormGroup, FormItem2, FormItemSE, FormItemCust, FormDependency, FormText2, FormTextER, FormTextCust, VenusFormSlider, VenusFormRate, FormTextarea, FormSelect, FormSelect2, FormSelectER, FormRadioGroup, FormNumber, FormNumberPercent, FormNumberUnit, FormDatePicker, FormDatePickerDesign, FormUpload, FormSearch, FormTreeSelect, VenusFormSelect, VenusFormText, VenusFormDatePicker, VenusFormRadioGroup, VenusFormCheckBoxInputGroup, VenusFormCheckBoxGroup, VenusFormTextarea, VenusFormNumber, VenusFormNumberUnit, VenusFormNumberPercent, VenusFormUpload, VenusFormTreeSelect, VenusFormSearch, VenusFormSwitch, VenusFormUploadPro, VenusFormUploadImage, VenusFormUploadSecLevel } from './ProForm';
2
2
  export { default as NumberPercent } from './NumberPercent';
3
3
  export { default as NumberUnit } from './NumberUnits';
4
4
  export { default as Search } from './Search';
@@ -20,7 +20,7 @@ export { default as VenusWorkDetail } from './VenusWorkDetail';
20
20
  export { default as VenusCard } from './VenusCard';
21
21
  export { default as VenusCardStyle } from './VenusCard/style.less';
22
22
  export { default as SelectRoleAndUser } from './Approval/components/SelectRoleAndUser';
23
- export { thousandSeparator, unitWanNum, tableUnitWanNum, getCookieDomain, getUrlParams, getUrlSearchStr, renderMillion, isNotNullVenus, renderFileNameAndIds, renderFileNameAndIdsNew, renderTableFileNameAndIds, haveSecLevel, haveSecLevelNew, isValidDate, getweek, formatLarkAvatar, isVenusStrNotNull, getApp, encrypt, initOwnerApp, getDefaultMenu, getDifyConfig, getDifyUserNames, onMnLoginDify, deleteSessionKeysWithPrefix, } from './Config/utils';
23
+ export { thousandSeparator, unitWanNum, tableUnitWanNum, getCookieDomain, getUrlParams, getUrlSearchStr, renderMillion, isNotNullVenus, renderFileNameAndIds, renderFileNameAndIdsNew, renderTableFileNameAndIds, haveSecLevel, haveSecLevelNew, isValidDate, getweek, formatLarkAvatar, isVenusStrNotNull, getApp, encrypt, initOwnerApp, getDefaultMenu, getDifyConfig, getDifyUserNames, onMnLoginDify, deleteSessionKeysWithPrefix, handleSecLevelUploadValue } from './Config/utils';
24
24
  export { default as AuthButton, ButtonPath, checkPathname, getRouteMap, AddButtonNew, EditButton, ADDButtona, DetailButton, CommonButton, VenusButton, AddButton, AButton } from './AuthButton';
25
25
  export { default as DataView } from './DataView';
26
26
  export { default as BISpin } from './BISpin';
@@ -86,3 +86,4 @@ export { default as Config } from './VirtTable/src/Config';
86
86
  export { createUltimateSearch } from './Config/columnFilter';
87
87
  export { default as VenusEditor } from './VenusEditor';
88
88
  export { addRenderVirtFunction } from './VenusVirtTable/staticAttr';
89
+ export { default as VenusUploadSecLevel } from './VenusUploadSecLevel';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { default as ProForm, FormItem, FormText, FormGroup, FormItem2, FormItemSE, FormItemCust, FormDependency, FormText2, FormTextER, FormTextCust, VenusFormSlider, VenusFormRate, FormTextarea, FormSelect, FormSelect2, FormSelectER, FormRadioGroup, FormNumber, FormNumberPercent, FormNumberUnit, FormDatePicker, FormDatePickerDesign, FormUpload, FormSearch, FormTreeSelect, VenusFormSelect, VenusFormText, VenusFormDatePicker, VenusFormRadioGroup, VenusFormCheckBoxInputGroup, VenusFormCheckBoxGroup, VenusFormTextarea, VenusFormNumber, VenusFormNumberUnit, VenusFormNumberPercent, VenusFormUpload, VenusFormTreeSelect, VenusFormSearch, VenusFormSwitch, VenusFormUploadPro, VenusFormUploadImage } from "./ProForm";
1
+ export { default as ProForm, FormItem, FormText, FormGroup, FormItem2, FormItemSE, FormItemCust, FormDependency, FormText2, FormTextER, FormTextCust, VenusFormSlider, VenusFormRate, FormTextarea, FormSelect, FormSelect2, FormSelectER, FormRadioGroup, FormNumber, FormNumberPercent, FormNumberUnit, FormDatePicker, FormDatePickerDesign, FormUpload, FormSearch, FormTreeSelect, VenusFormSelect, VenusFormText, VenusFormDatePicker, VenusFormRadioGroup, VenusFormCheckBoxInputGroup, VenusFormCheckBoxGroup, VenusFormTextarea, VenusFormNumber, VenusFormNumberUnit, VenusFormNumberPercent, VenusFormUpload, VenusFormTreeSelect, VenusFormSearch, VenusFormSwitch, VenusFormUploadPro, VenusFormUploadImage, VenusFormUploadSecLevel } from "./ProForm";
2
2
  export { default as NumberPercent } from "./NumberPercent";
3
3
  export { default as NumberUnit } from "./NumberUnits";
4
4
  export { default as Search } from "./Search";
@@ -20,7 +20,7 @@ export { default as VenusWorkDetail } from "./VenusWorkDetail";
20
20
  export { default as VenusCard } from "./VenusCard";
21
21
  export { default as VenusCardStyle } from "./VenusCard/style.less";
22
22
  export { default as SelectRoleAndUser } from "./Approval/components/SelectRoleAndUser";
23
- export { thousandSeparator, unitWanNum, tableUnitWanNum, getCookieDomain, getUrlParams, getUrlSearchStr, renderMillion, isNotNullVenus, renderFileNameAndIds, renderFileNameAndIdsNew, renderTableFileNameAndIds, haveSecLevel, haveSecLevelNew, isValidDate, getweek, formatLarkAvatar, isVenusStrNotNull, getApp, encrypt, initOwnerApp, getDefaultMenu, getDifyConfig, getDifyUserNames, onMnLoginDify, deleteSessionKeysWithPrefix } from "./Config/utils";
23
+ export { thousandSeparator, unitWanNum, tableUnitWanNum, getCookieDomain, getUrlParams, getUrlSearchStr, renderMillion, isNotNullVenus, renderFileNameAndIds, renderFileNameAndIdsNew, renderTableFileNameAndIds, haveSecLevel, haveSecLevelNew, isValidDate, getweek, formatLarkAvatar, isVenusStrNotNull, getApp, encrypt, initOwnerApp, getDefaultMenu, getDifyConfig, getDifyUserNames, onMnLoginDify, deleteSessionKeysWithPrefix, handleSecLevelUploadValue } from "./Config/utils";
24
24
  export { default as AuthButton, ButtonPath, checkPathname, getRouteMap, AddButtonNew, EditButton, ADDButtona, DetailButton, CommonButton, VenusButton, AddButton, AButton } from "./AuthButton";
25
25
  export { default as DataView } from "./DataView";
26
26
  export { default as BISpin } from "./BISpin";
@@ -88,4 +88,5 @@ export { default as Cell } from "./VirtTable/src/Cell";
88
88
  export { default as Config } from "./VirtTable/src/Config";
89
89
  export { createUltimateSearch } from "./Config/columnFilter";
90
90
  export { default as VenusEditor } from "./VenusEditor";
91
- export { addRenderVirtFunction } from "./VenusVirtTable/staticAttr";
91
+ export { addRenderVirtFunction } from "./VenusVirtTable/staticAttr";
92
+ export { default as VenusUploadSecLevel } from "./VenusUploadSecLevel";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venus-design",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "venus all compoments",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -54,6 +54,8 @@
54
54
  "@ant-design/cssinjs": "^1.5.6",
55
55
  "@ant-design/icons": "4.8.3",
56
56
  "@ant-design/pro-components": "2.4.2",
57
+ "@emotion/react": "^11.14.0",
58
+ "@emotion/styled": "^11.14.1",
57
59
  "@grapecity/spread-excelio": "^14.2.5",
58
60
  "@grapecity/spread-sheets": "^14.2.5",
59
61
  "@grapecity/spread-sheets-barcode": "^14.2.5",
@@ -97,6 +99,8 @@
97
99
  "@ant-design/pro-components": "2.4.2",
98
100
  "@commitlint/cli": "^17.1.2",
99
101
  "@commitlint/config-conventional": "^17.1.0",
102
+ "@emotion/react": "^11.14.0",
103
+ "@emotion/styled": "^11.14.1",
100
104
  "@types/crypto-js": "^4.2.2",
101
105
  "@types/file-saver": "^2.0.7",
102
106
  "@types/js-cookie": "^3.0.6",