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 5acd95c0
authored
Nov 17, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交一客一群
1 parent
6d1f54ff
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
680 additions
and
248 deletions
src/api/modules/groupGuest.js
src/config/env.development.js
src/router/index.js
src/setup/single.js
src/views/guestGroup/add.vue
src/views/guestGroup/components/preview.vue
src/views/guestGroup/components/selectEmp.vue
src/views/guestGroup/components/selectMembers.vue
src/views/guestGroup/components/welcomeWords.vue
src/views/guestGroup/index.vue
src/api/modules/groupGuest.js
View file @
5acd95c
...
@@ -8,10 +8,60 @@
...
@@ -8,10 +8,60 @@
*/
*/
import
{
http
}
from
'@/main'
import
{
http
}
from
'@/main'
const
URL
=
'/rop-scrm-entmicro/router'
const
URL
=
'/rop-scrm-entmicro/router'
const
PATH
=
'org.ore.api.one.'
const
PATH
=
'org.ore.api.one.
template.
'
const
templateList
=
params
=>
{
const
templateList
=
params
=>
{
params
.
method
=
`
${
PATH
}
template.list`
params
.
method
=
`
${
PATH
}
list`
return
http
({
url
:
URL
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
insert
=
params
=>
{
params
.
method
=
`
${
PATH
}
insert`
return
http
({
url
:
URL
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
update
=
params
=>
{
params
.
method
=
`
${
PATH
}
update`
return
http
({
url
:
URL
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
detail
=
params
=>
{
params
.
method
=
`
${
PATH
}
detail`
return
http
({
url
:
URL
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
status
=
params
=>
{
params
.
method
=
`
${
PATH
}
status`
return
http
({
url
:
URL
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
listDepartmentTree
=
params
=>
{
params
.
method
=
'cn.com.glsx.entmicro.department.listDepartmentTree'
return
http
({
return
http
({
url
:
URL
,
url
:
URL
,
method
:
'GET'
,
method
:
'GET'
,
...
@@ -21,5 +71,10 @@ const templateList = params => {
...
@@ -21,5 +71,10 @@ const templateList = params => {
}
}
export
default
{
export
default
{
templateList
templateList
,
insert
,
detail
,
status
,
update
,
listDepartmentTree
}
}
src/config/env.development.js
View file @
5acd95c
...
@@ -23,7 +23,7 @@ module.exports = {
...
@@ -23,7 +23,7 @@ module.exports = {
*/
*/
request
:
{
request
:
{
// baseURL: 'http://scrm.test.glsx.com.cn', // 测试
// baseURL: 'http://scrm.test.glsx.com.cn', // 测试
baseURL
:
'http://192.168.
1.65
:8064'
,
baseURL
:
'http://192.168.
2.42
:8064'
,
// 设置超时时间
// 设置超时时间
timeout
:
180000
,
timeout
:
180000
,
// 携带凭证
// 携带凭证
...
...
src/router/index.js
View file @
5acd95c
...
@@ -25,11 +25,11 @@ VueRouter.prototype.push = function push(location) {
...
@@ -25,11 +25,11 @@ VueRouter.prototype.push = function push(location) {
// }
// }
function
getRoutes
(
routesData
)
{
function
getRoutes
(
routesData
)
{
return
routesData
.
reduce
((
routes
,
route
)
=>
{
return
routesData
.
reduce
((
routes
,
route
)
=>
{
routes
.
push
({
...
route
,
component
:
()
=>
import
(
'@/views'
+
route
.
path
+
'.vue'
)
})
routes
.
push
({
...
route
,
component
:
()
=>
import
(
'@/views'
+
route
.
com
path
+
'.vue'
)
})
return
routes
return
routes
},
[])
},
[])
}
}
export
{
export
{
VueRouter
,
VueRouter
,
routes
,
routes
,
getRoutes
getRoutes
...
...
src/setup/single.js
View file @
5acd95c
...
@@ -10,15 +10,16 @@
...
@@ -10,15 +10,16 @@
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
message
}
from
'@/plugins/element.js'
import
{
message
}
from
'@/plugins/element.js'
import
{
fetchConfig
}
from
'@/config'
import
{
fetchConfig
}
from
'@/config'
import
{
GLButton
,
GLTable
}
from
'glsx-components'
//权限按钮 (根据权限动态创建)
import
{
GLButton
,
GLTable
}
from
'glsx-components'
//权限按钮 (根据权限动态创建)
import
{
Http
,
utils
}
from
'glsx-common'
import
{
Http
,
utils
}
from
'glsx-common'
import
render
from
'./render'
import
render
from
'./render'
import
{
routes
}
from
'@/router'
import
{
routes
}
from
'@/router'
export
async
function
start
()
{
export
async
function
start
()
{
if
(
window
.
__POWERED_BY_QIANKUN__
)
return
if
(
window
.
__POWERED_BY_QIANKUN__
)
return
const
{
response
,
request
,
sign
,
secret
}
=
await
fetchConfig
(
true
)
const
{
response
,
request
,
sign
,
secret
}
=
await
fetchConfig
(
true
)
Vue
.
prototype
.
$http
=
new
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
'mini-f27a0943-8fbf-4b21-a7a1-8e82a117ba39-rop'
}
})
Vue
.
prototype
.
$http
=
new
Http
({
response
,
request
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop'
}
})
Vue
.
use
(
GLButton
,
GLTable
,
{
permissions
:
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
Vue
.
prototype
.
$http_common
=
new
Http
({
response
,
signWay
:
"md5"
,
request
:
'http://qcdidicb.glsx.net:7060'
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop'
}
})
Vue
.
use
(
GLButton
,
GLTable
,
{
permissions
:
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
render
(
'/'
,
routes
)
render
(
'/'
,
routes
)
}
}
src/views/guestGroup/add.vue
View file @
5acd95c
...
@@ -7,26 +7,44 @@
...
@@ -7,26 +7,44 @@
<div
class=
"info-box"
>
<div
class=
"info-box"
>
<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=
"
n
ame"
>
<el-form-item
label=
"组名"
prop=
"
orgN
ame"
>
<el-input
v-model=
"basicForm.
n
ame"
placeholder=
"为群聊设置一个组名"
maxlength=
"10"
></el-input>
<el-input
v-model=
"basicForm.
orgN
ame"
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=
"设置群聊名称前缀,如新车售后一组"
maxlength=
"10"
></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
prop=
"userList"
>
<label
slot=
"label"
class=
"required"
>
默认成员
</label>
<el-button
size=
"small"
@
click=
"openMembers"
>
<el-button
size=
"small"
@
click=
"openMembers"
>
<i
class=
"el-icon-plus"
></i>
<i
class=
"el-icon-plus"
></i>
全部
成员
选择
成员
</el-button>
</el-button>
<!--
<el-input
v-model=
"basicForm.groupName"
placeholder=
"设置群聊名称前缀,如新车售后一组"
></el-input>
-->
<span
class=
"label-text"
>
已选择
<span>
{{
basicForm
.
userList
?
basicForm
.
userList
.
length
:
0
}}
</span>
人
</span>
<div
class=
"sale-select"
v-show=
"basicForm.userList"
>
<div
:key=
"key"
class=
"el-input-tag input-tag-wrapper"
>
<el-tag
v-for=
"(tag, idx) in basicForm.userList"
:key=
"idx"
closable
:disable-transitions=
"false"
@
close=
"remove(tag)"
>
{{
tag
.
staffName
}}
</el-tag>
<el-input
size=
"small"
style=
"outline: none; border: none"
></el-input>
</div>
</div>
<div
class=
"form-tips"
>
必须配置2个及以上成员
</div>
<div
class=
"form-tips"
>
必须配置2个及以上成员
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<!-- 编辑入群欢迎语 -->
<!-- 编辑入群欢迎语 -->
<div
class=
"title"
>
编辑入群欢迎语
</div>
<div
class=
"title"
>
编辑入群欢迎语
</div>
<div>
<div>
<WelcomeWords
:eventBus=
"eventBus"
></WelcomeWords>
<el-form
:model=
"basicForm"
:rules=
"basicRules"
ref=
"groupForm"
label-width=
"120px"
>
<el-form-item
label=
"入群欢迎语"
prop=
"attachmentList"
>
<label
slot=
"label"
class=
"required"
>
入群欢迎语
</label>
<WelcomeWords
ref=
"welcome"
:eventBus=
"eventBus"
></WelcomeWords>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
<div
class=
"preview"
>
<div
class=
"preview"
>
...
@@ -42,11 +60,11 @@
...
@@ -42,11 +60,11 @@
width: footerWidth + 'px'
width: footerWidth + 'px'
}"
}"
>
>
<el-button
type=
"primary"
@
click=
"handle
Nex
t"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handle
Submi
t"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handle
Next
"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handle
Cancel
"
>
取消
</el-button>
</div>
</div>
<basic-dialog
:title=
"'选择成员'"
:width=
"'712px'"
:isVisible=
"membersVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"membersVisible = !membersVisible"
>
<basic-dialog
:title=
"'选择成员'"
:width=
"'712px'"
:isVisible=
"membersVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"membersVisible = !membersVisible"
>
<SelectMembers
ref=
"drawerForm"
@
closeDrawer=
"closeDrawer"
@
handSelectdEmp=
"handSelectdEmp
"
></SelectMembers>
<SelectMembers
:selectData=
"selectData"
ref=
"membersForm
"
></SelectMembers>
</basic-dialog>
</basic-dialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -63,25 +81,184 @@ export default {
...
@@ -63,25 +81,184 @@ export default {
Preview
Preview
},
},
data
()
{
data
()
{
const
validatorUser
=
(
rule
,
value
,
callback
)
=>
{
console
.
log
(
value
)
if
(
this
.
$route
.
params
.
id
==
-
1
)
{
if
(
this
.
$refs
.
membersForm
.
innerTags
)
this
.
basicForm
.
userList
=
this
.
$refs
.
membersForm
.
innerTags
if
(
this
.
basicForm
.
userList
)
{
if
(
this
.
basicForm
.
userList
.
length
<
2
)
{
callback
(
new
Error
(
'至少配置2个及以上成员'
))
}
else
{
callback
()
}
}
else
{
callback
(
new
Error
(
'请选择默认成员'
))
}
}
else
{
if
(
value
)
{
if
(
value
.
length
<
2
)
{
callback
(
new
Error
(
'至少配置2个及以上成员'
))
}
else
{
callback
()
}
}
else
{
callback
(
new
Error
(
'请选择默认成员'
))
}
}
}
const
validatorAttachment
=
(
rule
,
value
,
callback
)
=>
{
const
previewList
=
this
.
$refs
.
welcome
.
previewList
if
(
previewList
.
length
!=
0
)
{
this
.
basicForm
.
attachmentList
=
previewList
}
console
.
log
(
this
.
basicForm
.
attachmentList
,
'---'
)
if
(
this
.
basicForm
.
attachmentList
)
{
if
(
this
.
basicForm
.
attachmentList
.
length
>
9
)
{
callback
(
new
Error
(
'附件不可超过9个'
))
}
else
{
callback
()
}
}
else
{
callback
(
new
Error
(
'请输入入群欢迎语'
))
}
}
return
{
return
{
eventBus
:
new
Vue
(),
eventBus
:
new
Vue
(),
basicForm
:
{},
basicForm
:
{},
basicRules
:
{
basicRules
:
{
name
:
[{
required
:
true
,
message
:
'请输入组名'
,
trigger
:
'blur'
}],
orgName
:
[{
required
:
true
,
message
:
'请输入组名'
,
trigger
:
'blur'
}],
groupName
:
[{
required
:
true
,
message
:
'请输入群聊名称'
,
trigger
:
'blur'
}]
groupName
:
[{
required
:
true
,
message
:
'请输入群聊名称'
,
trigger
:
'blur'
}],
attachmentList
:
[
// { required: true, message: '请输入入群欢迎语' },
{
validator
:
validatorAttachment
,
trigger
:
'change'
}
],
userList
:
[
// { required: true, message: '请选择默认成员', trigger: 'change' },
{
validator
:
validatorUser
,
trigger
:
'change'
}
]
},
},
membersVisible
:
false
membersVisible
:
false
,
key
:
new
Date
(),
previewFlag
:
false
,
selectData
:
[]
}
},
mounted
()
{
console
.
log
(
this
.
$route
.
params
)
if
(
this
.
$route
.
params
)
{
const
id
=
this
.
$route
.
params
.
id
if
(
id
!=
-
1
)
this
.
getDetail
(
id
)
}
}
// // let clientHeight = document.documentElement.clientHeight
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft
// // this.boxHeight = clientHeight - 200
},
},
// mounted() {
// // let clientHeight = document.documentElement.clientHeight
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft
// // this.boxHeight = clientHeight - 200
// },
methods
:
{
methods
:
{
openMembers
()
{
openMembers
()
{
this
.
membersVisible
=
!
this
.
membersVisible
this
.
membersVisible
=
!
this
.
membersVisible
if
(
this
.
membersVisible
&&
this
.
$route
.
params
.
id
!=
-
1
)
{
this
.
$nextTick
(()
=>
{
console
.
log
(
this
.
$refs
.
membersForm
)
this
.
$refs
.
membersForm
.
selectTable
(
this
.
basicForm
.
userList
)
this
.
basicForm
.
userList
.
map
(
item
=>
{
if
(
item
.
masterStatus
)
{
this
.
basicForm
.
group
=
item
this
.
$refs
.
membersForm
.
group
=
item
this
.
selectData
=
this
.
basicForm
.
userList
}
})
})
}
},
handleSubmit
()
{
this
.
$refs
.
basicForm
.
validate
(
valid
=>
{
if
(
valid
)
{
console
.
log
(
this
.
basicForm
,
'111'
)
this
.
$refs
.
groupForm
.
validate
(
v
=>
{
console
.
log
(
v
)
if
(
v
)
{
console
.
log
(
this
.
basicForm
,
'122211'
)
const
params
=
{
attachmentList
:
this
.
basicForm
.
attachmentList
,
orgName
:
this
.
basicForm
.
orgName
,
groupName
:
this
.
basicForm
.
groupName
,
merchantId
:
1
}
params
.
userList
=
this
.
basicForm
.
userList
.
map
(
item
=>
{
if
(
this
.
basicForm
.
group
.
id
==
item
.
id
)
{
return
{
staffId
:
item
.
id
,
masterStatus
:
1
}
}
else
{
return
{
staffId
:
item
.
id
}
}
})
console
.
log
(
params
)
let
apiName
=
'insert'
if
(
this
.
basicForm
.
id
)
{
apiName
=
'update'
params
.
id
=
this
.
basicForm
.
id
}
this
.
$apis
.
groupGuest
[
apiName
](
params
)
.
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$message
({
type
:
'success'
,
message
:
'操作成功!'
})
this
.
handleCancel
()
}
})
.
catch
(
err
=>
{
this
.
$message
({
type
:
'error'
,
message
:
err
.
message
})
})
}
})
}
})
},
getDetail
(
id
)
{
this
.
$apis
.
groupGuest
.
detail
({
id
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
basicForm
=
{
orgName
:
res
.
orgName
,
groupName
:
res
.
groupName
,
id
:
res
.
id
,
merchantId
:
1
,
userList
:
res
.
userList
,
attachmentList
:
res
.
attachmentList
}
this
.
$refs
.
welcome
.
updateList
(
res
.
attachmentList
)
this
.
selectData
=
res
.
userList
// this.$refs.membersForm.selectTable(res.userList)
// this.group = {}
})
},
handleCancel
()
{
this
.
$router
.
go
(
-
1
)
},
remove
(
val
)
{
this
.
$refs
.
membersForm
.
remove
(
val
)
console
.
log
(
this
.
$refs
.
membersForm
.
innerTags
)
this
.
$set
(
this
.
basicForm
,
'userList'
,
this
.
$refs
.
membersForm
.
innerTags
)
this
.
key
=
new
Date
()
},
// 成员弹窗
handleConfirm
()
{
console
.
log
(
this
.
$refs
.
membersForm
.
innerTags
)
this
.
basicForm
.
userList
=
this
.
$refs
.
membersForm
.
innerTags
this
.
basicForm
.
group
=
this
.
$refs
.
membersForm
.
group
// if (this.$refs.membersForm.group.id) {
this
.
openMembers
()
// }
}
}
}
}
}
}
...
@@ -139,4 +316,80 @@ export default {
...
@@ -139,4 +316,80 @@ export default {
background
:
#ffffff
;
background
:
#ffffff
;
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
box-shadow
:
0px
-1px
1px
0px
rgba
(
88
,
80
,
255
,
0.1
);
}
}
.label-text
{
margin-left
:
10px
;
font-size
:
14px
;
span
{
color
:
#5850ff
;
}
}
.form-error
{
color
:
#f56c6c
;
font-size
:
12px
;
margin-left
:
186px
;
margin-top
:
10px
;
}
.sale-select
{
display
:
flex
;
align-items
:
center
;
}
.input-tag-wrapper
{
max-width
:
320px
;
position
:
relative
;
font-size
:
14px
;
background-color
:
#fff
;
background-image
:
none
;
border-radius
:
4px
;
border
:
1px
solid
#dcdfe6
;
box-sizing
:
border-box
;
color
:
#606266
;
display
:
inline-block
;
outline
:
none
;
padding
:
0
10px
0
5px
;
flex-wrap
:
wrap
;
line-height
:
32px
;
transition
:
border-color
0.2s
cubic-bezier
(
0.645
,
0.045
,
0.355
,
1
);
width
:
100%
;
display
:
flex
;
align-items
:
center
;
/deep/
input
{
/* input { */
/* background-color: red!important; 调试用的样式 */
outline
:
none
!important
;
border
:
none
!important
;
}
/
deep
/
.el-input
{
min-width
:
150px
;
width
:
auto
;
flex
:
1
;
}
}
.el-tag
{
margin-right
:
4px
;
height
:
26px
;
line-height
:
24px
;
}
.tag-input
{
background
:
transparent
;
border
:
none
!important
;
font-size
:
14px
;
height
:
32px
;
outline
:
none
;
padding-left
:
0
;
width
:
100px
;
}
/
deep
/
{
.el-form-item
.el-form-item
{
margin-bottom
:
22px
;
}
.required
{
display
:
inline-block
;
line-height
:
40px
;
}
.required
::before
{
content
:
'*'
;
color
:
#f56c6c
;
margin-right
:
4
px
;
}
}
</
style
>
</
style
>
src/views/guestGroup/components/preview.vue
View file @
5acd95c
...
@@ -3,26 +3,30 @@
...
@@ -3,26 +3,30 @@
<div
class=
"preview-content"
>
<div
class=
"preview-content"
>
<div
class=
"preview-time"
>
{{
currentTime
}}
</div>
<div
class=
"preview-time"
>
{{
currentTime
}}
</div>
<div
class=
"preview-info"
v-for=
"item in previewList"
:key=
"item.id"
>
<div
class=
"preview-info"
v-for=
"item in previewList"
:key=
"item.id"
>
<img
class=
"avatar"
src=
"
../../..
/assets/logo.png"
alt=
""
/>
<img
class=
"avatar"
src=
"
@
/assets/logo.png"
alt=
""
/>
<template
v-if=
"item.
type == 'text'
"
>
<template
v-if=
"item.
attType == 1
"
>
<div
class=
"preview-text text"
>
{{
item
.
c
ontent
}}
</div>
<div
class=
"preview-text text"
>
{{
item
.
attC
ontent
}}
</div>
</
template
>
</
template
>
<
template
v-else-if=
"item.
type == 'link'
"
>
<
template
v-else-if=
"item.
attType == 4
"
>
<div
class=
"preview-text preview-link"
>
<div
class=
"preview-text preview-link"
>
{{
item
.
url
}}
{{
item
.
attContent
.
url
}}
<img
src=
"
../../..
/assets/guestCustom/preview-link.png"
alt=
""
/>
<img
src=
"
@
/assets/guestCustom/preview-link.png"
alt=
""
/>
</div>
</div>
</
template
>
</
template
>
<
template
v-else-if=
"item.
type == 'img'
"
>
<
template
v-else-if=
"item.
attType == 2
"
>
<el-image
style=
"width: 100px"
:src=
"item.
url
"
fit=
"contain"
></el-image>
<el-image
style=
"width: 100px"
:src=
"item.
attContent
"
fit=
"contain"
></el-image>
</
template
>
</
template
>
<
template
v-else-if=
"item.type == 'applet'"
>
<
template
v-else-if=
"item.attType == 3"
>
<!--
<el-image
style=
"width: 100px"
:src=
"item.attContent"
fit=
"contain"
></el-image>
-->
<video
style=
"width: 100px"
:src=
"item.attContent"
></video>
</
template
>
<
template
v-else-if=
"item.attType == 5"
>
<div
class=
"preview-text text preview-applet"
>
<div
class=
"preview-text text preview-applet"
>
<div
class=
"preview-applet-title"
>
<div
class=
"preview-applet-title"
>
<img
:src=
"item.a
ppleIcon
"
alt=
""
/>
<img
:src=
"item.a
ttContent.picUrl
"
alt=
""
/>
<span>
{{
item
.
title
}}
</span>
<span>
{{
item
.
attContent
.
title
}}
</span>
</div>
</div>
{{
item
.
content
}}
{{
item
.
attContent
.
page
}}
</div>
</div>
</
template
>
</
template
>
</div>
</div>
...
@@ -88,10 +92,11 @@ export default {
...
@@ -88,10 +92,11 @@ export default {
}
}
.preview-text
{
.preview-text
{
position
:
relative
;
position
:
relative
;
max-width
:
1
90
px
;
max-width
:
1
69
px
;
color
:
#333
;
color
:
#333
;
background-color
:
#fff
;
background-color
:
#fff
;
border-radius
:
4px
;
border-radius
:
4px
;
word-wrap
:
break-word
;
}
}
.text
{
.text
{
font-size
:
16px
;
font-size
:
16px
;
...
...
src/views/guestGroup/components/selectEmp.vue
View file @
5acd95c
...
@@ -18,13 +18,19 @@
...
@@ -18,13 +18,19 @@
height: treeHeight + 20 + 'px'
height: treeHeight + 20 + 'px'
}"
}"
>
>
<GLTable
ref=
"saleTable"
:tableData=
"tableEmpData"
:tableParams=
"tableParams"
:hasNum=
"false"
:hasPage=
"false"
@
selectionTable=
"selectionTable"
></GLTable>
<GLTable
ref=
"saleTable"
:tableData=
"tableEmpData"
:tableParams=
"tableParams"
:hasNum=
"false"
:hasPage=
"false"
@
selectionTable=
"selectionTable"
>
<div
class=
"table-btns"
slot=
"optionBtns"
slot-scope=
"scope"
>
<el-button
type=
"text"
v-show=
"!group.staffName"
@
click=
"selectGroup(scope.scope)"
>
设为群主
</el-button>
<el-button
type=
"text"
v-show=
"group.staffName && scope.scope.staffName == group.staffName"
@
click=
"cancelGroup"
>
取消群主
</el-button>
</div>
</GLTable>
</el-col>
</el-col>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'selectEmp'
,
name
:
'selectEmp'
,
props
:
[
'selectData'
],
data
()
{
data
()
{
return
{
return
{
treeHeight
:
0
,
treeHeight
:
0
,
...
@@ -52,19 +58,41 @@ export default {
...
@@ -52,19 +58,41 @@ export default {
{
{
label
:
'职务'
,
label
:
'职务'
,
prop
:
'staffTitle'
prop
:
'staffTitle'
},
{
label
:
''
,
prop
:
'optionBtns'
,
addHtml
:
'optionBtns'
,
fixed
:
'right'
}
}
]
]
},
},
tableEmpData
:
[]
tableEmpData
:
[],
group
:
{},
allGroup
:
[],
employeeList
:
[]
}
}
},
},
methods
:
{
methods
:
{
selectionTable
(
val
)
{
selectionTable
(
val
)
{
console
.
log
(
val
)
this
.
$emit
(
'selectTable'
,
val
)
this
.
$emit
(
'selectTable'
,
val
)
this
.
allGroup
=
val
const
hasGroup
=
val
.
find
(
item
=>
item
.
id
==
this
.
group
.
id
)
if
(
!
hasGroup
)
{
this
.
cancelGroup
()
}
},
},
listDepartmentTree
()
{
listDepartmentTree
()
{
this
.
$apis
.
emp
.
listDepartmentTree
({
id
:
1
}).
then
(
res
=>
{
this
.
$apis
.
groupGuest
.
listDepartmentTree
({
merchantId
:
10001001
,
addChildrensFlag
:
true
}).
then
(
res
=>
{
this
.
listTree
=
res
this
.
listTree
=
res
this
.
listTree
[
0
].
entmicroStaffResponses
=
this
.
getEmployee
(
this
.
listTree
)
console
.
log
(
this
.
listTree
)
this
.
selectData
.
forEach
(
i
=>
{
const
row
=
this
.
getEmployee
(
this
.
listTree
).
find
(
j
=>
j
.
id
==
i
.
staffId
)
console
.
log
(
row
)
this
.
clearSelect
(
row
)
})
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
document
.
getElementsByClassName
(
'el-tree-node__expand-icon'
)[
0
].
click
()
document
.
getElementsByClassName
(
'el-tree-node__expand-icon'
)[
0
].
click
()
document
.
getElementsByClassName
(
'el-tree-node__content'
)[
0
].
click
()
document
.
getElementsByClassName
(
'el-tree-node__content'
)[
0
].
click
()
...
@@ -72,30 +100,59 @@ export default {
...
@@ -72,30 +100,59 @@ export default {
})
})
},
},
clearSelect
(
row
)
{
clearSelect
(
row
)
{
console
.
log
(
row
,
'2222'
)
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
row
)
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
row
)
},
},
clearSelection
()
{
clearSelection
()
{
console
.
log
(
2222
)
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
clearSelection
()
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
clearSelection
()
},
},
handleNodeClick
(
data
)
{
handleNodeClick
(
data
)
{
this
.
departmentId
=
data
.
id
this
.
departmentId
=
data
.
id
this
.
listEntmicroStaff
()
this
.
tableEmpData
=
data
.
entmicroStaffResponses
// this.listEntmicroStaff()
},
},
listEntmicroStaff
(
staffName
)
{
selectGroup
(
data
)
{
let
params
=
{
console
.
log
(
data
)
departmentId
:
this
.
departmentId
,
this
.
group
=
data
staffName
:
staffName
?
staffName
:
this
.
staffName
,
const
obj
=
this
.
allGroup
.
find
(
item
=>
item
.
id
==
data
.
id
)
merchantid
:
this
.
$globalState
.
session
.
merchantId
if
(
!
obj
)
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
data
)
}
this
.
$emit
(
'group'
,
this
.
group
)
this
.
$apis
.
emp
.
listEntmicroStaff
(
params
).
then
(
res
=>
{
},
this
.
tableEmpData
=
res
cancelGroup
()
{
this
.
group
=
{}
this
.
$emit
(
'group'
,
this
.
group
)
},
getEmployee
(
d
,
arr
=
[])
{
d
.
forEach
(
i
=>
{
if
(
i
.
entmicroStaffResponses
)
{
i
.
entmicroStaffResponses
.
forEach
(
j
=>
{
arr
.
push
(
j
)
})
}
if
(
i
.
children
)
{
this
.
getEmployee
(
i
.
children
,
arr
)
}
})
})
return
arr
}
}
// listEntmicroStaff(staffName) {
// let params = {
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
},
},
mounted
()
{
mounted
()
{
let
clientHeight
=
document
.
documentElement
.
clientHeight
let
clientHeight
=
document
.
documentElement
.
clientHeight
this
.
treeHeight
=
clientHeight
-
450
this
.
treeHeight
=
clientHeight
-
450
this
.
listDepartmentTree
()
this
.
listDepartmentTree
()
console
.
log
(
this
.
selectData
,
'.....'
)
}
}
}
}
</
script
>
</
script
>
...
...
src/views/guestGroup/components/selectMembers.vue
View file @
5acd95c
...
@@ -13,28 +13,14 @@
...
@@ -13,28 +13,14 @@
</div>
</div>
<div>
<div>
<div
class=
"select-sale-panel"
>
<div
class=
"select-sale-panel"
>
<select-emp
@
selectTable=
"selectTable"
ref=
"selectEmpTabel"
></select-emp>
<select-emp
:selectData=
"selectData"
@
group=
"handlGroup"
@
selectTable=
"selectTable"
ref=
"selectEmpTabel"
></select-emp>
<div
class=
"popper__arrow"
></div>
<div
class=
"popper__arrow"
></div>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"请选择跟进员工类型"
>
<el-form-item
label=
"群主"
>
<div
class=
"emp-type"
>
<el-tag
v-show=
"group.staffName"
closable
@
close=
"cancelGroup"
>
{{
group
.
staffName
}}
</el-tag>
<div
@
click=
"handleType(index)"
:class=
"
{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{
item
.
followName
}}
<i
class=
"el-icon-error"
@
click=
"delEmpType(item, index)"
v-if=
"!item.commonFlag"
></i>
</div>
</div>
<div
class=
"sale-select"
>
<el-input
size=
"small"
v-model=
"empTypeValue"
placeholder=
"添加类型名称"
maxlength=
"8"
show-word-limit
></el-input>
<div><el-button
size=
"small"
class=
"sale-select-btn"
type=
"primary"
@
click=
"addEmpType"
>
新增
</el-button></div>
</div>
<div
class=
"sale-type-desc"
>
跟进员工类型最多新增30个,已新增
{{
empType
.
length
-
3
}}
个
</div>
</el-form-item>
</el-form-item>
<!--
<el-form-item
style=
"text-align: center"
>
<el-button
@
click=
"onCancel"
size=
"small"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmit"
size=
"small"
>
确定
</el-button>
</el-form-item>
-->
</el-form>
</el-form>
</div>
</div>
</
template
>
</
template
>
...
@@ -42,6 +28,7 @@
...
@@ -42,6 +28,7 @@
import
selectEmp
from
'./selectEmp.vue'
import
selectEmp
from
'./selectEmp.vue'
export
default
{
export
default
{
name
:
'SelectMembers'
,
name
:
'SelectMembers'
,
props
:
[
'selectData'
],
components
:
{
components
:
{
selectEmp
selectEmp
},
},
...
@@ -50,10 +37,11 @@ export default {
...
@@ -50,10 +37,11 @@ export default {
addForm
:
{},
addForm
:
{},
typeIndex
:
0
,
typeIndex
:
0
,
empType
:
[],
empType
:
[],
empTypeValue
:
''
,
//
empTypeValue: '',
newTag
:
''
,
newTag
:
''
,
innerTags
:
[],
innerTags
:
[],
dialog_temp
:
{}
dialog_temp
:
{},
group
:
{}
}
}
},
},
methods
:
{
methods
:
{
...
@@ -67,16 +55,9 @@ export default {
...
@@ -67,16 +55,9 @@ export default {
}
}
},
},
selectTable
(
val
)
{
selectTable
(
val
)
{
console
.
log
(
val
)
this
.
innerTags
=
val
this
.
innerTags
=
val
},
},
listEntFollowerType
()
{
this
.
$apis
.
emp
.
listEntFollowerType
({
merchantId
:
this
.
$globalState
.
session
.
merchantId
}).
then
(
res
=>
{
this
.
empType
=
res
})
},
handleType
(
index
)
{
this
.
typeIndex
=
index
},
foucusTagInput
()
{
foucusTagInput
()
{
if
(
this
.
readOnly
||
!
this
.
$el
.
querySelector
(
'.tag-input'
))
{
if
(
this
.
readOnly
||
!
this
.
$el
.
querySelector
(
'.tag-input'
))
{
return
return
...
@@ -85,58 +66,33 @@ export default {
...
@@ -85,58 +66,33 @@ export default {
}
}
},
},
remove
(
row
)
{
remove
(
row
)
{
console
.
log
(
row
,
'111'
)
this
.
$refs
.
selectEmpTabel
.
clearSelect
(
row
)
this
.
$refs
.
selectEmpTabel
.
clearSelect
(
row
)
},
},
//查询
//查询
searchEmp
()
{
searchEmp
()
{
this
.
$refs
.
selectEmpTabel
.
list
EntmicroStaff
(
this
.
newTag
)
this
.
$refs
.
selectEmpTabel
.
list
DepartmentTree
(
this
.
newTag
)
},
},
addEmpType
()
{
handlGroup
(
val
)
{
if
(
!
this
.
empTypeValue
)
{
console
.
log
(
val
)
this
.
$message
.
error
(
'请输入类型名称'
)
this
.
group
=
val
return
},
}
cancelGroup
()
{
if
(
this
.
empType
.
length
==
33
)
{
this
.
$refs
.
selectEmpTabel
.
cancelGroup
()
this
.
$message
.
error
(
'跟进员工类型最多新增30个'
)
},
onSubmit
()
{
if
(
this
.
innerTags
.
length
==
0
)
{
this
.
$message
({
message
:
'请选择成员'
,
type
:
'error'
})
return
return
}
}
let
params
=
{
let
userIds
=
[]
followName
:
this
.
empTypeValue
,
this
.
innerTags
.
forEach
(
item
=>
{
merchantid
:
this
.
$globalState
.
session
.
merchantId
userIds
.
push
(
item
.
userId
)
}
this
.
$apis
.
emp
.
saveFollowerType
(
params
).
then
(
res
=>
{
this
.
listEntFollowerType
()
})
this
.
empTypeValue
=
''
},
delEmpType
(
item
,
index
)
{
this
.
$apis
.
emp
.
deleteFollowerType
({
id
:
item
.
id
}).
then
(
res
=>
{
if
(
res
)
{
this
.
listEntFollowerType
()
this
.
typeIndex
=
0
}
})
})
}
}
// onSubmit() {
// if (this.innerTags.length == 0) {
// this.$message({
// message: '请选择员工',
// type: 'error'
// })
// return
// }
// let userIds = []
// this.innerTags.forEach(item => {
// userIds.push(item.userId)
// })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
// },
// onCancel() {
// this.$emit('closeDrawer')
// }
},
mounted
()
{
this
.
listEntFollowerType
()
}
}
}
}
</
script
>
</
script
>
...
...
src/views/guestGroup/components/welcomeWords.vue
View file @
5acd95c
<
template
>
<
template
>
<div
class=
"welcome-box"
>
<div
class=
"welcome-box"
>
<
div
class=
"required"
>
入群欢迎语
</div
>
<
!--
<div
class=
"required"
>
入群欢迎语
</div>
--
>
<div
class=
"content"
>
<div
class=
"content"
>
<el-input
type=
"textarea"
:rows=
"9"
maxlength=
"600"
show-word-limit
v-model=
"guestForm.name"
placeholder=
"请输入内容"
></el-input>
<div
class=
"content-bg"
>
<div>
<el-input
type=
"textarea"
:rows=
"9"
maxlength=
"600"
show-word-limit
v-model=
"text"
@
input=
"textInput"
placeholder=
"请输入内容"
></el-input>
<div
class=
"welcome-file"
v-for=
"itm in previewList"
:key=
"itm.id"
>
<div
v-for=
"itm in previewList"
:key=
"itm.id"
>
<template
v-if=
"itm.type == 'img'"
>
<div
class=
"welcome-file"
v-if=
"itm.attType != 1"
>
<img
src=
"../../../assets/guestCustom/icon-img.png"
alt=
""
/>
<template
v-if=
"itm.attType == 2"
>
<span>
{{
itm
.
name
}}
</span>
<img
src=
"@/assets/guestCustom/icon-img.png"
alt=
""
/>
</
template
>
<span>
{{
itm
.
attContent
}}
</span>
<
template
v-else-if=
"itm.type == 'link'"
>
</
template
>
<img
src=
"../../../assets/guestCustom/icon-link.png"
alt=
""
/>
<
template
v-else-if=
"itm.attType == 3"
>
<span>
{{
itm
.
url
}}
</span>
<img
src=
"@/assets/guestCustom/icon-img.png"
alt=
""
/>
</
template
>
<span>
{{
itm
.
attContent
}}
</span>
<
template
v-else-if=
"itm.type == 'applet'"
>
</
template
>
<img
src=
"../../../assets/guestCustom/icon-applet.png"
alt=
""
/>
<
template
v-else-if=
"itm.attType == 4"
>
<span>
{{
itm
.
title
}}
</span>
<img
src=
"@/assets/guestCustom/icon-link.png"
alt=
""
/>
</
template
>
<span>
{{
itm
.
attContent
.
url
}}
</span>
<i
class=
"el-icon-circle-close"
@
click=
"close(index)"
></i>
</
template
>
<
template
v-else-if=
"itm.attType == 5"
>
<img
src=
"@/assets/guestCustom/icon-applet.png"
alt=
""
/>
<span>
{{
itm
.
attContent
.
title
}}
</span>
</
template
>
<i
class=
"el-icon-circle-close"
@
click=
"close(index)"
></i>
</div>
</div>
</div>
</div>
<div
class=
"btn-group"
>
<div
class=
"btn-group"
>
<div
class=
"add-btn"
v-for=
"item in btnList"
:key=
"item.id"
>
<div
class=
"add-btn"
v-for=
"item in btnList"
:key=
"item.id"
>
<i
class=
"el-icon-circle-plus-outline"
></i>
<i
class=
"el-icon-circle-plus-outline"
></i>
<span>
{{ item.name }}
</span>
<span>
{{ item.name }}
</span>
<!-- <div id="video"></div> -->
<input
v-if=
"item.type == 'img'"
type=
"file"
style=
"opacity: 0"
:id=
"item.name + 'file'"
ref=
"file"
class=
"welcome-input"
:accept=
"item.accept || 'image/png, image/jpeg, image/jpg'"
@
change=
"e => handleImgChange(e, item)"
/>
<input
v-if=
"item.type == 'img'"
type=
"file"
style=
"opacity: 0"
:id=
"item.name + 'file'"
ref=
"file"
class=
"welcome-input"
:accept=
"item.accept || 'image/png, image/jpeg, image/jpg'"
@
change=
"e => handleImgChange(e, item)"
/>
<el-link
v-if=
"item.type == 'popup'"
style=
"opacity: 0"
@
click=
"switchDailog(item.funName)"
>
{{ item.name }}
</el-link>
<input
v-if=
"item.type == 'video'"
type=
"file"
style=
"opacity: 0"
:id=
"item.name + 'file'"
ref=
"file"
class=
"welcome-input"
:accept=
"item.accept || 'video/*'"
@
change=
"e => handleVideoChange(e, item)"
/>
<el-link
v-if=
"item.type == 'popup'"
style=
"opacity: 0"
@
click=
"switchDailog(item.funName)"
>
{{ item.name }}
</el-link>
</div>
</div>
</div>
</div>
</div>
<div
class=
"tips-text"
>
<div
class=
"tips-text"
>
<img
src=
"../../../assets/guestCustom/tips.png"
class=
"tips-icon"
alt=
""
/>
<img
src=
"../../../assets/guestCustom/tips.png"
class=
"tips-icon"
alt=
""
/>
<span>
欢迎语将在客户进群时发送一次,不设置时不发送入群欢迎语。
</span>
<span>
欢迎语将在客户进群时发送一次,不设置时不发送入群欢迎语。
</span>
</div>
</div>
</div>
</div>
<basic-dialog
:title=
"dialogTitle"
:width=
"'712px'"
:isVisible=
"dialogVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"
dialogVisible = !dialogVisible
"
>
<basic-dialog
:title=
"dialogTitle"
:width=
"'712px'"
:isVisible=
"dialogVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"
closeDialog
"
>
<slot>
<slot>
<el-form
v-if=
"dialogTitle == '添加网页消息'"
:model=
"linkForm"
:rules=
"linkRules"
ref=
"linkForm"
label-width=
"120px"
>
<el-form
v-if=
"dialogTitle == '添加网页消息'"
:model=
"linkForm"
:rules=
"linkRules"
ref=
"linkForm"
label-width=
"120px"
>
<el-form-item
label=
"网页标题"
prop=
"
nam
e"
>
<el-form-item
label=
"网页标题"
prop=
"
titl
e"
>
<el-input
v-model=
"linkForm.
nam
e"
placeholder=
"请输入网页标题"
></el-input>
<el-input
v-model=
"linkForm.
titl
e"
placeholder=
"请输入网页标题"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"添加网页链接"
prop=
"
link
"
>
<el-form-item
label=
"添加网页链接"
prop=
"
url
"
>
<el-input
v-model=
"linkForm.
link
"
placeholder=
"以http或https开头"
></el-input>
<el-input
v-model=
"linkForm.
url
"
placeholder=
"以http或https开头"
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-form
v-else-if=
"dialogTitle == '添加小程序'"
:model=
"appletForm"
:rules=
"appletRules"
ref=
"appletForm"
label-width=
"120px"
>
<el-form
v-else-if=
"dialogTitle == '添加小程序'"
:model=
"appletForm"
:rules=
"appletRules"
ref=
"appletForm"
label-width=
"120px"
>
<el-form-item
label=
"小程序标题"
prop=
"
nam
e"
>
<el-form-item
label=
"小程序标题"
prop=
"
titl
e"
>
<el-input
v-model=
"appletForm.
nam
e"
placeholder=
"请输入小程序标题"
></el-input>
<el-input
v-model=
"appletForm.
titl
e"
placeholder=
"请输入小程序标题"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"小程序appID"
prop=
"
link
"
>
<el-form-item
label=
"小程序appID"
prop=
"
appid
"
>
<el-input
v-model=
"appletForm.
link
"
placeholder=
"请输入小程序appID"
></el-input>
<el-input
v-model=
"appletForm.
appid
"
placeholder=
"请输入小程序appID"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"小程序路径"
prop=
"
link
"
>
<el-form-item
label=
"小程序路径"
prop=
"
page
"
>
<el-input
v-model=
"appletForm.
url
"
placeholder=
"请输入小程序路径"
></el-input>
<el-input
v-model=
"appletForm.
page
"
placeholder=
"请输入小程序路径"
></el-input>
<div
class=
"form-tips"
>
注意:小程序路径以html作为后缀
</div>
<div
class=
"form-tips"
>
注意:小程序路径以html作为后缀
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"小程序路径"
prop=
"link"
>
<el-form-item
label=
"小程序封面"
prop=
"picUrl"
>
<div
class=
"upload-bg"
>
<div
class=
"upload"
>
<i
class=
"el-icon-circle-plus"
></i>
<div
v-show=
"!appletForm.picUrl"
class=
"upload-bg"
>
<div>
上传封面
</div>
<i
class=
"el-icon-circle-plus"
></i>
<div
class=
"upload-text"
>
上传封面
</div>
</div>
<input
type=
"file"
style=
"opacity: 0"
ref=
"file"
class=
"form-upload img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"handleImg"
/>
<input
type=
"file"
style=
"opacity: 0"
ref=
"file"
class=
"form-upload img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"handleImg"
/>
<el-image
v-show=
"appletForm.picUrl"
style=
"width: 140px"
:src=
"appletForm.picUrl"
fit=
"contain"
></el-image>
</div>
</div>
<div
class=
"form-tips"
>
建议图片大小在2M以内,建议尺寸:352*282px
</div>
<div
class=
"form-tips"
>
建议图片大小在2M以内,建议尺寸:352*282px
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -68,8 +81,15 @@
...
@@ -68,8 +81,15 @@
</basic-dialog>
</basic-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
const
ATT_TYPE
=
{
TEXT
:
1
,
IMAGE
:
2
,
VEDIO
:
3
,
URL
:
4
,
MINIPROGRAM
:
5
,
FILE
:
6
}
export
default
{
export
default
{
name
:
'WelcomeWords'
,
name
:
'WelcomeWords'
,
props
:
{
eventBus
:
Object
},
props
:
{
eventBus
:
Object
},
...
@@ -87,8 +107,7 @@ export default {
...
@@ -87,8 +107,7 @@ export default {
id
:
2
,
id
:
2
,
name
:
'视频'
,
name
:
'视频'
,
funcName
:
''
,
funcName
:
''
,
type
:
'img'
,
type
:
'video'
,
accept
:
'video/*'
,
limitSize
:
10
limitSize
:
10
},
},
{
{
...
@@ -105,73 +124,29 @@ export default {
...
@@ -105,73 +124,29 @@ export default {
}
}
],
],
guestForm
:
{},
guestForm
:
{},
text
:
''
,
dialogTitle
:
''
,
dialogTitle
:
''
,
dialogVisible
:
false
,
dialogVisible
:
false
,
linkForm
:
{},
linkForm
:
{},
linkRules
:
{
linkRules
:
{
nam
e
:
[{
required
:
true
,
message
:
'请输入网页标题'
,
trigger
:
'blur'
}],
titl
e
:
[{
required
:
true
,
message
:
'请输入网页标题'
,
trigger
:
'blur'
}],
link
:
[{
required
:
true
,
message
:
'请输入网页链接'
,
trigger
:
'blur'
}]
url
:
[{
required
:
true
,
message
:
'请输入网页链接'
,
trigger
:
'blur'
}]
},
},
appletForm
:
{},
appletForm
:
{},
appletRules
:
{
appletRules
:
{
name
:
[{
required
:
true
,
message
:
'请输入网页标题'
,
trigger
:
'blur'
}],
title
:
[{
required
:
true
,
message
:
'请输入小程序标题'
,
trigger
:
'blur'
}],
link
:
[{
required
:
true
,
message
:
'请输入网页链接'
,
trigger
:
'blur'
}],
appid
:
[{
required
:
true
,
message
:
'请输入小程序appID'
,
trigger
:
'blur'
}],
url
:
[{
required
:
true
,
message
:
'请输入小程序路径'
,
trigger
:
'blur'
}]
page
:
[{
required
:
true
,
message
:
'请输入小程序路径'
,
trigger
:
'blur'
}],
picUrl
:
[{
required
:
true
,
message
:
'请上传封面路径'
,
trigger
:
'change'
}]
},
},
previewList
:
[
previewList
:
[]
{
id
:
1
,
type
:
'text'
,
content
:
'fasf'
},
{
id
:
2
,
type
:
'link'
,
url
:
'https://baidu.comdfasdfasdfa'
},
{
id
:
3
,
type
:
'img'
,
name
:
'hdjkashfajk'
,
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'
,
appleIcon
:
'../../../assets/logo.png'
,
title
:
'我的智慧门店'
,
content
:
'我的智慧门店'
},
{
id
:
5
,
type
:
'text'
,
content
:
'fasf'
},
{
id
:
6
,
type
:
'text'
,
content
:
'fasf'
},
{
id
:
7
,
type
:
'text'
,
content
:
'fasf'
},
{
id
:
8
,
type
:
'text'
,
content
:
'fasf'
},
{
id
:
9
,
type
:
'text'
,
content
:
'fasf'
}
]
}
}
},
},
mounted
()
{
mounted
()
{
console
.
log
(
this
.
previewList
)
this
.
eventBus
.
$emit
(
'update'
,
this
.
previewList
)
this
.
eventBus
.
$emit
(
'update'
,
this
.
previewList
)
// this.updateList(this.previewList)
// obj.init('video')
},
},
methods
:
{
methods
:
{
handleImgChange
(
e
,
targetItem
)
{
handleImgChange
(
e
,
targetItem
)
{
...
@@ -179,7 +154,7 @@ export default {
...
@@ -179,7 +154,7 @@ export default {
var
reader
=
new
FileReader
()
var
reader
=
new
FileReader
()
var
file
=
e
.
srcElement
.
files
[
0
]
var
file
=
e
.
srcElement
.
files
[
0
]
console
.
log
(
file
)
console
.
log
(
file
)
//
//
默认1MB
// 默认1MB
const
limitSize
=
targetItem
.
limitSize
||
1
const
limitSize
=
targetItem
.
limitSize
||
1
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
if
(
!
isLt
)
{
if
(
!
isLt
)
{
...
@@ -197,13 +172,68 @@ export default {
...
@@ -197,13 +172,68 @@ export default {
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
this
.
previewList
.
push
({
attType
:
ATT_TYPE
.
IMAGE
,
attContent
:
res
})
}
})
}
}
},
handleVideoChange
(
e
,
targetItem
)
{
var
file
=
e
.
srcElement
.
files
[
0
]
var
reader
=
new
FileReader
()
// 默认1MB
const
limitSize
=
targetItem
.
limitSize
||
1
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传视频大小不能超过'
+
limitSize
+
'MB!'
)
return
true
}
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
if
(
res
)
{
console
.
log
(
res
)
this
.
previewList
.
push
({
attType
:
ATT_TYPE
.
VEDIO
,
attContent
:
res
})
}
})
}
},
handleImg
(
e
)
{
var
reader
=
new
FileReader
()
var
file
=
e
.
srcElement
.
files
[
0
]
console
.
log
(
file
)
// 默认1MB
const
limitSize
=
10
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传图片大小不能超过'
+
limitSize
+
'MB!'
)
return
true
}
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
var
image
=
new
Image
()
image
.
src
=
e
.
target
.
result
image
.
onload
=
()
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$set
(
this
.
appletForm
,
'picUrl'
,
'dfasdfasfa'
)
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
if
(
res
)
{
console
.
log
(
res
)
this
.
$set
(
this
.
appletForm
,
'picUrl'
,
res
)
}
}
})
})
}
}
}
}
this
.
guestForm
.
imgUrl
=
'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'
},
},
handleImg
(
e
)
{},
switchDailog
(
funName
)
{
switchDailog
(
funName
)
{
console
.
log
(
funName
)
console
.
log
(
funName
)
if
(
funName
==
'link'
)
{
if
(
funName
==
'link'
)
{
...
@@ -219,7 +249,16 @@ export default {
...
@@ -219,7 +249,16 @@ export default {
case
'添加网页消息'
:
case
'添加网页消息'
:
this
.
$refs
.
linkForm
.
validate
(
valid
=>
{
this
.
$refs
.
linkForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
alert
(
'submit!'
)
console
.
log
(
this
.
linkForm
)
this
.
previewList
.
push
({
attType
:
ATT_TYPE
.
URL
,
attContent
:
this
.
linkForm
})
this
.
closeDialog
(
'linkForm'
)
// this.dialogVisible = !this.dialogVisible
// this.linkForm = {}
// this.$refs.linkForm.clearValidate()
}
else
{
}
else
{
console
.
log
(
'error submit!!'
)
console
.
log
(
'error submit!!'
)
return
false
return
false
...
@@ -227,9 +266,18 @@ export default {
...
@@ -227,9 +266,18 @@ export default {
})
})
break
break
case
'添加小程序'
:
case
'添加小程序'
:
console
.
log
(
this
.
appletForm
)
this
.
$refs
.
appletForm
.
validate
(
valid
=>
{
this
.
$refs
.
appletForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
alert
(
'submit!'
)
console
.
log
(
this
.
appletForm
)
this
.
previewList
.
push
({
attType
:
ATT_TYPE
.
MINIPROGRAM
,
attContent
:
this
.
appletForm
})
this
.
closeDialog
(
'appletForm'
)
// this.dialogVisible = !this.dialogVisible
// this.appletForm = {}
// this.$refs.appletForm.clearValidate()
}
else
{
}
else
{
console
.
log
(
'error submit!!'
)
console
.
log
(
'error submit!!'
)
return
false
return
false
...
@@ -243,6 +291,40 @@ export default {
...
@@ -243,6 +291,40 @@ export default {
close
(
index
)
{
close
(
index
)
{
this
.
previewList
.
splice
(
index
,
1
)
this
.
previewList
.
splice
(
index
,
1
)
this
.
eventBus
.
$emit
(
'update'
,
this
.
previewList
)
this
.
eventBus
.
$emit
(
'update'
,
this
.
previewList
)
},
textInput
(
val
)
{
console
.
log
(
val
)
const
hasText
=
this
.
previewList
.
some
(
item
=>
item
.
attType
==
1
)
console
.
log
(
hasText
)
if
(
hasText
)
{
this
.
$set
(
this
.
previewList
,
0
,
{
attContent
:
val
,
attType
:
ATT_TYPE
.
TEXT
})
}
else
{
this
.
previewList
.
unshift
({
attContent
:
val
,
attType
:
ATT_TYPE
.
TEXT
})
}
console
.
log
(
this
.
previewList
)
},
closeDialog
()
{
if
(
this
.
dialogVisible
)
{
if
(
this
.
$refs
.
linkForm
)
this
.
$refs
.
linkForm
.
clearValidate
()
this
.
linkForm
=
{}
if
(
this
.
$refs
.
appletForm
)
this
.
$refs
.
appletForm
.
clearValidate
()
this
.
appletForm
=
{}
}
this
.
dialogVisible
=
!
this
.
dialogVisible
},
updateList
(
val
)
{
this
.
previewList
=
val
this
.
eventBus
.
$emit
(
'update'
,
this
.
previewList
)
const
obj
=
val
.
find
(
item
=>
item
.
attType
==
1
)
if
(
obj
)
{
this
.
text
=
obj
.
attContent
}
}
}
}
}
}
}
...
@@ -250,15 +332,17 @@ export default {
...
@@ -250,15 +332,17 @@ export default {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.welcome-box
{
.welcome-box
{
padding-top
:
20px
;
//
padding-top
:
20px
;
margin-left
:
87px
;
//
margin-left
:
87px
;
}
}
.content
{
.content
{
display
:
inline-block
;
display
:
inline-block
;
vertical-align
:
text-top
;
vertical-align
:
text-top
;
width
:
calc
(
100%
-
103px
);
width
:
calc
(
100%
-
103px
);
margin-left
:
12px
;
//
margin-left
:
12px
;
background-color
:
#f7f7f7
;
.content-bg
{
background-color
:
#f7f7f7
;
}
.welcome-file
{
.welcome-file
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
@@ -332,9 +416,12 @@ export default {
...
@@ -332,9 +416,12 @@ export default {
}
}
.form-upload
{
.form-upload
{
position
:
absolute
;
position
:
absolute
;
width
:
100%
;
top
:
0
;
width
:
140px
;
//
width
:
100%
;
height
:
100%
;
height
:
100%
;
cursor
:
pointer
;
cursor
:
pointer
;
z-index
:
1
;
}
}
/
deep
/
{
/
deep
/
{
.el-textarea__inner
{
.el-textarea__inner
{
...
@@ -348,6 +435,9 @@ export default {
...
@@ -348,6 +435,9 @@ export default {
background-color
:
#f7f7f7
;
background-color
:
#f7f7f7
;
}
}
}
}
.upload
{
position
:
relative
;
}
.upload-bg
{
.upload-bg
{
position
:
relative
;
position
:
relative
;
width
:
140px
;
width
:
140px
;
...
@@ -362,7 +452,7 @@ export default {
...
@@ -362,7 +452,7 @@ export default {
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
font-size
:
30px
;
font-size
:
30px
;
}
}
div
{
.upload-text
{
position
:
absolute
;
position
:
absolute
;
bottom
:
40px
;
bottom
:
40px
;
left
:
50%
;
left
:
50%
;
...
@@ -372,7 +462,7 @@ export default {
...
@@ -372,7 +462,7 @@ export default {
}
}
.tips-text
{
.tips-text
{
display
:
flex
;
display
:
flex
;
align-
self
:
center
;
align-
items
:
center
;
justify-self
:
center
;
justify-self
:
center
;
color
:
#000
;
color
:
#000
;
font-size
:
14px
;
font-size
:
14px
;
...
...
src/views/guestGroup/index.vue
View file @
5acd95c
...
@@ -8,18 +8,18 @@
...
@@ -8,18 +8,18 @@
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<search-form
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formList=
"searchFormData"
@
searchTable=
"searchTable"
@
syncClick=
"syncClick"
>
<search-form
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formList=
"searchFormData"
>
<span
class=
"inline-b"
slot=
"form-slot"
>
<span
class=
"inline-b"
slot=
"form-slot"
>
<el-button
type=
"primary"
@
click=
"searchTable"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"searchTable"
>
查询
</el-button>
</span>
</span>
</search-form>
</search-form>
<!-- 表格区域 开始 -->
<!-- 表格区域 开始 -->
<GLTable
ref=
"gueastGroup"
:
tableData=
"tableData"
:searchForm=
"searchFormData
"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
<GLTable
ref=
"gueastGroup"
:
getListApi=
"getListApi"
:searchForm=
"searchForm
"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
>
<div
slot=
"entmicro-name"
class=
"entmicro"
slot-scope=
"scope"
>
<div
slot=
"entmicro-name"
class=
"entmicro"
slot-scope=
"scope"
>
<span
v-for=
"(i, index) in scope.scope.userList"
:key=
"index"
>
{{
i
.
name
}}
(
{{
i
.
tips
}}
);
</span>
<span
v-for=
"(i, index) in scope.scope.userList"
:key=
"index"
>
{{
i
.
staffName
}}
(
{{
i
.
departmentName
}}
);
</span>
</div>
</div>
<span
slot=
"status"
slot-scope=
"scope"
>
<span
slot=
"status"
slot-scope=
"scope"
>
<span
class=
"statusText"
:class=
"
{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">
{{
s
tatusText
(
scope
.
scope
.
status
)
}}
</span>
<span
class=
"statusText"
:class=
"
{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">
{{
s
cope
.
scope
.
status
==
'1'
?
'启用'
:
'停用'
}}
</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=
"btnClick('edit', scope.scope)"
>
修改
</el-button>
<el-button
type=
"text"
@
click=
"btnClick('edit', scope.scope)"
>
修改
</el-button>
...
@@ -40,7 +40,7 @@ export default {
...
@@ -40,7 +40,7 @@ export default {
{
{
type
:
'input'
,
type
:
'input'
,
inputType
:
'text'
,
inputType
:
'text'
,
prop
:
'
org
Name'
,
prop
:
'
group
Name'
,
label
:
'组名'
,
label
:
'组名'
,
placeholder
:
'请输入组名搜索'
placeholder
:
'请输入组名搜索'
}
}
...
@@ -48,7 +48,7 @@ export default {
...
@@ -48,7 +48,7 @@ export default {
// 表格
// 表格
getListApi
:
this
.
$apis
.
groupGuest
.
templateList
,
getListApi
:
this
.
$apis
.
groupGuest
.
templateList
,
tableParams
:
{
tableParams
:
{
listName
:
'
data
'
,
listName
:
''
,
tableOption
:
false
,
tableOption
:
false
,
otherOptions
:
{
otherOptions
:
{
label
:
'启用开关'
label
:
'启用开关'
...
@@ -180,17 +180,13 @@ export default {
...
@@ -180,17 +180,13 @@ export default {
//搜索表格
//搜索表格
searchTable
()
{
searchTable
()
{
console
.
log
(
this
.
searchForm
)
console
.
log
(
this
.
searchForm
)
// this.$refs.gueastGroup.refreshTable()
this
.
$refs
.
gueastGroup
.
refreshTable
()
},
statusText
(
val
)
{
console
.
log
(
val
)
return
val
===
'1'
?
'启用'
:
'停用'
},
},
btnClick
(
name
,
rowData
)
{
btnClick
(
name
,
rowData
)
{
console
.
log
(
name
)
console
.
log
(
name
)
switch
(
name
)
{
switch
(
name
)
{
case
'create'
:
case
'create'
:
this
.
$router
.
push
(
'/guestGroup/add/'
+
1
)
this
.
$router
.
push
(
'/guestGroup/add/'
+
-
1
)
break
break
case
'edit'
:
case
'edit'
:
this
.
$router
.
push
(
'/guestGroup/add/'
+
rowData
.
id
)
this
.
$router
.
push
(
'/guestGroup/add/'
+
rowData
.
id
)
...
@@ -202,10 +198,29 @@ export default {
...
@@ -202,10 +198,29 @@ export default {
type
:
'warning'
type
:
'warning'
})
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
$message
({
const
params
=
{
type
:
'success'
,
id
:
rowData
.
id
,
message
:
'操作成功!'
status
:
rowData
.
status
==
1
?
2
:
1
,
})
merchantId
:
1
}
this
.
$apis
.
groupGuest
.
status
(
params
)
.
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
searchTable
()
this
.
$message
({
type
:
'success'
,
message
:
'操作成功!'
})
}
})
.
catch
(
err
=>
{
this
.
$message
({
type
:
'error'
,
message
:
err
.
message
})
})
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
$message
({
this
.
$message
({
...
...
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