Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xulili
ybf
Commits
35d0e243
Commit
35d0e243
authored
Jan 08, 2020
by
xd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://114.67.93.201/xulili/ybf
parents
534694f7
d8c7420a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
296 additions
and
209 deletions
+296
-209
index.css
ybf_admin/src/assets/elementYbf02/theme/index.css
+2
-1
index.vue
ybf_admin/src/layout/header-aside/components/tabs/index.vue
+120
-119
index.vue
ybf_admin/src/pages/task/bar/index.vue
+171
-87
index.vue
ybf_admin/src/pages/task/main/index.vue
+3
-2
No files found.
ybf_admin/src/assets/elementYbf02/theme/index.css
View file @
35d0e243
...
...
@@ -4861,10 +4861,11 @@
display
:
inline-block
}
/* Z-Style-tabs */
.el-tabs__header
{
padding
:
0
;
position
:
relative
;
margin
:
0
0
15
px
margin
:
0
0
0
px
}
.el-tabs__active-bar
{
...
...
ybf_admin/src/layout/header-aside/components/tabs/index.vue
View file @
35d0e243
...
...
@@ -59,130 +59,131 @@
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
'vuex'
import
Sortable
from
'sortablejs'
export
default
{
components
:
{
D2Contextmenu
:
()
=>
import
(
'../contextmenu'
),
D2ContextmenuList
:
()
=>
import
(
'../contextmenu/components/contentmenuList'
)
},
data
()
{
return
{
contextmenuFlag
:
false
,
contentmenuX
:
0
,
contentmenuY
:
0
,
contextmenuListIndex
:
[
{
icon
:
'times-circle'
,
title
:
'关闭全部'
,
value
:
'all'
}
],
contextmenuList
:
[
{
icon
:
'arrow-left'
,
title
:
'关闭左侧'
,
value
:
'left'
},
{
icon
:
'arrow-right'
,
title
:
'关闭右侧'
,
value
:
'right'
},
{
icon
:
'times'
,
title
:
'关闭其它'
,
value
:
'other'
},
{
icon
:
'times-circle'
,
title
:
'关闭全部'
,
value
:
'all'
}
],
tagName
:
'/index'
}
},
computed
:
{
...
mapState
(
'd2admin/page'
,
[
'opened'
,
'current'
])
},
methods
:
{
...
mapActions
(
'd2admin/page'
,
[
'close'
,
'closeLeft'
,
'closeRight'
,
'closeOther'
,
'closeAll'
,
'openedSort'
]),
/**
* @description 右键菜单功能点击
*/
handleContextmenu
(
event
)
{
let
target
=
event
.
target
// 解决 https://github.com/d2-projects/d2-admin/issues/54
let
flag
=
false
if
(
target
.
className
.
indexOf
(
'el-tabs__item'
)
>
-
1
)
flag
=
true
else
if
(
target
.
parentNode
.
className
.
indexOf
(
'el-tabs__item'
)
>
-
1
)
{
target
=
target
.
parentNode
flag
=
true
}
if
(
flag
)
{
event
.
preventDefault
()
event
.
stopPropagation
()
this
.
contentmenuX
=
event
.
clientX
this
.
contentmenuY
=
event
.
clientY
this
.
tagName
=
target
.
getAttribute
(
'aria-controls'
).
slice
(
5
)
this
.
contextmenuFlag
=
true
}
},
/**
* @description 右键菜单的row-click事件
*/
contextmenuClick
(
command
)
{
this
.
handleControlItemClick
(
command
,
this
.
tagName
)
import
{
mapState
,
mapActions
}
from
'vuex'
import
Sortable
from
'sortablejs'
export
default
{
components
:
{
D2Contextmenu
:
()
=>
import
(
'../contextmenu'
),
D2ContextmenuList
:
()
=>
import
(
'../contextmenu/components/contentmenuList'
)
},
/**
* @description 接收点击关闭控制上选项的事件
*/
handleControlItemClick
(
command
,
tagName
=
null
)
{
if
(
tagName
)
{
this
.
contextmenuFlag
=
false
}
const
params
=
{
pageSelect
:
tagName
}
switch
(
command
)
{
case
'left'
:
this
.
closeLeft
(
params
)
break
case
'right'
:
this
.
closeRight
(
params
)
break
case
'other'
:
this
.
closeOther
(
params
)
break
case
'all'
:
this
.
closeAll
()
break
default
:
this
.
$message
.
error
(
'无效的操作'
)
break
data
()
{
return
{
contextmenuFlag
:
false
,
contentmenuX
:
0
,
contentmenuY
:
0
,
contextmenuListIndex
:
[
{
icon
:
'times-circle'
,
title
:
'关闭全部'
,
value
:
'all'
}
],
contextmenuList
:
[
{
icon
:
'arrow-left'
,
title
:
'关闭左侧'
,
value
:
'left'
},
{
icon
:
'arrow-right'
,
title
:
'关闭右侧'
,
value
:
'right'
},
{
icon
:
'times'
,
title
:
'关闭其它'
,
value
:
'other'
},
{
icon
:
'times-circle'
,
title
:
'关闭全部'
,
value
:
'all'
}
],
tagName
:
'/index'
}
},
/**
* @description 接收点击 tab 标签的事件
*/
handleClick
(
tab
,
event
)
{
// 找到点击的页面在 tag 列表里是哪个
const
page
=
this
.
opened
.
find
(
page
=>
page
.
fullPath
===
tab
.
name
)
const
{
name
,
params
,
query
}
=
page
if
(
page
)
{
this
.
$router
.
push
({
name
,
params
,
query
})
}
computed
:
{
...
mapState
(
'd2admin/page'
,
[
'opened'
,
'current'
])
},
/**
* @description 点击 tab 上的删除按钮触发这里 首页的删除按钮已经隐藏 因此这里不用判断是 index
*/
handleTabsEdit
(
tagName
,
action
)
{
if
(
action
===
'remove'
)
{
this
.
close
({
tagName
})
methods
:
{
...
mapActions
(
'd2admin/page'
,
[
'close'
,
'closeLeft'
,
'closeRight'
,
'closeOther'
,
'closeAll'
,
'openedSort'
]),
/**
* @description 右键菜单功能点击
*/
handleContextmenu
(
event
)
{
let
target
=
event
.
target
// 解决 https://github.com/d2-projects/d2-admin/issues/54
let
flag
=
false
if
(
target
.
className
.
indexOf
(
'el-tabs__item'
)
>
-
1
)
flag
=
true
else
if
(
target
.
parentNode
.
className
.
indexOf
(
'el-tabs__item'
)
>
-
1
)
{
target
=
target
.
parentNode
flag
=
true
}
if
(
flag
)
{
event
.
preventDefault
()
event
.
stopPropagation
()
this
.
contentmenuX
=
event
.
clientX
this
.
contentmenuY
=
event
.
clientY
this
.
tagName
=
target
.
getAttribute
(
'aria-controls'
).
slice
(
5
)
this
.
contextmenuFlag
=
true
}
},
/**
* @description 右键菜单的row-click事件
*/
contextmenuClick
(
command
)
{
this
.
handleControlItemClick
(
command
,
this
.
tagName
)
},
/**
* @description 接收点击关闭控制上选项的事件
*/
handleControlItemClick
(
command
,
tagName
=
null
)
{
if
(
tagName
)
{
this
.
contextmenuFlag
=
false
}
const
params
=
{
pageSelect
:
tagName
}
switch
(
command
)
{
case
'left'
:
this
.
closeLeft
(
params
)
break
case
'right'
:
this
.
closeRight
(
params
)
break
case
'other'
:
this
.
closeOther
(
params
)
break
case
'all'
:
this
.
closeAll
()
break
default
:
this
.
$message
.
error
(
'无效的操作'
)
break
}
},
/**
* @description 接收点击 tab 标签的事件
*/
handleClick
(
tab
,
event
)
{
// 找到点击的页面在 tag 列表里是哪个
const
page
=
this
.
opened
.
find
(
page
=>
page
.
fullPath
===
tab
.
name
)
const
{
name
,
params
,
query
}
=
page
if
(
page
)
{
this
.
$router
.
push
({
name
,
params
,
query
})
}
},
/**
* @description 点击 tab 上的删除按钮触发这里 首页的删除按钮已经隐藏 因此这里不用判断是 index
*/
handleTabsEdit
(
tagName
,
action
)
{
if
(
action
===
'remove'
)
{
this
.
close
({
tagName
})
}
}
},
mounted
()
{
const
el
=
document
.
querySelectorAll
(
'.d2-multiple-page-sort .el-tabs__nav'
)[
0
]
Sortable
.
create
(
el
,
{
onEnd
:
(
evt
)
=>
{
const
{
oldIndex
,
newIndex
}
=
evt
this
.
openedSort
({
oldIndex
,
newIndex
})
}
})
}
},
mounted
()
{
const
el
=
document
.
querySelectorAll
(
'.d2-multiple-page-sort .el-tabs__nav'
)[
0
]
Sortable
.
create
(
el
,
{
onEnd
:
(
evt
)
=>
{
const
{
oldIndex
,
newIndex
}
=
evt
this
.
openedSort
({
oldIndex
,
newIndex
})
}
})
}
}
</
script
>
ybf_admin/src/pages/task/bar/index.vue
View file @
35d0e243
This diff is collapsed.
Click to expand it.
ybf_admin/src/pages/task/main/index.vue
View file @
35d0e243
<
template
>
<!--
<d2-container
type=
"card"
>
-->
<el-card
class=
"box-card main"
>
<el-card
class=
"box-card main
s
"
>
<el-tabs
class=
"ztabs"
v-model=
"cache.nowMenu"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"柜组任务"
name=
"taskBar"
>
<task-bar
/>
...
...
@@ -37,7 +37,8 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.main
{
.mains
{
border
:
1px
solid
red
;
height
:
90vh
;
margin
:
10px
10px
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment