venus-design 0.4.7 → 0.5.0

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.
@@ -87,14 +87,19 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
87
87
  _useState24 = _slicedToArray(_useState23, 2),
88
88
  load = _useState24[0],
89
89
  setload = _useState24[1];
90
- var _useState25 = useState(false),
90
+ var _useState25 = useState("approve"),
91
91
  _useState26 = _slicedToArray(_useState25, 2),
92
- okload = _useState26[0],
93
- setokload = _useState26[1];
92
+ actionId = _useState26[0],
93
+ setActionId = _useState26[1];
94
94
  var _useState27 = useState(false),
95
95
  _useState28 = _slicedToArray(_useState27, 2),
96
- idS = _useState28[0],
97
- setIds = _useState28[1];
96
+ okload = _useState28[0],
97
+ setokload = _useState28[1];
98
+ var _useState29 = useState(false),
99
+ _useState30 = _slicedToArray(_useState29, 2),
100
+ idS = _useState30[0],
101
+ setIds = _useState30[1];
102
+ //查询流程配置
98
103
  var findByOption = /*#__PURE__*/function () {
99
104
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record, code, name) {
100
105
  var idService, res, res1, options, i, userLi, _i, projectname, name1, restablename;
@@ -108,6 +113,7 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
108
113
  } else {
109
114
  setserviceid(idService);
110
115
  }
116
+ //查询流程配置
111
117
  _context.next = 4;
112
118
  return findByOptionCode(code);
113
119
  case 4:
@@ -154,17 +160,10 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
154
160
  } else {
155
161
  projectname = name;
156
162
  }
157
- // var name1="项目【"+projectname+"】"+res.data.modelname+"【"+name+"】"+planStatusEnum[res.data.operationname];
158
163
  name1 = name ? name : "送审" + "【" + record.data.commissionNo + "】" + moment().format("YYYY-MM-DD hh:mm:ss");
159
164
  form.setFieldsValue({
160
165
  name: name1
161
166
  });
162
- /* if(res1.data.rolename==undefined){
163
- form.setFieldsValue({name:name1,person:options});
164
- }else{
165
- //const personstr=res1.data.rolename+"、【"+res1.data.username+"】";
166
- form.setFieldsValue({name:name1,person:options});
167
- }*/
168
167
  setload(false);
169
168
  }
170
169
  } else {
@@ -215,26 +214,38 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
215
214
  return _ref.apply(this, arguments);
216
215
  };
217
216
  }();
