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 e5439bd2
authored
Oct 29, 2020
by
[zmy2771345724]
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
素材页面,各个接口函数,接口暂未通。等待继续优化
1 parent
89d2b0cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
37 deletions
linkwe-ui/src/api/zmyApi/sucai-guanli/all.js
linkwe-ui/src/components/zmyComponents/zmyDialog.vue
linkwe-ui/src/views/material/text.vue
linkwe-ui/src/api/zmyApi/sucai-guanli/all.js
View file @
e5439bd
import
request
from
'@/utils/request'
import
axios
from
'axios'
export
function
getList
(
data
)
{
return
request
({
url
:
'/w
agesApi/listWages'
,
method
:
'get'
,
data
})
return
request
({
url
:
'/w
ecom/material/list'
,
method
:
'get'
,
params
:
data
})
}
export
function
info
(
data
)
{
return
request
({
url
:
'/wecom/material'
,
method
:
'get'
,
data
})
return
request
({
url
:
'/wecom/material'
,
method
:
'get'
,
params
:
data
})
}
export
function
add
(
data
)
{
return
request
({
url
:
'/wecom/material'
,
method
:
'post'
,
data
})
return
request
({
url
:
'/wecom/material'
,
method
:
'post'
,
params
:
data
})
}
export
function
edit
(
data
)
{
return
request
({
url
:
'/w
agesApi/editWages'
,
method
:
'post'
,
data
})
return
request
({
url
:
'/w
ecom/material'
,
method
:
'put'
,
params
:
data
})
}
export
function
del
(
data
)
{
return
request
({
url
:
'/w
agesApi/delWages'
,
method
:
'post'
,
data
})
return
request
({
url
:
'/w
ecom/material'
,
method
:
'del'
,
params
:
data
})
}
export
function
doExport
(
data
)
{
return
request
({
url
:
'/w
agesApi/doExport'
,
method
:
'post'
,
responseType
:
'blob'
,
data
})
return
request
({
url
:
'/w
ecom/material'
,
method
:
'post'
,
responseType
:
'blob'
,
params
:
data
})
}
export
function
doImport
(
data
)
{
return
request
({
url
:
'/w
agesApi/doImport'
,
method
:
'post'
,
responseType
:
'blob'
,
data
})
return
request
({
url
:
'/w
ecom/material'
,
method
:
'post'
,
responseType
:
'blob'
,
params
:
data
})
}
export
function
getTemplate
(
data
)
{
return
request
({
url
:
'/w
agesApi/getTemplate'
,
method
:
'get'
,
responseType
:
'blob'
,
data
})
return
request
({
url
:
'/w
ecom/material'
,
method
:
'get'
,
responseType
:
'blob'
,
params
:
data
})
}
export
function
upload
(
data
)
{
return
request
({
url
:
'/wecom/material'
,
method
:
'get'
,
params
:
data
})
}
export
function
getTreeList
(
data
)
{
return
request
({
url
:
'/wecom/category/list'
,
method
:
'get'
,
params
:
data
})
}
export
function
infoTree
(
data
)
{
return
request
({
url
:
'/wecom/category'
,
method
:
'get'
,
params
:
data
})
}
export
function
addTree
(
data
)
{
return
request
({
url
:
'/wecom/category'
,
method
:
'post'
,
params
:
data
})
}
export
function
editTree
(
data
)
{
return
request
({
url
:
'/wecom/category'
,
method
:
'put'
,
params
:
data
})
}
export
function
delTree
(
data
)
{
return
request
({
url
:
'/wecom/category'
,
method
:
'del'
,
params
:
data
})
}
\ No newline at end of file
linkwe-ui/src/components/zmyComponents/zmyDialog.vue
View file @
e5439bd
...
...
@@ -67,7 +67,7 @@
<el-form-item
class=
"dialog-footer"
>
<el-button
v-for=
"btnItem in dialogBtns"
:key=
"btnItem.label"
:type=
"btnItem.type || 'primary'"
style=
"b
ackground-color:#2EA39D;b
order-color:#fff"
style=
"border-color:#fff"
:size=
"btnItem.size || 'medium'"
@
click=
"btnItem.handle(dialogData)"
>
{{
btnItem
.
label
}}
</el-button>
...
...
@@ -171,12 +171,13 @@ export default {
width
:
100%
!important
;
}
/
deep
/
.el-dialog__header
{
background-color
:
#2EA39D
;
//
background-color
:
#2EA39D
;
text-align
:
center
;
}
/
deep
/
.el-dialog__title
{
color
:
#fff
!important
;
font-weight
:
550
;
color
:
#000
;
//
font-weight
:
550
;
font-size
:
22px
;
}
/
deep
/
.el-select
{
...
...
linkwe-ui/src/views/material/text.vue
View file @
e5439bd
...
...
@@ -37,6 +37,11 @@
:dialogForm=
"dialogForms"
:rules=
"dialog.rules"
:dialogBtns=
"dialogBtns"
:dialogWidth=
"dialog.dialogWidth"
>
</zmy-dialog>
</div>
<div
class=
'ces-dialog'
>
<zmy-dialog
:title=
"dialog2.title"
:dialogFormVisible=
"dialog2.visible"
:dialogData=
"dialog2.dialogData"
:dialogForm=
"dialogForms2"
:rules=
"dialog2.rules"
:dialogBtns=
"dialogBtns2"
:dialogWidth=
"dialog2.dialogWidth"
>
</zmy-dialog>
</div>
</div>
</div>
</
template
>
...
...
@@ -48,7 +53,7 @@ const modules = {}
const
path
=
require
(
'path'
)
const
files
=
require
.
context
(
'@/components/zmyComponents'
,
false
,
/
\.
vue$/
)
files
.
keys
().
forEach
(
key
=>
{
const
name
=
path
.
basename
(
key
,
'.vue'
);
modules
[
name
]
=
files
(
key
).
default
||
files
(
key
)})
import
{
getList
,
info
,
add
,
edit
,
del
,
doExport
,
doImport
,
getTemplat
e
}
from
'@/api/zmyApi/sucai-guanli/all.js'
import
{
getList
,
info
,
add
,
edit
,
del
,
getTreeList
,
infoTree
,
addTree
,
editTree
,
delTre
e
}
from
'@/api/zmyApi/sucai-guanli/all.js'
import
{
isEmpty
,
objCopy
,
initObj
}
from
'@/utils/zmyUtils'
export
default
{
components
:
modules
,
...
...
@@ -100,17 +105,23 @@ export default {
dialogtip
:
'add'
,
selectArr
:[],
tableData
:
[],
searchValue
:{
categoryId
:
''
,
total
:
0
,
pageNum
:
1
,
pageSize
:
10
,},
searchValue
:{
categoryId
:
4
,
search
:
''
,
pageNum
:
1
,
pageSize
:
10
,},
options
:{},
dialog
:{
title
:
''
,
dialogWidth
:
'
6
0%'
,
dialogWidth
:
'
5
0%'
,
dialogRef
:
'form1'
,
visible
:
false
,
dialogData
:{},
rules
:{
class_name
:[{
required
:
true
,
message
:
"请输入"
,
trigger
:
"blur"
}],
}
dialogData
:{
id
:
''
,
parentId
:
''
,
name
:
''
,
mediaType
:
4
},
rules
:{}
},
dialog2
:{
title
:
''
,
dialogWidth
:
'60%'
,
dialogRef
:
'form2'
,
visible
:
false
,
dialogData
:{
categoryId
:
''
,
id
:
''
,
content
:
''
,
mediaType
:
4
},
rules
:{}
},
};
},
...
...
@@ -118,7 +129,11 @@ export default {
// 树事件
treeEvent
(){
return
{
addParent
:()
=>
{
this
.
$message
.
error
(
'123'
)},
addParent
:()
=>
{
this
.
dialogtip
=
'add'
;
this
.
dialog
.
title
=
'新增父节点'
;
this
.
dialog
.
dialogData
=
{
parentId
:
''
,
id
:
''
,
name
:
''
,
mediaType
:
4
};
this
.
dialog
.
visible
=
true
;
},
edit
:(
node
,
data
)
=>
{
this
.
$message
.
error
(
'123'
)},
append
:(
node
,
data
)
=>
{
this
.
$message
.
error
(
'123'
)},
remove
:(
node
,
data
)
=>
{
this
.
$message
.
error
(
'123'
)},
...
...
@@ -128,19 +143,19 @@ export default {
// 搜索框
searchForm
(){
return
[
{
type
:
'Input'
,
label
:
'文本素材'
,
prop
:
'
name
'
},
{
type
:
'Input'
,
label
:
'文本素材'
,
prop
:
'
search
'
},
{
type
:
'search'
,
handle
:(
that
,
row
)
=>
{
this
.
fetchData
();
}},
]
},
searchBtns
(){
return
[
{
label
:
'移动分组'
,
type
:
'danger'
,
handle
:()
=>
{
{
label
:
'移动分组'
,
type
:
'danger'
,
handle
:()
=>
{
}},
{
label
:
'添加文本'
,
type
:
'danger'
,
handle
:()
=>
{
this
.
dialogtip
=
'add'
;
this
.
dialog
.
title
=
'新增'
;
this
.
dialog
.
dialogData
=
initObj
(
this
.
dialog
.
dialogData
,[
'school_id'
]);
this
.
dialog
.
visible
=
true
;
this
.
dialogtip
=
'add'
;
this
.
dialog
2
.
title
=
'新增'
;
this
.
dialog
2
.
dialogData
=
initObj
(
this
.
dialog2
.
dialogData
,[
]);
this
.
dialog
2
.
visible
=
true
;
}},
{
label
:
'删除'
,
type
:
'danger'
,
handle
:()
=>
{
let
that
=
this
;
...
...
@@ -154,12 +169,13 @@ export default {
},
tableCols
(){
return
[
{
label
:
'届次'
,
prop
:
'grade_name'
},
{
label
:
'文本名称'
,
prop
:
'grade_name'
},
{
label
:
'时间'
,
prop
:
'grade_name'
},
{
label
:
'操作'
,
type
:
'Button'
,
width
:
'240px'
,
btnList
:[
{
type
:
"primary"
,
label
:
'编辑'
,
class
:
'el-icon-edit'
,
handle
:(
that
,
row
)
=>
{
this
.
dialogtip
=
'edit'
;
this
.
dialog
.
title
=
'编辑'
;
this
.
dialog
.
dialogData
=
objCopy
(
this
.
dialog
.
dialogData
,
row
);
this
.
dialog
.
visible
=
true
;
this
.
dialogtip
=
'edit'
;
this
.
dialog
2
.
title
=
'编辑'
;
this
.
dialog
2
.
dialogData
=
objCopy
(
this
.
dialog2
.
dialogData
,
row
);
this
.
dialog
2
.
visible
=
true
;
}},
]},
...
...
@@ -167,17 +183,28 @@ export default {
},
dialogForms
(){
return
[
{
type
:
'Select'
,
label
:
'届次'
,
prop
:
'grade_id'
,
options
:
this
.
options
.
nianjiOption
,
props
:{
label
:
'label'
,
value
:
'value'
},
placeholder
:
'请选择'
,
change
:
row
=>
{
}},
{
type
:
'Input'
,
label
:
'节点名称'
,
prop
:
'name'
,
placeholder
:
'请输入'
},
]
},
dialogForms2
(){
return
[
{
type
:
'Input'
,
label
:
'文本分类'
,
prop
:
'name'
,
placeholder
:
'请输入'
},
{
type
:
'TextArea'
,
label
:
'文本内容'
,
prop
:
'content'
,
placeholder
:
'请输入'
,
width
:
'100%'
},
]
},
dialogBtns
(){
return
[
{
label
:
'保存'
,
type
:
'primary'
,
handle
:(
value
)
=>
{
console
.
log
(
this
.
dialog
.
dialogData
)
if
(
!
isEmpty
(
this
.
dialog
.
dialogData
,[
'
class_
id'
])){
this
.
$message
.
error
(
'请先填写所有信息再进行保存!'
);
return
;
}
if
(
!
isEmpty
(
this
.
dialog
.
dialogData
,[
'
parentId'
,
'
id'
])){
this
.
$message
.
error
(
'请先填写所有信息再进行保存!'
);
return
;
}
if
(
this
.
dialogtip
==
'add'
){
add
(
this
.
dialog
.
dialogData
).
then
(
res
=>
{
let
params
=
{
mediaType
:
this
.
dialog
.
dialogData
.
mediaType
,
name
:
this
.
dialog
.
dialogData
.
name
,
parentId
:
''
}
addTree
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
1
){
this
.
$message
.
success
(
'新增成功'
);
this
.
dialog
.
dialogData
=
initObj
(
this
.
dialog
.
dialogData
,[
'school_id'
]);
...
...
@@ -200,20 +227,64 @@ export default {
}}
]
},
dialogBtns2
(){
return
[
{
label
:
'保存'
,
type
:
'primary'
,
handle
:(
value
)
=>
{
console
.
log
(
this
.
dialog
.
dialogData
)
if
(
!
isEmpty
(
this
.
dialog
.
dialogData
,[
'parentId'
,
'id'
])){
this
.
$message
.
error
(
'请先填写所有信息再进行保存!'
);
return
;
}
if
(
this
.
dialogtip
==
'add'
){
let
params
=
{
mediaType
:
this
.
dialog
.
dialogData
.
mediaType
,
name
:
this
.
dialog
.
dialogData
.
name
,
parentId
:
''
}
addTree
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
1
){
this
.
$message
.
success
(
'新增成功'
);
this
.
dialog
.
dialogData
=
initObj
(
this
.
dialog
.
dialogData
,[
'school_id'
]);
this
.
dialog
.
visible
=
false
;
this
.
fetchData
();
}
})
}
else
{
edit
(
this
.
dialog
.
dialogData
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
1
){
this
.
$message
.
success
(
'编辑成功'
);
this
.
dialog
.
dialogData
=
initObj
(
this
.
dialog
.
dialogData
,[
'school_id'
]);
this
.
dialog
.
visible
=
false
;
this
.
fetchData
();
}
})
}
}},
{
label
:
'返回'
,
type
:
'info'
,
handle
:(
value
)
=>
{
this
.
dialog
.
dialogData
=
initObj
(
this
.
dialog
.
dialogData
,[
'school_id'
]);
this
.
dialog
.
visible
=
false
;
}}
]
}
},
methods
:
{
fetchData
(){
this
.
loading
=
true
;
this
.
tableData
=
[];
getList
(
this
.
searchValue
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
1
){
this
.
searchValue
.
total
=
res
.
data
.
data
.
total
;
this
.
tableData
=
res
.
data
.
data
.
data
;
console
.
log
(
res
)
if
(
res
.
code
==
200
){
this
.
searchValue
.
total
=
parseInt
(
res
.
total
)
;
this
.
tableData
=
res
.
rows
;
setTimeout
(()
=>
{
this
.
loading
=
false
;},
500
)
}
})
},
getTreeDate
(){
let
params
=
{
mediaType
:
2
}
getTreeList
(
params
).
then
(
res
=>
{
})
},
select
(
all
,
current
){
this
.
selectArr
=
[];
all
.
forEach
(
item
=>
{
this
.
selectArr
.
push
(
item
)
})
},
selectAll
(
all
){
this
.
selectArr
=
[];
all
.
forEach
(
item
=>
{
this
.
selectArr
.
push
(
item
)
})
},
},
...
...
@@ -224,7 +295,8 @@ export default {
},
},
created
()
{
this
.
getTreeDate
()
this
.
fetchData
();
},
};
...
...
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