Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
8a6b75eb
提交
8a6b75eb
authored
3月 22, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:保存已经设计的面板
上级
69ae877b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
310 行增加
和
600 行删除
+310
-600
PanelDesign.java
...nd/src/main/java/io/dataease/base/domain/PanelDesign.java
+4
-5
PanelDesignExample.java
...main/java/io/dataease/base/domain/PanelDesignExample.java
+0
-0
PanelGroup.java
...end/src/main/java/io/dataease/base/domain/PanelGroup.java
+3
-0
PanelGroupExample.java
.../main/java/io/dataease/base/domain/PanelGroupExample.java
+70
-0
PanelDesignMapper.xml
...c/main/java/io/dataease/base/mapper/PanelDesignMapper.xml
+35
-49
PanelGroupMapper.xml
...rc/main/java/io/dataease/base/mapper/PanelGroupMapper.xml
+23
-5
ExtPanelDesignMapper.java
...ava/io/dataease/base/mapper/ext/ExtPanelDesignMapper.java
+4
-0
ExtPanelDesignMapper.xml
...java/io/dataease/base/mapper/ext/ExtPanelDesignMapper.xml
+4
-0
PanelConstants.java
...in/java/io/dataease/commons/constants/PanelConstants.java
+15
-0
PanelDesignController.java
...a/io/dataease/controller/panel/PanelDesignController.java
+6
-0
PanelGroupController.java
...va/io/dataease/controller/panel/PanelGroupController.java
+5
-0
PanelGroupRequest.java
.../dataease/controller/request/panel/PanelGroupRequest.java
+2
-1
PanelDesignDTO.java
...d/src/main/java/io/dataease/dto/panel/PanelDesignDTO.java
+3
-0
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+40
-0
V12__panel_table.sql
backend/src/main/resources/db/migration/V12__panel_table.sql
+13
-9
generatorConfig.xml
backend/src/main/resources/generatorConfig.xml
+8
-12
panel.js
frontend/src/api/panel/panel.js
+1
-1
index.vue
frontend/src/components/vue-drag-resize-rotate/index.vue
+46
-29
panel.js
frontend/src/store/modules/panel.js
+4
-3
chart.js
frontend/src/views/panel/chart/chart.js
+0
-41
ChartComponent.vue
frontend/src/views/panel/components/ChartComponent.vue
+0
-77
ColorSelector.vue
frontend/src/views/panel/components/ColorSelector.vue
+0
-130
DimensionItem.vue
frontend/src/views/panel/components/DimensionItem.vue
+0
-60
QuotaItem.vue
frontend/src/views/panel/components/QuotaItem.vue
+0
-164
PanelViewShow.vue
frontend/src/views/panel/list/PanelViewShow.vue
+24
-14
没有找到文件。
backend/src/main/java/io/dataease/base/domain/PanelDesign.java
浏览文件 @
8a6b75eb
...
...
@@ -13,17 +13,15 @@ public class PanelDesign implements Serializable {
private
String
componentStyle
;
private
String
componentPosition
;
private
String
componentType
;
private
String
componentDetails
;
private
Long
createTime
;
private
Long
updateTime
;
private
String
createPersion
;
private
String
updatePersion
;
private
String
updatePerson
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/PanelDesignExample.java
浏览文件 @
8a6b75eb
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/domain/PanelGroup.java
浏览文件 @
8a6b75eb
...
...
@@ -21,5 +21,7 @@ public class PanelGroup implements Serializable {
private
String
panelType
;
private
String
panelStyle
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/PanelGroupExample.java
浏览文件 @
8a6b75eb
...
...
@@ -643,6 +643,76 @@ public class PanelGroupExample {
addCriterion
(
"panel_type not between"
,
value1
,
value2
,
"panelType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleIsNull
()
{
addCriterion
(
"panel_style is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleIsNotNull
()
{
addCriterion
(
"panel_style is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleEqualTo
(
String
value
)
{
addCriterion
(
"panel_style ="
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleNotEqualTo
(
String
value
)
{
addCriterion
(
"panel_style <>"
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleGreaterThan
(
String
value
)
{
addCriterion
(
"panel_style >"
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"panel_style >="
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleLessThan
(
String
value
)
{
addCriterion
(
"panel_style <"
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"panel_style <="
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleLike
(
String
value
)
{
addCriterion
(
"panel_style like"
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleNotLike
(
String
value
)
{
addCriterion
(
"panel_style not like"
,
value
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleIn
(
List
<
String
>
values
)
{
addCriterion
(
"panel_style in"
,
values
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"panel_style not in"
,
values
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"panel_style between"
,
value1
,
value2
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelStyleNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"panel_style not between"
,
value1
,
value2
,
"panelStyle"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
backend/src/main/java/io/dataease/base/mapper/PanelDesignMapper.xml
浏览文件 @
8a6b75eb
...
...
@@ -6,12 +6,11 @@
<result
column=
"panel_id"
jdbcType=
"VARCHAR"
property=
"panelId"
/>
<result
column=
"component_id"
jdbcType=
"VARCHAR"
property=
"componentId"
/>
<result
column=
"component_style"
jdbcType=
"VARCHAR"
property=
"componentStyle"
/>
<result
column=
"component_position"
jdbcType=
"VARCHAR"
property=
"componentPosition"
/>
<result
column=
"component_type"
jdbcType=
"VARCHAR"
property=
"componentType"
/>
<result
column=
"component_details"
jdbcType=
"VARCHAR"
property=
"componentDetails"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"BIGINT"
property=
"updateTime"
/>
<result
column=
"create_persion"
jdbcType=
"VARCHAR"
property=
"createPersion"
/>
<result
column=
"update_persion"
jdbcType=
"VARCHAR"
property=
"updatePersion"
/>
<result
column=
"update_person"
jdbcType=
"VARCHAR"
property=
"updatePerson"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -72,8 +71,8 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, panel_id, component_id, component_style, component_
type, component_details, create_tim
e,
update_time, create_persion, update_persi
on
id, panel_id, component_id, component_style, component_
position, component_typ
e,
component_details, update_time, update_pers
on
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.PanelDesignExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -107,13 +106,13 @@
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.PanelDesign"
>
insert into panel_design (id, panel_id, component_id,
component_style, component_
type, component_details
,
c
reate_time, update_time, create_persion,
update_persion
)
component_style, component_
position, component_type
,
c
omponent_details, update_time, update_person
)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{componentId,jdbcType=VARCHAR},
#{componentStyle,jdbcType=VARCHAR}, #{component
Type,jdbcType=VARCHAR}, #{componentDetails
,jdbcType=VARCHAR},
#{c
reateTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createPersion,jdbcType=VARCHAR},
#{updatePersion,jdbcType=VARCHAR}
)
#{componentStyle,jdbcType=VARCHAR}, #{component
Position,jdbcType=VARCHAR}, #{componentType
,jdbcType=VARCHAR},
#{c
omponentDetails,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{updatePerson,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.PanelDesign"
>
insert into panel_design
...
...
@@ -130,23 +129,20 @@
<if
test=
"componentStyle != null"
>
component_style,
</if>
<if
test=
"componentPosition != null"
>
component_position,
</if>
<if
test=
"componentType != null"
>
component_type,
</if>
<if
test=
"componentDetails != null"
>
component_details,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"createPersion != null"
>
create_persion,
</if>
<if
test=
"updatePersion != null"
>
update_persion,
<if
test=
"updatePerson != null"
>
update_person,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -162,23 +158,20 @@
<if
test=
"componentStyle != null"
>
#{componentStyle,jdbcType=VARCHAR},
</if>
<if
test=
"componentPosition != null"
>
#{componentPosition,jdbcType=VARCHAR},
</if>
<if
test=
"componentType != null"
>
#{componentType,jdbcType=VARCHAR},
</if>
<if
test=
"componentDetails != null"
>
#{componentDetails,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=BIGINT},
</if>
<if
test=
"createPersion != null"
>
#{createPersion,jdbcType=VARCHAR},
</if>
<if
test=
"updatePersion != null"
>
#{updatePersion,jdbcType=VARCHAR},
<if
test=
"updatePerson != null"
>
#{updatePerson,jdbcType=VARCHAR},
</if>
</trim>
</insert>
...
...
@@ -203,23 +196,20 @@
<if
test=
"record.componentStyle != null"
>
component_style = #{record.componentStyle,jdbcType=VARCHAR},
</if>
<if
test=
"record.componentPosition != null"
>
component_position = #{record.componentPosition,jdbcType=VARCHAR},
</if>
<if
test=
"record.componentType != null"
>
component_type = #{record.componentType,jdbcType=VARCHAR},
</if>
<if
test=
"record.componentDetails != null"
>
component_details = #{record.componentDetails,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if
test=
"record.createPersion != null"
>
create_persion = #{record.createPersion,jdbcType=VARCHAR},
</if>
<if
test=
"record.updatePersion != null"
>
update_persion = #{record.updatePersion,jdbcType=VARCHAR},
<if
test=
"record.updatePerson != null"
>
update_person = #{record.updatePerson,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
...
...
@@ -232,12 +222,11 @@
panel_id = #{record.panelId,jdbcType=VARCHAR},
component_id = #{record.componentId,jdbcType=VARCHAR},
component_style = #{record.componentStyle,jdbcType=VARCHAR},
component_position = #{record.componentPosition,jdbcType=VARCHAR},
component_type = #{record.componentType,jdbcType=VARCHAR},
component_details = #{record.componentDetails,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_persion = #{record.createPersion,jdbcType=VARCHAR},
update_persion = #{record.updatePersion,jdbcType=VARCHAR}
update_person = #{record.updatePerson,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -254,23 +243,20 @@
<if
test=
"componentStyle != null"
>
component_style = #{componentStyle,jdbcType=VARCHAR},
</if>
<if
test=
"componentPosition != null"
>
component_position = #{componentPosition,jdbcType=VARCHAR},
</if>
<if
test=
"componentType != null"
>
component_type = #{componentType,jdbcType=VARCHAR},
</if>
<if
test=
"componentDetails != null"
>
component_details = #{componentDetails,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if
test=
"createPersion != null"
>
create_persion = #{createPersion,jdbcType=VARCHAR},
</if>
<if
test=
"updatePersion != null"
>
update_persion = #{updatePersion,jdbcType=VARCHAR},
<if
test=
"updatePerson != null"
>
update_person = #{updatePerson,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
...
...
@@ -280,12 +266,11 @@
set panel_id = #{panelId,jdbcType=VARCHAR},
component_id = #{componentId,jdbcType=VARCHAR},
component_style = #{componentStyle,jdbcType=VARCHAR},
component_position = #{componentPosition,jdbcType=VARCHAR},
component_type = #{componentType,jdbcType=VARCHAR},
component_details = #{componentDetails,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_persion = #{createPersion,jdbcType=VARCHAR},
update_persion = #{updatePersion,jdbcType=VARCHAR}
update_person = #{updatePerson,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/PanelGroupMapper.xml
浏览文件 @
8a6b75eb
...
...
@@ -10,6 +10,7 @@
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
<result
column=
"panel_type"
jdbcType=
"VARCHAR"
property=
"panelType"
/>
<result
column=
"panel_style"
jdbcType=
"VARCHAR"
property=
"panelStyle"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -70,7 +71,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, `name`, pid, `level`, node_type, create_by, create_time, panel_type
id, `name`, pid, `level`, node_type, create_by, create_time, panel_type
, panel_style
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.PanelGroupExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -105,10 +106,12 @@
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.PanelGroup"
>
insert into panel_group (id, `name`, pid,
`level`, node_type, create_by,
create_time, panel_type)
create_time, panel_type, panel_style
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
#{level,jdbcType=INTEGER}, #{nodeType,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{panelType,jdbcType=VARCHAR})
#{createTime,jdbcType=BIGINT}, #{panelType,jdbcType=VARCHAR}, #{panelStyle,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.PanelGroup"
>
insert into panel_group
...
...
@@ -137,6 +140,9 @@
<if
test=
"panelType != null"
>
panel_type,
</if>
<if
test=
"panelStyle != null"
>
panel_style,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -163,6 +169,9 @@
<if
test=
"panelType != null"
>
#{panelType,jdbcType=VARCHAR},
</if>
<if
test=
"panelStyle != null"
>
#{panelStyle,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.PanelGroupExample"
resultType=
"java.lang.Long"
>
...
...
@@ -198,6 +207,9 @@
<if
test=
"record.panelType != null"
>
panel_type = #{record.panelType,jdbcType=VARCHAR},
</if>
<if
test=
"record.panelStyle != null"
>
panel_style = #{record.panelStyle,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -212,7 +224,8 @@
node_type = #{record.nodeType,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
panel_type = #{record.panelType,jdbcType=VARCHAR}
panel_type = #{record.panelType,jdbcType=VARCHAR},
panel_style = #{record.panelStyle,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -241,6 +254,9 @@
<if
test=
"panelType != null"
>
panel_type = #{panelType,jdbcType=VARCHAR},
</if>
<if
test=
"panelStyle != null"
>
panel_style = #{panelStyle,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
...
...
@@ -252,7 +268,8 @@
node_type = #{nodeType,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
panel_type = #{panelType,jdbcType=VARCHAR}
panel_type = #{panelType,jdbcType=VARCHAR},
panel_style = #{panelStyle,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelDesignMapper.java
浏览文件 @
8a6b75eb
package
io
.
dataease
.
base
.
mapper
.
ext
;
import
org.apache.ibatis.annotations.Param
;
public
interface
ExtPanelDesignMapper
{
void
deleteByPanelId
(
@Param
(
"panelId"
)
String
panelId
);
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelDesignMapper.xml
浏览文件 @
8a6b75eb
...
...
@@ -6,4 +6,8 @@
</resultMap>
<delete
id=
"deleteByPanelId"
>
delete from panel_design where panel_id =#{panelId}
</delete>
</mapper>
backend/src/main/java/io/dataease/commons/constants/PanelConstants.java
0 → 100644
浏览文件 @
8a6b75eb
package
io
.
dataease
.
commons
.
constants
;
/**
* Author: wangjiahao
* Date: 2021-03-22
* Description:
*/
public
class
PanelConstants
{
public
final
static
String
COMPONENT_TYPE_VIEW
=
"view"
;
public
final
static
String
COMPONENT_TYPE_PUBLIC
=
"public"
;
}
backend/src/main/java/io/dataease/controller/panel/PanelDesignController.java
浏览文件 @
8a6b75eb
...
...
@@ -25,4 +25,10 @@ public class PanelDesignController {
// panelGroupService.deleteCircle(id);
// }
@PostMapping
(
"/saveDesign/{id}"
)
public
void
deleteCircle
(
@PathVariable
String
id
)
{
panelGroupService
.
deleteCircle
(
id
);
}
}
backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java
浏览文件 @
8a6b75eb
...
...
@@ -51,4 +51,9 @@ public class PanelGroupController {
return
panelGroupService
.
findOne
(
id
);
}
@PostMapping
(
"/saveGroupWithDesign"
)
public
void
saveGroupWithDesign
(
@RequestBody
PanelGroupRequest
request
)
{
panelGroupService
.
saveGroupWithDesign
(
request
);
}
}
backend/src/main/java/io/dataease/controller/request/panel/PanelGroupRequest.java
浏览文件 @
8a6b75eb
package
io
.
dataease
.
controller
.
request
.
panel
;
import
io.dataease.base.domain.PanelGroup
;
import
io.dataease.dto.panel.PanelGroupDTO
;
import
lombok.Data
;
/**
...
...
@@ -9,7 +10,7 @@ import lombok.Data;
* Description:
*/
@Data
public
class
PanelGroupRequest
extends
PanelGroup
{
public
class
PanelGroupRequest
extends
PanelGroup
DTO
{
private
String
sort
;
public
PanelGroupRequest
()
{
...
...
backend/src/main/java/io/dataease/dto/panel/PanelDesignDTO.java
浏览文件 @
8a6b75eb
...
...
@@ -15,6 +15,9 @@ public class PanelDesignDTO extends PanelDesign {
//当前视图是否在仪表盘中显示
private
boolean
keepFlag
=
false
;
//当前视图是否已经进行样式初始化
private
boolean
styleInit
=
false
;
private
ChartViewDTO
chartView
;
private
Object
systemComponent
;
...
...
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
8a6b75eb
...
...
@@ -4,7 +4,9 @@ import io.dataease.base.domain.*;
import
io.dataease.base.mapper.ChartViewMapper
;
import
io.dataease.base.mapper.PanelDesignMapper
;
import
io.dataease.base.mapper.PanelGroupMapper
;
import
io.dataease.base.mapper.ext.ExtPanelDesignMapper
;
import
io.dataease.base.mapper.ext.ExtPanelGroupMapper
;
import
io.dataease.commons.constants.PanelConstants
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.controller.request.panel.PanelGroupRequest
;
import
io.dataease.dto.chart.ChartViewDTO
;
...
...
@@ -17,6 +19,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
javax.annotation.Resource
;
...
...
@@ -24,6 +27,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
/**
* Author: wangjiahao
...
...
@@ -45,6 +49,8 @@ public class PanelGroupService {
private
ChartViewService
chartViewService
;
@Resource
private
ChartViewMapper
chartViewMapper
;
@Resource
private
ExtPanelDesignMapper
extPanelDesignMapper
;
public
List
<
PanelGroupDTO
>
tree
(
PanelGroupRequest
panelGroupRequest
)
{
List
<
PanelGroupDTO
>
panelGroupDTOList
=
extPanelGroupMapper
.
panelGroupList
(
panelGroupRequest
);
...
...
@@ -126,4 +132,38 @@ public class PanelGroupService {
return
chartViewDTOList
;
}
@Transactional
public
void
saveGroupWithDesign
(
PanelGroupRequest
request
)
{
//TODO 更新panelGroup 信息
if
(
StringUtils
.
isEmpty
(
request
.
getId
()))
{
request
.
setId
(
UUID
.
randomUUID
().
toString
());
request
.
setCreateTime
(
System
.
currentTimeMillis
());
panelGroupMapper
.
insert
(
request
);
}
else
{
panelGroupMapper
.
updateByPrimaryKey
(
request
);
}
//TODO 更新panelDesign 信息
String
panelId
=
request
.
getId
();
Assert
.
notNull
(
panelId
,
"panelId should not be null"
);
//清理原有design
extPanelDesignMapper
.
deleteByPanelId
(
panelId
);
//保存view 或者component design
Optional
.
ofNullable
(
request
.
getPanelDesigns
()).
orElse
(
new
ArrayList
<>()).
stream
().
forEach
(
panelDesignDTO
->
{
if
(
panelDesignDTO
.
isKeepFlag
())
{
String
componentId
=
""
;
if
(
StringUtils
.
equals
(
PanelConstants
.
COMPONENT_TYPE_VIEW
,
panelDesignDTO
.
getComponentType
())){
componentId
=
panelDesignDTO
.
getChartView
().
getId
();
}
else
{
//预留 公共组件id获取
componentId
=
""
;
}
panelDesignDTO
.
setPanelId
(
panelId
);
panelDesignDTO
.
setComponentId
(
componentId
);
panelDesignDTO
.
setUpdateTime
(
System
.
currentTimeMillis
());
panelDesignMapper
.
insertSelective
(
panelDesignDTO
);
}
});
}
}
backend/src/main/resources/db/migration/V12__panel_table.sql
浏览文件 @
8a6b75eb
SET
NAMES
utf8mb4
;
SET
FOREIGN_KEY_CHECKS
=
0
;
-- ----------------------------
-- Table structure for panel_design
-- ----------------------------
DROP
TABLE
IF
EXISTS
`panel_design`
;
CREATE
TABLE
`panel_design`
(
`id`
varchar
(
100
)
NOT
NULL
,
`panel_id`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'panel id'
,
`component_id`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'组件 id'
,
`component_style`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'组件样式 样式'
,
`component_position`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'组件样式 样式定位'
,
`component_type`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'组件 类型 view 视图 public 公共组件'
,
`component_details`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'组件明细'
,
`create_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`update_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'修改时间'
,
`create_persion`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'创建人'
,
`update_persion`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'修改人'
,
`update_person`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'修改人'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'仪表盘和组件的关联关系 组件分为普通视图和系统组件'
;
...
...
@@ -28,6 +31,7 @@ CREATE TABLE `panel_group` (
`create_by`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'创建人'
,
`create_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`panel_type`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'仪表盘类型 system 系统内置 self 用户自建 '
,
`panel_style`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'panel 样式'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -35,11 +39,12 @@ CREATE TABLE `panel_group` (
-- Records of panel_group
-- ----------------------------
BEGIN
;
INSERT
INTO
`panel_group`
VALUES
(
'1001'
,
'飞致云'
,
NULL
,
0
,
'folder'
,
NULL
,
NULL
,
'self'
);
INSERT
INTO
`panel_group`
VALUES
(
'1c78bc65-ea38-40bc-ad73-738a9b386379'
,
'测试仪表盘1'
,
'1001'
,
1
,
'panel'
,
NULL
,
1615961778552
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'2003'
,
'默认仪表盘1'
,
NULL
,
NULL
,
'panel'
,
NULL
,
NULL
,
'system'
);
INSERT
INTO
`panel_group`
VALUES
(
'2004'
,
'默认仪表盘2'
,
NULL
,
NULL
,
'panel'
,
NULL
,
NULL
,
'system'
);
INSERT
INTO
`panel_group`
VALUES
(
'8ff64eb1-a96a-4218-85cd-01b437d21f2e'
,
'测试仪表盘2'
,
'1001'
,
1
,
'panel'
,
NULL
,
1615200099827
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'1001'
,
'飞致云'
,
NULL
,
0
,
'folder'
,
NULL
,
NULL
,
'self'
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'1c78bc65-ea38-40bc-ad73-738a9b386379'
,
'测试仪表盘1'
,
'1001'
,
1
,
'panel'
,
NULL
,
1615961778552
,
NULL
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'2003'
,
'默认仪表盘1'
,
NULL
,
NULL
,
'panel'
,
NULL
,
NULL
,
'system'
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'2004'
,
'默认仪表盘2'
,
NULL
,
NULL
,
'panel'
,
NULL
,
NULL
,
'system'
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'8ff64eb1-a96a-4218-85cd-01b437d21f2e'
,
'测试仪表盘2'
,
'1001'
,
1
,
'panel'
,
NULL
,
1615200099827
,
NULL
,
NULL
);
INSERT
INTO
`panel_group`
VALUES
(
'd15f816d-46b7-4859-8ec8-2b19918dc772'
,
'TSEE'
,
'1001'
,
1
,
'folder'
,
NULL
,
1616403978419
,
NULL
,
NULL
);
COMMIT
;
-- ----------------------------
...
...
@@ -56,7 +61,6 @@ CREATE TABLE `panel_view` (
`update_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
SET
FOREIGN_KEY_CHECKS
=
1
;
...
...
backend/src/main/resources/generatorConfig.xml
浏览文件 @
8a6b75eb
...
...
@@ -37,11 +37,11 @@
</commentGenerator>
<!-- jdbc连接信息 -->
<!-- EduLoanManage EduTestDataBase -->
<
jdbcConnection
driverClass=
"com.mysql.jdbc.Driver"
connectionURL=
"jdbc:mysql://62.234.205.170:3306/dataease"
userId=
"root"
password=
"Password123@mysql"
/
>
<!-- <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"-->
<!-- connectionURL="${spring.datasource.url}&nullCatalogMeansCurrent=true"-->
<!-- userId="${spring.datasource.username}" password="${spring.datasource.password}"/>--
>
<
!--<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.20.180:3306/fit2cloud"-->
<!--userId="root" password="Fit2cloud2015!" />--
>
<jdbcConnection
driverClass=
"com.mysql.cj.jdbc.Driver"
connectionURL=
"${spring.datasource.url}&nullCatalogMeansCurrent=true"
userId=
"${spring.datasource.username}"
password=
"${spring.datasource.password}"
/
>
<!-- javaTypeResolver式类型转换的信息 -->
<javaTypeResolver>
...
...
@@ -64,13 +64,9 @@
<!--要生成的数据库表 -->
<table
tableName=
"dataset_table_incremental_config"
>
<!--以下为添加内容 -->
<columnOverride
column=
"incremental_delete"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<columnOverride
column=
"incremental_add"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
</table>
<!-- <table tableName="datasource"/>-->
<table
tableName=
"panel_design"
/>
<table
tableName=
"panel_design"
/>
</context>
...
...
frontend/src/api/panel/panel.js
浏览文件 @
8a6b75eb
...
...
@@ -115,4 +115,4 @@ export function get(url) {
})
}
export
default
{
post
,
get
,
groupTree
,
defaultTree
}
export
default
{
post
,
get
,
groupTree
,
defaultTree
}
frontend/src/components/vue-drag-resize-rotate/index.vue
浏览文件 @
8a6b75eb
...
...
@@ -69,14 +69,10 @@ export default {
replace
:
true
,
name
:
'VueDragResizeRotate'
,
props
:
{
p
reStyle
:
{
p
anelDesign
:
{
type
:
Object
,
default
:
null
},
panelDesignId
:
{
type
:
String
,
default
:
''
},
className
:
{
type
:
String
,
default
:
'vdr'
...
...
@@ -412,21 +408,48 @@ export default {
}
},
style
()
{
let
newStyle
=
{};
if
(
this
.
styleInit
&&
this
.
preStyle
){
newStyle
=
this
.
preStyle
;
}
else
{
newStyle
=
{
transform
:
`translate(
${
this
.
left
}
px,
${
this
.
top
}
px) rotate(
${
this
.
rotate
}
deg)`
,
width
:
this
.
computedWidth
,
height
:
this
.
computedHeight
,
zIndex
:
this
.
zIndex
,
...(
this
.
dragging
&&
this
.
disableUserSelect
?
userSelectNone
:
userSelectAuto
)
};
if
(
!
this
.
panelDesign
.
styleInit
&&
this
.
panelDesign
.
componentPosition
)
{
debugger
// 设置定位
const
componentPosition
=
JSON
.
parse
(
this
.
panelDesign
.
componentPosition
)
this
.
left
=
componentPosition
.
left
this
.
top
=
componentPosition
.
top
this
.
width
=
componentPosition
.
width
this
.
height
=
componentPosition
.
height
this
.
w
=
componentPosition
.
width
this
.
h
=
componentPosition
.
height
this
.
zIndex
=
componentPosition
.
zIndex
this
.
dragging
=
componentPosition
.
dragging
this
.
disableUserSelect
=
componentPosition
.
disableUserSelect
}
const
newStyle
=
{
transform
:
`translate(
${
this
.
left
}
px,
${
this
.
top
}
px) rotate(
${
this
.
rotate
}
deg)`
,
width
:
this
.
computedWidth
,
height
:
this
.
computedHeight
,
zIndex
:
this
.
zIndex
,
...(
this
.
dragging
&&
this
.
disableUserSelect
?
userSelectNone
:
userSelectAuto
)
}
this
.
styleInit
=
false
;
this
.
$emit
(
'newStyle'
,
this
.
panelDesignId
,
newStyle
);
return
newStyle
;
this
.
panelDesign
.
styleInit
=
true
this
.
panelDesign
.
componentStyle
=
JSON
.
stringify
(
newStyle
)
// 回收定位
const
newComponentPosition
=
{
left
:
this
.
left
,
top
:
this
.
top
,
width
:
this
.
width
,
height
:
this
.
height
,
w
:
this
.
width
,
h
:
this
.
height
,
zIndex
:
this
.
zIndex
,
dragging
:
this
.
dragging
,
disableUserSelect
:
this
.
disableUserSelect
}
this
.
panelDesign
.
componentPosition
=
JSON
.
stringify
(
newComponentPosition
)
this
.
$emit
(
'newStyle'
,
this
.
panelDesign
.
id
,
newStyle
)
return
newStyle
},
// 控制柄显示与否
actualHandles
()
{
...
...
@@ -578,14 +601,6 @@ export default {
this
.
resetBoundsAndMouseState
()
},
mounted
:
function
()
{
//f2c 页面初始化后对样式重新赋值
if
(
this
.
preStyle
){
}
if
(
!
this
.
enableNativeDrag
)
{
this
.
$el
.
ondragstart
=
()
=>
false
}
...
...
@@ -620,9 +635,11 @@ export default {
},
methods
:
{
removeView
(){
removeView
()
{
debugger
this
.
panelDesign
.
keepFlag
=
false
// console.log(this.panelDesignId);
this
.
$emit
(
'removeView'
,
this
.
panelDesignI
d
)
// this.$emit('removeView', this.panelDesign.i
d)
},
// 重置边界和鼠标状态
resetBoundsAndMouseState
()
{
...
...
frontend/src/store/modules/panel.js
浏览文件 @
8a6b75eb
...
...
@@ -2,9 +2,10 @@
const
getDefaultState
=
()
=>
{
return
{
panelName
:
''
,
panelInfo
:{
id
:
null
,
name
:
''
panelInfo
:
{
id
:
null
,
name
:
''
,
preStyle
:
null
}
}
}
...
...
frontend/src/views/panel/chart/chart.js
deleted
100644 → 0
浏览文件 @
69ae877b
export
const
DEFAULT_COLOR_CASE
=
{
value
:
'default'
,
colors
:
[
'#5470c6'
,
'#91cc75'
,
'#fac858'
,
'#ee6666'
,
'#73c0de'
,
'#3ba272'
,
'#fc8452'
,
'#9a60b4'
,
'#ea7ccc'
]
}
export
const
BASE_BAR
=
{
title
:
{
text
:
''
},
tooltip
:
{},
legend
:
{
data
:
[]
},
xAxis
:
{
data
:
[]
},
yAxis
:
{
type
:
'value'
},
series
:
[]
}
export
const
BASE_LINE
=
{
title
:
{
text
:
''
},
tooltip
:
{},
legend
:
{
data
:
[]
},
xAxis
:
{
data
:
[]
},
yAxis
:
{
type
:
'value'
},
series
:
[]
}
export
default
{
BASE_BAR
,
BASE_LINE
,
DEFAULT_COLOR_CASE
}
frontend/src/views/panel/components/ChartComponent.vue
deleted
100644 → 0
浏览文件 @
69ae877b
<
template
>
<div
class=
"Echarts"
style=
"height: 100%;display: flex;margin-top: 10px;"
>
<div
id=
"echart"
style=
"width: 100%;height: 80vh;"
/>
</div>
</
template
>
<
script
>
import
{
BASE_BAR
,
BASE_LINE
}
from
'../chart/chart'
export
default
{
name
:
'ChartComponent'
,
props
:
{
chart
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
myChart
:
{}
}
},
watch
:
{
chart
()
{
debugger
this
.
drawEcharts
()
}
},
mounted
()
{
// 基于准备好的dom,初始化echarts实例
this
.
myChart
=
this
.
$echarts
.
init
(
document
.
getElementById
(
'echart'
))
},
methods
:
{
drawEcharts
()
{
debugger
const
chart
=
this
.
chart
let
chart_option
=
{}
// todo type
if
(
chart
.
type
===
'bar'
)
{
chart_option
=
JSON
.
parse
(
JSON
.
stringify
(
BASE_BAR
))
}
else
if
(
chart
.
type
===
'line'
)
{
chart_option
=
JSON
.
parse
(
JSON
.
stringify
(
BASE_LINE
))
}
// console.log(chart_option);
// 处理data
if
(
chart
.
data
)
{
chart_option
.
title
.
text
=
chart
.
title
chart_option
.
xAxis
.
data
=
chart
.
data
.
x
chart
.
data
.
series
.
forEach
(
function
(
y
)
{
chart_option
.
legend
.
data
.
push
(
y
.
name
)
chart_option
.
series
.
push
(
y
)
})
}
// console.log(chart_option);
// 处理shape attr
if
(
chart
.
customAttr
)
{
if
(
chart
.
customAttr
.
color
)
{
chart_option
.
color
=
chart
.
customAttr
.
color
.
colors
}
}
this
.
myEcharts
(
chart_option
)
},
myEcharts
(
option
)
{
// 指定图表的配置项和数据
const
chart
=
this
.
myChart
setTimeout
(
chart
.
setOption
(
option
,
true
),
500
)
window
.
onresize
=
function
()
{
chart
.
resize
()
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/views/panel/components/ColorSelector.vue
deleted
100644 → 0
浏览文件 @
69ae877b
<
template
>
<div>
<div
style=
"width:100%;height: 32px;margin:0;padding:0 4px;border-radius: 4px;border: 1px solid #DCDFE6;display: flex;align-items: center;"
>
<el-popover
placement=
"right"
width=
"400"
trigger=
"click"
>
<el-col>
<el-form
ref=
"colorForm"
:model=
"colorForm"
label-width=
"80px"
size=
"mini"
>
<el-form-item
:label=
"$t('chart.color_case')"
class=
"form-item"
>
<el-select
v-model=
"colorForm.colorCase"
:placeholder=
"$t('chart.pls_slc_color_case')"
size=
"mini"
@
change=
"changeColorCase"
>
<el-option
v-for=
"option in colorCases"
:key=
"option.value"
:label=
"option.name"
:value=
"option.value"
style=
"display: flex;align-items: center;"
>
<div
style=
"float: left"
>
<span
v-for=
"(c,index) in option.colors"
:key=
"index"
:style=
"
{width: '20px',height: '20px',float: 'left',backgroundColor: c}" />
</div>
<span
style=
"margin-left: 4px;"
>
{{
option
.
name
}}
</span>
</el-option>
</el-select>
</el-form-item>
</el-form>
</el-col>
<el-button
slot=
"reference"
size=
"mini"
class=
"shape-item"
>
{{
$t
(
'chart.color'
)
}}
<i
class=
"el-icon-setting el-icon--right"
/></el-button>
</el-popover>
<!--todo other color attr-->
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'ColorSelector'
,
props
:
{
chart
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
colorCases
:
[
{
name
:
this
.
$t
(
'chart.color_default'
),
value
:
'default'
,
colors
:
[
'#5470c6'
,
'#91cc75'
,
'#fac858'
,
'#ee6666'
,
'#73c0de'
,
'#3ba272'
,
'#fc8452'
,
'#9a60b4'
,
'#ea7ccc'
]
},
{
name
:
this
.
$t
(
'chart.color_retro'
),
value
:
'retro'
,
colors
:
[
'#0780cf'
,
'#765005'
,
'#fa6d1d'
,
'#0e2c82'
,
'#b6b51f'
,
'#da1f18'
,
'#701866'
,
'#f47a75'
,
'#009db2'
]
},
{
name
:
this
.
$t
(
'chart.color_elegant'
),
value
:
'elegant'
,
colors
:
[
'#95a2ff'
,
'#fa8080'
,
'#ffc076'
,
'#fae768'
,
'#87e885'
,
'#3cb9fc'
,
'#73abf5'
,
'#cb9bff'
,
'#434348'
]
},
{
name
:
this
.
$t
(
'chart.color_future'
),
value
:
'future'
,
colors
:
[
'#63b2ee'
,
'#76da91'
,
'#f8cb7f'
,
'#f89588'
,
'#7cd6cf'
,
'#9192ab'
,
'#7898e1'
,
'#efa666'
,
'#eddd86'
]
},
{
name
:
this
.
$t
(
'chart.color_gradual'
),
value
:
'gradual'
,
colors
:
[
'#71ae46'
,
'#96b744'
,
'#c4cc38'
,
'#ebe12a'
,
'#eab026'
,
'#e3852b'
,
'#d85d2a'
,
'#ce2626'
,
'#ac2026'
]
},
{
name
:
this
.
$t
(
'chart.color_simple'
),
value
:
'simple'
,
colors
:
[
'#929fff'
,
'#9de0ff'
,
'#ffa897'
,
'#af87fe'
,
'#7dc3fe'
,
'#bb60b2'
,
'#433e7c'
,
'#f47a75'
,
'#009db2'
]
},
{
name
:
this
.
$t
(
'chart.color_business'
),
value
:
'business'
,
colors
:
[
'#194f97'
,
'#555555'
,
'#bd6b08'
,
'#00686b'
,
'#c82d31'
,
'#625ba1'
,
'#898989'
,
'#9c9800'
,
'#007f54'
]
},
{
name
:
this
.
$t
(
'chart.color_gentle'
),
value
:
'gentle'
,
colors
:
[
'#5b9bd5'
,
'#ed7d31'
,
'#70ad47'
,
'#ffc000'
,
'#4472c4'
,
'#91d024'
,
'#b235e6'
,
'#02ae75'
,
'#5b9bd5'
]
},
{
name
:
this
.
$t
(
'chart.color_technology'
),
value
:
'technology'
,
colors
:
[
'#05f8d6'
,
'#0082fc'
,
'#fdd845'
,
'#22ed7c'
,
'#09b0d3'
,
'#1d27c9'
,
'#f9e264'
,
'#f47a75'
,
'#009db2'
]
}
],
colorForm
:
{
colorCase
:
'default'
}
}
},
watch
:
{
'chart'
:
{
handler
:
function
()
{
const
chart
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
chart
))
this
.
colorForm
.
colorCase
=
chart
.
customAttr
.
color
.
value
}
}
},
mounted
()
{
},
methods
:
{
changeColorCase
()
{
const
that
=
this
const
items
=
this
.
colorCases
.
filter
(
ele
=>
{
return
ele
.
value
===
that
.
colorForm
.
colorCase
})
this
.
$emit
(
'onColorChange'
,
{
value
:
items
[
0
].
value
,
colors
:
items
[
0
].
colors
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.shape-item
{
padding
:
6px
;
border
:
none
;
}
.form-item
>>>
.el-form-item__label
{
font-size
:
12px
;
}
.el-select-dropdown__item
{
padding
:
0
20px
;
}
span
{
font-size
:
12px
}
</
style
>
frontend/src/views/panel/components/DimensionItem.vue
deleted
100644 → 0
浏览文件 @
69ae877b
<
template
>
<span>
<el-dropdown
trigger=
"click"
size=
"mini"
>
<span
class=
"el-dropdown-link"
>
<el-tag
size=
"small"
class=
"item-axis"
>
{{
item
.
name
}}
<i
class=
"el-icon-arrow-down el-icon--right"
/>
</el-tag>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
icon=
"el-icon-edit-outline"
>
item1
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-delete"
>
item2
</el-dropdown-item>
</el-dropdown-menu>
</span>
</el-dropdown>
</span>
</
template
>
<
script
>
export
default
{
name
:
'DimensionItem'
,
props
:
{
item
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{}
},
mounted
()
{
},
methods
:
{}
}
</
script
>
<
style
scoped
>
.item-axis
{
padding
:
1px
6px
;
margin
:
0
3px
2px
3px
;
text-align
:
left
;
height
:
24px
;
line-height
:
22px
;
display
:
inline-block
;
border-radius
:
4px
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
}
.item-axis
:hover
{
background-color
:
#fdfdfd
;
cursor
:
pointer
;
}
span
{
font-size
:
12px
;
}
</
style
>
frontend/src/views/panel/components/QuotaItem.vue
deleted
100644 → 0
浏览文件 @
69ae877b
<
template
>
<span>
<el-dropdown
trigger=
"click"
size=
"mini"
@
command=
"clickItem"
>
<span
class=
"el-dropdown-link"
>
<el-tag
size=
"small"
class=
"item-axis"
>
{{
item
.
name
}}
<span
v-if=
"item.summary"
class=
"summary-span"
>
{{
$t
(
'chart.'
+
item
.
summary
)
}}
</span><i
class=
"el-icon-arrow-down el-icon--right"
/>
</el-tag>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
icon=
"el-icon-notebook-2"
>
<el-dropdown
placement=
"right-start"
size=
"mini"
@
command=
"summary"
>
<span
class=
"el-dropdown-link"
>
{{
$t
(
'chart.summary'
)
}}
<span
class=
"summary-span"
>
(
{{
$t
(
'chart.'
+
item
.
summary
)
}}
)
</span><i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"beforeSummary('sum')"
>
{{
$t
(
'chart.sum'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeSummary('avg')"
>
{{
$t
(
'chart.avg'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeSummary('max')"
>
{{
$t
(
'chart.max'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeSummary('min')"
>
{{
$t
(
'chart.min'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeSummary('std')"
>
{{
$t
(
'chart.std'
)
}}
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeSummary('var_samp')"
>
{{
$t
(
'chart.var_samp'
)
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-s-grid"
>
<el-dropdown
placement=
"right-start"
size=
"mini"
@
command=
"quickCalc"
>
<span
class=
"el-dropdown-link"
>
{{
$t
(
'chart.quick_calc'
)
}}
<span
class=
"summary-span"
>
(test)
</span><i
class=
"el-icon-arrow-right el-icon--right"
/>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"beforeQuickCalc('none')"
>
test
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-edit-outline"
divided
:command=
"beforeClickItem('rename')"
>
<span>
{{
$t
(
'chart.show_name_set'
)
}}
</span>
</el-dropdown-item>
</el-dropdown-menu>
</span>
</el-dropdown>
<el-dialog
:title=
"$t('chart.show_name_set')"
:visible=
"renameItem"
:show-close=
"false"
width=
"30%"
>
<el-form
ref=
"itemForm"
:model=
"itemForm"
:rules=
"itemFormRules"
>
<el-form-item
:label=
"$t('commons.name')"
prop=
"name"
>
<el-input
v-model=
"itemForm.name"
size=
"mini"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"closeRename()"
>
{{
$t
(
'chart.cancel'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"saveRename(itemForm)"
>
{{
$t
(
'chart.confirm'
)
}}
</el-button>
</div>
</el-dialog>
</span>
</
template
>
<
script
>
export
default
{
name
:
'QuotaItem'
,
props
:
{
item
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
renameItem
:
false
,
itemForm
:
{
name
:
''
},
itemFormRules
:
{
name
:
[
{
required
:
true
,
message
:
this
.
$t
(
'commons.input_content'
),
trigger
:
'change'
}
]
}
}
},
mounted
()
{
},
methods
:
{
summary
(
param
)
{
// console.log(param)
this
.
item
.
summary
=
param
.
type
this
.
$emit
(
'onQuotaItemChange'
,
this
.
item
)
},
beforeSummary
(
type
)
{
return
{
type
:
type
}
},
quickCalc
(
param
)
{
},
beforeQuickCalc
(
type
)
{
return
{
type
:
type
}
},
clickItem
(
param
)
{
if
(
!
param
)
{
return
}
switch
(
param
.
type
)
{
case
'rename'
:
this
.
showRename
()
break
default
:
break
}
},
beforeClickItem
(
type
)
{
return
{
type
:
type
}
},
showRename
()
{
this
.
itemForm
.
name
=
this
.
item
.
name
this
.
renameItem
=
true
},
closeRename
()
{
this
.
renameItem
=
false
this
.
resetRename
()
},
saveRename
(
param
)
{
this
.
item
.
name
=
param
.
name
this
.
$emit
(
'onQuotaItemChange'
,
this
.
item
)
this
.
closeRename
()
},
resetRename
()
{
this
.
itemForm
=
{
name
:
''
}
}
}
}
</
script
>
<
style
scoped
>
.item-axis
{
padding
:
1px
6px
;
margin
:
0
3px
2px
3px
;
text-align
:
left
;
height
:
24px
;
line-height
:
22px
;
display
:
inline-block
;
border-radius
:
4px
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
}
.item-axis
:hover
{
background-color
:
#fdfdfd
;
cursor
:
pointer
;
}
span
{
font-size
:
12px
;
}
.summary-span
{
margin-left
:
4px
;
color
:
#878d9f
;
;
}
</
style
>
frontend/src/views/panel/list/PanelViewShow.vue
浏览文件 @
8a6b75eb
...
...
@@ -39,6 +39,9 @@
<el-button
size=
"mini"
>
背景图
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"savePanel"
>
保存
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"preViewShow"
>
预览
</el-button>
...
...
@@ -50,10 +53,9 @@
v-for=
"panelDesign in panelDetails.panelDesigns"
v-show=
"panelDesign.keepFlag"
:key=
"panelDesign.id"
:panel-design
-id=
"panelDesign.id
"
:panel-design
=
"panelDesign
"
:parent=
"true"
@
newStyle=
"newStyle"
@
removeView=
"removeView"
>
<!--视图显示 panelDesign.componentType==='view'-->
<chart-component
v-if=
"panelDesign.componentType==='view'"
:ref=
"panelDesign.id"
:chart-id=
"panelDesign.id"
:chart=
"panelDesign.chartView"
/>
...
...
@@ -70,7 +72,7 @@
</
template
>
<
script
>
import
{
get
}
from
'@/api/panel/panel'
import
{
post
,
get
}
from
'@/api/panel/panel'
import
draggable
from
'vuedraggable'
import
ChartComponent
from
'../../chart/components/ChartComponent'
import
VueDragResizeRotate
from
'@/components/vue-drag-resize-rotate'
...
...
@@ -90,8 +92,8 @@ export default {
position
:
'relative'
,
height
:
'100%'
,
width
:
'100%'
,
backgroundColor
:
'#
808080
'
,
background
:
'linear-gradient(-90deg, rgba(0, 0, 0, .1) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 1px)'
,
backgroundColor
:
'#
f2f2f2
'
,
//
background: 'linear-gradient(-90deg, rgba(0, 0, 0, .1) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 1px)',
backgroundSize
:
'20px 20px, 20px 20px'
},
ViewActiveName
:
'Views'
...
...
@@ -141,24 +143,25 @@ export default {
id
:
uuid
.
v1
(),
keepFlag
:
true
,
chartView
:
item
,
componentType
:
'view'
componentType
:
'view'
,
styleInit
:
false
}
panelDesigns
.
push
(
newComponent
)
}
})
},
removeView
(
panelDesignId
)
{
this
.
panelDetails
.
panelDesigns
.
forEach
(
function
(
panelDesign
,
index
)
{
if
(
panelDesign
.
id
===
panelDesignId
)
{
panelDesign
.
keepFlag
=
false
}
})
},
//
removeView(panelDesignId) {
//
this.panelDetails.panelDesigns.forEach(function(panelDesign, index) {
//
if (panelDesign.id === panelDesignId) {
//
panelDesign.keepFlag = false
//
}
//
})
//
},
newStyle
(
viewId
,
newStyleInfo
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
viewId
][
0
].
chartResize
()
})
this
.
panelInfo
.
preStyle
=
JSON
.
stringify
(
newStyleInfo
)
console
.
log
(
viewId
)
console
.
log
(
JSON
.
stringify
(
newStyleInfo
))
},
...
...
@@ -184,6 +187,13 @@ export default {
},
preViewShow
()
{
},
savePanel
()
{
debugger
post
(
'panel/group/saveGroupWithDesign'
,
this
.
panelDetails
,
()
=>
{
debugger
})
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论