218
- var oncancel = function oncancel() {
217
+ //取消
218
+ var onCancel = function onCancel() {
219
219
  setVisible(false);
220
220
  setload(true);
221
221
  setokload(false);
222
222
  form.resetFields();
223
223
  };
224
- var onok = function onok(val) {
224
+ var _onOk = function onOk(val) {
225
225
  setokload(true);
226
226
  onStartInstance(data.workflowcode, val.name, serviceid, defineid, tablename, val.memo, val.person, data.operationname);
227
227
  };
228
+ /**
229
+ * 发起送审
230
+ * @param key
231
+ * @param instanceName
232
+ * @param id
233
+ * @param defineid
234
+ * @param tablename
235
+ * @param memo
236
+ * @param persong
237
+ * @param operationname
238
+ */
228
239
  var onStartInstance = /*#__PURE__*/function () {
229
240
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, instanceName, id, defineid, tablename, memo, persong, operationname) {
230
- var firstPerson, flagWf, res, res1, _res, _res2, _res3, _res4;
241
+ var firstPerson, flagWf, res, _res;
231
242
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
232
243
  while (1) switch (_context2.prev = _context2.next) {
233
244
  case 0:
234
245
  firstPerson = form.getFieldValue("person");
235
246
  flagWf = false; //启动
236
247
  if (!isReturn) {
237
- _context2.next = 25;
248
+ _context2.next = 19;
238
249
  break;
239
250
  }
240
251
  _context2.next = 5;
@@ -242,7 +253,7 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
242
253
  case 5:
243
254
  res = _context2.sent;
244
255
  if (!(res && res.success)) {
245
- _context2.next = 22;
256
+ _context2.next = 16;
246
257
  break;
247
258
  }
248
259
  _message.success("送审成功!");
@@ -251,71 +262,55 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
251
262
  //const editUser = await editCandateGroupsOrUsers(firstPerson,res.message);
252
263
  setVisible(false);
253
264
  //刷新状态
254
- if (!idS) {
255
- _context2.next = 17;
265
+ if (!(urlUpdateStatus != undefined && urlUpdateStatus != null)) {
266
+ _context2.next = 14;
256
267
  break;
257
268
  }
258
269
  _context2.next = 14;
259
- return SubmitDataStatus(id, props.statusList[0] + "&" + record.data.processInstanceId, urlUpdateStatus, prefix);
260
- case 14:
261
- res1 = _context2.sent;
262
- _context2.next = 20;
263
- break;
264
- case 17:
265
- _context2.next = 19;
266
270
  return SubmitDataStatus(record.id, props.statusList[0], urlUpdateStatus, prefix);
267
- case 19:
268
- _res = _context2.sent;
269
- case 20:
270
- _context2.next = 23;
271
+ case 14:
272
+ _context2.next = 17;
271
273
  break;
272
- case 22:
274
+ case 16:
273
275
  _message.error("请检查流程是否部署!");
274
- case 23:
275
- _context2.next = 45;
276
+ case 17:
277
+ _context2.next = 33;
276
278
  break;
277
- case 25:
278
- _context2.next = 27;
279
+ case 19:
280
+ _context2.next = 21;
279
281
  return startData(key, instanceName, id, defineid, tablename, memo, url, prefix, operationname, urlUpdateStatus, _objectSpread(_objectSpread({}, record.data), {}, {
280
282
  currentState: props.currentState != undefined ? props.currentState : "",
281
283
  modifyState: props.modifyState != undefined ? props.modifyState : "",
282
284
  isProjectBG: props.isProjectBG != undefined ? props.isProjectBG : false
283
- }), firstPerson, props.statusList);
284
- case 27:
285
- _res2 = _context2.sent;
286
- if (!(_res2 && _res2.success)) {
287
- _context2.next = 44;
285
+ }), firstPerson, props.statusList, actionId, record.data.businessKey, props.dataViewIid != undefined ? props.dataViewIid : "-1", props.dataSceneIid != undefined ? props.dataSceneIid : "-1",
286
+ //场景标识
287
+ props.serviceUrl != undefined ? props.serviceUrl : "", props.componentUrl != undefined ? props.componentUrl : null //组件地址
288
+ );
289
+ case 21:
290
+ _res = _context2.sent;
291
+ if (!(_res && _res.success)) {
292
+ _context2.next = 32;
288
293
  break;
289
294
  }
290
295
  _message.success("送审成功!");
291
296
  flagWf = true;
292
297
  setokload(false);
293
- //const editUser = await editCandateGroupsOrUsers(firstPerson,res.message);
294
298
  setVisible(false);
295
299
  //刷新状态
296
- if (!idS) {
297
- _context2.next = 39;
300
+ if (!(urlUpdateStatus != undefined && urlUpdateStatus != null)) {
301
+ _context2.next = 30;
298
302
  break;
299
303
  }
300
- _context2.next = 36;
301
- return SubmitDataStatus(id, props.statusList[0] + "&" + _res2.message, urlUpdateStatus, prefix);
302
- case 36:
303
- _res3 = _context2.sent;
304
- _context2.next = 42;
305
- break;
306
- case 39:
307
- _context2.next = 41;
304
+ _context2.next = 30;
308
305
  return SubmitDataStatus(record.id, props.statusList[0], urlUpdateStatus, prefix);
309
- case 41:
310
- _res4 = _context2.sent;
311
- case 42:
312
- _context2.next = 45;
306
+ case 30:
307
+ _context2.next = 33;
313
308
  break;
314
- case 44:
309
+ case 32:
315
310
  _message.error("请检查流程是否部署!");
316
- case 45:
311
+ case 33:
317
312
  props.callback(flagWf);
318
- case 46:
313
+ case 34:
319
314
  case "end":
320
315
  return _context2.stop();
321
316
  }
@@ -337,13 +332,16 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
337
332
  case 0:
338
333
  setVisible(true);
339
334
  setrecord(record);
335
+ if (record.actionId != undefined) {
336
+ setActionId(record.actionId);
337
+ }
340
338
  if (record.data.isReturn != undefined && record.data.isReturn == true) {
341
339
  //是退回的流程
342
340
  console.log("是退回的流程");
343
341
  setisReturn(true);
344
342
  }
345
343
  findByOption(record, code, name);
346
- case 4:
344
+ case 5:
347
345
  case "end":
348
346
  return _context3.stop();
349
347
  }
@@ -361,7 +359,7 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
361
359
  title: "\u9001\u5BA1",
362
360
  confirmLoading: okload,
363
361
  visible: visible,
364
- onCancel: oncancel,
362
+ onCancel: onCancel,
365
363
  okButtonProps: {
366
364
  size: "small"
367
365
  },
@@ -370,7 +368,7 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
370
368
  },
371
369
  onOk: function onOk() {
372
370
  form.validateFields().then(function (values) {
373
- onok(values);
371
+ _onOk(values);
374
372
  }).catch(function (info) {
375
373
  _message.error('异常');
376
374
  setokload(false);
@@ -1,4 +1,4 @@
1
- export declare function startData(key: string, instanceName: string, id: string, defineid: number, tablename: string, memo: string, url: string, prefix: string, operationname: string, urlUpdateStatus: string, vis: any, firstPerson: any, stateList: any): Promise<any>;
1
+ export declare function startData(key: string, instanceName: string, id: string, defineid: number, tablename: string, memo: string, url: string, prefix: string, operationname: string, urlUpdateStatus: string, vis: any, firstPerson: any, stateList: any, actionId: string, businessKey: string, dataViewIid: string, dataSceneIid: string, serviceUrl: string, componentUrl: string): Promise<any>;
2
2
  export declare function updateProcessInstance(instanceName: string, memo: string, firstPerson: any, proId: string): Promise<any>;
3
3
  export declare function editCandateGroupsOrUsers(person: any, instanceid: string): Promise<any>;
4
4
  export declare function findByOptionCode(code: string): Promise<any>;
@@ -6,18 +6,18 @@ import { request } from "./..";
6
6
  /*
7
7
  * 启动流程部署记录
8
8
  */
9
- export function startData(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12, _x13) {
9
+ export function startData(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12, _x13, _x14, _x15, _x16, _x17, _x18, _x19) {
10
10
  return _startData.apply(this, arguments);
11
11
  }
12
12
  /*
13
13
  * 退回的流程重新发起
14
14
  */
15
15
  function _startData() {
16
- _startData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, instanceName, id, defineid, tablename, memo, url, prefix, operationname, urlUpdateStatus, vis, firstPerson, stateList) {
16
+ _startData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, instanceName, id, defineid, tablename, memo, url, prefix, operationname, urlUpdateStatus, vis, firstPerson, stateList, actionId, businessKey, dataViewIid, dataSceneIid, serviceUrl, componentUrl) {
17
17
  return _regeneratorRuntime().wrap(function _callee$(_context) {
18
18
  while (1) switch (_context.prev = _context.next) {
19
19
  case 0:
20
- return _context.abrupt("return", request("/wfprocessinstance/startProcessByKey?instanceName=".concat(instanceName, "&defineid=").concat(defineid, "&tablename=").concat(tablename, "&businessKey=&processDefinitionKey=").concat(key, "&memo=").concat(memo, "&url=").concat(url, "&prefix=").concat(prefix, "&operation=").concat(operationname, "&urlUpdateStatus=").concat(urlUpdateStatus), {
20
+ return _context.abrupt("return", request("/wfprocessinstance/startProcessByKey?instanceName=".concat(instanceName, "&defineid=").concat(defineid, "&tablename=").concat(tablename, "&businessKey=").concat(businessKey, "&processDefinitionKey=").concat(key, "&memo=").concat(memo, "&url=").concat(url, "&prefix=").concat(prefix, "&operation=").concat(operationname, "&urlUpdateStatus=").concat(urlUpdateStatus, "&actionId=").concat(actionId, "&dataViewIid=").concat(dataViewIid, "&dataSceneIid=").concat(dataSceneIid, "&serviceUrl=").concat(serviceUrl, "&componentUrl=").concat(componentUrl), {
21
21
  method: 'post',
22
22
  data: {
23
23
  vis: vis,
@@ -35,7 +35,7 @@ function _startData() {
35
35
  }));
36
36
  return _startData.apply(this, arguments);
37
37
  }
38
- export function updateProcessInstance(_x14, _x15, _x16, _x17) {
38
+ export function updateProcessInstance(_x20, _x21, _x22, _x23) {
39
39
  return _updateProcessInstance.apply(this, arguments);
40
40
  }
41
41
 
@@ -62,7 +62,7 @@ function _updateProcessInstance() {
62
62
  }));
63
63
  return _updateProcessInstance.apply(this, arguments);
64
64
  }
65
- export function editCandateGroupsOrUsers(_x18, _x19) {
65
+ export function editCandateGroupsOrUsers(_x24, _x25) {
66
66
  return _editCandateGroupsOrUsers.apply(this, arguments);
67
67
  }
68
68
  /*
@@ -85,7 +85,7 @@ function _editCandateGroupsOrUsers() {
85
85
  }));
86
86
  return _editCandateGroupsOrUsers.apply(this, arguments);
87
87
  }
88
- export function findByOptionCode(_x20) {
88
+ export function findByOptionCode(_x26) {
89
89
  return _findByOptionCode.apply(this, arguments);
90
90
  }
91
91
  //查询节点人员
@@ -106,7 +106,7 @@ function _findByOptionCode() {
106
106
  }));
107
107
  return _findByOptionCode.apply(this, arguments);
108
108
  }
109
- export function findByUserid(_x21, _x22) {
109
+ export function findByUserid(_x27, _x28) {
110
110
  return _findByUserid.apply(this, arguments);
111
111
  }
112
112
  //查询流程定义
@@ -128,7 +128,7 @@ function _findByUserid() {
128
128
  }));
129
129
  return _findByUserid.apply(this, arguments);
130
130
  }
131
- export function findBydefineId(_x23) {
131
+ export function findBydefineId(_x29) {
132
132
  return _findBydefineId.apply(this, arguments);
133
133
  }
134
134
  //查询表名
@@ -149,7 +149,7 @@ function _findBydefineId() {
149
149
  }));
150
150
  return _findBydefineId.apply(this, arguments);
151
151
  }
152
- export function findTableByFormid(_x24) {
152
+ export function findTableByFormid(_x30) {
153
153
  return _findTableByFormid.apply(this, arguments);
154
154
  }
155
155
 
@@ -173,7 +173,7 @@ function _findTableByFormid() {
173
173
  }));
174
174
  return _findTableByFormid.apply(this, arguments);
175
175
  }
176
- export function SubmitDataStatus(_x25, _x26, _x27, _x28) {
176
+ export function SubmitDataStatus(_x31, _x32, _x33, _x34) {
177
177
  return _SubmitDataStatus.apply(this, arguments);
178
178
  }
179
179
  function _SubmitDataStatus() {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Demo: () => React.JSX.Element;
3
+ export default Demo;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Ckediter } from "./..";
3
+ var Demo = function Demo() {
4
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Ckediter, {
5
+ style: {
6
+ width: "80%"
7
+ }
8
+ }));
9
+ };
10
+ export default Demo;
@@ -1,3 +1,4 @@
1
+ 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); }
1
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
3
  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."); }
3
4
  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); }
@@ -43,7 +44,7 @@ var CKEditorFormItem = function CKEditorFormItem(props) {
43
44
  seteditor = _useState2[1];
44
45
  return /*#__PURE__*/React.createElement("div", {
45
46
  className: "b-demo__editor"
46
- }, /*#__PURE__*/React.createElement(CKEditor, {
47
+ }, /*#__PURE__*/React.createElement(CKEditor, _extends({
47
48
  onReady: function onReady(editor) {
48
49
  editor.ui.getEditableElement().parentElement.insertBefore(editor.ui.view.toolbar.element, editor.ui.getEditableElement());
49
50
  seteditor(editor);
@@ -57,6 +58,6 @@ var CKEditorFormItem = function CKEditorFormItem(props) {
57
58
  editor: VenusCkeditor,
58
59
  data: props.value != undefined && props.value != null ? props.value : "请填写内容!",
59
60
  disabled: props.disabled != undefined && props.disabled != null
60
- }));
61
+ }, props)));
61
62
  };
62
63
  export default CKEditorFormItem;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Demo: () => React.JSX.Element;
3
+ export default Demo;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { ExcelBatchEdit } from '..';
3
+ var Demo = function Demo() {
4
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ExcelBatchEdit, {
5
+ onSetVisData: function onSetVisData() {},
6
+ conds: "",
7
+ id: "1",
8
+ tempid: "21"
9
+ }));
10
+ };
11
+ export default Demo;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import '@grapecity/spread-sheets-resources-zh';
3
+ import '@grapecity/spread-sheets-designer-resources-cn';
4
+ import "@grapecity/spread-sheets-designer/styles/gc.spread.sheets.designer.min.css";
5
+ import "@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css";
6
+ import '@grapecity/spread-sheets-print';
7
+ declare const ExcelBatchEdit: (props: any) => React.JSX.Element;
8
+ export default ExcelBatchEdit;
@@ -0,0 +1,471 @@
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/message/style";
7
+ import _message from "antd/es/message";
8
+ import "antd/es/form/style";
9
+ import _Form from "antd/es/form";
10
+ 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; }
11
+ 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); } }
12
+ 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); }); }; }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ 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."); }
15
+ 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); }
16
+ 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; }
17
+ 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; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ import React, { useEffect, useState } from 'react';
20
+ import '@grapecity/spread-sheets-resources-zh';
21
+ import GC from '@grapecity/spread-sheets';
22
+ import '@grapecity/spread-sheets-designer-resources-cn';
23
+ import "@grapecity/spread-sheets-designer/styles/gc.spread.sheets.designer.min.css";
24
+ import "@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css";
25
+ import '@grapecity/spread-sheets-print';
26
+ import { SpreadSheets, Worksheet } from '@grapecity/spread-sheets-react';
27
+ import { excelFieldTable } from "./..";
28
+ import { saveDataExcel, getDataExcel } from "./services";
29
+ import { ProForm } from '@ant-design/pro-components';
30
+ GC.Spread.Common.CultureManager.culture('zh-cn');
31
+ var ExcelBatchEdit = function ExcelBatchEdit(props) {
32
+ // 提前执行渲染模板
33
+ useEffect(function () {
34
+ //得到SpreadJS表格对象
35
+ //var spread = GC.Spread.Sheets.findControl(document.getElementsByClassName("gc-no-user-select"));
36
+ //请求服务获取当前模板的数据,由于表格初始化时已经调用,此处不重复调用
37
+ //getTempJson(spread);
38
+ }, [props.tempid]);
39
+
40
+ // 设置组件大小自适应
41
+ var winHeight = document.documentElement.clientHeight - 140;
42
+ var winWidth = document.documentElement.clientWidth - 285;
43
+ var _useState = useState(false),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ isEdit = _useState2[0],
46
+ setisEdit = _useState2[1];
47
+ var hostStyle = {
48
+ width: '100%',
49
+ height: winHeight,
50
+ marginTop: 10,
51
+ borderTop: "1px solid",
52
+ borderTopColor: "rgb(174, 176, 178)"
53
+ };
54
+ var hostS = hostStyle;
55
+ var _useState3 = useState(false),
56
+ _useState4 = _slicedToArray(_useState3, 2),
57
+ submitIng = _useState4[0],
58
+ saveSubmitIng = _useState4[1];
59
+ var _Form$useForm = _Form.useForm(),
60
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
61
+ form = _Form$useForm2[0];
62
+ var _useState5 = useState(true),
63
+ _useState6 = _slicedToArray(_useState5, 2),
64
+ loading = _useState6[0],
65
+ setloading = _useState6[1];
66
+ var _useState7 = useState(false),
67
+ _useState8 = _slicedToArray(_useState7, 2),
68
+ useLimit = _useState8[0],
69
+ setuseLimit = _useState8[1];
70
+ var _useState9 = useState(1),
71
+ _useState10 = _slicedToArray(_useState9, 2),
72
+ zoomFactor = _useState10[0],
73
+ setzoomFactor = _useState10[1];
74
+ var formu = []; //公式集合
75
+ var valiList = []; //下拉集合
76
+ var ylist = []; //单元格样式集合
77
+ var spread = null;
78
+ // 根据模板标识查询模板样式
79
+ var getTempJson = /*#__PURE__*/function () {
80
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
81
+ var res, sheet, i, j, gon, vali, cstyle;
82
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
83
+ while (1) switch (_context.prev = _context.next) {
84
+ case 0:
85
+ spread = e;
86
+ if (!(props.tempid != undefined)) {
87
+ _context.next = 6;
88
+ break;
89
+ }
90
+ _context.next = 4;
91
+ return excelFieldTable(props.tempid);
92
+ case 4:
93
+ res = _context.sent;
94
+ if (res && res.success && res.data.success) {
95
+ // 将模板样式数据添加进来
96
+ if (res.data != undefined && res.data.spreadjson != undefined) {
97
+ e.fromJSON(JSON.parse(res.data.spreadjson));
98
+ sheet = e.getActiveSheet();
99
+ for (i = 0; i < sheet.getRowCount(); i++) {
100
+ for (j = 0; j < sheet.getColumnCount(); j++) {
101
+ gon = sheet.getFormula(i, j); //获取模板上的公式
102
+ vali = sheet.getDataValidator(i, j);
103
+ cstyle = sheet.getStyle(i, j, GC.Spread.Sheets.SheetArea.viewport);
104
+ if (vali != null) {
105
+ valiList.push({
106
+ row: i,
107
+ col: j,
108
+ valid: vali
109
+ });
110
+ }
111
+ if (gon != null) {
112
+ formu.push({
113
+ row: i,
114
+ col: j,
115
+ gon: gon
116
+ });
117
+ }
118
+ if (cstyle != null) {
119
+ ylist.push({
120
+ row: i,
121
+ col: j,
122
+ ccstyle: cstyle
123
+ });
124
+ }
125
+ }
126
+ }
127
+ }
128
+ // 渲染当前模板数据源
129
+ getDataSource();
130
+ } else {
131
+ _message.error(res.data.message);
132
+ }
133
+ case 6:
134
+ case "end":
135
+ return _context.stop();
136
+ }
137
+ }, _callee);
138
+ }));
139
+ return function getTempJson(_x) {
140
+ return _ref.apply(this, arguments);
141
+ };
142
+ }();
143
+
144
+ // 将数据源渲染进来
145
+ var getDataSource = /*#__PURE__*/function () {
146
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
147
+ var conds, whereStr, filterConds, getData, res, spread, sheet, ssource;
148
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
149
+ while (1) switch (_context2.prev = _context2.next) {
150
+ case 0:
151
+ if (!(props.tempid != undefined)) {
152
+ _context2.next = 11;
153
+ break;
154
+ }
155
+ conds = props.conds != undefined ? "and " + props.conds : "";
156
+ whereStr = "owner_record_id='" + props.id + "'" + conds;
157
+ filterConds = props.id != undefined ? whereStr : "owner_record_id='-1'"; // 组织数据查询条件
158
+ getData = {
159
+ id: props.tempid,
160
+ tableConds: filterConds,
161
+ propConds: filterConds
162
+ }; //设置缩放
163
+ initStatusBar();
164
+ initEvents();
165
+ // 获取数据源
166
+ _context2.next = 9;
167
+ return getDataExcel(getData);
168
+ case 9:
169
+ res = _context2.sent;
170
+ if (res.data != null && res.data != undefined) {
171
+ if (props.id != undefined) {
172
+ //编辑时
173
+ setisEdit(true);
174
+ }
175
+ //@ts-ignore
176
+ spread = GC.Spread.Sheets.findControl(document.getElementsByClassName("gc-no-user-select"));
177
+ sheet = spread.getActiveSheet();
178
+ ssource = new GC.Spread.Sheets.Bindings.CellBindingSource(res.data);
179
+ sheet.setDataSource(ssource);
180
+ //设置公式
181
+ if (formu.length > 0) {
182
+ formu.forEach(function (v) {
183
+ sheet.setFormula(v.row, v.col, v.gon, GC.Spread.Sheets.SheetArea.viewport);
184
+ });
185
+ }
186
+ //设置数据验证
187
+ /*if(valiList.length>0){
188
+ valiList.forEach(v=>{
189
+ sheet.setDataValidator(v.row,v.col,v.valid,GC.Spread.Sheets.SheetArea.viewport)
190
+ })
191
+ }*/
192
+ //样式复制
193
+ /**
194
+ * 20230628
195
+ * 系统院是属性列表,不存在新增行,所有去除样式复制
196
+ */
197
+ /*var rowcount=ylist.length>0? ylist[ylist.length-1].row:0;
198
+ var tables=sheet.tables.all();
199
+ tables.forEach(v=>{
200
+ let range = v.dataRange();
201
+ for(let i=1; i<rowcount;i++){
202
+ sheet.copyTo(range.row,range.col,range.row+i,range.col,1,range.colCount,GC.Spread.Sheets.CopyToOptions.style)
203
+ }
204
+ })*/
205
+ //设置样式
206
+ /*if(ylist.length>0){
207
+ let i=0;
208
+ while(i>ylist[ylist.length-1].row){
209
+ sheet.copyTo(ylist[0].row,ylist[0].col,ylist[i].row+i,ylist[i].col,1,10,GC.Spread.Sheets.CopyToOptions.style)
210
+ //sheet.setStyle(v.row,v.col,v.ccstyle,GC.Spread.Sheets.SheetArea.viewport);
211
+ i++;
212
+ }
213
+ }*/
214
+ //监听编辑的单元格是否有公式
215
+ sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
216
+ var formula = sheet.getFormula(args.row, args.col);
217
+ // 判断如果是不能编辑的单元格,则执行以下代码
218
+ if (formula != null && formula != "") {
219
+ args.cancel = true;
220
+ }
221
+ });
222
+ //设置数据源
223
+ /*let dv3 = new GC.Spread.Sheets.DataValidation.createListValidator("123\\,456,234\\,567,789\\,564");
224
+ dv3.inputTitle("Please choose a number:");
225
+ dv3.inputMessage("Amount of money");
226
+ dv3.highlightStyle({
227
+ type: GC.Spread.Sheets.DataValidation.HighlightType.dogEar,
228
+ color: "green",
229
+ position: GC.Spread.Sheets.DataValidation.HighlightPosition.topRight
230
+ });
231
+ sheet.setDataValidator(14, 2, dv3);*/
232
+ //绑定数据验证
233
+ sheet.bind(GC.Spread.Sheets.Events.ValidationError, function (e, args) {
234
+ setTimeout(function () {
235
+ spread.focus(false);
236
+ }, 0);
237
+ var sheet = args.sheet;
238
+ if (sheet.getDataValidator(args.row, args.col).type() == 2 || sheet.getDataValidator(args.row, args.col).type() == 1) {
239
+ _message.error("不是数字或长度超过单元格限制!");
240
+ }
241
+ if (sheet.getDataValidator(args.row, args.col).type() == 3) {
242
+ _message.error("必须选择序列中的项!");
243
+ }
244
+ if (sheet.getDataValidator(args.row, args.col).type() == 4) {
245
+ _message.error("不是日期类型或日期不在单元格设置的范围内!");
246
+ }
247
+ if (sheet.getDataValidator(args.row, args.col).type() == 6) {
248
+ _message.error("字符串长度超过单元格限制!");
249
+ }
250
+ args.validationResult = GC.Spread.Sheets.DataValidation.DataValidationResult.discard;
251
+ });
252
+ sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
253
+ //如果是查看则设置表单保护
254
+ //sheet.options.isProtected = true;
255
+ setloading(false);
256
+ }
257
+ case 11:
258
+ case "end":
259
+ return _context2.stop();
260
+ }
261
+ }, _callee2);
262
+ }));
263
+ return function getDataSource() {
264
+ return _ref2.apply(this, arguments);
265
+ };
266
+ }();
267
+ var initStatusBar = function initStatusBar() {
268
+ var statusBarDOM = document.getElementById('statusBar');
269
+ //@ts-ignore
270
+ var statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(statusBarDOM);
271
+ statusBar.bind(spread);
272
+ };
273
+ var initEvents = function initEvents() {
274
+ spread.bind(GC.Spread.Sheets.Events.ViewZooming, function (e, args) {
275
+ //@ts-ignore
276
+ var maxZoom = parseFloat(maxZoom),
277
+ //@ts-ignore
278
+ minZoom = parseFloat(minZoom);
279
+ if (useLimit) {
280
+ if (args.newZoomFactor >= maxZoom) {
281
+ args.newZoomFactor = maxZoom;
282
+ }
283
+ if (args.newZoomFactor <= minZoom) {
284
+ args.newZoomFactor = minZoom;
285
+ }
286
+ }
287
+ setzoomFactor(args.newZoomFactor);
288
+ });
289
+ };
290
+
291
+ // 遍历单元格的方式来判断是否通过验证
292
+ var isSheetValid = function isSheetValid(sheet) {
293
+ var rowCount = sheet.getRowCount(),
294
+ colCount = sheet.getColumnCount();
295
+ var num = 0;
296
+ for (var row = 0; row < rowCount; row++) {
297
+ for (var col = 0; col < colCount; col++) {
298
+ var comboBoxCellType = sheet.getCellType(row, col);
299
+ if (comboBoxCellType.typeName == "7") {
300
+ var item = comboBoxCellType.items();
301
+ var t = 0;
302
+ for (var i = 0; i < item.length; i++) {
303
+ if (sheet.getText(row, col) != "") {
304
+ if (item[i].text == sheet.getText(row, col)) {
305
+ t++;
306
+ }
307
+ } else {
308
+ t++;
309
+ }
310
+ }
311
+ if (t == 0) {
312
+ sheet.getCell(row, col).backColor("red");
313
+ num++;
314
+ }
315
+ }
316
+ if (!sheet.isValid(row, col, sheet.getValue(row, col))) {
317
+ sheet.getCell(row, col).backColor("red");
318
+ num++;
319
+ }
320
+ }
321
+ }
322
+ return num > 0 ? false : true;
323
+ };
324
+ // 保存数据时操作
325
+ var onFinish = /*#__PURE__*/function () {
326
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(val) {
327
+ var spread, sheet, stdata, userData, user, saveData, updateData, fn, res;
328
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
329
+ while (1) switch (_context3.prev = _context3.next) {
330
+ case 0:
331
+ _context3.next = 2;
332
+ return saveSubmitIng(true);
333
+ case 2:
334
+ //@ts-ignore
335
+ spread = GC.Spread.Sheets.findControl(document.getElementsByClassName("gc-no-user-select"));
336
+ sheet = spread.getActiveSheet();
337
+ if (!isSheetValid(sheet)) {
338
+ _context3.next = 19;
339
+ break;
340
+ }
341
+ // 准备保存的数据
342
+ stdata = sheet.getDataSource(); // 获取到当前用户信息
343
+ userData = sessionStorage.getItem("user"); //@ts-ignore
344
+ user = JSON.parse(userData);
345
+ saveData = {
346
+ createDeptId: user.departmentId,
347
+ createDeptName: user.departmentName,
348
+ id: props.tempid,
349
+ data: JSON.stringify(stdata.xf),
350
+ dataYear: "2022",
351
+ //年度
352
+ dataMonth: "11",
353
+ //月份
354
+ seclevelId: null,
355
+ seclevelName: null
356
+ };
357
+ updateData = {
358
+ createDeptId: user.departmentId,
359
+ createDeptName: user.departmentName,
360
+ ownerRecordId: props.id,
361
+ //专项项目标识
362
+ id: props.tempid,
363
+ data: JSON.stringify(stdata.xf),
364
+ dataYear: "2022",
365
+ //年度
366
+ dataMonth: "11",
367
+ //月份
368
+ seclevelId: null,
369
+ seclevelName: null
370
+ };
371
+ fn = saveDataExcel; // 保存填报数据
372
+ _context3.next = 13;
373
+ return fn(isEdit ? updateData : saveData);
374
+ case 13:
375
+ res = _context3.sent;
376
+ if (res && res.success) {
377
+ _message.success("保存成功!");
378
+ props.onSetVisData(false, "save");
379
+ } else {
380
+ _message.error(res.message);
381
+ }
382
+ _context3.next = 17;
383
+ return saveSubmitIng(false);
384
+ case 17:
385
+ _context3.next = 20;
386
+ break;
387
+ case 19:
388
+ _message.warning("数据验证不通过!");
389
+ case 20:
390
+ case "end":
391
+ return _context3.stop();
392
+ }
393
+ }, _callee3);
394
+ }));
395
+ return function onFinish(_x2) {
396
+ return _ref3.apply(this, arguments);
397
+ };
398
+ }();
399
+
400
+ // 取消时返回列表页
401
+ var onCancel = function onCancel() {
402
+ props.onSetVisData(false, "cancal");
403
+ };
404
+
405
+ //打印预览
406
+ var onPrint = function onPrint() {
407
+ //@ts-ignore
408
+ var spreadPrint = GC.Spread.Sheets.findControl(document.getElementsByClassName("gc-no-user-select"));
409
+ spreadPrint.print();
410
+ };
411
+
412
+ // 页面结构
413
+ return /*#__PURE__*/React.createElement(_Spin, {
414
+ spinning: loading
415
+ }, /*#__PURE__*/React.createElement("div", {
416
+ className: "all"
417
+ }, /*#__PURE__*/React.createElement(ProForm, {
418
+ layout: "inline",
419
+ labelCol: {
420
+ span: 11
421
+ },
422
+ wrapperCol: {
423
+ span: 14
424
+ },
425
+ form: form,
426
+ onFinish: onFinish,
427
+ submitter: {
428
+ // 完全自定义整个区域
429
+ render: function render(props, doms) {
430
+ return [];
431
+ }
432
+ }
433
+ }, /*#__PURE__*/React.createElement("div", {
434
+ style: {
435
+ width: '100%'
436
+ }
437
+ }, /*#__PURE__*/React.createElement(_Button, {
438
+ key: "onCancel",
439
+ hidden: false,
440
+ onClick: onCancel,
441
+ style: {
442
+ float: "right",
443
+ marginRight: 20
444
+ }
445
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(_Button, {
446
+ type: "primary",
447
+ key: "submit",
448
+ hidden: false,
449
+ style: {
450
+ float: "right",
451
+ marginRight: 20
452
+ },
453
+ onClick: function onClick() {
454
+ return form.submit();
455
+ }
456
+ }, "\u786E\u5B9A")), /*#__PURE__*/React.createElement(SpreadSheets
457
+ //@ts-ignore
458
+ , {
459
+ hostStyle: hostS,
460
+ workbookInitialized: getTempJson
461
+ }, /*#__PURE__*/React.createElement(Worksheet, {
462
+ name: "sheet1"
463
+ })), /*#__PURE__*/React.createElement("div", {
464
+ id: "statusBar",
465
+ style: {
466
+ width: '100%',
467
+ height: 15
468
+ }
469
+ }))));
470
+ };
471
+ export default ExcelBatchEdit;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 20220418 添加密级id:seclevelId,密级名称seclevelName 【待修改】
3
+ * 存储填报后的工作表数据
4
+ * @param data {spreadjson:"整个工作表的json" }
5
+ * @returns
6
+ */
7
+ export declare function saveDataExcel(data: any): Promise<any>;
8
+ /**
9
+ * 获取表单初次打开数据 【待修改】
10
+ * 20220419修改 返回值中密级id:seclevelId,密级名称seclevelName,以及选择的填报时间:0000-00
11
+ * @param data
12
+ * @returns
13
+ */
14
+ export declare function getDataExcel(data: any): Promise<any>;
15
+ /**
16
+ * 编辑专项项目
17
+ * 点击专项项目列表中的编辑后保存
18
+ * @param data:{tempid:模板id,data:数据源信息,year:年度,month:月份,id:专项项目唯一标识}
19
+ */
20
+ export declare function edit(data: any): Promise<{
21
+ success: boolean;
22
+ }>;
23
+ /**
24
+ * 根据选择的年度查询可以选择的月份
25
+ * @param year 选择的年度
26
+ * @returns
27
+ */
28
+ export declare function getMonth(paramObj: any): Promise<any>;
29
+ /**
30
+ * 根据当前记录的唯一标识查询记录信息
31
+ * @param recordId 数据填报记录的唯一标识
32
+ * @returns 数据填报记录信息
33
+ */
34
+ export declare function getRecordInfo(recordId: string): Promise<any>;
35
+ export declare function getDataListByType(data: any): Promise<{
36
+ success: boolean;
37
+ data: {
38
+ id: string;
39
+ secLevelName: string;
40
+ }[];
41
+ }>;
@@ -0,0 +1,180 @@
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
+ * 20220418 添加密级id:seclevelId,密级名称seclevelName 【待修改】
9
+ * 存储填报后的工作表数据
10
+ * @param data {spreadjson:"整个工作表的json" }
11
+ * @returns
12
+ */
13
+ export function saveDataExcel(_x) {
14
+ return _saveDataExcel.apply(this, arguments);
15
+ }
16
+
17
+ /**
18
+ * 获取表单初次打开数据 【待修改】
19
+ * 20220419修改 返回值中密级id:seclevelId,密级名称seclevelName,以及选择的填报时间:0000-00
20
+ * @param data
21
+ * @returns
22
+ */
23
+ function _saveDataExcel() {
24
+ _saveDataExcel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
25
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
26
+ while (1) switch (_context.prev = _context.next) {
27
+ case 0:
28
+ return _context.abrupt("return", request("/template/info/savedata", {
29
+ method: 'post',
30
+ data: data,
31
+ prefix: '/workhour'
32
+ }));
33
+ case 1:
34
+ case "end":
35
+ return _context.stop();
36
+ }
37
+ }, _callee);
38
+ }));
39
+ return _saveDataExcel.apply(this, arguments);
40
+ }
41
+ export function getDataExcel(_x2) {
42
+ return _getDataExcel.apply(this, arguments);
43
+ }
44
+ /**
45
+ * 编辑专项项目
46
+ * 点击专项项目列表中的编辑后保存
47
+ * @param data:{tempid:模板id,data:数据源信息,year:年度,month:月份,id:专项项目唯一标识}
48
+ */
49
+ function _getDataExcel() {
50
+ _getDataExcel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
51
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
52
+ while (1) switch (_context2.prev = _context2.next) {
53
+ case 0:
54
+ return _context2.abrupt("return", request("/template/info/getdata", {
55
+ method: 'post',
56
+ data: data,
57
+ prefix: '/workhour'
58
+ }));
59
+ case 1:
60
+ case "end":
61
+ return _context2.stop();
62
+ }
63
+ }, _callee2);
64
+ }));
65
+ return _getDataExcel.apply(this, arguments);
66
+ }
67
+ export function edit(_x3) {
68
+ return _edit.apply(this, arguments);
69
+ }
70
+
71
+ /**
72
+ * 根据选择的年度查询可以选择的月份
73
+ * @param year 选择的年度
74
+ * @returns
75
+ */
76
+ function _edit() {
77
+ _edit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
78
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
79
+ while (1) switch (_context3.prev = _context3.next) {
80
+ case 0:
81
+ return _context3.abrupt("return", {
82
+ success: true
83
+ });
84
+ case 1:
85
+ case "end":
86
+ return _context3.stop();
87
+ }
88
+ }, _callee3);
89
+ }));
90
+ return _edit.apply(this, arguments);
91
+ }
92
+ export function getMonth(_x4) {
93
+ return _getMonth.apply(this, arguments);
94
+ }
95
+
96
+ /**
97
+ * 根据当前记录的唯一标识查询记录信息
98
+ * @param recordId 数据填报记录的唯一标识
99
+ * @returns 数据填报记录信息
100
+ */
101
+ function _getMonth() {
102
+ _getMonth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paramObj) {
103
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
104
+ while (1) switch (_context4.prev = _context4.next) {
105
+ case 0:
106
+ return _context4.abrupt("return", request("/data/record/month/list", {
107
+ method: 'post',
108
+ data: paramObj,
109
+ prefix: '/workhour'
110
+ }));
111
+ case 1:
112
+ case "end":
113
+ return _context4.stop();
114
+ }
115
+ }, _callee4);
116
+ }));
117
+ return _getMonth.apply(this, arguments);
118
+ }
119
+ export function getRecordInfo(_x5) {
120
+ return _getRecordInfo.apply(this, arguments);
121
+ }
122
+
123
+ /*
124
+ * 20220418添加 与服务端一致
125
+ * 获取密级列表 【待加】
126
+ * 用于填报时选择密级
127
+ */
128
+ function _getRecordInfo() {
129
+ _getRecordInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(recordId) {
130
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
131
+ while (1) switch (_context5.prev = _context5.next) {
132
+ case 0:
133
+ return _context5.abrupt("return", request("/data/record/get/".concat(recordId), {
134
+ method: 'get',
135
+ prefix: '/workhour'
136
+ }));
137
+ case 1:
138
+ case "end":
139
+ return _context5.stop();
140
+ }
141
+ }, _callee5);
142
+ }));
143
+ return _getRecordInfo.apply(this, arguments);
144
+ }
145
+ export function getDataListByType(_x6) {
146
+ return _getDataListByType.apply(this, arguments);
147
+ }
148
+ function _getDataListByType() {
149
+ _getDataListByType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data) {
150
+ var dataResult;
151
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
152
+ while (1) switch (_context6.prev = _context6.next) {
153
+ case 0:
154
+ // 由于目前客户端服务器还没有迁移密级相关代码,
155
+ // 经过沟通此处先默认列出密级,不经过接口查询,后续完善
156
+ dataResult = {
157
+ success: true,
158
+ data: [{
159
+ id: '公开',
160
+ secLevelName: '公开'
161
+ }, {
162
+ id: '内部',
163
+ secLevelName: '内部'
164
+ }, {
165
+ id: '秘密',
166
+ secLevelName: '秘密'
167
+ }, {
168
+ id: '机密',
169
+ secLevelName: '机密'
170
+ }]
171
+ };
172
+ return _context6.abrupt("return", dataResult);
173
+ case 2:
174
+ case "end":
175
+ return _context6.stop();
176
+ }
177
+ }, _callee6);
178
+ }));
179
+ return _getDataListByType.apply(this, arguments);
180
+ }
@@ -14,23 +14,6 @@
14
14
  font-size: 13px;
