@vtx/modals2 6.0.0-beta.19 → 6.0.0-beta.20

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.
@@ -43,9 +43,9 @@ var BarCharts = function BarCharts(_ref) {
43
43
  chartFontColor = _useSettings.chartFontColor,
44
44
  isDark = _useSettings.isDark,
45
45
  chartLineColor = _useSettings.chartLineColor;
46
- var geekblue = ['rgba(22, 119, 255, 1)', 'rgba(22, 119, 255, 0)'];
47
- var green = ['rgba(15, 185, 100, 1)', 'rgba(15, 185, 100, 0)'];
48
- var blue = ['rgba(25, 201, 255, 1)', 'rgba(25, 201, 255, 0)'];
46
+ var geekblue = ['rgba(22, 119, 255, 1)', 'rgba(22, 119, 255, 0.5)'];
47
+ var green = ['rgba(15, 185, 100, 1)', 'rgba(15, 185, 100, 0.5)'];
48
+ var blue = ['rgba(25, 201, 255, 1)', 'rgba(25, 201, 255, 0.5)'];
49
49
  if (isDark) {
50
50
  geekblue = ['rgba(0, 157, 255, 1)', 'rgba(0, 157, 255, 0)'];
51
51
  green = ['rgba(19, 249, 122, 1)', 'rgba(19, 249, 122, 0)'];
@@ -86,7 +86,7 @@ var LineCharts = function LineCharts(_ref) {
86
86
  grid: _objectSpread({
87
87
  left: 50,
88
88
  right: 50,
89
- top: showLegend ? 40 : 20,
89
+ top: showLegend ? 40 : 32,
90
90
  bottom: showDataZoom ? 50 : 20
91
91
  }, gridOption),
92
92
  xAxis: _objectSpread({
@@ -155,6 +155,7 @@
155
155
  "common.placeholder.select": "Please select",
156
156
  "vtxtfdmodal.totalCount": "Total Count",
157
157
  "vtxtfdmodal.tons": "tons",
158
+ "vtxtfdmodal.wanTons": "10k tons",
158
159
  "vtxtfdmodal.kg": "kg",
159
160
  "vtxtfdmodal.day2": "Throw Calendar",
160
161
  "vtxtfdmodal.throwRecord": "Drop-off Records",
@@ -155,6 +155,7 @@
155
155
  "common.placeholder.select": "请选择",
156
156
  "vtxtfdmodal.totalCount": "总数",
157
157
  "vtxtfdmodal.tons": "吨",
158
+ "vtxtfdmodal.wanTons": "万吨",
158
159
  "vtxtfdmodal.kg": "kg",
159
160
  "vtxtfdmodal.day2": "投放日历",
160
161
  "vtxtfdmodal.throwRecord": "投放记录",
@@ -9,27 +9,33 @@ import { BaseService } from "../../api";
9
9
  import "./index.less";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  function Qyjcl(props) {
12
- var _areaSumData$areaDeta, _areaSumData$areaDeta2;
12
+ var _areaSumData$areaDeta, _ref, _areaSumData$areaDeta2;
13
13
  var code = props.code,
14
14
  startDate = props.startDate,
15
15
  endDate = props.endDate;
16
16
  var _BaseService$useQyjcl = BaseService.useQyjcl(code, startDate, endDate),
17
17
  areaSumData = _BaseService$useQyjcl.areaSumData;
18
18
  var total = sumBy((areaSumData === null || areaSumData === void 0 ? void 0 : areaSumData.areaDetailList) || [], 'todayInWeight') || 0;
19
+ // 数据量达到万吨及以上时,转换为万吨展示,保留2位小数
20
+ var isWanTons = total >= 10000;
21
+ var rate = isWanTons ? 10000 : 1;
22
+ var unitText = isWanTons ? translateLocaleText("t('vtxtfdmodal.wanTons')") : translateLocaleText("t('vtxdefaultmodal.tonUnit')");
23
+ var titleText = isWanTons ? translateLocaleText("t('vtxtfdmodal.wanTons')") : translateLocaleText("t('vtxtfdmodal.tons')");
19
24
  return /*#__PURE__*/_jsx("div", {
20
25
  className: "df-qyjcl",
21
26
  children: areaSumData !== null && areaSumData !== void 0 && (_areaSumData$areaDeta = areaSumData.areaDetailList) !== null && _areaSumData$areaDeta !== void 0 && _areaSumData$areaDeta.length ? /*#__PURE__*/_jsx(VmPieCharts, {
22
27
  height: 216,
23
- total: total === null || total === void 0 ? void 0 : total.toFixed(2),
24
- title: translateLocaleText("t('vtxtfdmodal.tons')"),
25
- unit: translateLocaleText("t('vtxdefaultmodal.tonUnit')"),
28
+ total: (_ref = total / rate) === null || _ref === void 0 ? void 0 : _ref.toFixed(2),
29
+ title: titleText,
30
+ unit: unitText,
26
31
  name: translateLocaleText("t('vtxdfmodal.areaInboundAmount')"),
27
32
  innerRadius: ['50%', '65%'],
28
33
  outerRadius: ['65%', '70%'],
29
34
  dataList: (areaSumData === null || areaSumData === void 0 || (_areaSumData$areaDeta2 = areaSumData.areaDetailList) === null || _areaSumData$areaDeta2 === void 0 ? void 0 : _areaSumData$areaDeta2.map(function (ele) {
35
+ var _ref2;
30
36
  return {
31
37
  name: ele.areaName,
32
- value: ele.todayInWeight,
38
+ value: Number((_ref2 = ele.todayInWeight / rate) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2)),
33
39
  rate: ele.todayInWeightPercent
34
40
  };
35
41
  })) || [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/modals2",
3
- "version": "6.0.0-beta.19",
3
+ "version": "6.0.0-beta.20",
4
4
  "description": "弹窗组件",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",