dtable-statistic 5.3.50 → 5.3.51

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.
@@ -4,44 +4,48 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- /**
8
- * local development settings
9
- */
10
- var _default = exports.default = {
11
- username: '7355da59470c4402884fa1b21a10cd06@auth.local',
7
+ let config = {
8
+ username: 'cffbc4dbc6364befbdccb8623842a8ed@auth.local',
12
9
  password: '123456',
13
- token: "2a06aeb633ffb5bb1937aed421e8043210959652",
14
- // dtable api token (required)
15
- APIToken: 'b48e52714601c464ca4bf2fa3d10daea095ef070',
16
- // server URL of the dtable of the plugin (required)
10
+ dtableUuid: '842e9c84-8311-432d-b818-27012c807b13',
11
+ // required
12
+ APIToken: '83a5ec5848242d4da6c086acabd8e3a6e2fefa10',
13
+ // required
17
14
  server: 'https://dev.seatable.cn',
18
- // id of the workspace with the dtable of the plugin (required, workspace must exist)
19
- workspaceID: '169',
20
- // name of the dtable to add the plugin to (required, dtable must exist under this name)
21
- fileName: 'Coll',
22
- // default language ('en' or 'zh-cn' are common, see "src/locale/index.js" for all lang keys)
23
- lang: 'zh-cn',
24
- permission: 'rw',
25
- dtableUuid: '8e905209-b306-4aa8-a082-8046801ba94c',
26
- // media URL of the dtable of the plugin (required)
27
- mediaUrl: 'https://dev.seatable.cn/media/',
28
- isAdmin: true
29
- }; // export default {
30
- // username: '8e6fd68ab7764dd2b01c2f2a17b7d991@auth.local',
31
- // password: '1',
32
- // token: "2a06aeb633ffb5bb1937aed421e8043210959652",
33
- // // dtable api token (required)
34
- // APIToken: '89d80ccbba8c1033264ba02df4441de2e5f2c394',
35
- // // server URL of the dtable of the plugin (required)
36
- // server: 'http://127.0.0.1:80',
37
- // // id of the workspace with the dtable of the plugin (required, workspace must exist)
38
- // workspaceID: '1',
39
- // // name of the dtable to add the plugin to (required, dtable must exist under this name)
40
- // fileName: '页面设计测试',
41
- // // default language ('en' or 'zh-cn' are common, see "src/locale/index.js" for all lang keys)
42
- // lang: 'en',
43
- // permission: 'rw',
44
- // // media URL of the dtable of the plugin (required)
45
- // mediaUrl: '/media/',
46
- // isAdmin: false,
47
- // };
15
+ mediaUrl: '/media/',
16
+ // required
17
+ dtableBaiduMapKey: '1qRjaf9gprzfG6Kykg54jSzAEZZI0NZV',
18
+ // required
19
+ dtableMineMapKey: '57bccfdf646e4118aa68accfa1f256a5',
20
+ // optional
21
+ dtableGoogleMapKey: 'AIzaSyC0K2fPe31FfLm3fyoPT5YXQcqO-GrSTi8',
22
+ workspaceID: '291',
23
+ // optional
24
+ fileName: '通用应用表格测试',
25
+ // optional
26
+ lang: 'en' // optional
27
+ // lang:'en'
28
+ };
29
+ let config2 = {
30
+ username: 'cffbc4dbc6364befbdccb8623842a8ed@auth.local',
31
+ password: '123456',
32
+ dtableUuid: '90048f2f-a397-4739-8049-29c97eb5c0c2',
33
+ // required
34
+ APIToken: '7abd6e329205b9c63190429a716e5d15f682a817',
35
+ // required
36
+ server: 'https://dev.seatable.cn',
37
+ mediaUrl: '/media/',
38
+ // required
39
+ dtableBaiduMapKey: '1qRjaf9gprzfG6Kykg54jSzAEZZI0NZV',
40
+ // required
41
+ dtableMineMapKey: '57bccfdf646e4118aa68accfa1f256a5',
42
+ // optional
43
+ dtableGoogleMapKey: 'AIzaSyC0K2fPe31FfLm3fyoPT5YXQcqO-GrSTi8',
44
+ workspaceID: '291',
45
+ // optional
46
+ fileName: '实验动物笼位统计表',
47
+ // optional
48
+ lang: 'en' // optional
49
+ // lang:'en'
50
+ };
51
+ var _default = exports.default = config2;
@@ -223,11 +223,7 @@ const exportOneDimensionToTable = _ref => {
223
223
  type: _dtableUtils.CellType.NUMBER,
224
224
  name: _reactIntlUniversal.default.get('Total'),
225
225
  data: {
226
- decimal: 'dot',
227
- enable_precision: false,
228
- format: 'yuan',
229
- precision: 2,
230
- thousands: 'no'
226
+ format: 'number'
231
227
  }
232
228
  };