15
15
  line-height: 16px;
16
16
  }
17
- .table .ant-table-container{
18
- font-size: 12px;
19
- line-height: 16px;
20
- }
21
- .table .ant-select-show-arrow .ant-select-selector{
22
- }
23
- .table .ant-select-show-arrow .ant-select-selector .ant-select-selection-item{
24
- height: 20px;
25
- margin-top: -5px;
26
- }
27
- .table .ant-select-selector .ant-select-selection-search{
28
- height: 16px;
29
- }
30
- .table .ant-select-show-arrow .ant-select-selector .ant-select-selection-placeholder{
31
- height: 20px;
32
- margin-top: -5px;
33
- }
34
17
 
35
18
  .container{
36
19
  display: flex;
@@ -1,3 +1,6 @@
1
+ import "antd/es/input/style";
2
+ import _Input from "antd/es/input";
3
+ 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); }
1
4
  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; }
2
5
  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; }
3
6
  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); }
@@ -14,7 +17,6 @@ import { dataToEnum } from "./..";
14
17
  import { handleDataIndex } from "../VenusTable/handleVenusTableFunctions";
15
18
  import moment from "moment";
16
19
  import { haveSecLevel, isNotNullVenus, isVenusStrNotNull, renderFileNameAndIds, SelectUDRBySecLevelId } from "./..";
