Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-task
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 28663662
authored
Nov 29, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
73b85aa0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
src/views/task/addTask/components/preView.vue
src/views/task/addTask/index.vue
src/views/task/addTask/components/preView.vue
View file @
2866366
...
@@ -5,7 +5,11 @@
...
@@ -5,7 +5,11 @@
<div
class=
"preview"
>
预览:
</div>
<div
class=
"preview"
>
预览:
</div>
<img
src=
"../../../../assets/view.png"
alt=
""
/>
<img
src=
"../../../../assets/view.png"
alt=
""
/>
<!-- 任务日期 -->
<!-- 任务日期 -->
<div
class=
"basic-box-right-date swiper-container"
id=
"swiper"
>
<div
class=
"basic-box-right-date swiper-container"
id=
"swiper"
v-if=
"datebox.length"
>
<!--
<div
class=
"swiper-wrapper"
>
-->
<!--
<div
class=
"swiper-wrapper"
>
-->
<div
<div
v-for=
"(item, index) in datebox"
v-for=
"(item, index) in datebox"
...
@@ -24,7 +28,7 @@
...
@@ -24,7 +28,7 @@
<!--
</div>
-->
<!--
</div>
-->
</div>
</div>
<!-- 任务列表 -->
<!-- 任务列表 -->
<div
class=
"basic-box-right-task"
>
<div
class=
"basic-box-right-task"
v-if=
"datebox.length"
>
<div
<div
class=
"taskSwiper"
class=
"taskSwiper"
v-if=
"datebox && datebox[dateActive].missionList.length"
v-if=
"datebox && datebox[dateActive].missionList.length"
...
@@ -92,7 +96,7 @@
...
@@ -92,7 +96,7 @@
<div
v-else
>
暂无数据
</div>
<div
v-else
>
暂无数据
</div>
</div>
</div>
<!-- 刷新 -->
<!-- 刷新 -->
<div
class=
"shua"
>
<div
class=
"shua"
@
click=
"refresh"
>
<img
src=
"../../../../assets/shua.png"
alt=
""
/>
<img
src=
"../../../../assets/shua.png"
alt=
""
/>
刷新
刷新
</div>
</div>
...
@@ -101,8 +105,6 @@
...
@@ -101,8 +105,6 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
Swiper
from
'swiper'
import
'swiper/dist/css/swiper.min.css'
export
default
{
export
default
{
props
:
{
props
:
{
dateList
:
{
dateList
:
{
...
@@ -112,20 +114,30 @@ export default {
...
@@ -112,20 +114,30 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
datebox
:
this
.
dateList
,
datebox
:
[]
,
dateActive
:
0
,
dateActive
:
0
,
}
}
},
},
mounted
()
{
watch
:
{
this
.
scrollInit
()
datebox
:
{
this
.
scrollInitTask
(
'taskSwiper0'
)
handler
(
val
)
{},
},
},
},
mounted
()
{},
methods
:
{
methods
:
{
init
(
dateList
)
{
this
.
datebox
=
dateList
this
.
$nextTick
(()
=>
{
this
.
scrollInit
()
this
.
dateActive
=
0
if
(
dateList
[
0
].
missionList
.
length
)
{
this
.
scrollInitTask
(
'taskSwiper0'
)
}
})
},
// 预览选择任务日期
// 预览选择任务日期
clickDate
(
index
)
{
clickDate
(
index
)
{
console
.
log
(
index
)
this
.
dateActive
=
index
this
.
dateActive
=
index
console
.
log
(
this
.
datebox
[
index
])
if
(
this
.
datebox
[
index
].
missionList
.
length
)
{
if
(
this
.
datebox
[
index
].
missionList
.
length
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
scrollInitTask
(
'taskSwiper'
+
index
)
this
.
scrollInitTask
(
'taskSwiper'
+
index
)
...
@@ -148,7 +160,6 @@ export default {
...
@@ -148,7 +160,6 @@ export default {
var
moveX
=
event
.
clientX
// 获取移动的x轴
var
moveX
=
event
.
clientX
// 获取移动的x轴
var
scrollX
=
moveX
-
downX
// 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
var
scrollX
=
moveX
-
downX
// 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
this
.
scrollLeft
=
scrollLeft
-
scrollX
// 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
this
.
scrollLeft
=
scrollLeft
-
scrollX
// 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
console
.
log
(
scrollX
)
}
}
})
})
// 鼠标抬起停止拖动
// 鼠标抬起停止拖动
...
@@ -161,7 +172,6 @@ export default {
...
@@ -161,7 +172,6 @@ export default {
})
})
},
},
scrollInitTask
(
id
)
{
scrollInitTask
(
id
)
{
console
.
log
(
id
)
const
nav
=
document
.
getElementById
(
id
)
const
nav
=
document
.
getElementById
(
id
)
var
flag
// 鼠标按下
var
flag
// 鼠标按下
var
downY
// 鼠标点击的x下标
var
downY
// 鼠标点击的x下标
...
@@ -177,7 +187,6 @@ export default {
...
@@ -177,7 +187,6 @@ export default {
var
moveY
=
event
.
clientY
// 获取移动的x轴
var
moveY
=
event
.
clientY
// 获取移动的x轴
var
scrollY
=
moveY
-
downY
// 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
var
scrollY
=
moveY
-
downY
// 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
this
.
scrollTop
=
scrollTop
-
scrollY
// 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
this
.
scrollTop
=
scrollTop
-
scrollY
// 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
console
.
log
(
scrollX
)
}
}
})
})
// 鼠标抬起停止拖动
// 鼠标抬起停止拖动
...
@@ -189,6 +198,9 @@ export default {
...
@@ -189,6 +198,9 @@ export default {
flag
=
false
flag
=
false
})
})
},
},
refresh
()
{
this
.
$emit
(
'refresh'
)
},
},
},
}
}
</
script
>
</
script
>
...
@@ -218,6 +230,7 @@ export default {
...
@@ -218,6 +230,7 @@ export default {
font-weight
:
400
;
font-weight
:
400
;
font-size
:
14px
;
font-size
:
14px
;
color
:
#409eff
;
color
:
#409eff
;
cursor
:
pointer
;
img
{
img
{
width
:
16px
;
width
:
16px
;
height
:
16px
;
height
:
16px
;
...
@@ -237,8 +250,8 @@ export default {
...
@@ -237,8 +250,8 @@ export default {
text-align
:
center
;
text-align
:
center
;
.date-item
{
.date-item
{
//
float
:
left
;
//
float
:
left
;
width
:
42
px
;
width
:
50
px
;
height
:
56
px
;
height
:
60
px
;
margin-left
:
6px
;
margin-left
:
6px
;
background
:
#f7f8fa
;
background
:
#f7f8fa
;
border-radius
:
6px
;
border-radius
:
6px
;
...
@@ -247,6 +260,7 @@ export default {
...
@@ -247,6 +260,7 @@ export default {
img
{
img
{
width
:
24px
;
width
:
24px
;
height
:
24px
;
height
:
24px
;
margin-top
:
8px
;
}
}
}
}
.date-item
:first-child
{
.date-item
:first-child
{
...
...
src/views/task/addTask/index.vue
View file @
2866366
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment