@bchr/bchr-front-lib 0.6.11 → 0.6.13

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.
@@ -38,6 +38,7 @@ var PASSWORD_ICON_STYLE = {
38
38
  color: "#337DB7",
39
39
  fontWeight: "bolder"
40
40
  };
41
+ var MODIFY_INPUT_CLASS = "bchr-input-password-decrypt-modify";
41
42
  var normalizeValue = function normalizeValue(value) {
42
43
  if (value === null || value === undefined) {
43
44
  return "";
@@ -249,95 +250,85 @@ var InputPasswordDecrypt = function InputPasswordDecrypt(props) {
249
250
  resetReveal();
250
251
  secret = realValueRef.current;
251
252
  if (!(ui_render_type === "modify")) {
252
- _context.n = 4;
253
+ _context.n = 3;
253
254
  break;
254
255
  }
255
- if (secret) {
256
+ if (!editingRef.current) {
256
257
  _context.n = 3;
257
258
  break;
258
259
  }
259
- commitValue("", false);
260
- if (inputRef.current && inputRef.current.focus) {
261
- inputRef.current.focus();
262
- }
260
+ showPlainText(secret, false);
263
261
  return _context.a(2);
264
262
  case 3:
265
- if (!editingRef.current) {
263
+ if (secret) {
266
264
  _context.n = 4;
267
265
  break;
268
266
  }
269
- showPlainText(secret);
270
267
  return _context.a(2);
271
268
  case 4:
272
- if (secret) {
273
- _context.n = 5;
274
- break;
275
- }
276
- return _context.a(2);
277
- case 5:
278
269
  if (requestContextPath) {
279
- _context.n = 6;
270
+ _context.n = 5;
280
271
  break;
281
272
  }
282
273
  _antd.message.error("请为组件注入属性【requestUrl】");
283
274
  return _context.a(2);
284
- case 6:
275
+ case 5:
285
276
  if (serviceConfig) {
286
- _context.n = 7;
277
+ _context.n = 6;
287
278
  break;
288
279
  }
289
280
  _antd.message.error("请为组件注入属性【appconfig】");
290
281
  return _context.a(2);
291
- case 7:
282
+ case 6:
292
283
  requestSeq = requestSeqRef.current + 1;
293
284
  requestSeqRef.current = requestSeq;
294
285
  setLoading(true);
295
- _context.p = 8;
296
- _context.n = 9;
286
+ _context.p = 7;
287
+ _context.n = 8;
297
288
  return new _HttpService["default"](requestContextPath, serviceConfig).post("decrypt", {
298
289
  data: secret
299
290
  });
300
- case 9:
291
+ case 8:
301
292
  result = _context.v;
302
293
  if (!(requestSeq !== requestSeqRef.current)) {
303
- _context.n = 10;
294
+ _context.n = 9;
304
295
  break;
305
296
  }
306
297
  return _context.a(2);
307
- case 10:
298
+ case 9:
308
299
  if (!(typeof result !== "string")) {
309
- _context.n = 11;
300
+ _context.n = 10;
310
301
  break;
311
302
  }
312
303
  _antd.message.error("解密失败");
313
304
  return _context.a(2);
314
- case 11:
315
- showPlainText(result);
316
- _context.n = 14;
305
+ case 10:
306
+ showPlainText(result, ui_render_type !== "modify");
307
+ _context.n = 13;
317
308
  break;
318
- case 12:
319
- _context.p = 12;
309
+ case 11:
310
+ _context.p = 11;
320
311
  _t = _context.v;
321
312
  if (!(requestSeq !== requestSeqRef.current)) {
322
- _context.n = 13;
313
+ _context.n = 12;
323
314
  break;
324
315
  }
325
316
  return _context.a(2);
326
- case 13:
317
+ case 12:
327
318
  resetReveal();
328
319
  setToggle(false);
329
320
  setToggleVal(maskValue(secret, resolvedMaskLength));
330
321
  _antd.message.error(getErrorMessage(_t));
331
- case 14:
332
- _context.p = 14;
322
+ case 13:
323
+ _context.p = 13;
333
324
  if (requestSeq === requestSeqRef.current) {
334
325
  setLoading(false);
335
326
  }
336
- return _context.f(14);
337
- case 15:
327
+ return _context.f(13);
328
+ case 14:
338
329
  return _context.a(2);
339
330
  }
340
- }, _callee, null, [[8, 12, 14, 15]]);
331
+ }, _callee, null, [[7, 11, 13, 14]]);
341
332
  }));