17
-
18
20
  /**
19
21
  * 表单项的占位符提示前缀
20
22
  */
@@ -704,7 +706,11 @@ export var VENUS_FORM_ITEM_TYPE = {
704
706
  try {
705
707
  //@ts-ignore
706
708
  var handleFormCustomType = VENUS_FORM_CUSTOMCOM_TYPE[column.parameterSource.compName || "Demo"] || function (props) {
707
- return /*#__PURE__*/React.createElement(Input, null);
709
+ return /*#__PURE__*/React.createElement(_Input, _extends({
710
+ //@ts-ignore
711
+ placeholder: VENUS_FORM_PLACHOLDER_TYPE[column.formUnitType] + column.fieldName,
712
+ disabled: disabled
713
+ }, column.parameterSource));
708
714
  };
709
715
  return /*#__PURE__*/React.createElement(FormItem2, {
710
716
  width: "md",
@@ -713,16 +719,17 @@ export var VENUS_FORM_ITEM_TYPE = {
713
719
  className: column.formItemClassName,
714
720
  key: column.fieldId,
715
721
  label: column.fieldName,
722
+ comAttr: _objectSpread({}, column.parameterSource),
716
723
  disabled: disabled ? disabled : isNotEditScene(type, column.nonEditableScene),
717
724
  span: column.formWidth || 8,
718
- style: column.formWidth != null ? null : {
725
+ style: {
719
726
  width: column.formWidth
720
727
  },
721
- initialValue: column.initialValue //@ts-ignore
728
+ initialValue: column.initialValue
729
+ //@ts-ignore
722
730
  ,
723
731
  placeholder: VENUS_FORM_PLACHOLDER_TYPE[column.formUnitType] + column.fieldName,
724
732
  rules: [{
725
- //是否必填通过其他字段判断时可使用required:{label:string,fieldName:string,value:any}
726
733
  required: column.parameterSource.required ? getOperatorByLabel(column.parameterSource.required, formData, column) : zeroAndOneToTrueOrFalse(column.formRequiredFlag),
727
734
  //@ts-ignore
728
735
  message: VENUS_FORM_PLACHOLDER_TYPE[column.formUnitType] + column.fieldName
@@ -731,7 +738,8 @@ export var VENUS_FORM_ITEM_TYPE = {
731
738
  disabled: disabled ? disabled : isNotEditScene(type, column.nonEditableScene)
732
739
  }));
733
740
  } catch (err) {
734
- console.log(err);
741
+ console.error("Error rendering form item:", err);
742
+ return /*#__PURE__*/React.createElement("div", null, "Error rendering form item");
735
743
  }
736
744
  },
737
745
  "numberUnit": function numberUnit(column, type, disabled, formData) {
package/dist/index.d.ts CHANGED
@@ -80,3 +80,4 @@ export { default as EditingTools } from './EditingTools';
80
80
  export { default as ResizeableTableColum } from './ResizeableTableColum';
81
81
  export { default as ChangePwd } from './ChangePwd';
82
82
  export { default as Drawer } from './VenusDrawer';
83
+ export { default as ExcelBatchEdit } from './ExcelBatchEdit';
package/dist/index.js CHANGED
@@ -79,4 +79,5 @@ export { getStrLeng, renderTxt, renderDoubleTxt, renderArrText, renderPopTable }
79
79
  export { default as EditingTools } from "./EditingTools";
80
80
  export { default as ResizeableTableColum } from "./ResizeableTableColum";
81
81
  export { default as ChangePwd } from "./ChangePwd";
82
- export { default as Drawer } from "./VenusDrawer";
82
+ export { default as Drawer } from "./VenusDrawer";
83
+ export { default as ExcelBatchEdit } from "./ExcelBatchEdit";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venus-design",
3
- "version": "0.4.7",
3
+ "version": "0.5.0",
4
4
  "description": "venus all compoments",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",