Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-home
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 5edd9e47
authored
May 18, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
ab6ed82c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
56 deletions
package-lock.json
src/api/modules/activity.js
src/store/modules/marketing.js
src/views/home/components/Marketing/MarketingLeft.vue
src/views/home/components/Marketing/components/GlsxCalendar/index.vue
src/views/home/components/Marketing/components/ScheduleCalendar/index.vue
src/views/home/marketing.vue
package-lock.json
View file @
5edd9e4
This diff is collapsed.
Click to expand it.
src/api/modules/activity.js
View file @
5edd9e4
...
...
@@ -48,10 +48,10 @@ const exportCustomer = params => {
})
}
// 营销日历列表
const
getCalendarList
Data
=
params
=>
{
const
getCalendarList
=
params
=>
{
params
.
method
=
'marketing.api.calendar.list'
return
http
({
url
:
'/rop-scrm-marketing/router'
,
url
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
...
...
@@ -65,5 +65,5 @@ export default {
createSuperMarketing
,
exportCustomer
,
listByPage
,
getCalendarList
Data
getCalendarList
}
src/store/modules/marketing.js
View file @
5edd9e4
...
...
@@ -52,8 +52,9 @@ export default {
commit
(
'SET_ACTIVITY_PEOJECT'
,
data
)
},
//营销日历列表
getCalendarList
(
conText
,
payload
){
apis
.
calendar
.
getCalendarListData
(
payload
).
then
(
res
=>
{
getCalendarListData
(
conText
,
payload
){
apis
.
activity
.
getCalendarList
(
payload
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
==
0
){
conText
.
commit
(
'SET_CALENDAR_DATA'
,
{
calendarData
:
res
.
data
})
}
...
...
src/views/home/components/Marketing/MarketingLeft.vue
View file @
5edd9e4
...
...
@@ -39,7 +39,7 @@
<div
class=
"theme-list"
>
<
template
v-for=
"(item, index) in themeList"
>
<div
class=
"theme-line scrm-c3 scrm-f12 flex"
:class=
"
{ select: item.hovering }" :key="index" @mouseenter="item.hovering = true" @mouseleave="item.hovering = false">
<div
class=
"scheme-text"
>
{{
index
+
1
}}
、
{{
item
.
t
ext
}}
</div>
<div
class=
"scheme-text"
>
{{
index
+
1
}}
、
{{
item
.
t
itle
}}
</div>
<div
class=
"flex txt-blue"
v-show=
"item.hovering"
>
<span
class=
"scrm-ml6"
>
引用
</span>
</div>
...
...
@@ -51,6 +51,7 @@
</template>
<
script
>
import
GlsxCalendar
from
'./components/GlsxCalendar'
import
{
mapState
}
from
'vuex'
export
default
{
components
:
{
GlsxCalendar
...
...
@@ -94,6 +95,27 @@ export default {
}
]
}
},
computed
:
{
...
mapState
({
calendarData
:
state
=>
state
.
marketing
.
calendarData
})
},
watch
:
{
calendarData
(
newVal
)
{
this
.
getThemeData
(
newVal
)
}
},
methods
:
{
getThemeData
(
data
)
{
this
.
themeList
=
data
.
map
(
item
=>
{
return
{
title
:
item
.
title
,
id
:
item
.
id
,
hovering
:
false
}
})
}
}
}
</
script
>
...
...
src/views/home/components/Marketing/components/GlsxCalendar/index.vue
View file @
5edd9e4
...
...
@@ -20,7 +20,7 @@
<ul
class=
"ul-day"
@
click=
"handleShowCalendar"
>
<li
class=
"li-day"
v-for=
"(item, index) in days"
:key=
"index"
:isThisMonth=
"item.isThisMonth"
>
{{
item
.
date
}}
<img
class=
"star-icon"
src=
"@/assets/star.png"
/>
<img
v-if=
"item.isStar"
class=
"star-icon"
src=
"@/assets/star.png"
/>
</li>
</ul>
</div>
...
...
@@ -28,6 +28,7 @@
</
template
>
<
script
>
import
{
mapState
}
from
'vuex'
export
default
{
name
:
'SimpleCalendar'
,
data
()
{
...
...
@@ -44,18 +45,37 @@ export default {
},
curretIndex
:
30
,
week
:
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
],
days
:
[]
days
:
[],
starList
:
[]
}
},
computed
:
{
...
mapState
({
calendarData
:
state
=>
state
.
marketing
.
calendarData
})
},
watch
:
{
calendarData
(
newVal
)
{
console
.
log
(
newVal
)
this
.
handleSelectCalendar
(
newVal
)
}
},
methods
:
{
handleShowCalendar
(){
handleSelectCalendar
(
data
)
{
this
.
starList
=
data
.
map
(
item
=>
{
let
dateArray
=
item
.
startTime
.
split
(
'/'
)
return
{
date
:
+
dateArray
[
2
],
month
:
dateArray
[
1
]
-
1
,
year
:
+
dateArray
[
0
]
}
})
this
.
createCalendar
(
this
.
current
.
year
,
this
.
current
.
month
)
},
handleShowCalendar
()
{
console
.
log
(
111
)
this
.
$parent
.
$parent
.
handleShowCalendar
()
},
handleClick
:
function
(
index
)
{
// console.log(item.year + '-' + item.month + '-' + item.date)
this
.
curretIndex
=
index
},
plusMonth
:
function
()
{
if
(
this
.
date
.
month
==
11
)
{
this
.
date
.
month
=
0
...
...
@@ -101,8 +121,8 @@ export default {
d
.
setDate
(
1
)
let
dayOfFirstDay
=
d
.
getDay
()
this
.
days
=
[]
for
(
let
i
=
0
;
i
<
42
;
i
++
)
{
let
i
=
0
for
(;
i
<
42
;
i
++
)
{
d
.
setDate
(
1
)
d
.
setMonth
(
month
)
d
.
setDate
(
i
-
dayOfFirstDay
+
1
)
...
...
@@ -132,7 +152,17 @@ export default {
}
this
.
days
.
push
(
date
)
// console.log(this.days)
}
}
if
(
i
==
42
)
this
.
selectStar
()
},
selectStar
()
{
let
{
days
,
starList
}
=
this
for
(
let
i
=
0
;
i
<
starList
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
days
.
length
;
j
++
)
{
if
(
starList
[
i
].
date
==
days
[
j
].
date
&&
starList
[
i
].
year
==
days
[
j
].
year
&&
starList
[
i
].
month
==
days
[
j
].
month
)
{
days
[
j
].
isStar
=
true
}
}
}
}
...
...
@@ -146,8 +176,6 @@ export default {
this
.
current
.
year
=
d
.
getFullYear
()
this
.
current
.
month
=
d
.
getMonth
()
this
.
current
.
date
=
d
.
getDate
()
this
.
createCalendar
(
this
.
current
.
year
,
this
.
current
.
month
)
}
}
</
script
>
...
...
@@ -265,6 +293,6 @@ export default {
position
:
absolute
;
top
:
17px
;
left
:
8px
;
height
:
8px
;
height
:
8px
;
}
</
style
>
src/views/home/components/Marketing/components/ScheduleCalendar/index.vue
View file @
5edd9e4
...
...
@@ -13,6 +13,7 @@
<
script
>
import
Calendar
from
'@toast-ui/calendar'
import
*
as
dayjs
from
'dayjs'
import
{
mapState
}
from
'vuex'
export
default
{
data
()
{
return
{
...
...
@@ -21,49 +22,40 @@ export default {
options
:
{
defaultView
:
'month'
,
calendars
:
[]
}
},
eventList
:
[]
}
},
computed
:
{
...
mapState
({
calendarData
:
state
=>
state
.
marketing
.
calendarData
})
},
mounted
()
{
let
container
=
this
.
$refs
.
calendar
this
.
calendar
=
new
Calendar
(
container
,
this
.
options
)
this
.
calendar
.
on
(
'clickEvent'
,
e
=>
{
console
.
log
(
e
)
//
console.log(e)
})
this
.
getCalendarData
()
this
.
getCalendarData
()
},
methods
:
{
getCalendarData
()
{
this
.
calendar
.
createEvents
([
{
id
:
'event1'
,
calendarId
:
'cal2'
,
title
:
'Weekly meeting'
,
start
:
'2023-05-07'
,
end
:
'2023-05-07'
},
{
id
:
'event2'
,
calendarId
:
'cal1'
,
title
:
'Lunch appointment'
,
start
:
'2023-05-08'
,
end
:
'2023-05-09'
},
{
id
:
'event3'
,
calendarId
:
'cal2'
,
title
:
'Vacation'
,
start
:
'2023-05-08'
,
end
:
'2023-05-10'
,
isAllday
:
true
,
category
:
'allday'
let
{
eventList
,
calendarData
,
calendar
,
currentDate
}
=
this
eventList
=
calendarData
.
map
(
item
=>
{
return
{
id
:
item
.
id
,
calendarId
:
item
.
id
,
title
:
item
.
title
,
start
:
item
.
startTime
.
replace
(
'/'
,
'-'
),
end
:
item
.
endTime
}
])
})
calendar
.
createEvents
(
eventList
)
this
.
currentDate
=
dayjs
(
this
.
calendar
.
getDate
()).
format
(
'YYYY年MM'
)
},
handlePrev
(
type
)
{
this
.
calendar
[
type
]()
this
.
getCalendarData
()
}
}
}
...
...
src/views/home/marketing.vue
View file @
5edd9e4
...
...
@@ -30,7 +30,7 @@
<marketing-right></marketing-right>
</div>
</div>
<div
v-
show
=
"showCalendar"
class=
"calendar-panel"
>
<div
v-
if
=
"showCalendar"
class=
"calendar-panel"
>
<schedule-calendar
ref=
"calendar"
></schedule-calendar>
</div>
</div>
...
...
@@ -41,6 +41,7 @@ import ScheduleCalendar from './components/Marketing/components/ScheduleCalendar
import
MarketingLeft
from
'./components/Marketing/MarketingLeft'
import
MarketingMiddle
from
'./components/Marketing/MarketingMiddle'
import
MarketingRight
from
'./components/Marketing/MarketingRight'
import
{
mapActions
}
from
'vuex'
export
default
{
components
:
{
MarketingLeft
,
...
...
@@ -54,19 +55,14 @@ export default {
}
},
mounted
()
{
this
.
getCalendarList
(
)
this
.
getCalendarList
Data
({}
)
},
methods
:
{
...
mapActions
({
getCalendarList
:
'marketing/getCalendarList
'
getCalendarList
Data
:
'marketing/getCalendarListData
'
}),
handleShowCalendar
()
{
this
.
showCalendar
=
!
this
.
showCalendar
console
.
log
(
this
.
$refs
.
calendar
.
$refs
.
full
.
calendar
)
let
calendar
=
this
.
$refs
.
calendar
.
$refs
.
full
.
calendar
.
render
console
.
log
(
calendar
)
calendar
()
this
.
showCalendar
=
true
},
goBack
()
{
this
.
$router
.
push
(
'/home/index'
)
...
...
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