@ztocwst/rc-pro-materials 0.2.17 → 0.2.19
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +3 -3
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.js +6 -6
- package/dist/SCM_Comps.js +4 -4
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-templates-data-common/components/link-renderer/index.js +42 -16
- package/es/components/z-templates-data-common/components/table-renderer/index.js +28 -6
- package/es/components/z-templates-data-common/data-common.helper.d.ts +7 -0
- package/es/components/z-templates-data-common/data-common.helper.js +16 -1
- package/lib/components/z-templates-data-common/components/link-renderer/index.js +41 -15
- package/lib/components/z-templates-data-common/components/table-renderer/index.js +27 -5
- package/lib/components/z-templates-data-common/data-common.helper.d.ts +7 -0
- package/lib/components/z-templates-data-common/data-common.helper.js +20 -3
- package/package.json +3 -3
|
@@ -6,7 +6,8 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
import { useEffect, useState, useRef, useContext, useImperativeHandle } from 'react';
|
|
7
7
|
import { ProTable, RcConfigContext } from '@ztocwst/rc-pro';
|
|
8
8
|
import { ArrowLeftOutlined } from '@ant-design/icons';
|
|
9
|
-
import
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import { tableConfigDefault, dateStart, separator, timeUnit, getType, getMaxWidth, handleQueryParams, getReportData } from "../../data-common.helper";
|
|
10
11
|
import { handleDimTargetFormat, handleColumns } from "../table-renderer/table-renderer.helper";
|
|
11
12
|
import "./index.less";
|
|
12
13
|
var linkStateDefault = {
|
|
@@ -75,7 +76,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
75
76
|
return function () {
|
|
76
77
|
handleClearInterval();
|
|
77
78
|
};
|
|
78
|
-
}, [linkState
|
|
79
|
+
}, [linkState]);
|
|
79
80
|
|
|
80
81
|
// 获取表头
|
|
81
82
|
var handleGetColumns = function handleGetColumns(stateParams) {
|
|
@@ -118,26 +119,51 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
118
119
|
queryKeys = Object.keys(queryCache);
|
|
119
120
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
120
121
|
queryKeys.forEach(function (k) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var key = (queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find = queryBind.find(function (item) {
|
|
122
|
+
// 查看是否有绑定关联关系 有取绑定的入参"键" 没有则取默认的"键"
|
|
123
|
+
var queryBindFilter = queryBind === null || queryBind === void 0 ? void 0 : queryBind.filter(function (item) {
|
|
124
124
|
return (item === null || item === void 0 ? void 0 : item.currentQueryKey) === k;
|
|
125
|
-
})
|
|
126
|
-
// "
|
|
127
|
-
|
|
125
|
+
});
|
|
126
|
+
// "键"(有建立绑定关系 取当前数据源参数(paraJson)的"键",没有则是默认查询配置的"键")
|
|
127
|
+
if (queryBindFilter !== null && queryBindFilter !== void 0 && queryBindFilter.length) {
|
|
128
|
+
// 参数为时间时会出现多个绑定关系
|
|
129
|
+
queryBindFilter.forEach(function (item) {
|
|
130
|
+
var key = item.sourceQueryKey;
|
|
131
|
+
// "值"(当前查询条件的"值")
|
|
132
|
+
var value = queryCache[k];
|
|
133
|
+
if (key) {
|
|
134
|
+
// 类型为时间时 处理
|
|
135
|
+
if (getType(value) === 'array' && value.length === 2 && value.some(function (d) {
|
|
136
|
+
return moment(d).isValid();
|
|
137
|
+
})) {
|
|
138
|
+
var i = key.includes(dateStart) ? 0 : 1;
|
|
139
|
+
query[key] = value[i];
|
|
140
|
+
} else {
|
|
141
|
+
query[key] = value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
// "值"(当前查询条件的"值")
|
|
147
|
+
query[k] = queryCache[k];
|
|
148
|
+
}
|
|
128
149
|
});
|
|
129
150
|
}
|
|
130
151
|
recordKeys = Object.keys(record || {});
|
|
131
152
|
if (recordKeys.length) {
|
|
132
153
|
recordKeys.forEach(function (k) {
|
|
133
|
-
var _queryBind$find2;
|
|
134
154
|
// 查看是否有绑定关联关系
|
|
135
|
-
var
|
|
155
|
+
var queryBindFilter = queryBind === null || queryBind === void 0 ? void 0 : queryBind.filter(function (item) {
|
|
136
156
|
return (item === null || item === void 0 ? void 0 : item.parentDimKey) === k;
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
157
|
+
});
|
|
158
|
+
// 参数为时间时会出现多个绑定关系
|
|
159
|
+
if (queryBindFilter !== null && queryBindFilter !== void 0 && queryBindFilter.length) {
|
|
160
|
+
queryBindFilter.forEach(function (item) {
|
|
161
|
+
var key = item.sourceQueryKey;
|
|
162
|
+
if (key) {
|
|
163
|
+
// "值"(有建立绑定关系 取上一级数据源的维度的"值")
|
|
164
|
+
query[key] = record[k];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
141
167
|
}
|
|
142
168
|
});
|
|
143
169
|
}
|
|
@@ -244,8 +270,8 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
244
270
|
index: index
|
|
245
271
|
});
|
|
246
272
|
/** 当前进入与上次进入link页不同时需要清空数据 */
|
|
247
|
-
var isSource = "" +
|
|
248
|
-
var isSame = JSON.stringify(
|
|
273
|
+
var isSource = "" + paramsState.dataSetName + separator + index === "" + linkState.dataSetName + separator + (linkState === null || linkState === void 0 ? void 0 : linkState.index);
|
|
274
|
+
var isSame = JSON.stringify(paramsState === null || paramsState === void 0 ? void 0 : paramsState.record) === JSON.stringify(linkState === null || linkState === void 0 ? void 0 : linkState.record);
|
|
249
275
|
if (!currentState.custom && (!isSource || !isSame)) {
|
|
250
276
|
var _tableRef$current2, _tableRef$current2$up;
|
|
251
277
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$up = _tableRef$current2.updateDataSource) === null || _tableRef$current2$up === void 0 ? void 0 : _tableRef$current2$up.call(_tableRef$current2, []);
|
|
@@ -7,7 +7,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import { useRef, useState, useEffect, useImperativeHandle, useContext } from 'react';
|
|
9
9
|
import { ProTable, RcConfigContext } from '@ztocwst/rc-pro';
|
|
10
|
-
import
|
|
10
|
+
import moment from 'moment';
|
|
11
|
+
import { tableConfigDefault, dateStart, separator, timeUnit, getType, handleQueryParams, getReportData } from "../../data-common.helper";
|
|
11
12
|
import { handleColumns, handleValueFormat, getDimTargetData } from "./table-renderer.helper";
|
|
12
13
|
import DimTarget from "../dim-target";
|
|
13
14
|
import LinkRenderer from "../link-renderer";
|
|
@@ -190,12 +191,33 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
190
191
|
var queryKeys = Object.keys(queryCache);
|
|
191
192
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
192
193
|
queryKeys.forEach(function (k) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
var key = (queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find = queryBind.find(function (item) {
|
|
194
|
+
// 查看是否有绑定关联关系 有取绑定的入参"键" 没有则取默认的"键"
|
|
195
|
+
var queryBindFilter = queryBind === null || queryBind === void 0 ? void 0 : queryBind.filter(function (item) {
|
|
196
196
|
return (item === null || item === void 0 ? void 0 : item.currentQueryKey) === k;
|
|
197
|
-
})
|
|
198
|
-
|
|
197
|
+
});
|
|
198
|
+
// "键"(有建立绑定关系 取当前数据源参数(paraJson)的"键",没有则是默认查询配置的"键")
|
|
199
|
+
if (queryBindFilter !== null && queryBindFilter !== void 0 && queryBindFilter.length) {
|
|
200
|
+
// 参数为时间时会出现多个绑定关系
|
|
201
|
+
queryBindFilter.forEach(function (item) {
|
|
202
|
+
var key = item.sourceQueryKey;
|
|
203
|
+
// "值"(当前查询条件的"值")
|
|
204
|
+
var value = queryCache[k];
|
|
205
|
+
if (key) {
|
|
206
|
+
// 类型为时间时 处理
|
|
207
|
+
if (getType(value) === 'array' && value.length === 2 && value.some(function (d) {
|
|
208
|
+
return moment(d).isValid();
|
|
209
|
+
})) {
|
|
210
|
+
var i = key.includes(dateStart) ? 0 : 1;
|
|
211
|
+
query[key] = value[i];
|
|
212
|
+
} else {
|
|
213
|
+
query[key] = value;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
} else {
|
|
218
|
+
// "值"(当前查询条件的"值")
|
|
219
|
+
query[k] = queryCache[k];
|
|
220
|
+
}
|
|
199
221
|
});
|
|
200
222
|
}
|
|
201
223
|
|
|
@@ -6,6 +6,8 @@ export declare const tableConfigDefault: {
|
|
|
6
6
|
hideDefRowSelection: boolean;
|
|
7
7
|
columns: any[];
|
|
8
8
|
};
|
|
9
|
+
/** 时间区间 开始键包含的字符串 */
|
|
10
|
+
export declare const dateStart = "_start";
|
|
9
11
|
/** 字符串拼接分割符 */
|
|
10
12
|
export declare const separator = "***";
|
|
11
13
|
/** 时间单位 */
|
|
@@ -14,6 +16,11 @@ export declare const timeUnit: number;
|
|
|
14
16
|
export declare const BETWEEN = "<=,<";
|
|
15
17
|
/** 数据类型 */
|
|
16
18
|
export type valueType = number | string | null | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* 获取数据类型
|
|
21
|
+
* @param {any} value
|
|
22
|
+
*/
|
|
23
|
+
export declare const getType: (value: any) => string;
|
|
17
24
|
/**
|
|
18
25
|
* 计算宽
|
|
19
26
|
* @param length
|
|
@@ -14,6 +14,9 @@ export var tableConfigDefault = {
|
|
|
14
14
|
columns: []
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
/** 时间区间 开始键包含的字符串 */
|
|
18
|
+
export var dateStart = '_start';
|
|
19
|
+
|
|
17
20
|
/** 字符串拼接分割符 */
|
|
18
21
|
export var separator = '***';
|
|
19
22
|
|
|
@@ -22,8 +25,20 @@ export var timeUnit = 60 * 1000;
|
|
|
22
25
|
|
|
23
26
|
/** 介于 前闭后开 */
|
|
24
27
|
export var BETWEEN = '<=,<';
|
|
28
|
+
|
|
25
29
|
/** 数据类型 */
|
|
26
30
|
|
|
31
|
+
/**
|
|
32
|
+
* 获取数据类型
|
|
33
|
+
* @param {any} value
|
|
34
|
+
*/
|
|
35
|
+
export var getType = function getType(value) {
|
|
36
|
+
var type = typeof value;
|
|
37
|
+
if (type !== 'object') return type;
|
|
38
|
+
var string = Object.prototype.toString.call(value);
|
|
39
|
+
return string.replace(/^\[object (\S+)\]$/, '$1').toLocaleLowerCase();
|
|
40
|
+
};
|
|
41
|
+
|
|
27
42
|
/**
|
|
28
43
|
* 计算宽
|
|
29
44
|
* @param length
|
|
@@ -157,7 +172,7 @@ export var handleCondition = function handleCondition(value, handledValue, condi
|
|
|
157
172
|
};
|
|
158
173
|
|
|
159
174
|
// mock
|
|
160
|
-
var token = 'scm:tenant:token:2:
|
|
175
|
+
var token = 'scm:tenant:token:2:104:DB0D80CD71B76AF4A8858729478BA945';
|
|
161
176
|
|
|
162
177
|
/** 获取维度指标 */
|
|
163
178
|
export var getDimTarget = /*#__PURE__*/function () {
|
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _rcPro = require("@ztocwst/rc-pro");
|
|
13
13
|
var _icons = require("@ant-design/icons");
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
14
15
|
var _dataCommon = require("../../data-common.helper");
|
|
15
16
|
var _tableRenderer = require("../table-renderer/table-renderer.helper");
|
|
16
17
|
require("./index.less");
|
|
@@ -80,7 +81,7 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
80
81
|
return function () {
|
|
81
82
|
handleClearInterval();
|
|
82
83
|
};
|
|
83
|
-
}, [linkState
|
|
84
|
+
}, [linkState]);
|
|
84
85
|
|
|
85
86
|
// 获取表头
|
|
86
87
|
var handleGetColumns = function handleGetColumns(stateParams) {
|
|
@@ -123,26 +124,51 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
123
124
|
queryKeys = Object.keys(queryCache);
|
|
124
125
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
125
126
|
queryKeys.forEach(function (k) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var key = (queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find = queryBind.find(function (item) {
|
|
127
|
+
// 查看是否有绑定关联关系 有取绑定的入参"键" 没有则取默认的"键"
|
|
128
|
+
var queryBindFilter = queryBind === null || queryBind === void 0 ? void 0 : queryBind.filter(function (item) {
|
|
129
129
|
return (item === null || item === void 0 ? void 0 : item.currentQueryKey) === k;
|
|
130
|
-
})
|
|
131
|
-
// "
|
|
132
|
-
|
|
130
|
+
});
|
|
131
|
+
// "键"(有建立绑定关系 取当前数据源参数(paraJson)的"键",没有则是默认查询配置的"键")
|
|
132
|
+
if (queryBindFilter !== null && queryBindFilter !== void 0 && queryBindFilter.length) {
|
|
133
|
+
// 参数为时间时会出现多个绑定关系
|
|
134
|
+
queryBindFilter.forEach(function (item) {
|
|
135
|
+
var key = item.sourceQueryKey;
|
|
136
|
+
// "值"(当前查询条件的"值")
|
|
137
|
+
var value = queryCache[k];
|
|
138
|
+
if (key) {
|
|
139
|
+
// 类型为时间时 处理
|
|
140
|
+
if ((0, _dataCommon.getType)(value) === 'array' && value.length === 2 && value.some(function (d) {
|
|
141
|
+
return (0, _moment["default"])(d).isValid();
|
|
142
|
+
})) {
|
|
143
|
+
var i = key.includes(_dataCommon.dateStart) ? 0 : 1;
|
|
144
|
+
query[key] = value[i];
|
|
145
|
+
} else {
|
|
146
|
+
query[key] = value;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
} else {
|
|
151
|
+
// "值"(当前查询条件的"值")
|
|
152
|
+
query[k] = queryCache[k];
|
|
153
|
+
}
|
|
133
154
|
});
|
|
134
155
|
}
|
|
135
156
|
recordKeys = Object.keys(record || {});
|
|
136
157
|
if (recordKeys.length) {
|
|
137
158
|
recordKeys.forEach(function (k) {
|
|
138
|
-
var _queryBind$find2;
|
|
139
159
|
// 查看是否有绑定关联关系
|
|
140
|
-
var
|
|
160
|
+
var queryBindFilter = queryBind === null || queryBind === void 0 ? void 0 : queryBind.filter(function (item) {
|
|
141
161
|
return (item === null || item === void 0 ? void 0 : item.parentDimKey) === k;
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
162
|
+
});
|
|
163
|
+
// 参数为时间时会出现多个绑定关系
|
|
164
|
+
if (queryBindFilter !== null && queryBindFilter !== void 0 && queryBindFilter.length) {
|
|
165
|
+
queryBindFilter.forEach(function (item) {
|
|
166
|
+
var key = item.sourceQueryKey;
|
|
167
|
+
if (key) {
|
|
168
|
+
// "值"(有建立绑定关系 取上一级数据源的维度的"值")
|
|
169
|
+
query[key] = record[k];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
146
172
|
}
|
|
147
173
|
});
|
|
148
174
|
}
|
|
@@ -249,8 +275,8 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
249
275
|
index: index
|
|
250
276
|
});
|
|
251
277
|
/** 当前进入与上次进入link页不同时需要清空数据 */
|
|
252
|
-
var isSource = "" +
|
|
253
|
-
var isSame = JSON.stringify(
|
|
278
|
+
var isSource = "" + paramsState.dataSetName + _dataCommon.separator + index === "" + linkState.dataSetName + _dataCommon.separator + (linkState === null || linkState === void 0 ? void 0 : linkState.index);
|
|
279
|
+
var isSame = JSON.stringify(paramsState === null || paramsState === void 0 ? void 0 : paramsState.record) === JSON.stringify(linkState === null || linkState === void 0 ? void 0 : linkState.record);
|
|
254
280
|
if (!currentState.custom && (!isSource || !isSame)) {
|
|
255
281
|
var _tableRef$current2, _tableRef$current2$up;
|
|
256
282
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$up = _tableRef$current2.updateDataSource) === null || _tableRef$current2$up === void 0 ? void 0 : _tableRef$current2$up.call(_tableRef$current2, []);
|
|
@@ -9,6 +9,7 @@ var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _rcPro = require("@ztocwst/rc-pro");
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
12
13
|
var _dataCommon = require("../../data-common.helper");
|
|
13
14
|
var _tableRenderer = require("./table-renderer.helper");
|
|
14
15
|
var _dimTarget = _interopRequireDefault(require("../dim-target"));
|
|
@@ -195,12 +196,33 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
195
196
|
var queryKeys = Object.keys(queryCache);
|
|
196
197
|
if (queryKeys !== null && queryKeys !== void 0 && queryKeys.length) {
|
|
197
198
|
queryKeys.forEach(function (k) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
var key = (queryBind === null || queryBind === void 0 ? void 0 : (_queryBind$find = queryBind.find(function (item) {
|
|
199
|
+
// 查看是否有绑定关联关系 有取绑定的入参"键" 没有则取默认的"键"
|
|
200
|
+
var queryBindFilter = queryBind === null || queryBind === void 0 ? void 0 : queryBind.filter(function (item) {
|
|
201
201
|
return (item === null || item === void 0 ? void 0 : item.currentQueryKey) === k;
|
|
202
|
-
})
|
|
203
|
-
|
|
202
|
+
});
|
|
203
|
+
// "键"(有建立绑定关系 取当前数据源参数(paraJson)的"键",没有则是默认查询配置的"键")
|
|
204
|
+
if (queryBindFilter !== null && queryBindFilter !== void 0 && queryBindFilter.length) {
|
|
205
|
+
// 参数为时间时会出现多个绑定关系
|
|
206
|
+
queryBindFilter.forEach(function (item) {
|
|
207
|
+
var key = item.sourceQueryKey;
|
|
208
|
+
// "值"(当前查询条件的"值")
|
|
209
|
+
var value = queryCache[k];
|
|
210
|
+
if (key) {
|
|
211
|
+
// 类型为时间时 处理
|
|
212
|
+
if ((0, _dataCommon.getType)(value) === 'array' && value.length === 2 && value.some(function (d) {
|
|
213
|
+
return (0, _moment["default"])(d).isValid();
|
|
214
|
+
})) {
|
|
215
|
+
var i = key.includes(_dataCommon.dateStart) ? 0 : 1;
|
|
216
|
+
query[key] = value[i];
|
|
217
|
+
} else {
|
|
218
|
+
query[key] = value;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
// "值"(当前查询条件的"值")
|
|
224
|
+
query[k] = queryCache[k];
|
|
225
|
+
}
|
|
204
226
|
});
|
|
205
227
|
}
|
|
206
228
|
|
|
@@ -6,6 +6,8 @@ export declare const tableConfigDefault: {
|
|
|
6
6
|
hideDefRowSelection: boolean;
|
|
7
7
|
columns: any[];
|
|
8
8
|
};
|
|
9
|
+
/** 时间区间 开始键包含的字符串 */
|
|
10
|
+
export declare const dateStart = "_start";
|
|
9
11
|
/** 字符串拼接分割符 */
|
|
10
12
|
export declare const separator = "***";
|
|
11
13
|
/** 时间单位 */
|
|
@@ -14,6 +16,11 @@ export declare const timeUnit: number;
|
|
|
14
16
|
export declare const BETWEEN = "<=,<";
|
|
15
17
|
/** 数据类型 */
|
|
16
18
|
export type valueType = number | string | null | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* 获取数据类型
|
|
21
|
+
* @param {any} value
|
|
22
|
+
*/
|
|
23
|
+
export declare const getType: (value: any) => string;
|
|
17
24
|
/**
|
|
18
25
|
* 计算宽
|
|
19
26
|
* @param length
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.timeUnit = exports.tableConfigDefault = exports.separator = exports.saveDimTarget = exports.handleThousand = exports.handleQueryParams = exports.handlePercent = exports.handleLink = exports.handleDecimal = exports.handleCondition = exports.getReportData = exports.getMaxWidth = exports.getDimTarget = exports.computeWidth = exports.BETWEEN = void 0;
|
|
5
|
+
exports.timeUnit = exports.tableConfigDefault = exports.separator = exports.saveDimTarget = exports.handleThousand = exports.handleQueryParams = exports.handlePercent = exports.handleLink = exports.handleDecimal = exports.handleCondition = exports.getType = exports.getReportData = exports.getMaxWidth = exports.getDimTarget = exports.dateStart = exports.computeWidth = exports.BETWEEN = void 0;
|
|
6
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -18,8 +18,12 @@ var tableConfigDefault = {
|
|
|
18
18
|
columns: []
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
/**
|
|
21
|
+
/** 时间区间 开始键包含的字符串 */
|
|
22
22
|
exports.tableConfigDefault = tableConfigDefault;
|
|
23
|
+
var dateStart = '_start';
|
|
24
|
+
|
|
25
|
+
/** 字符串拼接分割符 */
|
|
26
|
+
exports.dateStart = dateStart;
|
|
23
27
|
var separator = '***';
|
|
24
28
|
|
|
25
29
|
/** 时间单位 */
|
|
@@ -29,13 +33,26 @@ var timeUnit = 60 * 1000;
|
|
|
29
33
|
/** 介于 前闭后开 */
|
|
30
34
|
exports.timeUnit = timeUnit;
|
|
31
35
|
var BETWEEN = '<=,<';
|
|
36
|
+
|
|
32
37
|
/** 数据类型 */
|
|
33
38
|
exports.BETWEEN = BETWEEN;
|
|
39
|
+
/**
|
|
40
|
+
* 获取数据类型
|
|
41
|
+
* @param {any} value
|
|
42
|
+
*/
|
|
43
|
+
var getType = function getType(value) {
|
|
44
|
+
var type = typeof value;
|
|
45
|
+
if (type !== 'object') return type;
|
|
46
|
+
var string = Object.prototype.toString.call(value);
|
|
47
|
+
return string.replace(/^\[object (\S+)\]$/, '$1').toLocaleLowerCase();
|
|
48
|
+
};
|
|
49
|
+
|
|
34
50
|
/**
|
|
35
51
|
* 计算宽
|
|
36
52
|
* @param length
|
|
37
53
|
* @param width
|
|
38
54
|
*/
|
|
55
|
+
exports.getType = getType;
|
|
39
56
|
var computeWidth = function computeWidth(length, width) {
|
|
40
57
|
if (width === void 0) {
|
|
41
58
|
width = 40;
|
|
@@ -172,7 +189,7 @@ var handleCondition = function handleCondition(value, handledValue, conditions)
|
|
|
172
189
|
|
|
173
190
|
// mock
|
|
174
191
|
exports.handleCondition = handleCondition;
|
|
175
|
-
var token = 'scm:tenant:token:2:
|
|
192
|
+
var token = 'scm:tenant:token:2:104:DB0D80CD71B76AF4A8858729478BA945';
|
|
176
193
|
|
|
177
194
|
/** 获取维度指标 */
|
|
178
195
|
var getDimTarget = /*#__PURE__*/function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztocwst/rc-pro-materials",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "@ztocwst/rc-pro-materials",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
},
|
|
87
87
|
"componentConfig": {
|
|
88
88
|
"isComponentLibrary": true,
|
|
89
|
-
"materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.
|
|
89
|
+
"materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.19/build/lowcode/assets-prod.json"
|
|
90
90
|
},
|
|
91
|
-
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.
|
|
91
|
+
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.19/build/index.html",
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"registry": "https://registry.npmjs.org/",
|
|
94
94
|
"access": "public"
|