Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 1b06135b
authored
Nov 16, 2020
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新建群发页面各弹窗组件抽离等
1 parent
a9e49d76
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
319 additions
and
38 deletions
linkwe-ui/src/components/SelectMaterial/index.vue
linkwe-ui/src/components/SelectMaterial/list.vue
linkwe-ui/src/components/SelectTag.vue
linkwe-ui/src/components/SelectUser.vue
linkwe-ui/src/utils/request.js
linkwe-ui/src/views/groupMessage/add.vue
linkwe-ui/src/components/SelectMaterial/index.vue
0 → 100644
View file @
1b06135
<
script
>
import
{
getList
}
from
'@/api/customer/tag'
import
list
from
'./list'
export
default
{
components
:
{
list
},
props
:
{
// 添加标签显隐
visible
:
{
type
:
Boolean
,
default
:
false
,
},
title
:
{
type
:
String
,
default
:
''
,
},
type
:
{
type
:
String
,
default
:
'0'
,
},
},
data
()
{
return
{
typeText
:
[
'文本'
,
'图片'
],
}
},
watch
:
{
type
(
val
)
{
val
===
'remove'
&&
(
this
.
removeTag
=
this
.
selected
.
slice
())
},
},
computed
:
{
Pvisible
:
{
get
()
{
// this.getTree();
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
},
},
Ptype
:
{
get
()
{
// this.getTree();
return
this
.
type
},
set
(
val
)
{
this
.
$emit
(
'update:type'
,
val
)
},
},
},
created
()
{},
mounted
()
{},
methods
:
{
submit
()
{
this
.
Pvisible
=
false
this
.
$emit
(
'success'
,
this
.
Pselected
)
},
},
}
</
script
>
<
template
>
<el-dialog
:title=
"`选择$
{typeText[Ptype]}素材`"
:visible.sync="Pvisible"
width="650px"
>
<div>
<el-tabs
v-model=
"Ptype"
>
<el-tab-pane
name=
"0"
>
<span
slot=
"label"
>
<i
class=
"el-icon-date"
></i>
文本
</span>
<list
type=
"4"
>
</list>
</el-tab-pane>
<el-tab-pane
name=
"1"
>
<span
slot=
"label"
>
<i
class=
"el-icon-date"
></i>
图片
</span>
<list
type=
"0"
>
</list>
</el-tab-pane>
<!--
<el-tab-pane
name=
"2"
>
<span
slot=
"label"
>
<i
class=
"el-icon-date"
></i>
文件
</span>
<list>
<el-table
:data=
"list"
style=
"width: 100%"
>
<el-table-column
width=
"50"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row.id"
></el-radio>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
</el-table>
</list>
</el-tab-pane>
-->
</el-tabs>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Pvisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
确 定
</el-button>
</div>
</el-dialog>
</template>
<
style
lang=
"scss"
scoped
>
.user-list
{
.el-row
{
line-height
:
26px
;
}
}
.mr30
{
margin-right
:
30px
;
}
</
style
>
linkwe-ui/src/components/SelectMaterial/list.vue
0 → 100644
View file @
1b06135
<
script
>
import
{
getTree
,
getList
}
from
'@/api/material'
export
default
{
components
:
{},
props
:
{
type
:
{
type
:
String
,
default
:
'4'
,
},
},
data
()
{
return
{
loading
:
true
,
// 遮罩层
// 查询条件
query
:
{
pageNum
:
1
,
pageSize
:
10
,
categoryId
:
''
,
search
:
''
,
mediaType
:
'4'
,
},
list
:
[],
// 列表
total
:
0
,
// 总条数
treeData
:
[],
// 树
// 树props
treeProps
:
{
children
:
'children'
,
label
:
'name'
,
},
// 分组props
groupProps
:
{
// expandTrigger: 'hover',
checkStrictly
:
true
,
children
:
'children'
,
label
:
'name'
,
value
:
'id'
,
emitPath
:
false
,
},
radio
:
''
,
}
},
watch
:
{},
computed
:
{},
created
()
{
this
.
query
.
mediaType
=
this
.
type
this
.
getTree
()
this
.
getList
()
},
mounted
()
{},
methods
:
{
// 获取类目树
getTree
()
{
getTree
(
this
.
type
).
then
(({
data
})
=>
{
this
.
treeData
=
data
})
},
// 获取素材列表
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
getList
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
total
=
+
total
this
.
loading
=
false
this
.
$emit
(
'listChange'
,
this
.
list
)
})
.
catch
(()
=>
{
this
.
loading
=
false
})
},
},
}
</
script
>
<
template
>
<div>
<el-form
ref=
"form"
:model=
"query"
label-width=
"80px"
>
<el-form-item
label=
"选择分组"
>
<el-cascader
v-model=
"query.categoryId"
:options=
"treeData"
:props=
"groupProps"
></el-cascader>
<el-input
v-model=
"query.search"
class=
"ml10 mr10"
style=
"width: 150px;"
@
keydown
.
enter=
"getList(1)"
></el-input>
<el-button
v-hasPermi=
"['contacts:organization:query']"
icon=
"el-icon-search"
circle
@
click=
"getList(1)"
></el-button>
<el-pagination
class=
"fr"
@
current-change=
"getList"
:current-page=
"query.pageNum"
:page-size=
"query.pageSize"
layout=
"prev, pager, next"
:total=
"total"
></el-pagination>
</el-form-item>
</el-form>
<!--
<slot
:list=
"list"
></slot>
-->
<!-- 文本 -->
<el-table
v-if=
"type == 4"
:data=
"list"
:show-header=
"false"
>
<el-table-column
width=
"30"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row.id"
>
'
</el-radio>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
</el-table>
<!-- 图片 -->
<el-radio-group
v-if=
"type == 0"
class=
"img-wrap"
v-model=
"radio"
>
<el-radio
v-for=
"(item, index) in list"
:label=
"item.id"
:key=
"index"
>
<img
class=
"img-li"
:src=
"item.materialUrl"
alt
/>
</el-radio>
</el-radio-group>
</div>
</template>
<
style
lang=
"scss"
scoped
>
.img-wrap
{
/deep/.el-radio__input
{
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
}
//
.img-li
{
//
width
:
115px
;
//
height
:
160px
;
//
}
</
style
>
linkwe-ui/src/components/SelectTag.vue
View file @
1b06135
...
...
@@ -90,7 +90,7 @@ export default {
<el-checkbox-group
v-model=
"Pselected"
v-if=
"type !== 'remove'"
>
<template
v-for=
"(item, index) in list"
>
<div
class=
"bfc-d"
class=
"bfc-d
mr30
"
v-show=
"item.groupId === selectedGroup || !selectedGroup"
:key=
"index"
>
...
...
@@ -129,4 +129,7 @@ export default {
line-height
:
26px
;
}
}
.mr30
{
margin-right
:
30px
;
}
</
style
>
linkwe-ui/src/components/SelectUser.vue
View file @
1b06135
<
script
>
import
*
as
api
from
"@/api/organization"
;
import
{
getTree
,
getList
}
from
'@/api/organization'
import
{
createUniqueString
}
from
'@/utils'
export
default
{
name
:
"SelectUser"
,
name
:
'SelectUser'
,
components
:
{},
props
:
{
// 添加标签显隐
...
...
@@ -12,34 +12,40 @@ export default {
},
title
:
{
type
:
String
,
default
:
"选择成员"
,
default
:
'选择成员'
,
},
// 是否 只选择叶子节点(人员节点)/禁止选择父节点(部门节点)
isOnlyLeaf
:
{
type
:
Boolean
,
default
:
true
,
},
},
data
()
{
let
isOnlyLeaf
=
this
.
isOnlyLeaf
return
{
treeData
:
[],
userList
:
[],
defaultProps
:
{
label
:
"name"
,
children
:
"children"
,
label
:
'name'
,
children
:
'children'
,
disabled
(
data
,
node
)
{
return
!
data
.
userId
;
return
isOnlyLeaf
&&
!
data
.
userId
},
isLeaf
(
data
,
node
)
{
return
!!
data
.
userId
;
return
!!
data
.
userId
},
},
}
;
}
},
watch
:
{},
computed
:
{
Pvisible
:
{
get
()
{
// this.getTree();
return
this
.
visible
;
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
"update:visible"
,
val
);
this
.
$emit
(
'update:visible'
,
val
)
},
},
},
...
...
@@ -48,36 +54,46 @@ export default {
methods
:
{
loadNode
(
node
,
resolve
)
{
if
(
node
.
level
===
0
)
{
this
.
userList
=
[];
api
.
getTree
().
then
(({
data
})
=>
{
let
_data
=
this
.
handleTree
(
data
);
resolve
(
_data
);
this
.
userList
=
[]
getTree
().
then
(({
data
})
=>
{
data
.
forEach
((
element
)
=>
{
element
.
key
=
createUniqueString
()
})
let
_data
=
this
.
handleTree
(
data
)
console
.
log
(
'd'
,
data
)
resolve
(
_data
)
// api.getList({ department: _data[0].id }).then(({ rows, total }) => {
// _data && rows.unshift(..._data);
// resolve(rows);
// });
})
;
})
}
else
{
api
.
getList
({
department
:
node
.
data
.
id
}).
then
(({
rows
,
total
})
=>
{
node
.
data
.
children
&&
rows
.
push
(...
node
.
data
.
children
);
resolve
(
rows
);
});
getList
({
department
:
node
.
data
.
id
}).
then
(({
rows
})
=>
{
rows
.
forEach
((
element
)
=>
{
element
.
key
=
createUniqueString
()
})
node
.
data
.
children
&&
rows
.
push
(...
node
.
data
.
children
)
resolve
(
rows
)
})
}
},
handleCheckChange
(
data
,
checked
,
indeterminate
)
{
checked
?
this
.
userList
.
push
(
data
)
:
this
.
userList
.
splice
(
this
.
userList
.
indexOf
(
data
),
1
)
;
:
this
.
userList
.
splice
(
this
.
userList
.
indexOf
(
data
),
1
)
// console.log(data, checked, indeterminate);
},
submit
()
{
this
.
Pvisible
=
false
;
this
.
$emit
(
"success"
,
this
.
userList
);
this
.
Pvisible
=
false
this
.
$emit
(
'success'
,
this
.
userList
)
},
cancle
(
key
)
{
this
.
$refs
.
tree
.
setChecked
(
key
,
false
)
},
},
}
;
}
</
script
>
setChecked
<
template
>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
>
<el-row
:gutter=
"20"
>
...
...
@@ -87,14 +103,16 @@ export default {
<!--
<div>
部门架构
</div>
-->
<!-- :filter-node-method="filterNode" -->
<el-tree
v-if=
"Pvisible
"
node-key=
"key
"
ref=
"tree"
lazy
accordion
show-checkbox
check-on-click-node
:expand-on-click-node=
"true"
:load=
"loadNode"
:props=
"defaultProps"
:check-strictly=
"!isOnlyLeaf"
@
check-change=
"handleCheckChange"
></el-tree>
</div>
...
...
@@ -104,7 +122,12 @@ export default {
<el-row
:gutter=
"10"
>
选择人员列表
</el-row>
<el-row
v-for=
"(item, index) in userList"
:key=
"index"
>
<i
class=
"el-icon-user-solid"
></i>
{{
item
.
name
}}
{{
item
.
name
}}
<i
class=
"el-icon-minus fr cp"
title=
"取消选择"
@
click=
"cancle(item.key)"
></i>
</el-row>
</el-col>
</el-row>
...
...
linkwe-ui/src/utils/request.js
View file @
1b06135
...
...
@@ -38,16 +38,19 @@ service.interceptors.response.use(
if
(
code
===
200
)
{
return
res
.
data
}
else
if
(
code
===
401
)
{
// MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }
// ).then(() => {
// store.dispatch('LogOut').then(() => {
// location.href = '/index';
// })
// })
MessageBox
.
confirm
(
'登录状态已过期,您可以继续留在该页面,或者重新登录'
,
'系统提示'
,
{
confirmButtonText
:
'重新登录'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
location
.
href
=
'/'
})
})
}
else
if
(
code
===
500
)
{
Message
({
message
:
msg
,
...
...
linkwe-ui/src/views/groupMessage/add.vue
View file @
1b06135
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