Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
7dac4702
提交
7dac4702
authored
9月 23, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 仪表板tabs组件
上级
f81e65aa
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
112 行增加
和
66 行删除
+112
-66
ComponentWrapper.vue
.../components/canvas/components/Editor/ComponentWrapper.vue
+1
-0
SettingMenu.vue
...d/src/components/canvas/components/Editor/SettingMenu.vue
+4
-0
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+1
-1
component-list.js
.../src/components/canvas/custom-component/component-list.js
+7
-0
DeTabs.vue
frontend/src/components/widget/DeWidget/DeTabs.vue
+99
-65
没有找到文件。
frontend/src/components/canvas/components/Editor/ComponentWrapper.vue
浏览文件 @
7dac4702
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
:out-style=
"config.style"
:out-style=
"config.style"
:style=
"getComponentStyleDefault(config.style)"
:style=
"getComponentStyleDefault(config.style)"
:prop-value=
"config.propValue"
:prop-value=
"config.propValue"
:is-edit=
"false"
:element=
"config"
:element=
"config"
:search-count=
"searchCount"
:search-count=
"searchCount"
/>
/>
...
...
frontend/src/components/canvas/components/Editor/SettingMenu.vue
浏览文件 @
7dac4702
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<el-dropdown-item
icon=
"el-icon-arrow-up"
@
click
.
native=
"upComponent"
>
{{
$t
(
'panel.upComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-arrow-up"
@
click
.
native=
"upComponent"
>
{{
$t
(
'panel.upComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-arrow-down"
@
click
.
native=
"downComponent"
>
{{
$t
(
'panel.downComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-arrow-down"
@
click
.
native=
"downComponent"
>
{{
$t
(
'panel.downComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
v-if=
"'view'===curComponent.type"
icon=
"el-icon-link"
@
click
.
native=
"linkageSetting"
>
{{
$t
(
'panel.linkage_setting'
)
}}
</el-dropdown-item>
<el-dropdown-item
v-if=
"'view'===curComponent.type"
icon=
"el-icon-link"
@
click
.
native=
"linkageSetting"
>
{{
$t
(
'panel.linkage_setting'
)
}}
</el-dropdown-item>
<el-dropdown-item
v-if=
"'de-tabs'===curComponent.type"
icon=
"el-icon-link"
@
click
.
native=
"addTab"
>
新增Tab
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</div>
</div>
...
@@ -137,6 +138,9 @@ export default {
...
@@ -137,6 +138,9 @@ export default {
getViewLinkageGather
(
requestInfo
).
then
(
rsp
=>
{
getViewLinkageGather
(
requestInfo
).
then
(
rsp
=>
{
this
.
$store
.
commit
(
'setLinkageInfo'
,
rsp
.
data
)
this
.
$store
.
commit
(
'setLinkageInfo'
,
rsp
.
data
)
})
})
},
addTab
()
{
bus
.
$emit
(
'add-new-tab'
)
}
}
}
}
}
}
...
...
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
7dac4702
...
@@ -630,7 +630,7 @@ export default {
...
@@ -630,7 +630,7 @@ export default {
this
.
$refs
.
wrapperChild
[
index
].
openChartDetailsDialog
()
this
.
$refs
.
wrapperChild
[
index
].
openChartDetailsDialog
()
},
},
resizestop
(
index
,
item
)
{
resizestop
(
index
,
item
)
{
if
(
item
.
type
===
'view'
)
{
if
(
item
.
type
===
'view'
||
item
.
type
===
'de-tabs'
)
{
this
.
$refs
.
wrapperChild
[
index
].
chartResize
()
this
.
$refs
.
wrapperChild
[
index
].
chartResize
()
}
}
}
}
...
...
frontend/src/components/canvas/custom-component/component-list.js
浏览文件 @
7dac4702
...
@@ -162,6 +162,13 @@ const list = [
...
@@ -162,6 +162,13 @@ const list = [
borderColor
:
'#000000'
,
borderColor
:
'#000000'
,
backgroundColor
:
'#ffffff'
,
backgroundColor
:
'#ffffff'
,
borderRadius
:
0
borderRadius
:
0
},
options
:
{
tabList
:
[{
title
:
'Tab1'
,
name
:
'1'
,
content
:
null
}]
}
}
},
},
{
{
...
...
frontend/src/components/widget/DeWidget/DeTabs.vue
浏览文件 @
7dac4702
<
template
>
<
template
>
<div>
<div
class=
"de-tabs-div"
>
<el-tabs
v-model=
"
editableTabsValue"
type=
"card"
addable
@
edit=
"handleTabsEdit
"
>
<el-tabs
v-model=
"
activeTabName"
type=
"card"
class=
"de-tabs
"
>
<el-tab-pane
<el-tab-pane
v-for=
"(item, index) in tabList"
v-for=
"(item, index) in tabList"
:key=
"item.name+index"
:key=
"item.name+index"
:lazy=
"true"
:name=
"item.name"
:name=
"item.name"
>
>
<span
slot=
"label"
>
<span>
{{
item
.
title
}}
</span>
<el-dropdown
slot=
"label"
:disabled=
"!isEdit
"
class=
"de-tab-drop"
trigger=
"click"
@
command=
"handleCommand"
>
<el-dropdown
v-if=
"isEdit"
slot=
"label
"
class=
"de-tab-drop"
trigger=
"click"
@
command=
"handleCommand"
>
<span
class=
"el-dropdown-link"
>
<span
class=
"el-dropdown-link"
>
<span>
{{
item
.
title
}}
</span
>
<!--
<span>
{{
item
.
title
}}
</span>
--
>
<i
v-if=
"isEdit"
class=
"de-tab-i el-icon-arrow-down el-icon--right"
/>
<i
v-if=
"isEdit"
class=
"de-tab-i el-icon-arrow-down el-icon--right"
/>
</span>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"beforeHandleCommond('editTitle', item)"
>
<el-dropdown-item
:command=
"beforeHandleCommond('editTitle', item)"
>
编辑标题
编辑标题
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeHandleCommond('selectView', item)"
>
<el-dropdown-item
:command=
"beforeHandleCommond('selectView', item)"
>
选择视图
选择视图
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeHandleCommond('deleteCur', item)"
>
<el-dropdown-item
v-if=
"tabList.length > 1"
:command=
"beforeHandleCommond('deleteCur', item)"
>
删除
删除
</el-dropdown-item>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
</span>
<div
class=
"de-tab-content"
>
<div
class=
"de-tab-content"
>
<user-view
v-if=
"item.
viewInfo"
:element=
"item.viewInfo
"
/>
<user-view
v-if=
"item.
content"
:ref=
"item.name"
:element=
"item.content"
:out-style=
"outStyle
"
/>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
...
@@ -82,7 +86,9 @@
...
@@ -82,7 +86,9 @@
import
ViewSelect
from
'@/views/panel/ViewSelect'
import
ViewSelect
from
'@/views/panel/ViewSelect'
import
{
uuid
}
from
'vue-uuid'
import
{
uuid
}
from
'vue-uuid'
import
bus
from
'@/utils/bus'
import
componentList
from
'@/components/canvas/custom-component/component-list'
import
componentList
from
'@/components/canvas/custom-component/component-list'
export
default
{
export
default
{
name
:
'DeTabls'
,
name
:
'DeTabls'
,
components
:
{
ViewSelect
},
components
:
{
ViewSelect
},
...
@@ -90,31 +96,37 @@ export default {
...
@@ -90,31 +96,37 @@ export default {
element
:
{
element
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
},
isEdit
:
{
type
:
Boolean
,
default
:
true
},
outStyle
:
{
type
:
Object
,
required
:
false
,
default
:
function
()
{
return
{}
}
}
}
},
},
data
()
{
data
()
{
return
{
return
{
editableTabsValue
:
'1'
,
activeTabName
:
null
,
editableTabs
:
[{
title
:
'Tab 1'
,
name
:
'1'
,
content
:
''
}],
tabIndex
:
1
,
tabIndex
:
1
,
isEdit
:
true
,
//
isEdit: true,
dialogVisible
:
false
,
dialogVisible
:
false
,
textarea
:
''
,
textarea
:
''
,
curItem
:
null
,
curItem
:
null
,
viewDialogVisible
:
false
,
viewDialogVisible
:
false
,
curViewInfo
:
null
,
tabList
:
[]
tabList
:
[],
options
:
null
}
}
},
},
created
()
{
created
()
{
this
.
options
=
this
.
element
.
options
bus
.
$on
(
'add-new-tab'
,
this
.
addNewTab
)
this
.
tabList
=
this
.
options
&&
this
.
options
.
tabList
||
this
.
editableTabs
this
.
tabList
=
this
.
element
.
options
&&
this
.
element
.
options
.
tabList
this
.
activeTabName
=
this
.
tabList
[
0
].
name
},
},
methods
:
{
methods
:
{
beforeHandleCommond
(
item
,
param
)
{
beforeHandleCommond
(
item
,
param
)
{
...
@@ -136,6 +148,11 @@ export default {
...
@@ -136,6 +148,11 @@ export default {
break
break
}
}
},
},
selectView
(
param
)
{
this
.
activeTabName
=
param
.
name
this
.
curItem
=
param
this
.
viewDialogVisible
=
true
},
sureViewSelector
()
{
sureViewSelector
()
{
const
nodes
=
this
.
$refs
.
viewSelect
.
getCurrentSelected
()
const
nodes
=
this
.
$refs
.
viewSelect
.
getCurrentSelected
()
const
node
=
nodes
[
0
]
const
node
=
nodes
[
0
]
...
@@ -162,12 +179,20 @@ export default {
...
@@ -162,12 +179,20 @@ export default {
component
.
id
=
newComponentId
component
.
id
=
newComponentId
component
.
style
.
width
=
'100%'
component
.
style
.
width
=
'100%'
component
.
style
.
height
=
'100%'
component
.
style
.
height
=
'100%'
this
.
curItem
.
viewInfo
=
component
this
.
curItem
.
content
=
component
this
.
curItem
.
name
=
newComponentId
this
.
curItem
.
name
=
newComponentId
this
.
viewDialogVisible
=
false
this
.
viewDialogVisible
=
false
this
.
activeTabName
=
newComponentId
this
.
styleChange
()
// this.setComponentInfo()
},
setComponentInfo
()
{
console
.
log
(
'aaa'
)
},
},
editCurTitle
(
param
)
{
editCurTitle
(
param
)
{
this
.
activeTabName
=
param
.
name
this
.
curItem
=
param
this
.
curItem
=
param
this
.
textarea
=
param
.
title
this
.
textarea
=
param
.
title
this
.
dialogVisible
=
true
this
.
dialogVisible
=
true
...
@@ -175,48 +200,57 @@ export default {
...
@@ -175,48 +200,57 @@ export default {
sureCurTitle
()
{
sureCurTitle
()
{
this
.
curItem
.
title
=
this
.
textarea
this
.
curItem
.
title
=
this
.
textarea
this
.
dialogVisible
=
false
this
.
dialogVisible
=
false
this
.
styleChange
()
},
},
deleteCur
(
param
)
{
deleteCur
(
param
)
{
},
selectView
(
param
)
{
this
.
curItem
=
param
this
.
curItem
=
param
this
.
viewDialogVisible
=
true
let
len
=
this
.
element
.
options
.
tabList
.
length
},
while
(
len
--
)
{
if
(
this
.
element
.
options
.
tabList
[
len
].
name
===
param
.
name
)
{
handleTabsEdit
(
targetName
,
action
)
{
this
.
element
.
options
.
tabList
.
splice
(
len
,
1
)
if
(
action
===
'add'
)
{
this
.
tabList
=
this
.
element
.
options
.
tabList
const
newTabName
=
++
this
.
tabIndex
+
''
const
activIndex
=
(
len
-
1
+
this
.
element
.
options
.
tabList
.
length
)
%
this
.
element
.
options
.
tabList
.
length
this
.
editableTabs
.
push
({
this
.
activeTabName
=
this
.
element
.
options
.
tabList
[
activIndex
].
name
title
:
'New Tab'
,
name
:
newTabName
,
content
:
'New Tab content'
})
this
.
editableTabsValue
=
newTabName
}
if
(
action
===
'remove'
)
{
const
tabs
=
this
.
editableTabs
let
activeName
=
this
.
editableTabsValue
if
(
activeName
===
targetName
)
{
tabs
.
forEach
((
tab
,
index
)
=>
{
if
(
tab
.
name
===
targetName
)
{
const
nextTab
=
tabs
[
index
+
1
]
||
tabs
[
index
-
1
]
if
(
nextTab
)
{
activeName
=
nextTab
.
name
}
}
})
}
}
}
this
.
styleChange
()
},
this
.
editableTabsValue
=
activeName
addNewTab
()
{
this
.
editableTabs
=
tabs
.
filter
(
tab
=>
tab
.
name
!==
targetName
)
const
curName
=
uuid
.
v1
()
const
tab
=
{
title
:
'NewTab'
,
name
:
curName
,
content
:
null
}
}
this
.
element
.
options
.
tabList
.
push
(
tab
)
this
.
tabList
=
this
.
element
.
options
.
tabList
this
.
styleChange
()
},
styleChange
()
{
this
.
$store
.
state
.
styleChangeTimes
++
},
chartResize
()
{
// this.$refs[this.activeTabName]
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.de-tabs-div
{
height
:
100%
;
}
.de-tabs
{
height
:
100%
;
>>>
div
.el-tabs__content
{
height
:
calc
(
100%
-
55px
);
.el-tab-pane
{
height
:
100%
;
}
}
}
.de-tab-i
{
.de-tab-i
{
transition
:
0
.3s
;
transition
:
0
.3s
;
opacity
:
0
;
opacity
:
0
;
...
@@ -228,8 +262,8 @@ export default {
...
@@ -228,8 +262,8 @@ export default {
transform
:
translateY
(
0
);
transform
:
translateY
(
0
);
}
}
.de-tab-content
{
.de-tab-content
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论