Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-custom
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 1da4c804
authored
Nov 12, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加eventbus
1 parent
9c58092b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
74 deletions
src/views/guestGroup/add.vue
src/views/guestGroup/components/preview.vue
src/views/guestGroup/components/ welcomeWords.vue → src/views/guestGroup/components/welcomeWords.vue
src/views/guestGroup/index.vue
src/views/guestGroup/add.vue
View file @
1da4c80
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
<div
class=
"info-content"
>
<div
class=
"info-content"
>
<el-form
:model=
"basicForm"
:rules=
"basicRules"
ref=
"basicForm"
label-width=
"120px"
>
<el-form
:model=
"basicForm"
:rules=
"basicRules"
ref=
"basicForm"
label-width=
"120px"
>
<el-form-item
label=
"组名"
prop=
"name"
>
<el-form-item
label=
"组名"
prop=
"name"
>
<el-input
v-model=
"basicForm.name"
placeholder=
"为群聊设置一个组名"
></el-input>
<el-input
v-model=
"basicForm.name"
placeholder=
"为群聊设置一个组名"
maxlength=
"10"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"群聊名称"
prop=
"groupName"
>
<el-form-item
label=
"群聊名称"
prop=
"groupName"
>
<el-input
v-model=
"basicForm.groupName"
placeholder=
"设置群聊名称前缀,如新车售后一组"
></el-input>
<el-input
v-model=
"basicForm.groupName"
placeholder=
"设置群聊名称前缀,如新车售后一组"
maxlength=
"10"
></el-input>
<div
class=
"form-tips"
>
群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”
</div>
<div
class=
"form-tips"
>
群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"默认成员"
prop=
"groupName"
>
<el-form-item
label=
"默认成员"
prop=
"groupName"
>
...
@@ -26,11 +26,11 @@
...
@@ -26,11 +26,11 @@
<!-- 编辑入群欢迎语 -->
<!-- 编辑入群欢迎语 -->
<div
class=
"title"
>
编辑入群欢迎语
</div>
<div
class=
"title"
>
编辑入群欢迎语
</div>
<div>
<div>
<WelcomeWords></WelcomeWords>
<WelcomeWords
:eventBus=
"eventBus"
></WelcomeWords>
</div>
</div>
</div>
</div>
<div
class=
"preview"
>
<div
class=
"preview"
>
<Preview></Preview>
<Preview
:eventBus=
"eventBus"
></Preview>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -52,7 +52,8 @@
...
@@ -52,7 +52,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
WelcomeWords
from
'./components/ welcomeWords.vue'
import
Vue
from
'vue'
import
WelcomeWords
from
'./components/welcomeWords.vue'
import
SelectMembers
from
'./components/selectMembers.vue'
import
SelectMembers
from
'./components/selectMembers.vue'
import
Preview
from
'./components/preview.vue'
import
Preview
from
'./components/preview.vue'
export
default
{
export
default
{
...
@@ -63,6 +64,7 @@ export default {
...
@@ -63,6 +64,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
eventBus
:
new
Vue
(),
basicForm
:
{},
basicForm
:
{},
basicRules
:
{
basicRules
:
{
name
:
[{
required
:
true
,
message
:
'请输入组名'
,
trigger
:
'blur'
}],
name
:
[{
required
:
true
,
message
:
'请输入组名'
,
trigger
:
'blur'
}],
...
...
src/views/guestGroup/components/preview.vue
View file @
1da4c80
...
@@ -33,57 +33,59 @@
...
@@ -33,57 +33,59 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'Preview'
,
name
:
'Preview'
,
props
:
{
eventBus
:
Object
},
data
()
{
data
()
{
return
{
return
{
previewList
:
[
previewList
:
[],
{
// previewList: [
id
:
1
,
// {
type
:
'text'
,
// id: 1,
content
:
'fasf'
// type: 'text',
},
// content: 'fasf'
{
// },
id
:
2
,
// {
type
:
'link'
,
// id: 2,
url
:
'https://baidu.comdfasdfasdfa'
// type: 'link',
},
// url: 'https://baidu.comdfasdfasdfa'
{
// },
id
:
3
,
// {
type
:
'img'
,
// id: 3,
url
:
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F945cad7c7105d352aa3c513c94846bb0c2f1a61342067-OWFZcE_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1639018450&t=a60f5defc48c980674edcf9a8d5981df'
// type: 'img',
},
// url: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F945cad7c7105d352aa3c513c94846bb0c2f1a61342067-OWFZcE_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1639018450&t=a60f5defc48c980674edcf9a8d5981df'
{
// },
id
:
4
,
// {
type
:
'applet'
,
// id: 4,
appleIcon
:
'../../../assets/logo.png'
,
// type: 'applet',
title
:
'我的智慧门店'
,
// appleIcon: '../../../assets/logo.png',
content
:
'我的智慧门店'
// title: '我的智慧门店',
},
// content: '我的智慧门店'
{
// },
id
:
5
,
// {
type
:
'text'
,
// id: 5,
content
:
'fasf'
// type: 'text',
},
// content: 'fasf'
{
// },
id
:
6
,
// {
type
:
'text'
,
// id: 6,
content
:
'fasf'
// type: 'text',
},
// content: 'fasf'
{
// },
id
:
7
,
// {
type
:
'text'
,
// id: 7,
content
:
'fasf'
// type: 'text',
},
// content: 'fasf'
{
// },
id
:
8
,
// {
type
:
'text'
,
// id: 8,
content
:
'fasf'
// type: 'text',
},
// content: 'fasf'
{
// },
id
:
9
,
// {
type
:
'text'
,
// id: 9,
content
:
'fasf'
// type: 'text',
}
// content: 'fasf'
],
// }
// ],
currentTime
:
''
currentTime
:
''
}
}
},
},
...
@@ -94,6 +96,10 @@ export default {
...
@@ -94,6 +96,10 @@ export default {
let
minutes
=
date
.
getMinutes
()
let
minutes
=
date
.
getMinutes
()
minutes
=
minutes
<
10
?
`0
${
minutes
}
`
:
minutes
minutes
=
minutes
<
10
?
`0
${
minutes
}
`
:
minutes
this
.
currentTime
=
`
${
date
.
getFullYear
()}
年
${
date
.
getMonth
()
+
1
}
月
${
date
.
getDate
()}
日
${
hours
}
:
${
minutes
}
`
this
.
currentTime
=
`
${
date
.
getFullYear
()}
年
${
date
.
getMonth
()
+
1
}
月
${
date
.
getDate
()}
日
${
hours
}
:
${
minutes
}
`
this
.
eventBus
.
$on
(
'update'
,
val
=>
{
console
.
log
(
val
)
this
.
previewList
=
val
})
}
}
}
}
</
script
>
</
script
>
...
...
src/views/guestGroup/components/
welcomeWords.vue
→
src/views/guestGroup/components/welcomeWords.vue
View file @
1da4c80
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'WelcomeWords'
,
name
:
'WelcomeWords'
,
props
:
{
eventBus
:
Object
},
data
()
{
data
()
{
return
{
return
{
btnList
:
[
btnList
:
[
...
@@ -169,6 +170,9 @@ export default {
...
@@ -169,6 +170,9 @@ export default {
]
]
}
}
},
},
mounted
()
{
this
.
eventBus
.
$emit
(
'update'
,
this
.
previewList
)
},
methods
:
{
methods
:
{
handleImgChange
(
e
,
targetItem
)
{
handleImgChange
(
e
,
targetItem
)
{
console
.
log
(
e
,
targetItem
)
console
.
log
(
e
,
targetItem
)
...
@@ -242,7 +246,7 @@ export default {
...
@@ -242,7 +246,7 @@ export default {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.welcome-box
{
.welcome-box
{
padding
:
20px
0
;
padding
-top
:
20px
;
margin-left
:
87px
;
margin-left
:
87px
;
}
}
.content
{
.content
{
...
...
src/views/guestGroup/index.vue
View file @
1da4c80
...
@@ -22,11 +22,9 @@
...
@@ -22,11 +22,9 @@
<span
class=
"statusText"
:class=
"
{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">
{{
statusText
(
scope
.
scope
.
status
)
}}
</span>
<span
class=
"statusText"
:class=
"
{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">
{{
statusText
(
scope
.
scope
.
status
)
}}
</span>
</span>
</span>
<div
class=
"table-btns"
slot=
"optionBtns"
slot-scope=
"scope"
>
<div
class=
"table-btns"
slot=
"optionBtns"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleEdit(scope.scope)"
>
修改
</el-button>
<el-button
type=
"text"
@
click=
"btnClick('edit', scope.scope)"
>
修改
</el-button>
<el-button
type=
"text"
@
click=
"btnClick('status', scope.scope)"
>
{{
scope
.
scope
.
status
==
1
?
'停用'
:
'启用'
}}
</el-button>
</div>
</div>
<template
slot=
"otherOptions"
slot-scope=
"scope"
>
<el-switch
:size=
"size"
slot=
"reference"
v-model=
"scope.scope.status"
active-value=
"1"
inactive-value=
"2"
@
change=
"e => handleSwitchChange(e, scope.scope)"
></el-switch>
</
template
>
</GLTable>
</GLTable>
<!-- 表格区域 end -->
<!-- 表格区域 end -->
</div>
</div>
...
@@ -84,19 +82,13 @@ export default {
...
@@ -84,19 +82,13 @@ export default {
width
:
'140px'
,
width
:
'140px'
,
addHtml
:
'optionBtns'
,
addHtml
:
'optionBtns'
,
fixed
:
'right'
fixed
:
'right'
},
{
label
:
'启用开关'
,
prop
:
'optionBtns'
,
width
:
'80px'
,
addHtml
:
'otherOptions'
,
fixed
:
'right'
}
}
]
]
},
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
tableData
:
[
tableData
:
[
{
{
id
:
1
,
orgName
:
'守候专用服务一组'
,
orgName
:
'守候专用服务一组'
,
createdTime
:
'2021-11-05'
,
createdTime
:
'2021-11-05'
,
status
:
'1'
,
status
:
'1'
,
...
@@ -154,6 +146,7 @@ export default {
...
@@ -154,6 +146,7 @@ export default {
]
]
},
},
{
{
id
:
2
,
orgName
:
'守候专用服务er组'
,
orgName
:
'守候专用服务er组'
,
createdTime
:
'2021-11-05'
,
createdTime
:
'2021-11-05'
,
status
:
'2'
,
status
:
'2'
,
...
@@ -189,21 +182,40 @@ export default {
...
@@ -189,21 +182,40 @@ export default {
console
.
log
(
this
.
searchForm
)
console
.
log
(
this
.
searchForm
)
// this.$refs.gueastGroup.refreshTable()
// this.$refs.gueastGroup.refreshTable()
},
},
// 启用开关
handleSwitchChange
(
e
,
scope
)
{
console
.
log
(
e
,
scope
)
},
statusText
(
val
)
{
statusText
(
val
)
{
console
.
log
(
val
)
console
.
log
(
val
)
return
val
===
'1'
?
'启用'
:
val
===
'2'
?
'停用'
:
'
'
return
val
===
'1'
?
'启用'
:
'停用
'
},
},
btnClick
(
name
)
{
btnClick
(
name
,
rowData
)
{
console
.
log
(
name
)
console
.
log
(
name
)
const
id
=
1
switch
(
name
)
{
switch
(
name
)
{
case
'create'
:
case
'create'
:
this
.
$router
.
push
(
'/guestGroup/add/'
+
id
)
this
.
$router
.
push
(
'/guestGroup/add/'
+
1
)
break
case
'edit'
:
this
.
$router
.
push
(
'/guestGroup/add/'
+
rowData
.
id
)
break
case
'status'
:
this
.
$confirm
(
`是否确认
${
rowData
.
status
==
1
?
'启用'
:
'停用'
}
?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功!'
})
})
.
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消操作'
})
})
break
break
default
:
console
.
log
(
'gaocuole'
)
}
}
}
}
}
}
...
...
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