342
333
  return function onToggleFull() {
343
334
  return _ref.apply(this, arguments);
@@ -347,36 +338,30 @@ var InputPasswordDecrypt = function InputPasswordDecrypt(props) {
347
338
  if (onKeyDown) {
348
339
  onKeyDown(event);
349
340
  }
350
- if (disabled || toggle || composingRef.current || event.defaultPrevented || event.ctrlKey || event.metaKey || event.altKey || event.isComposing) {
351
- return;
352
- }
353
- if (event.key === "Backspace" || event.key === "Delete") {
354
- event.preventDefault();
355
- commitValue(editingRef.current ? realValueRef.current.slice(0, -1) : "", false);
356
- return;
357
- }
358
- if (event.key.length !== 1) {
341
+ if (disabled || !toggle || event.defaultPrevented) {
359
342
  return;
360
343
  }
361
- event.preventDefault();
362
- commitValue(editingRef.current ? realValueRef.current + event.key : event.key, true);
363
344
  };
364
345
  var onModifyPaste = function onModifyPaste(event) {
365
346
  if (onPaste) {
366
347
  onPaste(event);
367
348
  }
368
- if (disabled || toggle || composingRef.current || event.defaultPrevented) {
349
+ if (disabled) {
350
+ return;
351
+ }
352
+ if (!toggle) {
353
+ event.preventDefault();
369
354
  return;
370
355
  }
371
- var text = event.clipboardData ? event.clipboardData.getData("text") : "";
372
- event.preventDefault();
373
- if (!text) {
356
+ if (event.defaultPrevented) {
374
357
  return;
375
358
  }
376
- commitValue(editingRef.current ? realValueRef.current + text : text, false);
377
359
  };
378
360
  var onCompositionStart = function onCompositionStart(event) {
379
361
  clearRevealTimer();
362
+ if (!toggle) {
363
+ return;
364
+ }
380
365
  var compositionDisplayValue = event && event.target ? event.target.value : typeof event === "string" ? event : "";
381
366
  composingRef.current = true;
382
367
  composeBaseDisplayRef.current = compositionDisplayValue;
@@ -387,25 +372,19 @@ var InputPasswordDecrypt = function InputPasswordDecrypt(props) {
387
372
  return;
388
373
  }
389
374
  composingRef.current = false;
390
- if (disabled || toggle) {
391
- return;
392
- }
393
- var domValue = event && event.target ? event.target.value : typeof event === "string" ? event : "";
394
- var baseValue = composeBaseDisplayRef.current;
395
- var composedText = baseValue && domValue.startsWith(baseValue) ? domValue.slice(baseValue.length) : domValue.replace(/^\*+/, "");
396
- if (!composedText) {
375
+ if (disabled || !toggle) {
397
376
  setCompositionDisplay(null);
398
377
  return;
399
378
  }
400
- commitValue(editingRef.current ? realValueRef.current + composedText : composedText, true);
379
+ commitValue(event && event.target ? event.target.value : "", false);
401
380
  };
402
381
  var onModifyChange = function onModifyChange(valueOrEvent) {
403
382
  var nextValue = valueOrEvent && valueOrEvent.target ? valueOrEvent.target.value : valueOrEvent;
404
- if (composingRef.current && !toggle) {
405
- setCompositionDisplay(nextValue);
383
+ if (disabled || !toggle) {
406
384
  return;
407
385
  }
408
- if (disabled || !toggle && nextValue !== "") {
386
+ if (composingRef.current) {
387
+ setCompositionDisplay(nextValue);
409
388
  return;
410
389
  }
411
390
  commitValue(nextValue, false);
@@ -443,22 +422,15 @@ var InputPasswordDecrypt = function InputPasswordDecrypt(props) {
443
422
  } else {
444
423
  modifyDisplay = maskValue(realValue, resolvedMaskLength);
445
424
  }
446
- return /*#__PURE__*/_react["default"].createElement(_antd.Input, _extends({}, restInputProps, {
425
+ return /*#__PURE__*/_react["default"].createElement(_antd.Input, _extends({}, restInputProps, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
447
426
  ref: inputRef,
448
427
  className: className,
449
428
  style: style,
450
429
  value: modifyDisplay,
451
430
  placeholder: placeholder,
452
- disabled: disabled,
453
- allowClear: allowClear,
454
- maxLength: toggle && typeof maxLength === "number" ? maxLength : undefined,
455
- onChange: onModifyChange,
456
- onKeyDown: onModifyKeyDown,
457
- onPaste: onModifyPaste,
458
- onCompositionStart: onCompositionStart,
459
- onCompositionEnd: onCompositionEnd,
460
- suffix: renderToggleIcon()
461
- }));
431
+ disabled: !toggle || disabled,
432
+ allowClear: allowClear && toggle
433
+ }, "className", [className, MODIFY_INPUT_CLASS].filter(Boolean).join(" ")), "maxLength", toggle && typeof maxLength === "number" ? maxLength : undefined), "onChange", onModifyChange), "onKeyDown", onModifyKeyDown), "onPaste", onModifyPaste), "onCompositionStart", onCompositionStart), "onCompositionEnd", onCompositionEnd), "suffix", renderToggleIcon())));
462
434
  }
463
435
  return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
464
436
  className: className,
@@ -222,10 +222,10 @@ var ExcelKits = {
222
222
  children: child.children && _this.extractColumns(child.children, level + 1)
223
223
  });
224
224
  },
225
- /**
226
- * 收集Excel列头信息(复合表头)
227
- * @param gridColumns
228
- * @returns {{totalColumnCount: {int}, totalColumnHeaderRowCount: {int}, columnHeaderArray: [] }}
225
+ /**
226
+ * 收集Excel列头信息(复合表头)
227
+ * @param gridColumns
228
+ * @returns {{totalColumnCount: {int}, totalColumnHeaderRowCount: {int}, columnHeaderArray: [] }}
229
229
  */
230
230
  gatherExcelColumnHeaderStructureInfo: function gatherExcelColumnHeaderStructureInfo(gridColumns) {
231
231
  var _this2 = this;
@@ -298,14 +298,14 @@ var ExcelKits = {
298
298
  columnHeaderMergeCellArray: columnHeaderMergeCellArray
299
299
  };
300
300
  },
301
- /**
302
- * @return {Array} eg -
303
- * [
304
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
305
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
306
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
307
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
308
- * ]
301
+ /**
302
+ * @return {Array} eg -
303
+ * [
304
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
305
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
306
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
307
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
308
+ * ]
309
309
  */
310
310
  gatherExcelColumnHeaderMergeCellInfo: function gatherExcelColumnHeaderMergeCellInfo(gridColumn, columnHeaderMergeCellArray, totalColumnHeaderRowCount) {
311
311
  var currentColumnHeaderRowIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
@@ -246,6 +246,18 @@
246
246
  display: none;
247
247
  }
248
248
 
