@ecan-bi/tools 1.0.2 → 1.0.4
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/index.js +35 -0
- package/package.json +2 -2
- package/src/hooks/{useValueFormatter.ts → useValueFormatter.js} +2 -2
- package/src/indicator.ts +1 -5
- package/index.ts +0 -22
package/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// 指标库相关内容
|
|
2
|
+
import { formatIndicatorParams } from './src/indicator'
|
|
3
|
+
// 通用函数
|
|
4
|
+
import runCode from './src/utils/runCode'
|
|
5
|
+
// 工作台专用
|
|
6
|
+
import useTransformChartDataByAttrKey from './src/hooks/useTransformChartDataByAttrKey'
|
|
7
|
+
import useTransformChartDataByAttrValue from './src/hooks/useTransformChartDataByAttrValue'
|
|
8
|
+
// import useValueFormatter from './src/hooks/useValueFormatter'
|
|
9
|
+
import useVariablesInText from './src/hooks/useVariablesInText'
|
|
10
|
+
import transformProps from './src/utils/transformProps'
|
|
11
|
+
import { getIndicatorParams } from './src/utils/util'
|
|
12
|
+
|
|
13
|
+
const useValueFormatter = require('./src/hooks/useValueFormatter')
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// export default {
|
|
18
|
+
// ...indicators,
|
|
19
|
+
// runCode,
|
|
20
|
+
// useTransformChartDataByAttrKey,
|
|
21
|
+
// useTransformChartDataByAttrValue,
|
|
22
|
+
// useValueFormatter,
|
|
23
|
+
// useVariablesInText,
|
|
24
|
+
// transformProps,
|
|
25
|
+
// getIndicatorParams
|
|
26
|
+
// }
|
|
27
|
+
|
|
28
|
+
exports.formatIndicatorParams = formatIndicatorParams
|
|
29
|
+
exports.runCode = runCode
|
|
30
|
+
exports.useTransformChartDataByAttrKey = useTransformChartDataByAttrKey
|
|
31
|
+
exports.useTransformChartDataByAttrValue = useTransformChartDataByAttrValue
|
|
32
|
+
exports.useValueFormatter = useValueFormatter
|
|
33
|
+
exports.useVariablesInText = useVariablesInText
|
|
34
|
+
exports.transformProps = transformProps
|
|
35
|
+
exports.getIndicatorParams = getIndicatorParams
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import runCode from '../utils/runCode'
|
|
2
|
-
export const useValueFormatter = (formatter
|
|
2
|
+
export const useValueFormatter = (formatter, value) => {
|
|
3
3
|
if (formatter == null) return value
|
|
4
4
|
const variables = (formatter).match(/\{.*\}/g)
|
|
5
5
|
if (variables == null || variables.length === 0) {
|
|
@@ -24,4 +24,4 @@ export const useValueFormatter = (formatter: string, value:string) => {
|
|
|
24
24
|
return formatter
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
module.exports = useValueFormatter
|
package/src/indicator.ts
CHANGED
|
@@ -693,7 +693,7 @@ const getCpntSortData = (data: any) => {
|
|
|
693
693
|
return customSort
|
|
694
694
|
}
|
|
695
695
|
|
|
696
|
-
const formatIndicatorParams = (props: any, otherParams: any = {}) => {
|
|
696
|
+
export const formatIndicatorParams = (props: any, otherParams: any = {}) => {
|
|
697
697
|
const { graphicConfig, type, globalModel, isGroupTable = false } = props
|
|
698
698
|
if (globalModel) {
|
|
699
699
|
modelValue = globalModel
|
|
@@ -1226,7 +1226,3 @@ const formatIndicatorParams = (props: any, otherParams: any = {}) => {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
return resultParams
|
|
1228
1228
|
}
|
|
1229
|
-
|
|
1230
|
-
export default {
|
|
1231
|
-
formatIndicatorParams
|
|
1232
|
-
}
|
package/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// 指标库相关内容
|
|
2
|
-
import indicators from './src/indicator'
|
|
3
|
-
// 通用函数
|
|
4
|
-
import runCode from './src/utils/runCode'
|
|
5
|
-
// 工作台专用
|
|
6
|
-
import useTransformChartDataByAttrKey from './src/hooks/useTransformChartDataByAttrKey'
|
|
7
|
-
import useTransformChartDataByAttrValue from './src/hooks/useTransformChartDataByAttrValue'
|
|
8
|
-
import useValueFormatter from './src/hooks/useValueFormatter'
|
|
9
|
-
import useVariablesInText from './src/hooks/useVariablesInText'
|
|
10
|
-
import transformProps from './src/utils/transformProps'
|
|
11
|
-
import { getIndicatorParams } from './src/utils/util'
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
...indicators,
|
|
15
|
-
runCode,
|
|
16
|
-
useTransformChartDataByAttrKey,
|
|
17
|
-
useTransformChartDataByAttrValue,
|
|
18
|
-
useValueFormatter,
|
|
19
|
-
useVariablesInText,
|
|
20
|
-
transformProps,
|
|
21
|
-
getIndicatorParams
|
|
22
|
-
}
|