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 222fed30
authored
Nov 25, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改预览
1 parent
ce7834d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
189 additions
and
110 deletions
src/views/task/addTask/components/preView.vue
src/views/task/addTask/index.vue
src/views/task/addTask/components/preView.vue
View file @
222fed3
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<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"
>
<
div
class=
"swiper-wrapper"
>
<
!--
<div
class=
"swiper-wrapper"
>
--
>
<div
<div
v-for=
"(item, index) in datebox"
v-for=
"(item, index) in datebox"
:key=
"index"
:key=
"index"
...
@@ -21,11 +21,15 @@
...
@@ -21,11 +21,15 @@
{{
item
.
activityTime
}}
{{
item
.
activityTime
}}
</div>
</div>
</div>
</div>
<
/div
>
<
!--
</div>
--
>
</div>
</div>
<!-- 任务列表 -->
<!-- 任务列表 -->
<div
class=
"basic-box-right-task"
>
<div
class=
"basic-box-right-task"
>
<div
v-if=
"datebox && datebox[dateActive].missionList.length"
>
<div
class=
"taskSwiper"
v-if=
"datebox && datebox[dateActive].missionList.length"
:id=
"'taskSwiper' + dateActive"
>
<div
<div
v-for=
"(itm, inx) in datebox[dateActive].missionList"
v-for=
"(itm, inx) in datebox[dateActive].missionList"
:key=
"inx"
:key=
"inx"
...
@@ -98,6 +102,7 @@
...
@@ -98,6 +102,7 @@
<
script
>
<
script
>
import
Swiper
from
'swiper'
import
Swiper
from
'swiper'
import
'swiper/dist/css/swiper.min.css'
export
default
{
export
default
{
props
:
{
props
:
{
dateList
:
{
dateList
:
{
...
@@ -112,49 +117,77 @@ export default {
...
@@ -112,49 +117,77 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
let
previewSwiper
=
new
Swiper
(
'.swiper-container'
,
{
this
.
scrollInit
()
grabCursor
:
true
,
this
.
scrollInitTask
(
'taskSwiper0'
)
// spaceBetween: 20,
mousewheel
:
true
,
// slidesPerView: 'auto',
observer
:
true
,
//修改swiper自己或子元素时,自动初始化
observeParents
:
true
,
//修改swiper的父元素时,自动初始化swiper
breakpoints
:
{
//当宽度小于等于1919
1440
:
{
slidesPerView
:
4
,
spaceBetween
:
20
,
},
2800
:
{
slidesPerView
:
5
,
spaceBetween
:
20
,
},
},
pagination
:
{
el
:
'.swiper-pagination'
,
type
:
'progressbar'
,
},
})
this
.
$nextTick
(()
=>
{
setTimeout
(
function
()
{
previewSwiper
.
slideTo
(
0
,
0
,
false
)
},
700
)
})
},
watch
:
{
datebox
:
{
handler
(
newVal
,
oldVa
)
{
console
.
log
(
val
,
'999999'
)
},
deep
:
true
,
},
},
},
methods
:
{
methods
:
{
// 预览选择任务日期
// 预览选择任务日期
clickDate
(
index
)
{
clickDate
(
index
)
{
console
.
log
(
index
)
console
.
log
(
index
)
this
.
dateActive
=
index
this
.
dateActive
=
index
console
.
log
(
dateActive
[
index
])
console
.
log
(
this
.
datebox
[
index
])
if
(
this
.
datebox
[
index
].
missionList
.
length
)
{
this
.
$nextTick
(()
=>
{
this
.
scrollInitTask
(
'taskSwiper'
+
index
)
})
}
},
scrollInit
()
{
const
nav
=
document
.
getElementById
(
'swiper'
)
var
flag
// 鼠标按下
var
downX
// 鼠标点击的x下标
var
scrollLeft
// 当前元素滚动条的偏移量
nav
.
addEventListener
(
'mousedown'
,
function
(
event
)
{
flag
=
true
downX
=
event
.
clientX
// 获取到点击的x下标
scrollLeft
=
this
.
scrollLeft
// 获取当前元素滚动条的偏移量
})
nav
.
addEventListener
(
'mousemove'
,
function
(
event
)
{
if
(
flag
)
{
// 判断是否是鼠标按下滚动元素区域
var
moveX
=
event
.
clientX
// 获取移动的x轴
var
scrollX
=
moveX
-
downX
// 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
this
.
scrollLeft
=
scrollLeft
-
scrollX
// 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
console
.
log
(
scrollX
)
}
})
// 鼠标抬起停止拖动
nav
.
addEventListener
(
'mouseup'
,
function
()
{
flag
=
false
})
// 鼠标离开元素停止拖动
nav
.
addEventListener
(
'mouseleave'
,
function
(
event
)
{
flag
=
false
})
},
scrollInitTask
(
id
)
{
console
.
log
(
id
)
const
nav
=
document
.
getElementById
(
id
)
var
flag
// 鼠标按下
var
downY
// 鼠标点击的x下标
var
scrollTop
// 当前元素滚动条的偏移量
nav
.
addEventListener
(
'mousedown'
,
function
(
event
)
{
flag
=
true
downY
=
event
.
clientY
// 获取到点击的x下标
scrollTop
=
this
.
scrollTop
// 获取当前元素滚动条的偏移量
})
nav
.
addEventListener
(
'mousemove'
,
function
(
event
)
{
if
(
flag
)
{
// 判断是否是鼠标按下滚动元素区域
var
moveY
=
event
.
clientY
// 获取移动的x轴
var
scrollY
=
moveY
-
downY
// 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
this
.
scrollTop
=
scrollTop
-
scrollY
// 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
console
.
log
(
scrollX
)
}
})
// 鼠标抬起停止拖动
nav
.
addEventListener
(
'mouseup'
,
function
()
{
flag
=
false
})
// 鼠标离开元素停止拖动
nav
.
addEventListener
(
'mouseleave'
,
function
(
event
)
{
flag
=
false
})
},
},
},
},
}
}
...
@@ -199,7 +232,7 @@ export default {
...
@@ -199,7 +232,7 @@ export default {
//
display
:
flex
;
//
display
:
flex
;
//
float
:
left
;
//
float
:
left
;
width
:
230px
;
width
:
230px
;
//
cursor
:
pointer
;
cursor
:
grab
;
//
overflow
:
auto
;
//
overflow
:
auto
;
text-align
:
center
;
text-align
:
center
;
.date-item
{
.date-item
{
...
@@ -210,6 +243,7 @@ export default {
...
@@ -210,6 +243,7 @@ export default {
background
:
#f7f8fa
;
background
:
#f7f8fa
;
border-radius
:
6px
;
border-radius
:
6px
;
align-items
:
center
;
align-items
:
center
;
flex-shrink
:
0
;
img
{
img
{
width
:
24px
;
width
:
24px
;
height
:
24px
;
height
:
24px
;
...
@@ -333,77 +367,93 @@ export default {
...
@@ -333,77 +367,93 @@ export default {
}
}
}
}
}
}
.swiper-container
{
.taskSwiper
{
height
:
193px
;
margin-top
:
auto
;
margin-bottom
:
auto
;
overflow
:
hidden
;
cursor
:
grab
;
}
#swiper
{
//
overflow-x
:
auto
;
//
overflow-y
:
hidden
;
margin-left
:
auto
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-right
:
auto
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
z-index
:
1
;
display
:
flex
;
}
}
#swiper
{
//
.swiper-container
{
//
padding
:
0
20px
;
//
margin-left
:
auto
;
.swiper-wrapper
{
//
margin-right
:
auto
;
margin-bottom
:
20px
;
//
//
position
:
relative
;
.swiper-slide
{
//
overflow
:
hidden
;
//
width
:
234px
;
//
z-index
:
1
;
//
}
//
#swiper
{
//
//
padding
:
0
20px
;
//
.swiper-wrapper
{
//
margin-bottom
:
20px
;
//
display
:
flex
;
//
.swiper-slide
{
//
//
width
:
234px
;
//
.marketItem-border
{
//
//
.marketItem-border
{
//
min-height
:
251px
;
//
//
min-height
:
251px
;
//
.peopleName
{
//
//
.peopleName
{
//
height
:
54px
;
//
//
height
:
54px
;
//
line-height
:
54px
;
//
//
line-height
:
54px
;
//
background
:
#f7f7fc
;
//
//
background
:
#f7f7fc
;
//
font-size
:
16px
;
//
//
font-size
:
16px
;
//
font-weight
:
600
;
//
//
font-weight
:
600
;
//
padding-left
:
16px
;
//
//
padding-left
:
16px
;
//
vertical-align
:
middle
;
//
//
vertical-align
:
middle
;
//
overflow
:
hidden
;
//
//
overflow
:
hidden
;
//
text-overflow
:
ellipsis
;
//
//
text-overflow
:
ellipsis
;
//
white-space
:
nowrap
;
//
//
white-space
:
nowrap
;
//
}
//
//
}
//
.itemBox
{
//
//
.itemBox
{
//
border-left
:
1px
solid
#ededf0
;
//
//
border-left
:
1px
solid
#ededf0
;
//
border-right
:
1px
solid
#ededf0
;
//
//
border-right
:
1px
solid
#ededf0
;
//
border-bottom
:
1px
solid
#ededf0
;
//
//
border-bottom
:
1px
solid
#ededf0
;
//
padding
:
0
16px
;
//
//
padding
:
0
16px
;
//
box-sizing
:
border-box
;
//
//
box-sizing
:
border-box
;
//
.peopleNum
{
//
//
.peopleNum
{
//
padding
:
24px
0
;
//
//
padding
:
24px
0
;
//
font-size
:
26px
;
//
//
font-size
:
26px
;
//
font-weight
:
600
;
//
//
font-weight
:
600
;
//
color
:
#333333
;
//
//
color
:
#333333
;
//
span
{
//
//
span
{
//
font-size
:
14px
;
//
//
font-size
:
14px
;
//
font-weight
:
400
;
//
//
font-weight
:
400
;
//
}
//
//
}
//
}
//
//
}
//
.peopledesc
{
//
//
.peopledesc
{
//
overflow
:
hidden
;
//
//
overflow
:
hidden
;
//
text-overflow
:
ellipsis
;
//
//
text-overflow
:
ellipsis
;
//
-webkit-line-clamp
:
2
;
//
//
-webkit-line-clamp
:
2
;
//
display
:
-webkit-box
;
//
//
display
:
-webkit-box
;
//
-webkit-box-orient
:
vertical
;
//
//
-webkit-box-orient
:
vertical
;
//
word-break
:
break-all
;
//
//
word-break
:
break-all
;
//
font-size
:
14px
;
//
//
font-size
:
14px
;
//
color
:
#999999
;
//
//
color
:
#999999
;
//
line-height
:
20px
;
//
//
line-height
:
20px
;
//
height
:
40px
;
//
//
height
:
40px
;
//
}
//
//
}
//
.createSOP
{
//
//
.createSOP
{
//
margin
:
24px
0
;
//
//
margin
:
24px
0
;
//
border-radius
:
4px
;
//
//
border-radius
:
4px
;
//
border
:
1px
solid
#5850ff
;
//
//
border
:
1px
solid
#5850ff
;
//
width
:
100%
;
//
//
width
:
100%
;
//
color
:
#5850ff
;
//
//
color
:
#5850ff
;
//
padding
:
9px
20px
;
//
//
padding
:
9px
20px
;
//
}
//
//
}
//
.isDisableSOP
{
//
//
.isDisableSOP
{
//
color
:
#c0bcff
;
//
//
color
:
#c0bcff
;
//
border
:
1px
solid
#c0bcff
;
//
//
border
:
1px
solid
#c0bcff
;
//
}
//
//
}
//
}
//
//
}
//
}
//
//
}
}
//
}
}
//
}
}
//
}
</
style
>
</
style
>
src/views/task/addTask/index.vue
View file @
222fed3
...
@@ -491,7 +491,20 @@ export default {
...
@@ -491,7 +491,20 @@ export default {
},
},
{
{
activityTime
:
'2022-11-26'
,
activityTime
:
'2022-11-26'
,
missionList
:
[],
missionList
:
[
{
missonType
:
1
,
missionName
:
'fdgsdg'
,
missonDesc
:
'大发噶地df方很多地方部分'
,
rewardScore
:
4
,
},
{
missonType
:
2
,
missionName
:
'fdgsdg'
,
missonDesc
:
'大发噶地方很多地方部分'
,
rewardScore
:
8
,
},
],
},
},
{
{
activityTime
:
'2022-11-27'
,
activityTime
:
'2022-11-27'
,
...
@@ -505,6 +518,22 @@ export default {
...
@@ -505,6 +518,22 @@ export default {
activityTime
:
'2022-11-29'
,
activityTime
:
'2022-11-29'
,
missionList
:
[],
missionList
:
[],
},
},
{
activityTime
:
'2022-11-30'
,
missionList
:
[],
},
{
activityTime
:
'2022-11-31'
,
missionList
:
[],
},
{
activityTime
:
'2022-11-32'
,
missionList
:
[],
},
{
activityTime
:
'2022-11-33'
,
missionList
:
[],
},
],
],
btnList
:
[
btnList
:
[
{
{
...
...
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