233
229
  columnMap['total'] = totalColumn;
@@ -650,18 +646,24 @@ const updatedOneDimensionToTable = _ref5 => {
650
646
  let newRow = {
651
647
  [nameColumn.key]: groupName
652
648
  };
649
+ let rowTotal = 0;
653
650
  Array.isArray(pivot_columns) && pivot_columns.forEach(item => {
654
651
  const {
655
- key,
656
- method
652
+ key
657
653
  } = item;
658
- const cellValueKey = key + method;
654
+ const cellValueKey = key;
659
655
  const column = columnMap[key];
660
656
  if (column) {
661
657
  const totalCellValue = getValidValueForColumn(column, total[cellValueKey]);
662
658
  newRow[column.key] = totalCellValue;
659
+ rowTotal = rowTotal + Number(totalCellValue);
663
660
  }
664
661
  });
662
+ // total column
663
+ const totalColumn = columnMap['total'];
664
+ if (totalColumn) {
665
+ newRow[totalColumn.key] = rowTotal;
666
+ }
665
667
  newRows.push(newRow);
666
668
  }
667
669
  });
@@ -773,7 +775,7 @@ const updateTwoDimensionToTable = _ref6 => {
773
775
  let newRow = {};
774
776
  newRow[nameColumnKey] = name;
775
777
  if (totalColumn) {
776
- newRow[totalColumn.key] = getValidValueForColumn(totalColumn, name);
778
+ newRow[totalColumn.key] = getValidValueForColumn(totalColumn, total);
777
779
  }
778
780
  Object.keys(cells).forEach(key => {
779
781
  const columnName = isEmptyName(key) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : key;
@@ -846,7 +848,13 @@ const updateTwoDimensionWithSummaryColumnsToTable = _ref7 => {
846
848
  name: tableColumnName
847
849
  } = tableColumn;
848
850
  const existCellValue = existRow[tableColumnKey];
849
- const exportingCellValue = exportingRow[tableColumnName];
851
+ let exportingCellValue = exportingRow[tableColumnName];
852
+ if (exportingCellValue === undefined) {
853
+ const matchedKey = Object.keys(exportingRow).find(key => key.includes(`(${tableColumnName})`));
854
+ if (matchedKey !== undefined) {
855
+ exportingCellValue = exportingRow[matchedKey];
856
+ }
857
+ }
850
858
  if (tableColumn && (0, _cellValue.isCellValueChanged)(existCellValue, exportingCellValue, tableColumnType)) {
851
859
  exportingRowData[tableColumnKey] = exportingCellValue;
852
860
  existRowData[tableColumnKey] = existCellValue;
@@ -859,8 +867,24 @@ const updateTwoDimensionWithSummaryColumnsToTable = _ref7 => {
859
867
  oldRows[rowId] = existRowData;
860
868
  }
861
869
  } else {
862
- // create new row which not exist
863
- newRows.push(exportingRow);
870
+ let newRowData = {};
871
+ tableColumns.forEach(tableColumn => {
872
+ const {
873
+ key: tableColumnKey,
874
+ name: tableColumnName
875
+ } = tableColumn;
876
+ let exportingCellValue = exportingRow[tableColumnName];
877
+ if (exportingCellValue === undefined) {
878
+ const matchedKey = Object.keys(exportingRow).find(key => key.includes(`(${tableColumnName})`));
879
+ if (matchedKey !== undefined) {
880
+ exportingCellValue = exportingRow[matchedKey];
881
+ }
882
+ }
883
+ if (exportingCellValue !== undefined && exportingCellValue !== null) {
884
+ newRowData[tableColumnKey] = exportingCellValue;
885
+ }
886
+ });
887
+ newRows.push(newRowData);
864
888
  }
865
889
  });
866
890
  return {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.3.50",
2
+ "version": "5.3.51",
3
3
  "name": "dtable-statistic",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
@@ -16,7 +16,7 @@
16
16
  "react-grid-layout": "^1.2.5",
17
17
  "react-intl-universal": "^2.4.8",
18
18
  "reactstrap": "9.2.3",
19
- "sea-chart": "^1.1.133"
19
+ "sea-chart": "^1.1.134"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "dtable-ui-component": "~6.0.*",