Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 e6bd9f8e
authored
Mar 17, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调整
1 parent
88a27f4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
src/views/material/addMaterial.vue
src/views/material/addMaterial.vue
View file @
e6bd9f8
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<input
type=
"file"
style=
"opacity: 0"
accept=
".pdf"
@
change=
"e => handlePdfChange(e)"
/>
<input
type=
"file"
style=
"opacity: 0"
accept=
".pdf"
@
change=
"e => handlePdfChange(e)"
/>
<el-button
icon=
"el-icon-plus"
:size=
"size"
>
选择文件
</el-button>
<el-button
icon=
"el-icon-plus"
:size=
"size"
>
选择文件
</el-button>
</div>
</div>
<div
v-if=
"
materialAddForm.materialUrl"
>
{{
materialAddForm
.
material
Url
}}
</div>
<div
v-if=
"
pdfUrl"
>
{{
pdf
Url
}}
</div>
</div>
</div>
<!-- 选择自定义链接 -->
<!-- 选择自定义链接 -->
<!--
<div
v-show=
"materialAddForm.materialType == 2"
>
<!--
<div
v-show=
"materialAddForm.materialType == 2"
>
...
@@ -202,6 +202,8 @@ export default {
...
@@ -202,6 +202,8 @@ export default {
dialogVisible
:
false
,
dialogVisible
:
false
,
tagging
:
[],
tagging
:
[],
urlSrc
:
''
,
urlSrc
:
''
,
pdfUrl
:
''
,
textBoxContent
:
''
,
materialAddForm
:
{
materialAddForm
:
{
groupId
:
''
,
groupId
:
''
,
groupName
:
''
,
groupName
:
''
,
...
@@ -258,7 +260,6 @@ export default {
...
@@ -258,7 +260,6 @@ export default {
var
params
=
{}
var
params
=
{}
params
.
id
=
this
.
routeInfo
.
id
params
.
id
=
this
.
routeInfo
.
id
this
.
$apis
.
material
.
materialDetail
(
params
).
then
(
res
=>
{
this
.
$apis
.
material
.
materialDetail
(
params
).
then
(
res
=>
{
console
.
log
(
res
,
'1212121212'
)
this
.
materialAddForm
=
res
this
.
materialAddForm
=
res
if
(
this
.
materialAddForm
.
businessType
)
{
if
(
this
.
materialAddForm
.
businessType
)
{
const
businessTypeArr
=
this
.
materialAddForm
.
businessType
.
split
(
','
)
const
businessTypeArr
=
this
.
materialAddForm
.
businessType
.
split
(
','
)
...
@@ -266,7 +267,11 @@ export default {
...
@@ -266,7 +267,11 @@ export default {
}
else
{
}
else
{
this
.
materialAddForm
.
businessType
=
[]
this
.
materialAddForm
.
businessType
=
[]
}
}
this
.
$refs
.
textBox
.
setEdit
(
this
.
materialAddForm
.
materialUrl
)
if
(
this
.
materialAddForm
.
materialType
==
3
)
{
this
.
$refs
.
textBox
.
setEdit
(
this
.
materialAddForm
.
materialUrl
)
}
else
if
(
this
.
materialAddForm
.
materialType
==
1
)
{
this
.
pdfUrl
=
this
.
materialAddForm
.
materialUrl
}
if
(
this
.
materialAddForm
.
tagJson
)
{
if
(
this
.
materialAddForm
.
tagJson
)
{
this
.
taggingList
=
eval
(
this
.
materialAddForm
.
tagJson
)
this
.
taggingList
=
eval
(
this
.
materialAddForm
.
tagJson
)
this
.
tagging
=
this
.
taggingList
.
map
(
item
=>
{
this
.
tagging
=
this
.
taggingList
.
map
(
item
=>
{
...
@@ -349,8 +354,7 @@ export default {
...
@@ -349,8 +354,7 @@ export default {
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
// console.log(res)
this
.
pdfUrl
=
res
this
.
materialAddForm
.
materialUrl
=
res
}
}
})
})
}
}
...
@@ -385,10 +389,22 @@ export default {
...
@@ -385,10 +389,22 @@ export default {
var
params
=
this
.
getParams
()
var
params
=
this
.
getParams
()
params
.
status
=
1
params
.
status
=
1
params
.
isNotifySender
=
-
1
params
.
isNotifySender
=
-
1
params
.
tagJson
=
JSON
.
stringify
(
this
.
taggingList
)
if
(
this
.
materialAddForm
.
isNotifySender
)
{
if
(
this
.
materialAddForm
.
isNotifySender
)
{
params
.
isNotifySender
=
0
params
.
isNotifySender
=
0
}
}
this
.
$apis
.
material
.
materialInsert
(
params
).
then
(
res
=>
{
if
(
params
.
materialType
==
1
)
{
params
.
materialUrl
=
this
.
pdfUrl
}
else
if
(
params
.
materialType
==
3
)
{
params
.
materialUrl
=
this
.
textBoxContent
}
let
material
if
(
params
.
id
)
{
material
=
'materialEdit'
}
else
{
material
=
'materialInsert'
}
this
.
$apis
.
material
[
material
](
params
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
$message
({
this
.
$message
({
message
:
'保存成功'
,
message
:
'保存成功'
,
...
@@ -416,13 +432,17 @@ export default {
...
@@ -416,13 +432,17 @@ export default {
if
(
this
.
materialAddForm
.
isNotifySender
)
{
if
(
this
.
materialAddForm
.
isNotifySender
)
{
params
.
isNotifySender
=
0
params
.
isNotifySender
=
0
}
}
if
(
params
.
materialType
==
1
)
{
params
.
materialUrl
=
this
.
pdfUrl
}
else
if
(
params
.
materialType
==
3
)
{
params
.
materialUrl
=
this
.
textBoxContent
}
let
material
let
material
if
(
params
.
id
)
{
if
(
params
.
id
)
{
material
=
'materialEdit'
material
=
'materialEdit'
}
else
{
}
else
{
material
=
'materialInsert'
material
=
'materialInsert'
}
}
console
.
log
(
params
,
'paramsw2wwww'
)
this
.
$apis
.
material
[
material
](
params
).
then
(
res
=>
{
this
.
$apis
.
material
[
material
](
params
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
$message
({
this
.
$message
({
...
@@ -449,8 +469,7 @@ export default {
...
@@ -449,8 +469,7 @@ export default {
},
},
// 获取富文本框内容
// 获取富文本框内容
writeChange
(
val
)
{
writeChange
(
val
)
{
// console.log(val, '--content--');
this
.
textBoxContent
=
val
this
.
materialAddForm
.
materialUrl
=
val
},
},
// 打开标签
// 打开标签
openLabel
()
{
openLabel
()
{
...
...
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