249
+ .bchr-input-password-decrypt-modify.ant-input-affix-wrapper-disabled,
250
+ .bchr-input-password-decrypt-modify.ant-input-affix-wrapper-disabled:hover {
251
+ border: 1px solid #d9d9d9;
252
+ padding-left: 11px;
253
+ background-color: #fff;
254
+ }
255
+
256
+ .bchr-input-password-decrypt-modify.ant-input-affix-wrapper-disabled .ant-input[disabled] {
257
+ background: transparent;
258
+ border: none;
259
+ }
260
+
249
261
  .ant-select-dropdown {
250
262
  width: 100%;
251
263
  min-height: 38px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.6.11",
3
+ "version": "0.6.13",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -11,6 +11,7 @@ const PASSWORD_ICON_STYLE = {
11
11
  color: "#337DB7",
12
12
  fontWeight: "bolder"
13
13
  };
14
+ const MODIFY_INPUT_CLASS = "bchr-input-password-decrypt-modify";
14
15
 
15
16
  const normalizeValue = (value) => {
16
17
  if (value === null || value === undefined) {
@@ -209,15 +210,8 @@ const InputPasswordDecrypt = (props) => {
209
210
  resetReveal();
210
211
  const secret = realValueRef.current;
211
212
  if (ui_render_type === "modify") {
212
- if (!secret) {
213
- commitValue("", false);
214
- if (inputRef.current && inputRef.current.focus) {
215
- inputRef.current.focus();
216
- }
217
- return;
218
- }
219
213
  if (editingRef.current) {
220
- showPlainText(secret);
214
+ showPlainText(secret, false);
221
215
  return;
222
216
  }
223
217
  }
@@ -245,7 +239,7 @@ const InputPasswordDecrypt = (props) => {
245
239
  message.error("解密失败");
246
240
  return;
247
241
  }
248
- showPlainText(result);
242
+ showPlainText(result, ui_render_type !== "modify");
249
243
  } catch (error) {
250
244
  if (requestSeq !== requestSeqRef.current) {
251
245
  return;
@@ -265,38 +259,32 @@ const InputPasswordDecrypt = (props) => {
265
259
  if (onKeyDown) {
266
260
  onKeyDown(event);
267
261
  }
268
- if (disabled || toggle || composingRef.current || event.defaultPrevented || event.ctrlKey || event.metaKey || event.altKey || event.isComposing) {
269
- return;
270
- }
271
- if (event.key === "Backspace" || event.key === "Delete") {
272
- event.preventDefault();
273
- commitValue(editingRef.current ? realValueRef.current.slice(0, -1) : "", false);
274
- return;
275
- }
276
- if (event.key.length !== 1) {
262
+ if (disabled || !toggle || event.defaultPrevented) {
277
263
  return;
278
264
  }
279
- event.preventDefault();
280
- commitValue(editingRef.current ? realValueRef.current + event.key : event.key, true);
281
265
  };
282
266
 
283
267
  const onModifyPaste = (event) => {
284
268
  if (onPaste) {
285
269
  onPaste(event);
286
270
  }
287
- if (disabled || toggle || composingRef.current || event.defaultPrevented) {
271
+ if (disabled) {
272
+ return;
273
+ }
274
+ if (!toggle) {
275
+ event.preventDefault();
288
276
  return;
289
277
  }
290
- const text = event.clipboardData ? event.clipboardData.getData("text") : "";
291
- event.preventDefault();
292
- if (!text) {
278
+ if (event.defaultPrevented) {
293
279
  return;
294
280
  }
295
- commitValue(editingRef.current ? realValueRef.current + text : text, false);
296
281
  };
297
282
 
298
283
  const onCompositionStart = (event) => {
299
284
  clearRevealTimer();
285
+ if (!toggle) {
286
+ return;
287
+ }
300
288
  const compositionDisplayValue = event && event.target ? event.target.value : (typeof event === "string" ? event : "");
301
289
  composingRef.current = true;
302
290
  composeBaseDisplayRef.current = compositionDisplayValue;
@@ -308,28 +296,20 @@ const InputPasswordDecrypt = (props) => {
308
296
  return;
309
297
  }
310
298
  composingRef.current = false;
311
- if (disabled || toggle) {
312
- return;
313
- }
314
- const domValue = event && event.target ? event.target.value : (typeof event === "string" ? event : "");
315
- const baseValue = composeBaseDisplayRef.current;
316
- const composedText = baseValue && domValue.startsWith(baseValue)
317
- ? domValue.slice(baseValue.length)
318
- : domValue.replace(/^\*+/, "");
319
- if (!composedText) {
299
+ if (disabled || !toggle) {
320
300
  setCompositionDisplay(null);
321
301
  return;
322
302
  }
323
- commitValue(editingRef.current ? realValueRef.current + composedText : composedText, true);
303
+ commitValue(event && event.target ? event.target.value : "", false);
324
304
  };
325
305
 
326
306
  const onModifyChange = (valueOrEvent) => {
327
307
  const nextValue = valueOrEvent && valueOrEvent.target ? valueOrEvent.target.value : valueOrEvent;
328
- if (composingRef.current && !toggle) {
329
- setCompositionDisplay(nextValue);
308
+ if (disabled || !toggle) {
330
309
  return;
331
310
  }
332
- if (disabled || (!toggle && nextValue !== "")) {
311
+ if (composingRef.current) {
312
+ setCompositionDisplay(nextValue);
333
313
  return;
334
314
  }
335
315
  commitValue(nextValue, false);
@@ -375,8 +355,9 @@ const InputPasswordDecrypt = (props) => {
375
355
  style={style}
376
356
  value={modifyDisplay}
377
357
  placeholder={placeholder}
378
- disabled={disabled}
379
- allowClear={allowClear}
358
+ disabled={!toggle || disabled}
359
+ allowClear={allowClear && toggle}
360
+ className={[className, MODIFY_INPUT_CLASS].filter(Boolean).join(" ")}
380
361
  maxLength={toggle && typeof maxLength === "number" ? maxLength : undefined}
381
362
  onChange={onModifyChange}
382
363
  onKeyDown={onModifyKeyDown}
@@ -1,373 +1,373 @@
1
- import * as ExcelJS from "exceljs/dist/exceljs.bare.js";
2
- import {saveAs} from "file-saver";
3
- import Values from "./Values";
4
-
5
-
6
- const DEFAULT_BORDER_COLOR_FOR_EXCEL = "CCCCCC";
7
- const DEFAULT_FG_COLOR_FOR_EXCEL = "FFFFFF";
8
- const DEFAULT_COL_HEADER_BG_COLOR = "F2F3F5";
9
-
10
- const excelHeaderRowStyle = {
11
- font: {
12
- size: 10,
13
- bold: true
14
- },
15
- alignment: {
16
- vertical: 'middle',
17
- horizontal: 'center'
18
- },
19
- fill: {
20
- type: 'pattern',
21
- pattern: 'solid',
22
- fgColor: {
23
- argb: DEFAULT_COL_HEADER_BG_COLOR
24
- }
25
- },
26
- border: {
27
- top: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
28
- left: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
29
- bottom: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
30
- right: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}}
31
- }
32
- }
33
-
34
- const excelBodyRowStyle = {
35
- font: {
36
- size: 10,
37
- bold: true
38
- },
39
- alignment: {
40
- vertical: 'middle',
41
- horizontal: 'center'
42
- },
43
- fill: {
44
- type: 'pattern',
45
- pattern: 'solid',
46
- fgColor: {
47
- argb: DEFAULT_FG_COLOR_FOR_EXCEL
48
- }
49
- },
50
- border: {
51
- top: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
52
- left: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
53
- bottom: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
54
- right: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}}
55
- }
56
- }
57
-
58
- const ExcelKits = {
59
-
60
- exportHandsontableData2CSVFile(handsonTableInstance, fileName) {
61
- if (handsonTableInstance === null || handsonTableInstance === void 0) {
62
- throw new IllegalArgumentError("HandsontableInstance is null for ExcelKits#exportHandsontableData2CSVFile");
63
- }
64
-
65
- if (Values.isBlankString(fileName)) {
66
- fileName = `${t('ui.export.csv.file')}-` + new Date().getTime();
67
- }
68
-
69
- const exportPlugin = handsonTableInstance.getPlugin('exportFile');
70
- exportPlugin.downloadFile('csv', {
71
- bom: false,
72
- columnDelimiter: ',',
73
- columnHeaders: false,
74
- exportHiddenColumns: true,
75
- exportHiddenRows: true,
76
- fileExtension: 'csv',
77
- filename: fileName,
78
- mimeType: 'text/csv',
79
- rowDelimiter: '\r\n',
80
- rowHeaders: true
81
- });
82
- },
83
-
84
- exportHandsontableData2ExcelFile(handsontableInstance, fileName) {
85
- if (handsontableInstance === null || handsontableInstance === void 0) {
86
- throw new IllegalArgumentError("HandsontableInstance is null for ExcelKits#exportHandsontableData2ExcelFile");
87
- }
88
-
89
- if (Values.isBlankString(fileName)) {
90
- fileName = t('ui.export.excel.file') + "-" + new Date().getTime();
91
- }
92
-
93
- let exportGridColumns = [];
94
- let exportGridData = handsontableInstance.hotInstance.getSourceData();
95
-
96
- window.handsontableInstance = handsontableInstance;
97
-
98
- if (handsontableInstance.columnSettings && handsontableInstance.columnSettings.length) {
99
- handsontableInstance.columnSettings.forEach(column => {
100
- exportGridColumns.push({
101
- ...column,
102
- dataIndex: column.data
103
- })
104
- })
105
- }
106
-
107
- console.log('exportGridColumns :', exportGridColumns)
108
- console.log('exportGridData :', exportGridData)
109
-
110
- this.exportTableData2ExcelFile(exportGridColumns, exportGridData, fileName);
111
- },
112
-
113
- exportTableData2ExcelFile(columns = [], data = [], fileName) {
114
-
115
- if (Values.isBlankString(fileName)) {
116
- fileName = `${t('ui.export.excel.file')}-` + new Date().getTime();
117
- }
118
-
119
- const workbook = new ExcelJS.Workbook();
120
- const worksheet = workbook.addWorksheet('sheet');
121
-
122
- let exportGridColumnsData = this.gatherExcelColumnHeaderStructureInfo(this.extractColumns(columns));
123
- let totalColumnHeaderRowCount = exportGridColumnsData.totalColumnHeaderRowCount;
124
- let columnHeaderData = exportGridColumnsData.columnHeaderData;
125
- let rowHeaderArray = exportGridColumnsData.rowHeaderArray;
126
- let columnHeaderMergeCellArray = exportGridColumnsData.columnHeaderMergeCellArray;
127
-
128
- let exportGridData = data;
129
-
130
- worksheet.columns = columnHeaderData;
131
- worksheet.spliceRows(1, 1);
132
- worksheet.insertRows(1, rowHeaderArray);
133
-
134
- exportGridData.forEach(gridItem => {
135
- worksheet.addRow(gridItem);
136
- })
137
-
138
- columnHeaderMergeCellArray.forEach(mergeCells => {
139
- worksheet.mergeCells(mergeCells)
140
- })
141
-
142
- // 设置表头样式
143
- const headerRows = worksheet.getRows(1, totalColumnHeaderRowCount);
144
- headerRows.forEach((row, rowIndex) => {
145
- row.eachCell((cell, cellIndex) => {
146
- cell.style = excelHeaderRowStyle;
147
- })
148
- })
149
-
150
- // 设置表体样式
151
- const bodyRows = worksheet.getRows(totalColumnHeaderRowCount + 1, totalColumnHeaderRowCount + exportGridData.length + 5);
152
- bodyRows.forEach((row) => {
153
- row.eachCell((cell, cellIndex) => {
154
- cell.style = excelBodyRowStyle;
155
- })
156
- })
157
-
158
- workbook.xlsx.writeBuffer().then(buffer => {
159
- saveAs(new Blob([buffer], {
160
- type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
161
- }), fileName + ".xlsx")
162
- })
163
- },
164
-
165
- extractColumns(children, level) {
166
- let _this = this;
167
- if (level === void 0) {
168
- level = 0;
169
- }
170
- return Array.isArray(children)
171
- ? children.map(function (child) {
172
- return _this.extractChild(child, level);
173
- })
174
- : [children, _this.extractChild(children, level)];
175
- },
176
-
177
- extractChild(child, level) {
178
- let _this = this;
179
- if (level === void 0) {
180
- level = 0;
181
- }
182
- return Object.assign(Object.assign({}, child), {
183
- level: level,
184
- children: child.children && _this.extractColumns(child.children, level + 1)
185
- })
186
- },
187
-
188
- /**
189
- * 收集Excel列头信息(复合表头)
190
- * @param gridColumns
191
- * @returns {{totalColumnCount: {int}, totalColumnHeaderRowCount: {int}, columnHeaderArray: [] }}
192
- */
193
- gatherExcelColumnHeaderStructureInfo(gridColumns) {
194
- let [totalColumnCount, totalColumnHeaderRowCount] = this.getTotalColumnCountAndTotalColumnHeaderRowCount(gridColumns, 0, 1);
195
-
196
- let columnHeaderArray = [];
197
- for (let i = 0, count = gridColumns.length; i < count; i++) {
198
- let column = gridColumns[i];
199
- this.$buildColumnHeaderArray(column, columnHeaderArray);
200
- }
201
-
202
- for (let i = 0, count = columnHeaderArray.length; i < count; i++) {
203
- let subArray = columnHeaderArray[i];
204
- let lastElem = subArray[subArray.length - 1];
205
- for (let r = subArray.length; r < totalColumnHeaderRowCount; r++) {
206
- subArray.push(lastElem);
207
- }
208
- }
209
-
210
- let columnHeaderMergeCellArray = [];
211
- let nextColIndex = 1;
212
- for (let i = 0, count = gridColumns.length; i < count; i++) {
213
- let gridColumn = gridColumns[i];
214
- nextColIndex = this.gatherExcelColumnHeaderMergeCellInfo(gridColumn, columnHeaderMergeCellArray, totalColumnHeaderRowCount, 1, nextColIndex);
215
- }
216
-
217
- let rowHeaderArray = [];
218
- for (let totalColumnHeaderRowStep = 0; totalColumnHeaderRowStep < totalColumnHeaderRowCount; totalColumnHeaderRowStep++) {
219
- let rowHeaderColumns = [];
220
- columnHeaderArray.forEach(columns => {
221
- rowHeaderColumns.push(columns[totalColumnHeaderRowStep])
222
- })
223
- rowHeaderArray.push(rowHeaderColumns);
224
- }
225
-
226
- let columnHeaderData = [];
227
- let columnIndex = 0;
228
-
229
- let addColumns = (columns, result) => {
230
- columns.forEach((column) => {
231
- let exporterColumn = this.$normalizedExportColumn(column);
232
- result.push(exporterColumn);
233
- if (column.children && column.children.length > 1) {
234
- let children = exporterColumn.columns = [];
235
- addColumns(column.children, children);
236
- } else {
237
- columnIndex++;
238
- }
239
- });
240
- };
241
- addColumns(gridColumns, columnHeaderData);
242
- const autoCreateArrayItems = function (column, columnStep, columns) {
243
- if (column.columns && column.columns.length) {
244
- columns.splice(columnStep, 1, ...column.columns);
245
- }
246
-
247
- if (columnStep === columns.length - 1) {
248
- console.log('success');
249
- } else {
250
- columnStep++;
251
- autoCreateArrayItems(columns[columnStep], columnStep, columns);
252
- }
253
- }
254
-
255
- autoCreateArrayItems(columnHeaderData[0], 0, columnHeaderData);
256
-
257
- return {
258
- totalColumnCount,
259
- totalColumnHeaderRowCount,
260
- columnHeaderArray,
261
- columnHeaderData,
262
- rowHeaderArray,
263
- columnHeaderMergeCellArray
264
- };
265
- },
266
-
267
- /**
268
- * @return {Array} eg -
269
- * [
270
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
271
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
272
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
273
- * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
274
- * ]
275
- */
276
- gatherExcelColumnHeaderMergeCellInfo(gridColumn, columnHeaderMergeCellArray, totalColumnHeaderRowCount, currentColumnHeaderRowIndex = 1, colIndex) {
277
-
278
- let allChildColumnCount = this.$countAllChildColumnCount(gridColumn);
279
-
280
- if (Array.isArray(gridColumn.children) && gridColumn.children.length) {
281
- let gridColumns = gridColumn.children;
282
- let gridColumnCount = gridColumns.length;
283
-
284
- columnHeaderMergeCellArray.push([currentColumnHeaderRowIndex, colIndex, currentColumnHeaderRowIndex, colIndex + allChildColumnCount - 1]);
285
-
286
- for (let i = 0; i < gridColumnCount; i++) {
287
- this.gatherExcelColumnHeaderMergeCellInfo(gridColumns[i], columnHeaderMergeCellArray, totalColumnHeaderRowCount,
288
- currentColumnHeaderRowIndex + 1, colIndex + i);
289
- }
290
- } else {
291
- if (currentColumnHeaderRowIndex !== totalColumnHeaderRowCount) {
292
- columnHeaderMergeCellArray.push([currentColumnHeaderRowIndex, colIndex, totalColumnHeaderRowCount, colIndex]);
293
- }
294
- }
295
-
296
- return colIndex + allChildColumnCount;
297
- },
298
-
299
- $countAllChildColumnCount(gridColumn) {
300
- let columnCount = 0;
301
- if (gridColumn === null || gridColumn === void 0) {
302
- return columnCount;
303
- }
304
-
305
- if (Array.isArray(gridColumn.children) && gridColumn.children.length) {
306
- let gridColumns = gridColumn.children;
307
- let gridColumnCount = gridColumns.length;
308
-
309
- for (let i = 0; i < gridColumnCount; i++) {
310
- let childColumnCount = this.$countAllChildColumnCount(gridColumns[i]);
311
- columnCount = columnCount + childColumnCount;
312
- }
313
- } else {
314
- columnCount = 1;
315
- }
316
-
317
- return columnCount;
318
- },
319
-
320
- getTotalColumnCountAndTotalColumnHeaderRowCount(gridColumns, totalColumnCount, totalColumnHeaderCount) {
321
- let maxN2 = totalColumnHeaderCount;
322
- for (let i = 0, count = gridColumns.length; i < count; i++) {
323
- let column = gridColumns[i];
324
- if (Array.isArray(column.children) && column.children.length) {
325
- let [n1, n2] = this.getTotalColumnCountAndTotalColumnHeaderRowCount(column.children, 0, totalColumnHeaderCount + 1);
326
- totalColumnCount = totalColumnCount + n1;
327
- if (n2 > maxN2) {
328
- maxN2 = n2;
329
- }
330
- } else {
331
- totalColumnCount = totalColumnCount + 1;
332
- }
333
- }
334
-
335
- return [totalColumnCount, maxN2]
336
- },
337
-
338
- $buildColumnHeaderArray(column, columnHeaderArray, parentHeaderTitles) {
339
- if (Array.isArray(column.children) && column.children.length) {
340
- if (parentHeaderTitles === null || parentHeaderTitles == void 0) {
341
- parentHeaderTitles = [column.title];
342
- } else {
343
- parentHeaderTitles.push(column.title);
344
- }
345
-
346
- for (let i = 0, count = column.children.length; i < count; i++) {
347
- let childColumn = column.children[i];
348
- this.$buildColumnHeaderArray(childColumn, columnHeaderArray, parentHeaderTitles);
349
- }
350
- } else {
351
- let columnSelfHeaderTitleArray = [];
352
- if (Array.isArray(parentHeaderTitles)) {
353
- columnSelfHeaderTitleArray.push(...parentHeaderTitles);
354
- }
355
-
356
- columnSelfHeaderTitleArray.push(column.title);
357
-
358
- columnHeaderArray.push(columnSelfHeaderTitleArray)
359
- }
360
- },
361
-
362
-
363
- $normalizedExportColumn(column) {
364
- return {
365
- header : column.title,
366
- key : column.dataIndex,
367
- locked : column.locked,
368
- width : column.width != null ? column.width * 0.1 : undefined
369
- }
370
- }
371
- }
372
-
373
- export default ExcelKits;
1
+ import * as ExcelJS from "exceljs/dist/exceljs.bare.js";
2
+ import {saveAs} from "file-saver";
3
+ import Values from "./Values";
4
+
5
+
6
+ const DEFAULT_BORDER_COLOR_FOR_EXCEL = "CCCCCC";
7
+ const DEFAULT_FG_COLOR_FOR_EXCEL = "FFFFFF";
8
+ const DEFAULT_COL_HEADER_BG_COLOR = "F2F3F5";
9
+
10
+ const excelHeaderRowStyle = {
11
+ font: {
12
+ size: 10,
13
+ bold: true
14
+ },
15
+ alignment: {
16
+ vertical: 'middle',
17
+ horizontal: 'center'
18
+ },
19
+ fill: {
20
+ type: 'pattern',
21
+ pattern: 'solid',
22
+ fgColor: {
23
+ argb: DEFAULT_COL_HEADER_BG_COLOR
24
+ }
25
+ },
26
+ border: {
27
+ top: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
28
+ left: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
29
+ bottom: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
30
+ right: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}}
31
+ }
32
+ }
33
+
34
+ const excelBodyRowStyle = {
35
+ font: {
36
+ size: 10,
37
+ bold: true
38
+ },
39
+ alignment: {
40
+ vertical: 'middle',
41
+ horizontal: 'center'
42
+ },
43
+ fill: {
44
+ type: 'pattern',
45
+ pattern: 'solid',
46
+ fgColor: {
47
+ argb: DEFAULT_FG_COLOR_FOR_EXCEL
48
+ }
49
+ },
50
+ border: {
51
+ top: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
52
+ left: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
53
+ bottom: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}},
54
+ right: {style: 'thin', color: {argb: DEFAULT_BORDER_COLOR_FOR_EXCEL}}
55
+ }
56
+ }
57
+
58
+ const ExcelKits = {
59
+
60
+ exportHandsontableData2CSVFile(handsonTableInstance, fileName) {
61
+ if (handsonTableInstance === null || handsonTableInstance === void 0) {
62
+ throw new IllegalArgumentError("HandsontableInstance is null for ExcelKits#exportHandsontableData2CSVFile");
63
+ }
64
+
65
+ if (Values.isBlankString(fileName)) {
66
+ fileName = `${t('ui.export.csv.file')}-` + new Date().getTime();
67
+ }
68
+
69
+ const exportPlugin = handsonTableInstance.getPlugin('exportFile');
70
+ exportPlugin.downloadFile('csv', {
71
+ bom: false,
72
+ columnDelimiter: ',',
73
+ columnHeaders: false,
74
+ exportHiddenColumns: true,
75
+ exportHiddenRows: true,
76
+ fileExtension: 'csv',
77
+ filename: fileName,
78
+ mimeType: 'text/csv',
79
+ rowDelimiter: '\r\n',
80
+ rowHeaders: true
81
+ });
82
+ },
83
+
84
+ exportHandsontableData2ExcelFile(handsontableInstance, fileName) {
85
+ if (handsontableInstance === null || handsontableInstance === void 0) {
86
+ throw new IllegalArgumentError("HandsontableInstance is null for ExcelKits#exportHandsontableData2ExcelFile");
87
+ }
88
+
89
+ if (Values.isBlankString(fileName)) {
90
+ fileName = t('ui.export.excel.file') + "-" + new Date().getTime();
91
+ }
92
+
93
+ let exportGridColumns = [];
94
+ let exportGridData = handsontableInstance.hotInstance.getSourceData();
95
+
96
+ window.handsontableInstance = handsontableInstance;
97
+
98
+ if (handsontableInstance.columnSettings && handsontableInstance.columnSettings.length) {
99
+ handsontableInstance.columnSettings.forEach(column => {
100
+ exportGridColumns.push({
101
+ ...column,
102
+ dataIndex: column.data
103
+ })
104
+ })
105
+ }
106
+
107
+ console.log('exportGridColumns :', exportGridColumns)
108
+ console.log('exportGridData :', exportGridData)
109
+
110
+ this.exportTableData2ExcelFile(exportGridColumns, exportGridData, fileName);
111
+ },
112
+
113
+ exportTableData2ExcelFile(columns = [], data = [], fileName) {
114
+
115
+ if (Values.isBlankString(fileName)) {
116
+ fileName = `${t('ui.export.excel.file')}-` + new Date().getTime();
117
+ }
118
+
119
+ const workbook = new ExcelJS.Workbook();
120
+ const worksheet = workbook.addWorksheet('sheet');
121
+
122
+ let exportGridColumnsData = this.gatherExcelColumnHeaderStructureInfo(this.extractColumns(columns));
123
+ let totalColumnHeaderRowCount = exportGridColumnsData.totalColumnHeaderRowCount;
124
+ let columnHeaderData = exportGridColumnsData.columnHeaderData;
125
+ let rowHeaderArray = exportGridColumnsData.rowHeaderArray;
126
+ let columnHeaderMergeCellArray = exportGridColumnsData.columnHeaderMergeCellArray;
127
+
128
+ let exportGridData = data;
129
+
130
+ worksheet.columns = columnHeaderData;
131
+ worksheet.spliceRows(1, 1);
132
+ worksheet.insertRows(1, rowHeaderArray);
133
+
134
+ exportGridData.forEach(gridItem => {
135
+ worksheet.addRow(gridItem);
136
+ })
137
+
138
+ columnHeaderMergeCellArray.forEach(mergeCells => {
139
+ worksheet.mergeCells(mergeCells)
140
+ })
141
+
142
+ // 设置表头样式
143
+ const headerRows = worksheet.getRows(1, totalColumnHeaderRowCount);
144
+ headerRows.forEach((row, rowIndex) => {
145
+ row.eachCell((cell, cellIndex) => {
146
+ cell.style = excelHeaderRowStyle;
147
+ })
148
+ })
149
+
150
+ // 设置表体样式
151
+ const bodyRows = worksheet.getRows(totalColumnHeaderRowCount + 1, totalColumnHeaderRowCount + exportGridData.length + 5);
152
+ bodyRows.forEach((row) => {
153
+ row.eachCell((cell, cellIndex) => {
154
+ cell.style = excelBodyRowStyle;
155
+ })
156
+ })
157
+
158
+ workbook.xlsx.writeBuffer().then(buffer => {
159
+ saveAs(new Blob([buffer], {
160
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
161
+ }), fileName + ".xlsx")
162
+ })
163
+ },
164
+
165
+ extractColumns(children, level) {
166
+ let _this = this;
167
+ if (level === void 0) {
168
+ level = 0;
169
+ }
170
+ return Array.isArray(children)
171
+ ? children.map(function (child) {
172
+ return _this.extractChild(child, level);
173
+ })
174
+ : [children, _this.extractChild(children, level)];
175
+ },
176
+
177
+ extractChild(child, level) {
178
+ let _this = this;
179
+ if (level === void 0) {
180
+ level = 0;
181
+ }
182
+ return Object.assign(Object.assign({}, child), {
183
+ level: level,
184
+ children: child.children && _this.extractColumns(child.children, level + 1)
185
+ })
186
+ },
187
+
188
+ /**
189
+ * 收集Excel列头信息(复合表头)
190
+ * @param gridColumns
191
+ * @returns {{totalColumnCount: {int}, totalColumnHeaderRowCount: {int}, columnHeaderArray: [] }}
192
+ */
193
+ gatherExcelColumnHeaderStructureInfo(gridColumns) {
194
+ let [totalColumnCount, totalColumnHeaderRowCount] = this.getTotalColumnCountAndTotalColumnHeaderRowCount(gridColumns, 0, 1);
195
+
196
+ let columnHeaderArray = [];
197
+ for (let i = 0, count = gridColumns.length; i < count; i++) {
198
+ let column = gridColumns[i];
199
+ this.$buildColumnHeaderArray(column, columnHeaderArray);
200
+ }
201
+
202
+ for (let i = 0, count = columnHeaderArray.length; i < count; i++) {
203
+ let subArray = columnHeaderArray[i];
204
+ let lastElem = subArray[subArray.length - 1];
205
+ for (let r = subArray.length; r < totalColumnHeaderRowCount; r++) {
206
+ subArray.push(lastElem);
207
+ }
208
+ }
209
+
210
+ let columnHeaderMergeCellArray = [];
211
+ let nextColIndex = 1;
212
+ for (let i = 0, count = gridColumns.length; i < count; i++) {
213
+ let gridColumn = gridColumns[i];
214
+ nextColIndex = this.gatherExcelColumnHeaderMergeCellInfo(gridColumn, columnHeaderMergeCellArray, totalColumnHeaderRowCount, 1, nextColIndex);
215
+ }
216
+
217
+ let rowHeaderArray = [];
218
+ for (let totalColumnHeaderRowStep = 0; totalColumnHeaderRowStep < totalColumnHeaderRowCount; totalColumnHeaderRowStep++) {
219
+ let rowHeaderColumns = [];
220
+ columnHeaderArray.forEach(columns => {
221
+ rowHeaderColumns.push(columns[totalColumnHeaderRowStep])
222
+ })
223
+ rowHeaderArray.push(rowHeaderColumns);
224
+ }
225
+
226
+ let columnHeaderData = [];
227
+ let columnIndex = 0;
228
+
229
+ let addColumns = (columns, result) => {
230
+ columns.forEach((column) => {
231
+ let exporterColumn = this.$normalizedExportColumn(column);
232
+ result.push(exporterColumn);
233
+ if (column.children && column.children.length > 1) {
234
+ let children = exporterColumn.columns = [];
235
+ addColumns(column.children, children);
236
+ } else {
237
+ columnIndex++;
238
+ }
239
+ });
240
+ };
241
+ addColumns(gridColumns, columnHeaderData);
242
+ const autoCreateArrayItems = function (column, columnStep, columns) {
243
+ if (column.columns && column.columns.length) {
244
+ columns.splice(columnStep, 1, ...column.columns);
245
+ }
246
+
247
+ if (columnStep === columns.length - 1) {
248
+ console.log('success');
249
+ } else {
250
+ columnStep++;
251
+ autoCreateArrayItems(columns[columnStep], columnStep, columns);
252
+ }
253
+ }
254
+
255
+ autoCreateArrayItems(columnHeaderData[0], 0, columnHeaderData);
256
+
257
+ return {
258
+ totalColumnCount,
259
+ totalColumnHeaderRowCount,
260
+ columnHeaderArray,
261
+ columnHeaderData,
262
+ rowHeaderArray,
263
+ columnHeaderMergeCellArray
264
+ };
265
+ },
266
+
267
+ /**
268
+ * @return {Array} eg -
269
+ * [
270
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
271
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
272
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
273
+ * [leftTopRowIndex, leftTopColumnIndex, rightBottomRowIndex, rightBottomColumnIndex],
274
+ * ]
275
+ */
276
+ gatherExcelColumnHeaderMergeCellInfo(gridColumn, columnHeaderMergeCellArray, totalColumnHeaderRowCount, currentColumnHeaderRowIndex = 1, colIndex) {
277
+
278
+ let allChildColumnCount = this.$countAllChildColumnCount(gridColumn);
279
+
280
+ if (Array.isArray(gridColumn.children) && gridColumn.children.length) {
281
+ let gridColumns = gridColumn.children;
282
+ let gridColumnCount = gridColumns.length;
283
+
284
+ columnHeaderMergeCellArray.push([currentColumnHeaderRowIndex, colIndex, currentColumnHeaderRowIndex, colIndex + allChildColumnCount - 1]);
285
+
286
+ for (let i = 0; i < gridColumnCount; i++) {
287
+ this.gatherExcelColumnHeaderMergeCellInfo(gridColumns[i], columnHeaderMergeCellArray, totalColumnHeaderRowCount,
288
+ currentColumnHeaderRowIndex + 1, colIndex + i);
289
+ }
290
+ } else {
291
+ if (currentColumnHeaderRowIndex !== totalColumnHeaderRowCount) {
292
+ columnHeaderMergeCellArray.push([currentColumnHeaderRowIndex, colIndex, totalColumnHeaderRowCount, colIndex]);
293
+ }
294
+ }
295
+
296
+ return colIndex + allChildColumnCount;
297
+ },
298
+
299
+ $countAllChildColumnCount(gridColumn) {
300
+ let columnCount = 0;
301
+ if (gridColumn === null || gridColumn === void 0) {
302
+ return columnCount;
303
+ }
304
+
305
+ if (Array.isArray(gridColumn.children) && gridColumn.children.length) {
306
+ let gridColumns = gridColumn.children;
307
+ let gridColumnCount = gridColumns.length;
308
+
309
+ for (let i = 0; i < gridColumnCount; i++) {
310
+ let childColumnCount = this.$countAllChildColumnCount(gridColumns[i]);
311
+ columnCount = columnCount + childColumnCount;
312
+ }
313
+ } else {
314
+ columnCount = 1;
315
+ }
316
+
317
+ return columnCount;
318
+ },
319
+
320
+ getTotalColumnCountAndTotalColumnHeaderRowCount(gridColumns, totalColumnCount, totalColumnHeaderCount) {
321
+ let maxN2 = totalColumnHeaderCount;
322
+ for (let i = 0, count = gridColumns.length; i < count; i++) {
323
+ let column = gridColumns[i];
324
+ if (Array.isArray(column.children) && column.children.length) {
325
+ let [n1, n2] = this.getTotalColumnCountAndTotalColumnHeaderRowCount(column.children, 0, totalColumnHeaderCount + 1);
326
+ totalColumnCount = totalColumnCount + n1;
327
+ if (n2 > maxN2) {
328
+ maxN2 = n2;
329
+ }
330
+ } else {
331
+ totalColumnCount = totalColumnCount + 1;
332
+ }
333
+ }
334
+
335
+ return [totalColumnCount, maxN2]
336
+ },
337
+
338
+ $buildColumnHeaderArray(column, columnHeaderArray, parentHeaderTitles) {
339
+ if (Array.isArray(column.children) && column.children.length) {
340
+ if (parentHeaderTitles === null || parentHeaderTitles == void 0) {
341
+ parentHeaderTitles = [column.title];
342
+ } else {
343
+ parentHeaderTitles.push(column.title);
344
+ }
345
+
346
+ for (let i = 0, count = column.children.length; i < count; i++) {
347
+ let childColumn = column.children[i];
348
+ this.$buildColumnHeaderArray(childColumn, columnHeaderArray, parentHeaderTitles);
349
+ }
350
+ } else {
351
+ let columnSelfHeaderTitleArray = [];
352
+ if (Array.isArray(parentHeaderTitles)) {
353
+ columnSelfHeaderTitleArray.push(...parentHeaderTitles);
354
+ }
355
+
356
+ columnSelfHeaderTitleArray.push(column.title);
357
+
358
+ columnHeaderArray.push(columnSelfHeaderTitleArray)
359
+ }
360
+ },
361
+
362
+
363
+ $normalizedExportColumn(column) {
364
+ return {
365
+ header : column.title,
366
+ key : column.dataIndex,
367
+ locked : column.locked,
368
+ width : column.width != null ? column.width * 0.1 : undefined
369
+ }
370
+ }
371
+ }
372
+
373
+ export default ExcelKits;
@@ -246,6 +246,18 @@
246
246
  display: none;
247
247
  }
248
248
 
249
+ .bchr-input-password-decrypt-modify.ant-input-affix-wrapper-disabled,
250
+ .bchr-input-password-decrypt-modify.ant-input-affix-wrapper-disabled:hover {
251
+ border: 1px solid #d9d9d9;
252
+ padding-left: 11px;
253
+ background-color: #fff;
254
+ }
255
+
256
+ .bchr-input-password-decrypt-modify.ant-input-affix-wrapper-disabled .ant-input[disabled] {
257
+ background: transparent;
258
+ border: none;
259
+ }
260
+
249
261
  .ant-select-dropdown {
250
262
  width: 100%;
251
263
  min-height: 38px;