Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
2f109a94
提交
2f109a94
authored
12月 10, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev' into pr@devfix_panel-filter
上级
31b76c15
139bd804
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
267 行增加
和
64 行删除
+267
-64
Dockerfile
Dockerfile
+1
-13
ChartFieldCompareCustomDTO.java
...ava/io/dataease/dto/chart/ChartFieldCompareCustomDTO.java
+21
-0
ChartFieldCompareDTO.java
...main/java/io/dataease/dto/chart/ChartFieldCompareDTO.java
+15
-0
ChartViewFieldDTO.java
...rc/main/java/io/dataease/dto/chart/ChartViewFieldDTO.java
+2
-0
ChartConstants.java
...c/main/java/io/dataease/service/chart/ChartConstants.java
+13
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+165
-16
CompareEdit.vue
frontend/src/views/chart/components/compare/CompareEdit.vue
+1
-3
ChartDragItem.vue
...nd/src/views/chart/components/drag-item/ChartDragItem.vue
+8
-2
DimensionItem.vue
...nd/src/views/chart/components/drag-item/DimensionItem.vue
+18
-5
QuotaExtItem.vue
...end/src/views/chart/components/drag-item/QuotaExtItem.vue
+7
-10
QuotaItem.vue
frontend/src/views/chart/components/drag-item/QuotaItem.vue
+7
-10
AddUnion.vue
frontend/src/views/dataset/add/AddUnion.vue
+6
-2
NodeItem.vue
frontend/src/views/dataset/add/union/NodeItem.vue
+2
-2
DatasetGroupSelectorTree.vue
...end/src/views/dataset/common/DatasetGroupSelectorTree.vue
+1
-1
没有找到文件。
Dockerfile
浏览文件 @
2f109a94
#FROM registry.cn-qingdao.aliyuncs.com/dataease/fabric8-java-alpine-openjdk8-jre
FROM
registry.cn-qingdao.aliyuncs.com/dataease/fabric8-java-alpine-openjdk8-jre
FROM
alpine
RUN
echo
-e
'http://mirrors.aliyun.com/alpine/v3.15/main/\nhttp://mirrors.aliyun.com/alpine/v3.15/community/'
>
/etc/apk/repositories
RUN
apk add openjdk8 chromium chromium-chromedriver fontconfig
--no-cache
--allow-untrusted
ADD
simsun.ttc /usr/share/fonts/
RUN
cd
/usr/share/fonts/
\
&&
mkfontscale
\
&&
mkfontdir
\
&&
fc-cache
-fv
ARG
IMAGE_TAG
ARG
IMAGE_TAG
...
...
backend/src/main/java/io/dataease/dto/chart/ChartFieldCompareCustomDTO.java
0 → 100644
浏览文件 @
2f109a94
package
io
.
dataease
.
dto
.
chart
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Author gin
* @Date 2021/12/9 2:48 下午
*/
@Data
public
class
ChartFieldCompareCustomDTO
{
private
String
field
;
private
String
calcType
;
private
String
timeType
;
private
String
currentTime
;
private
String
compareTime
;
private
List
<
String
>
currentTimeRange
;
private
List
<
String
>
compareTimeRange
;
}
backend/src/main/java/io/dataease/dto/chart/ChartFieldCompareDTO.java
0 → 100644
浏览文件 @
2f109a94
package
io
.
dataease
.
dto
.
chart
;
import
lombok.Data
;
/**
* @Author gin
* @Date 2021/12/9 2:48 下午
*/
@Data
public
class
ChartFieldCompareDTO
{
private
String
type
;
private
String
resultData
;
private
String
field
;
private
ChartFieldCompareCustomDTO
custom
;
}
backend/src/main/java/io/dataease/dto/chart/ChartViewFieldDTO.java
浏览文件 @
2f109a94
...
@@ -46,4 +46,6 @@ public class ChartViewFieldDTO implements Serializable {
...
@@ -46,4 +46,6 @@ public class ChartViewFieldDTO implements Serializable {
private
Integer
extField
;
private
Integer
extField
;
private
String
chartType
;
private
String
chartType
;
private
ChartFieldCompareDTO
compareCalc
;
}
}
backend/src/main/java/io/dataease/service/chart/ChartConstants.java
0 → 100644
浏览文件 @
2f109a94
package
io
.
dataease
.
service
.
chart
;
/**
* @Author gin
* @Date 2021/12/9 3:58 下午
*/
public
class
ChartConstants
{
public
static
final
String
YEAR_MOM
=
"year_mom"
;
public
static
final
String
MONTH_MOM
=
"month_mom"
;
public
static
final
String
YEAR_YOY
=
"year_yoy"
;
public
static
final
String
DAY_MOM
=
"day_mom"
;
public
static
final
String
MONTH_YOY
=
"month_yoy"
;
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
2f109a94
...
@@ -36,6 +36,7 @@ import org.springframework.stereotype.Service;
...
@@ -36,6 +36,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.locks.ReentrantLock
;
import
java.util.concurrent.locks.ReentrantLock
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -433,6 +434,88 @@ public class ChartViewService {
...
@@ -433,6 +434,88 @@ public class ChartViewService {
}
}
}
}
// 同比/环比计算,通过对比类型和数据设置,计算出对应指标的结果,然后替换结果data数组中的对应元素
// 如果因维度变化(如时间字段缺失,时间字段的展示格式变化)导致无法计算结果的,则结果data数组中的对应元素全置为null
// 根据不同图表类型,获得需要替换的指标index array
for
(
int
i
=
0
;
i
<
yAxis
.
size
();
i
++)
{
ChartViewFieldDTO
chartViewFieldDTO
=
yAxis
.
get
(
i
);
ChartFieldCompareDTO
compareCalc
=
chartViewFieldDTO
.
getCompareCalc
();
if
(
ObjectUtils
.
isEmpty
(
compareCalc
))
{
continue
;
}
if
(
StringUtils
.
isNotEmpty
(
compareCalc
.
getType
())
&&
!
StringUtils
.
equalsIgnoreCase
(
compareCalc
.
getType
(),
"none"
))
{
String
compareFieldId
=
compareCalc
.
getField
();
// 选中字段
String
resultData
=
compareCalc
.
getResultData
();
// 数据设置
// 获取选中字段以及下标
List
<
ChartViewFieldDTO
>
checkedField
=
new
ArrayList
<>(
xAxis
);
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"stack"
))
{
checkedField
.
addAll
(
extStack
);
}
int
timeIndex
=
0
;
// 时间字段下标
ChartViewFieldDTO
timeField
=
null
;
for
(
int
j
=
0
;
j
<
checkedField
.
size
();
j
++)
{
if
(
StringUtils
.
equalsIgnoreCase
(
checkedField
.
get
(
j
).
getId
(),
compareFieldId
))
{
timeIndex
=
j
;
timeField
=
checkedField
.
get
(
j
);
}
}
// 计算指标对应的下标
int
dataIndex
=
0
;
// 数据字段下标
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"stack"
))
{
dataIndex
=
xAxis
.
size
()
+
extStack
.
size
()
+
i
;
}
else
{
dataIndex
=
xAxis
.
size
()
+
i
;
}
// 无选中字段,或者选中字段已经不在维度list中,或者选中字段日期格式不符合对比类型的,直接将对应数据置为null
if
(
ObjectUtils
.
isEmpty
(
timeField
)
||
!
checkCalcType
(
timeField
.
getDateStyle
(),
compareCalc
.
getType
()))
{
// set null
for
(
String
[]
item
:
data
)
{
item
[
dataIndex
]
=
null
;
}
}
else
{
// 计算 同比/环比
// 1,处理当期数据;2,根据type计算上一期数据;3,根据resultData计算结果
Map
<
String
,
String
>
currentMap
=
new
LinkedHashMap
<>();
for
(
String
[]
item
:
data
)
{
String
[]
dimension
=
Arrays
.
copyOfRange
(
item
,
0
,
checkedField
.
size
());
currentMap
.
put
(
StringUtils
.
join
(
dimension
,
"-"
),
item
[
dataIndex
]);
}
for
(
int
index
=
0
;
index
<
data
.
size
();
index
++)
{
String
[]
item
=
data
.
get
(
index
);
String
cTime
=
item
[
timeIndex
];
String
cValue
=
item
[
dataIndex
];
// 获取计算后的时间,并且与所有维度拼接
String
lastTime
=
calcLastTime
(
cTime
,
compareCalc
.
getType
(),
timeField
.
getDateStyle
());
String
[]
dimension
=
Arrays
.
copyOfRange
(
item
,
0
,
checkedField
.
size
());
dimension
[
timeIndex
]
=
lastTime
;
String
lastValue
=
currentMap
.
get
(
StringUtils
.
join
(
dimension
,
"-"
));
if
(
StringUtils
.
isEmpty
(
cValue
)
||
StringUtils
.
isEmpty
(
lastValue
))
{
item
[
dataIndex
]
=
null
;
}
else
{
if
(
StringUtils
.
equalsIgnoreCase
(
resultData
,
"sub"
))
{
item
[
dataIndex
]
=
new
BigDecimal
(
cValue
).
subtract
(
new
BigDecimal
(
lastValue
)).
toString
();
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
resultData
,
"percent"
))
{
if
(
Integer
.
parseInt
(
lastValue
)
==
0
)
{
item
[
dataIndex
]
=
null
;
}
else
{
item
[
dataIndex
]
=
new
BigDecimal
(
cValue
)
.
divide
(
new
BigDecimal
(
lastValue
),
2
,
RoundingMode
.
HALF_UP
)
.
subtract
(
new
BigDecimal
(
1
))
.
setScale
(
2
,
RoundingMode
.
HALF_UP
)
.
toString
();
}
}
}
}
}
}
}
// 构建结果
Map
<
String
,
Object
>
map
=
new
TreeMap
<>();
Map
<
String
,
Object
>
map
=
new
TreeMap
<>();
// 图表组件可再扩展
// 图表组件可再扩展
Map
<
String
,
Object
>
mapChart
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapChart
=
new
HashMap
<>();
...
@@ -491,6 +574,68 @@ public class ChartViewService {
...
@@ -491,6 +574,68 @@ public class ChartViewService {
return
dto
;
return
dto
;
}
}
private
boolean
checkCalcType
(
String
dateStyle
,
String
calcType
)
{
switch
(
dateStyle
)
{
case
"y"
:
return
StringUtils
.
equalsIgnoreCase
(
calcType
,
"year_mom"
);
case
"y_M"
:
return
StringUtils
.
equalsIgnoreCase
(
calcType
,
"month_mom"
)
||
StringUtils
.
equalsIgnoreCase
(
calcType
,
"year_yoy"
);
case
"y_M_d"
:
return
StringUtils
.
equalsIgnoreCase
(
calcType
,
"day_mom"
)
||
StringUtils
.
equalsIgnoreCase
(
calcType
,
"month_yoy"
)
||
StringUtils
.
equalsIgnoreCase
(
calcType
,
"year_yoy"
);
}
return
false
;
}
private
String
calcLastTime
(
String
cTime
,
String
type
,
String
dateStyle
)
throws
Exception
{
String
lastTime
=
null
;
Calendar
calendar
=
Calendar
.
getInstance
();
if
(
StringUtils
.
equalsIgnoreCase
(
type
,
ChartConstants
.
YEAR_MOM
))
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy"
);
Date
date
=
simpleDateFormat
.
parse
(
cTime
);
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
YEAR
,
-
1
);
lastTime
=
simpleDateFormat
.
format
(
calendar
.
getTime
());
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
type
,
ChartConstants
.
MONTH_MOM
))
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Date
date
=
simpleDateFormat
.
parse
(
cTime
);
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
MONTH
,
-
1
);
lastTime
=
simpleDateFormat
.
format
(
calendar
.
getTime
());
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
type
,
ChartConstants
.
YEAR_YOY
))
{
SimpleDateFormat
simpleDateFormat
=
null
;
if
(
StringUtils
.
equalsIgnoreCase
(
dateStyle
,
"y_M"
))
{
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
dateStyle
,
"y_M_d"
))
{
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
}
Date
date
=
simpleDateFormat
.
parse
(
cTime
);
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
YEAR
,
-
1
);
lastTime
=
simpleDateFormat
.
format
(
calendar
.
getTime
());
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
type
,
ChartConstants
.
DAY_MOM
))
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date
=
simpleDateFormat
.
parse
(
cTime
);
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
lastTime
=
simpleDateFormat
.
format
(
calendar
.
getTime
());
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
type
,
ChartConstants
.
MONTH_YOY
))
{
SimpleDateFormat
simpleDateFormat
=
null
;
if
(
StringUtils
.
equalsIgnoreCase
(
dateStyle
,
"y_M"
))
{
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
dateStyle
,
"y_M_d"
))
{
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
}
Date
date
=
simpleDateFormat
.
parse
(
cTime
);
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
MONTH
,
-
1
);
lastTime
=
simpleDateFormat
.
format
(
calendar
.
getTime
());
}
return
lastTime
;
}
private
boolean
checkDrillExist
(
List
<
ChartViewFieldDTO
>
xAxis
,
List
<
ChartViewFieldDTO
>
extStack
,
ChartViewFieldDTO
dto
,
ChartViewWithBLOBs
view
)
{
private
boolean
checkDrillExist
(
List
<
ChartViewFieldDTO
>
xAxis
,
List
<
ChartViewFieldDTO
>
extStack
,
ChartViewFieldDTO
dto
,
ChartViewWithBLOBs
view
)
{
if
(
CollectionUtils
.
isNotEmpty
(
xAxis
))
{
if
(
CollectionUtils
.
isNotEmpty
(
xAxis
))
{
for
(
ChartViewFieldDTO
x
:
xAxis
)
{
for
(
ChartViewFieldDTO
x
:
xAxis
)
{
...
@@ -588,7 +733,7 @@ public class ChartViewService {
...
@@ -588,7 +733,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
row
[
i
])
?
"0"
:
row
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
row
[
i
])
?
null
:
new
BigDecimal
(
row
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -644,7 +789,7 @@ public class ChartViewService {
...
@@ -644,7 +789,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
row
[
valueIndex
])
?
"0"
:
row
[
valueIndex
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
row
[
valueIndex
])
?
null
:
new
BigDecimal
(
row
[
valueIndex
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -692,7 +837,7 @@ public class ChartViewService {
...
@@ -692,7 +837,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
row
[
i
])
?
"0"
:
row
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
row
[
i
])
?
null
:
new
BigDecimal
(
row
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -747,14 +892,18 @@ public class ChartViewService {
...
@@ -747,14 +892,18 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
row
[
i
])
?
"0"
:
row
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
row
[
i
])
?
null
:
new
BigDecimal
(
row
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
axisChartDataDTO
.
setCategory
(
yAxis
.
get
(
j
).
getName
());
axisChartDataDTO
.
setCategory
(
yAxis
.
get
(
j
).
getName
());
// pop
// pop
if
(
CollectionUtils
.
isNotEmpty
(
extBubble
))
{
if
(
CollectionUtils
.
isNotEmpty
(
extBubble
))
{
axisChartDataDTO
.
setPopSize
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
row
[
xAxis
.
size
()
+
yAxis
.
size
()])
?
"0"
:
row
[
xAxis
.
size
()
+
yAxis
.
size
()]));
try
{
axisChartDataDTO
.
setPopSize
(
StringUtils
.
isEmpty
(
row
[
xAxis
.
size
()
+
yAxis
.
size
()])
?
null
:
new
BigDecimal
(
row
[
xAxis
.
size
()
+
yAxis
.
size
()]));
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setPopSize
(
new
BigDecimal
(
0
));
}
}
}
datas
.
add
(
axisChartDataDTO
);
datas
.
add
(
axisChartDataDTO
);
}
}
...
@@ -806,7 +955,7 @@ public class ChartViewService {
...
@@ -806,7 +955,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
row
[
i
])
?
"0"
:
row
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
row
[
i
])
?
null
:
new
BigDecimal
(
row
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -868,7 +1017,7 @@ public class ChartViewService {
...
@@ -868,7 +1017,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -916,7 +1065,7 @@ public class ChartViewService {
...
@@ -916,7 +1065,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -977,7 +1126,7 @@ public class ChartViewService {
...
@@ -977,7 +1126,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -1032,7 +1181,7 @@ public class ChartViewService {
...
@@ -1032,7 +1181,7 @@ public class ChartViewService {
for
(
int
i
=
xAxis
.
size
();
i
<
xAxis
.
size
()
+
yAxis
.
size
();
i
++)
{
for
(
int
i
=
xAxis
.
size
();
i
<
xAxis
.
size
()
+
yAxis
.
size
();
i
++)
{
int
j
=
i
-
xAxis
.
size
();
int
j
=
i
-
xAxis
.
size
();
try
{
try
{
series
.
get
(
j
).
getData
().
add
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]));
series
.
get
(
j
).
getData
().
add
(
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
series
.
get
(
j
).
getData
().
add
(
new
BigDecimal
(
0
));
series
.
get
(
j
).
getData
().
add
(
new
BigDecimal
(
0
));
}
}
...
@@ -1074,7 +1223,7 @@ public class ChartViewService {
...
@@ -1074,7 +1223,7 @@ public class ChartViewService {
for
(
int
i
=
xAxis
.
size
();
i
<
xAxis
.
size
()
+
yAxis
.
size
();
i
++)
{
for
(
int
i
=
xAxis
.
size
();
i
<
xAxis
.
size
()
+
yAxis
.
size
();
i
++)
{
int
j
=
i
-
xAxis
.
size
();
int
j
=
i
-
xAxis
.
size
();
try
{
try
{
series
.
get
(
j
).
getData
().
add
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]));
series
.
get
(
j
).
getData
().
add
(
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
series
.
get
(
j
).
getData
().
add
(
new
BigDecimal
(
0
));
series
.
get
(
j
).
getData
().
add
(
new
BigDecimal
(
0
));
}
}
...
@@ -1214,7 +1363,7 @@ public class ChartViewService {
...
@@ -1214,7 +1363,7 @@ public class ChartViewService {
quotaList
.
add
(
chartQuotaDTO
);
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
try
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]));
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
...
@@ -1292,8 +1441,8 @@ public class ChartViewService {
...
@@ -1292,8 +1441,8 @@ public class ChartViewService {
try
{
try
{
scatterChartDataDTO
.
setValue
(
new
Object
[]{
scatterChartDataDTO
.
setValue
(
new
Object
[]{
a
.
toString
(),
a
.
toString
(),
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
]),
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
]),
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
xAxis
.
size
()
+
yAxis
.
size
()])
?
"0"
:
d
[
xAxis
.
size
()
+
yAxis
.
size
()])
StringUtils
.
isEmpty
(
d
[
xAxis
.
size
()
+
yAxis
.
size
()])
?
null
:
new
BigDecimal
(
d
[
xAxis
.
size
()
+
yAxis
.
size
()])
});
});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
scatterChartDataDTO
.
setValue
(
new
Object
[]{
a
.
toString
(),
new
BigDecimal
(
0
),
new
BigDecimal
(
0
)});
scatterChartDataDTO
.
setValue
(
new
Object
[]{
a
.
toString
(),
new
BigDecimal
(
0
),
new
BigDecimal
(
0
)});
...
@@ -1302,7 +1451,7 @@ public class ChartViewService {
...
@@ -1302,7 +1451,7 @@ public class ChartViewService {
try
{
try
{
scatterChartDataDTO
.
setValue
(
new
Object
[]{
scatterChartDataDTO
.
setValue
(
new
Object
[]{
a
.
toString
(),
a
.
toString
(),
new
BigDecimal
(
StringUtils
.
isEmpty
(
d
[
i
])
?
"0"
:
d
[
i
])
StringUtils
.
isEmpty
(
d
[
i
])
?
null
:
new
BigDecimal
(
d
[
i
])
});
});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
scatterChartDataDTO
.
setValue
(
new
Object
[]{
a
.
toString
(),
new
BigDecimal
(
0
)});
scatterChartDataDTO
.
setValue
(
new
Object
[]{
a
.
toString
(),
new
BigDecimal
(
0
)});
...
@@ -1338,7 +1487,7 @@ public class ChartViewService {
...
@@ -1338,7 +1487,7 @@ public class ChartViewService {
if
(
chartViewFieldDTO
.
getDeType
()
==
0
||
chartViewFieldDTO
.
getDeType
()
==
1
)
{
if
(
chartViewFieldDTO
.
getDeType
()
==
0
||
chartViewFieldDTO
.
getDeType
()
==
1
)
{
d
.
put
(
fields
.
get
(
i
).
getDataeaseName
(),
StringUtils
.
isEmpty
(
ele
[
i
])
?
""
:
ele
[
i
]);
d
.
put
(
fields
.
get
(
i
).
getDataeaseName
(),
StringUtils
.
isEmpty
(
ele
[
i
])
?
""
:
ele
[
i
]);
}
else
if
(
chartViewFieldDTO
.
getDeType
()
==
2
||
chartViewFieldDTO
.
getDeType
()
==
3
)
{
}
else
if
(
chartViewFieldDTO
.
getDeType
()
==
2
||
chartViewFieldDTO
.
getDeType
()
==
3
)
{
d
.
put
(
fields
.
get
(
i
).
getDataeaseName
(),
new
BigDecimal
(
StringUtils
.
isEmpty
(
ele
[
i
])
?
"0"
:
ele
[
i
]).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
d
.
put
(
fields
.
get
(
i
).
getDataeaseName
(),
StringUtils
.
isEmpty
(
ele
[
i
])
?
null
:
new
BigDecimal
(
ele
[
i
]).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
}
}
}
tableRow
.
add
(
d
);
tableRow
.
add
(
d
);
...
...
frontend/src/views/chart/components/compare/CompareEdit.vue
浏览文件 @
2f109a94
...
@@ -63,10 +63,8 @@ export default {
...
@@ -63,10 +63,8 @@ export default {
// 过滤xaxis,extStack所有日期字段
// 过滤xaxis,extStack所有日期字段
initFieldList
()
{
initFieldList
()
{
const
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
const
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
const
extStack
=
JSON
.
parse
(
this
.
chart
.
extStack
)
const
t1
=
xAxis
.
filter
(
ele
=>
{
return
ele
.
deType
===
1
})
const
t1
=
xAxis
.
filter
(
ele
=>
{
return
ele
.
deType
===
1
})
const
t2
=
extStack
.
filter
(
ele
=>
{
return
ele
.
deType
===
1
})
this
.
fieldList
=
t1
this
.
fieldList
=
t1
.
concat
(
t2
)
// 如果没有选中字段,则默认选中第一个
// 如果没有选中字段,则默认选中第一个
if
((
!
this
.
compareItem
.
compareCalc
.
field
||
this
.
compareItem
.
compareCalc
.
field
===
''
)
&&
this
.
fieldList
.
length
>
0
)
{
if
((
!
this
.
compareItem
.
compareCalc
.
field
||
this
.
compareItem
.
compareCalc
.
field
===
''
)
&&
this
.
fieldList
.
length
>
0
)
{
this
.
compareItem
.
compareCalc
.
field
=
this
.
fieldList
[
0
].
id
this
.
compareItem
.
compareCalc
.
field
=
this
.
fieldList
[
0
].
id
...
...
frontend/src/views/chart/components/drag-item/ChartDragItem.vue
浏览文件 @
2f109a94
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
</span>
<span
v-if=
"item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
</span>
<span
v-if=
"item.deType === 1"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
dateStyle
)
}}
</span>
</el-tag>
</el-tag>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<span
class=
"el-dropdown-link"
>
<span
class=
"el-dropdown-link"
>
...
@@ -25,6 +28,9 @@
...
@@ -25,6 +28,9 @@
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
</span>
<span
v-if=
"item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
</span>
<span
v-if=
"item.deType === 1"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
dateStyle
)
}}
</span>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
</el-tag>
</el-tag>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
...
@@ -239,7 +245,7 @@ export default {
...
@@ -239,7 +245,7 @@ export default {
.item-span-style
{
.item-span-style
{
display
:
inline-block
;
display
:
inline-block
;
width
:
8
0px
;
width
:
7
0px
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
overflow
:
hidden
;
...
@@ -254,6 +260,6 @@ export default {
...
@@ -254,6 +260,6 @@ export default {
margin-left
:
4px
;
margin-left
:
4px
;
color
:
#878d9f
;
color
:
#878d9f
;
position
:
absolute
;
position
:
absolute
;
right
:
30
px
;
right
:
25
px
;
}
}
</
style
>
</
style
>
frontend/src/views/chart/components/drag-item/DimensionItem.vue
浏览文件 @
2f109a94
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
<svg-icon
v-if=
"item.sort === 'desc'"
icon-class=
"sort-desc"
class-name=
"field-icon-sort"
/>
<svg-icon
v-if=
"item.sort === 'desc'"
icon-class=
"sort-desc"
class-name=
"field-icon-sort"
/>
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"item.deType === 1"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
dateStyle
)
}}
</span>
</el-tag>
</el-tag>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<span
class=
"el-dropdown-link"
>
<span
class=
"el-dropdown-link"
>
...
@@ -23,6 +26,9 @@
...
@@ -23,6 +26,9 @@
<svg-icon
v-if=
"item.sort === 'desc'"
icon-class=
"sort-desc"
class-name=
"field-icon-sort"
/>
<svg-icon
v-if=
"item.sort === 'desc'"
icon-class=
"sort-desc"
class-name=
"field-icon-sort"
/>
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"item.deType === 1"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
dateStyle
)
}}
</span>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
</el-tag>
</el-tag>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
...
@@ -32,7 +38,7 @@
...
@@ -32,7 +38,7 @@
<span>
<span>
<i
class=
"el-icon-sort"
/>
<i
class=
"el-icon-sort"
/>
<span>
{{
$t
(
'chart.sort'
)
}}
</span>
<span>
{{
$t
(
'chart.sort'
)
}}
</span>
<span
class=
"summary-span"
>
(
{{
$t
(
'chart.'
+
item
.
sort
)
}}
)
</span>
<span
class=
"summary-span
-item
"
>
(
{{
$t
(
'chart.'
+
item
.
sort
)
}}
)
</span>
</span>
</span>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
</span>
...
@@ -53,7 +59,7 @@
...
@@ -53,7 +59,7 @@
<span>
<span>
<i
class=
"el-icon-c-scale-to-original"
/>
<i
class=
"el-icon-c-scale-to-original"
/>
<span>
{{
$t
(
'chart.dateStyle'
)
}}
</span>
<span>
{{
$t
(
'chart.dateStyle'
)
}}
</span>
<span
class=
"summary-span"
>
(
{{
$t
(
'chart.'
+
item
.
dateStyle
)
}}
)
</span>
<span
class=
"summary-span
-item
"
>
(
{{
$t
(
'chart.'
+
item
.
dateStyle
)
}}
)
</span>
</span>
</span>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
</span>
...
@@ -73,7 +79,7 @@
...
@@ -73,7 +79,7 @@
<span>
<span>
<i
class=
"el-icon-timer"
/>
<i
class=
"el-icon-timer"
/>
<span>
{{
$t
(
'chart.datePattern'
)
}}
</span>
<span>
{{
$t
(
'chart.datePattern'
)
}}
</span>
<span
class=
"summary-span"
>
(
{{
$t
(
'chart.'
+
item
.
datePattern
)
}}
)
</span>
<span
class=
"summary-span
-item
"
>
(
{{
$t
(
'chart.'
+
item
.
datePattern
)
}}
)
</span>
</span>
</span>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
</span>
...
@@ -215,7 +221,9 @@ export default {
...
@@ -215,7 +221,9 @@ export default {
.summary-span
{
.summary-span
{
margin-left
:
4px
;
margin-left
:
4px
;
color
:
#878d9f
;
;
color
:
#878d9f
;
position
:
absolute
;
right
:
25px
;
}
}
.inner-dropdown-menu
{
.inner-dropdown-menu
{
...
@@ -227,9 +235,14 @@ export default {
...
@@ -227,9 +235,14 @@ export default {
.item-span-style
{
.item-span-style
{
display
:
inline-block
;
display
:
inline-block
;
width
:
8
0px
;
width
:
7
0px
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.summary-span-item
{
margin-left
:
4px
;
color
:
#878d9f
;
}
</
style
>
</
style
>
frontend/src/views/chart/components/drag-item/QuotaExtItem.vue
浏览文件 @
2f109a94
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc
&& item.compareCalc
.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
</span>
</span>
</el-tag>
</el-tag>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc
&& item.compareCalc
.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
</span>
</span>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
</el-tag>
</el-tag>
...
@@ -97,15 +97,15 @@
...
@@ -97,15 +97,15 @@
<el-dropdown
placement=
"right-start"
size=
"mini"
style=
"width: 100%"
@
command=
"quickCalc"
>
<el-dropdown
placement=
"right-start"
size=
"mini"
style=
"width: 100%"
@
command=
"quickCalc"
>
<span
class=
"el-dropdown-link inner-dropdown-menu"
>
<span
class=
"el-dropdown-link inner-dropdown-menu"
>
<span>
<span>
<i
class=
"el-icon-
crop
"
/>
<i
class=
"el-icon-
s-grid
"
/>
<span>
{{
$t
(
'chart.
yoy_label
'
)
}}
</span>
<span>
{{
$t
(
'chart.
quick_calc
'
)
}}
</span>
<span
class=
"summary-span-item"
>
(
{{
!
item
.
compareCalc
?
$t
(
'chart.none'
)
:
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
)
</span>
<span
class=
"summary-span-item"
>
(
{{
!
item
.
compareCalc
?
$t
(
'chart.none'
)
:
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
)
</span>
</span>
</span>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"beforeQuickCalc('none')"
>
{{
$t
(
'chart.none'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeQuickCalc('none')"
>
{{
$t
(
'chart.none'
)
}}
</el-dropdown-item>
<el-dropdown-item
:disabled=
"disableEditCompare"
:command=
"beforeQuickCalc('setting')"
>
{{
$t
(
'c
ommons.setting
'
)
}}
...
</el-dropdown-item>
<el-dropdown-item
:disabled=
"disableEditCompare"
:command=
"beforeQuickCalc('setting')"
>
{{
$t
(
'c
hart.yoy_label
'
)
}}
...
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</el-dropdown-item>
</el-dropdown-item>
...
@@ -191,14 +191,11 @@ export default {
...
@@ -191,14 +191,11 @@ export default {
},
},
isEnableCompare
()
{
isEnableCompare
()
{
const
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
const
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
const
extStack
=
JSON
.
parse
(
this
.
chart
.
extStack
)
const
t1
=
xAxis
.
filter
(
ele
=>
{
const
t1
=
xAxis
.
filter
(
ele
=>
{
return
ele
.
deType
===
1
return
ele
.
deType
===
1
})
})
const
t2
=
extStack
.
filter
(
ele
=>
{
// 暂时只支持类别轴/维度的时间类型字段,且视图中有且只有一个时间字段
return
ele
.
deType
===
1
if
(
t1
.
length
===
1
&&
this
.
chart
.
type
!==
'text'
&&
this
.
chart
.
type
!==
'gauge'
&&
this
.
chart
.
type
!==
'liquid'
)
{
})
if
(
t1
.
length
>
0
||
t2
.
length
>
0
)
{
this
.
disableEditCompare
=
false
this
.
disableEditCompare
=
false
}
else
{
}
else
{
this
.
disableEditCompare
=
true
this
.
disableEditCompare
=
true
...
...
frontend/src/views/chart/components/drag-item/QuotaItem.vue
浏览文件 @
2f109a94
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc
&& item.compareCalc
.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
</span>
</span>
</el-tag>
</el-tag>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<el-dropdown
v-else
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</span>
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
class=
"item-span-style"
:title=
"item.name"
>
{{
item
.
name
}}
</span>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
<span
v-if=
"chart.type !== 'table-info' && item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
<span
v-if=
"item.compareCalc
&& item.compareCalc
.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'"
>
-
{{
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
</span>
</span>
</span>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
<i
class=
"el-icon-arrow-down el-icon--right"
style=
"position: absolute;top: 6px;right: 10px;"
/>
</el-tag>
</el-tag>
...
@@ -97,15 +97,15 @@
...
@@ -97,15 +97,15 @@
<el-dropdown
placement=
"right-start"
size=
"mini"
style=
"width: 100%"
@
command=
"quickCalc"
>
<el-dropdown
placement=
"right-start"
size=
"mini"
style=
"width: 100%"
@
command=
"quickCalc"
>
<span
class=
"el-dropdown-link inner-dropdown-menu"
>
<span
class=
"el-dropdown-link inner-dropdown-menu"
>
<span>
<span>
<i
class=
"el-icon-
crop
"
/>
<i
class=
"el-icon-
s-grid
"
/>
<span>
{{
$t
(
'chart.
yoy_label
'
)
}}
</span>
<span>
{{
$t
(
'chart.
quick_calc
'
)
}}
</span>
<span
class=
"summary-span-item"
>
(
{{
!
item
.
compareCalc
?
$t
(
'chart.none'
)
:
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
)
</span>
<span
class=
"summary-span-item"
>
(
{{
!
item
.
compareCalc
?
$t
(
'chart.none'
)
:
$t
(
'chart.'
+
item
.
compareCalc
.
type
)
}}
)
</span>
</span>
</span>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
<i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"beforeQuickCalc('none')"
>
{{
$t
(
'chart.none'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeQuickCalc('none')"
>
{{
$t
(
'chart.none'
)
}}
</el-dropdown-item>
<el-dropdown-item
:disabled=
"disableEditCompare"
:command=
"beforeQuickCalc('setting')"
>
{{
$t
(
'c
ommons.setting
'
)
}}
...
</el-dropdown-item>
<el-dropdown-item
:disabled=
"disableEditCompare"
:command=
"beforeQuickCalc('setting')"
>
{{
$t
(
'c
hart.yoy_label
'
)
}}
...
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</el-dropdown-item>
</el-dropdown-item>
...
@@ -188,14 +188,11 @@ export default {
...
@@ -188,14 +188,11 @@ export default {
},
},
isEnableCompare
()
{
isEnableCompare
()
{
const
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
const
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
const
extStack
=
JSON
.
parse
(
this
.
chart
.
extStack
)
const
t1
=
xAxis
.
filter
(
ele
=>
{
const
t1
=
xAxis
.
filter
(
ele
=>
{
return
ele
.
deType
===
1
return
ele
.
deType
===
1
})
})
const
t2
=
extStack
.
filter
(
ele
=>
{
// 暂时只支持类别轴/维度的时间类型字段,且视图中有且只有一个时间字段
return
ele
.
deType
===
1
if
(
t1
.
length
===
1
&&
this
.
chart
.
type
!==
'text'
&&
this
.
chart
.
type
!==
'gauge'
&&
this
.
chart
.
type
!==
'liquid'
)
{
})
if
((
t1
.
length
>
0
||
t2
.
length
>
0
)
&&
this
.
chart
.
type
!==
'text'
&&
this
.
chart
.
type
!==
'gauge'
&&
this
.
chart
.
type
!==
'liquid'
)
{
this
.
disableEditCompare
=
false
this
.
disableEditCompare
=
false
}
else
{
}
else
{
this
.
disableEditCompare
=
true
this
.
disableEditCompare
=
true
...
...
frontend/src/views/dataset/add/AddUnion.vue
浏览文件 @
2f109a94
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<el-divider
/>
<el-divider
/>
<div>
<div>
<el-form
:inline=
"true"
style=
"display: flex;align-items: center;justify-content: space-between;"
>
<el-form
:inline=
"true"
style=
"display: flex;align-items: center;justify-content: space-between;"
>
<el-form-item
class=
"form-item"
>
<el-form-item
class=
"form-item"
:label=
"$t('commons.name')"
>
<el-input
v-model=
"name"
size=
"mini"
:placeholder=
"$t('commons.name')"
clearable
/>
<el-input
v-model=
"name"
size=
"mini"
:placeholder=
"$t('commons.name')"
clearable
/>
</el-form-item>
</el-form-item>
<el-form-item
class=
"form-item"
>
<el-form-item
class=
"form-item"
>
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
</div>
</div>
<!--选择数据集-->
<!--选择数据集-->
<el-dialog
v-if=
"selectDsDialog"
v-dialogDrag
:title=
"$t('chart.select_dataset')"
:visible=
"selectDsDialog"
:show-close=
"false"
width=
"
36
0px"
class=
"dialog-css"
>
<el-dialog
v-if=
"selectDsDialog"
v-dialogDrag
:title=
"$t('chart.select_dataset')"
:visible=
"selectDsDialog"
:show-close=
"false"
width=
"
40
0px"
class=
"dialog-css"
>
<dataset-group-selector-tree
:fix-height=
"true"
show-mode=
"union"
:custom-type=
"customType"
@
getTable=
"firstDs"
/>
<dataset-group-selector-tree
:fix-height=
"true"
show-mode=
"union"
:custom-type=
"customType"
@
getTable=
"firstDs"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"closeSelectDs()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
<el-button
size=
"mini"
@
click=
"closeSelectDs()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
...
@@ -337,4 +337,8 @@ export default {
...
@@ -337,4 +337,8 @@ export default {
.preview-style
>>>
.el-drawer
.el-drawer__body
{
.preview-style
>>>
.el-drawer
.el-drawer__body
{
padding
:
0
16px
10px
!important
;
padding
:
0
16px
10px
!important
;
}
}
.form-item
>>>
.el-form-item__label
{
font-size
:
12px
!important
;
font-weight
:
400
!important
;
}
</
style
>
</
style
>
frontend/src/views/dataset/add/union/NodeItem.vue
浏览文件 @
2f109a94
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</div>
</div>
<!--选择数据集-->
<!--选择数据集-->
<el-dialog
v-if=
"selectDsDialog"
v-dialogDrag
:title=
"$t('chart.select_dataset')"
:visible=
"selectDsDialog"
:show-close=
"false"
width=
"
36
0px"
class=
"dialog-css"
>
<el-dialog
v-if=
"selectDsDialog"
v-dialogDrag
:title=
"$t('chart.select_dataset')"
:visible=
"selectDsDialog"
:show-close=
"false"
width=
"
40
0px"
class=
"dialog-css"
>
<dataset-group-selector-tree
:fix-height=
"true"
show-mode=
"union"
:custom-type=
"customType"
:mode=
"currentNode.currentDs.mode"
@
getTable=
"firstDs"
/>
<dataset-group-selector-tree
:fix-height=
"true"
show-mode=
"union"
:custom-type=
"customType"
:mode=
"currentNode.currentDs.mode"
@
getTable=
"firstDs"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"closeSelectDs()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
<el-button
size=
"mini"
@
click=
"closeSelectDs()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
</el-dialog>
</el-dialog>
<!--编辑单个数据集字段-->
<!--编辑单个数据集字段-->
<el-dialog
v-if=
"editField"
v-dialogDrag
:title=
"$t('dataset.field_select')"
:visible=
"editField"
:show-close=
"false"
width=
"
36
0px"
class=
"dialog-css"
>
<el-dialog
v-if=
"editField"
v-dialogDrag
:title=
"$t('dataset.field_select')"
:visible=
"editField"
:show-close=
"false"
width=
"
40
0px"
class=
"dialog-css"
>
<union-field-edit
:node=
"currentNode"
/>
<union-field-edit
:node=
"currentNode"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"closeEditField()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
<el-button
size=
"mini"
@
click=
"closeEditField()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
...
...
frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue
浏览文件 @
2f109a94
...
@@ -173,7 +173,7 @@ export default {
...
@@ -173,7 +173,7 @@ export default {
},
},
isTreeSearch
:
false
,
isTreeSearch
:
false
,
treeStyle
:
this
.
fixHeight
?
{
treeStyle
:
this
.
fixHeight
?
{
height
:
'
2
00px'
,
height
:
'
3
00px'
,
overflow
:
'auto'
overflow
:
'auto'
}
:
{}
}
:
{}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论