Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
27ea12ed
提交
27ea12ed
authored
3月 10, 2021
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(视图): 视图编辑UI调整
上级
0c9e679e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
118 行增加
和
61 行删除
+118
-61
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+118
-61
没有找到文件。
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
27ea12ed
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
:move="onMove"
:move="onMove"
style="height: 90%;overflow:auto"
style="height: 90%;overflow:auto"
@end="end1"
@end="end1"
@start="start1"
>
>
<transition-group>
<transition-group>
<span
v-for=
"item in dimension"
:key=
"item.id"
class=
"item"
@
click=
"click1(item)"
>
{{
item
.
name
}}
</span>
<span
v-for=
"item in dimension"
:key=
"item.id"
class=
"item"
@
click=
"click1(item)"
>
{{
item
.
name
}}
</span>
...
@@ -42,7 +43,8 @@
...
@@ -42,7 +43,8 @@
animation="300"
animation="300"
:move="onMove"
:move="onMove"
style="height: 90%;overflow:auto"
style="height: 90%;overflow:auto"
@end="end2"
@end="end1"
@start="start1"
>
>
<transition-group>
<transition-group>
<span
v-for=
"item in quota"
:key=
"item.id"
class=
"item"
@
click=
"click2(item)"
>
{{
item
.
name
}}
</span>
<span
v-for=
"item in quota"
:key=
"item.id"
class=
"item"
@
click=
"click2(item)"
>
{{
item
.
name
}}
</span>
...
@@ -103,20 +105,28 @@
...
@@ -103,20 +105,28 @@
group=
"itxst"
group=
"itxst"
animation=
"300"
animation=
"300"
:move=
"onMove"
:move=
"onMove"
style=
"width:100%;height: 100%;margin:0 10px;border-radius: 4px;border: 1px solid #DCDFE6;overflow-x: auto;"
style=
"width:100%;height: 100%;margin:0 10px;border-radius: 4px;border: 1px solid #DCDFE6;overflow-x: auto;
display: flex;align-items: center;
"
@
end=
"end
3
"
@
end=
"end
2
"
>
>
<transition-group
style=
"width: 100%;height: 100%;"
>
<transition-group
class=
"draggable-group"
>
<el-tag
<el-dropdown
v-for=
"(item) in view.xaxis"
:key=
"item.id"
trigger=
"click"
size=
"small"
>
v-for=
"(item,index) in view.xaxis"
<span
class=
"el-dropdown-link"
>
:key=
"item.id"
<span
size=
"small"
class=
"item-axis"
class=
"item-axis"
>
closable
{{
item
.
name
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
@
close=
"clear1(index)"
<span/>
>
<el-dropdown-menu
slot=
"dropdown"
>
{{
item
.
name
}}
<el-dropdown-item
icon=
"el-icon-edit-outline"
>
</el-tag>
item1
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-delete"
>
item2
</el-dropdown-item>
</el-dropdown-menu>
</span>
</span>
</el-dropdown>
</transition-group>
</transition-group>
</draggable>
</draggable>
</el-row>
</el-row>
...
@@ -127,27 +137,35 @@
...
@@ -127,27 +137,35 @@
group=
"itxst"
group=
"itxst"
animation=
"300"
animation=
"300"
:move=
"onMove"
:move=
"onMove"
style=
"width:100%;height: 100%;margin:0 10px;border-radius: 4px;border: 1px solid #DCDFE6;overflow-x: auto;"
style=
"width:100%;height: 100%;margin:0 10px;border-radius: 4px;border: 1px solid #DCDFE6;overflow-x: auto;
display: flex;align-items: center;
"
@
end=
"end
4
"
@
end=
"end
2
"
>
>
<transition-group
style=
"width:100%;height: 100%;"
>
<transition-group
class=
"draggable-group"
>
<el-tag
<el-dropdown
v-for=
"(item) in view.yaxis"
:key=
"item.id"
trigger=
"click"
size=
"small"
>
v-for=
"(item,index) in view.yaxis"
<span
class=
"el-dropdown-link"
>
:key=
"item.id"
<span
size=
"small"
class=
"item-axis"
class=
"item-axis"
>
closable
{{
item
.
name
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
@
close=
"clear2(index)"
<span/>
>
<el-dropdown-menu
slot=
"dropdown"
>
{{
item
.
name
}}
<el-dropdown-item
icon=
"el-icon-edit-outline"
>
</el-tag>
item3
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-delete"
>
item4
</el-dropdown-item>
</el-dropdown-menu>
</span>
</span>
</el-dropdown>
</transition-group>
</transition-group>
</draggable>
</draggable>
</el-row>
</el-row>
</el-row>
</el-row>
<div
class=
"Echarts"
style=
"height: 100%;display: flex;margin-top: 10px;"
>
<div
class=
"Echarts"
style=
"height: 100%;display: flex;margin-top: 10px;"
>
<div
id=
"echart"
style=
"width: 100%;height: 80vh;"
/>
<div
id=
"echart"
style=
"width: 100%;height: 80vh;"
/>
</div>
</div>
</el-row>
</el-row>
</el-col>
</el-col>
...
@@ -252,12 +270,6 @@ export default {
...
@@ -252,12 +270,6 @@ export default {
this
.
view
.
yaxis
.
push
(
item
)
this
.
view
.
yaxis
.
push
(
item
)
}
}
},
},
clear1
(
index
)
{
this
.
view
.
xaxis
.
splice
(
index
,
1
)
},
clear2
(
index
)
{
this
.
view
.
yaxis
.
splice
(
index
,
1
)
},
get
(
id
)
{
get
(
id
)
{
if
(
id
)
{
if
(
id
)
{
post
(
'/chart/view/get/'
+
id
,
null
).
then
(
response
=>
{
post
(
'/chart/view/get/'
+
id
,
null
).
then
(
response
=>
{
...
@@ -311,37 +323,60 @@ export default {
...
@@ -311,37 +323,60 @@ export default {
},
},
// 左边往右边拖动时的事件
// 左边往右边拖动时的事件
start1
(
e
)
{
console
.
log
(
e
)
e
.
clone
.
className
=
'item-on-move'
e
.
item
.
className
=
'item-on-move'
},
end1
(
e
)
{
end1
(
e
)
{
// console.log(e)
console
.
log
(
e
)
// var that = this;
e
.
clone
.
className
=
'item'
// var items = this.arr2.filter(function (m) {
e
.
item
.
className
=
'item'
// return m.id == that.moveId
this
.
refuseMove
(
e
)
// })
},
// //如果左边
start2
(
e
)
{
// if (items.length
<
2
)
return
;
console
.
log
(
e
)
// this.arr2.splice(e.newDraggableIndex, 1)
},
},
// 右边往左边拖动时的事件
// 右边往左边拖动时的事件
end2
(
e
)
{
end2
(
e
)
{
// console.log(e)
console
.
log
(
e
)
// var that = this;
this
.
removeDuplicateKey
(
e
)
// var items = this.yAxisData.filter(function (m) {
// return m.id == that.moveId
// })
// //如果左边
// if (items.length
<
2
)
return
;
// this.yAxisData.splice(e.newDraggableIndex, 1)
},
},
end3
(
e
)
{
refuseMove
(
e
)
{
// TODO 最后逻辑再思考下...
const
that
=
this
const
xItems
=
this
.
dimension
.
filter
(
function
(
m
)
{
return
m
.
id
===
that
.
moveId
})
const
yItems
=
this
.
quota
.
filter
(
function
(
m
)
{
return
m
.
id
===
that
.
moveId
})
if
(
xItems
&&
xItems
.
length
>
0
)
{
this
.
dimension
.
splice
(
e
.
oldDraggableIndex
,
0
)
}
if
(
yItems
&&
yItems
.
length
>
0
)
{
this
.
quota
.
splice
(
e
.
oldDraggableIndex
,
0
)
}
},
},
end4
(
e
)
{
removeDuplicateKey
(
e
)
{
const
that
=
this
const
xItems
=
this
.
dimension
.
filter
(
function
(
m
)
{
return
m
.
id
===
that
.
moveId
})
const
yItems
=
this
.
quota
.
filter
(
function
(
m
)
{
return
m
.
id
===
that
.
moveId
})
if
(
xItems
&&
xItems
.
length
>
0
)
{
this
.
dimension
.
splice
(
e
.
newDraggableIndex
,
1
)
}
if
(
yItems
&&
yItems
.
length
>
0
)
{
this
.
quota
.
splice
(
e
.
newDraggableIndex
,
1
)
}
},
},
// move回调方法
// move回调方法
onMove
(
e
,
originalEvent
)
{
onMove
(
e
,
originalEvent
)
{
console
.
log
(
e
)
console
.
log
(
e
)
// this.moveId = e.relatedContext.element.id;
this
.
moveId
=
e
.
draggedContext
.
element
.
id
// //不允许停靠
// //不允许停靠
// if (e.relatedContext.element.id == 1) return false;
// if (e.relatedContext.element.id == 1) return false;
// //不允许拖拽
// //不允许拖拽
...
@@ -387,30 +422,46 @@ export default {
...
@@ -387,30 +422,46 @@ export default {
}
}
.item
{
.item
{
padding
:
2px
12
px
;
padding
:
3px
10
px
;
margin
:
3px
3px
0
3px
;
margin
:
3px
3px
0
3px
;
border
:
solid
1px
#eee
;
border
:
solid
1px
#eee
;
background-color
:
#f1f1f1
;
text-align
:
left
;
text-align
:
left
;
color
:
#606266
;
display
:
block
;
display
:
block
;
}
}
.item-on-move
{
padding
:
3px
10px
;
margin
:
3px
3px
0
3px
;
border
:
solid
1px
#eee
;
text-align
:
left
;
color
:
#606266
;
}
.item
+
.item
{
.item
+
.item
{
border-top
:
none
;
margin-top
:
3px
;
margin-top
:
3px
;
}
}
.item
:hover
{
.item
:hover
{
background-color
:
#fdfdfd
;
color
:
#1890ff
;
background
:
#e8f4ff
;
border-color
:
#a3d3ff
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.item-axis
{
.item-axis
{
padding
:
2px
12
px
;
padding
:
1px
8
px
;
margin
:
3px
3px
0
3px
;
margin
:
0
3px
;
border
:
solid
1px
#eee
;
border
:
solid
1px
#eee
;
background-color
:
#f1f1f1
;
background-color
:
#f1f1f1
;
text-align
:
left
;
text-align
:
left
;
height
:
24px
;
line-height
:
22px
;
display
:
inline-block
;
color
:
#1890ff
;
border-radius
:
4px
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
}
}
.item-axis
:hover
{
.item-axis
:hover
{
...
@@ -425,4 +476,10 @@ export default {
...
@@ -425,4 +476,10 @@ export default {
span
{
span
{
font-size
:
12px
;
font-size
:
12px
;
}
}
.draggable-group
{
display
:
inline-block
;
width
:
100%
;
height
:
calc
(
100%
-
6px
);
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论