Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 cca80124
authored
Apr 01, 2025
by
huyue
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
内容管理添加场景集市
1 parent
af59fbf7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
331 additions
and
2 deletions
src/api/contentManager.js
src/views/contentManager/components/uploadFile/index.vue
src/views/contentManager/constant/index.js
src/views/contentManager/contentAdd.vue
src/views/contentManager/contentDetail.vue
src/views/contentManager/contentManagerList.vue
src/api/contentManager.js
View file @
cca8012
...
@@ -250,3 +250,15 @@ export function getCustomerInfoDetail(data) {
...
@@ -250,3 +250,15 @@ export function getCustomerInfoDetail(data) {
data
.
method
=
`dj.api.mindworkplate.customervisit.getCustomerInfoDetail`
data
.
method
=
`dj.api.mindworkplate.customervisit.getCustomerInfoDetail`
return
request
(
data
,
"post"
)
return
request
(
data
,
"post"
)
}
}
/** 标签列表 */
export
function
findAllTags
(
data
=
{})
{
data
.
method
=
`dj.api.material.scenemarket.findAllTags`
return
request
(
data
,
"post"
)
}
/** 场景列表 */
export
function
findAllLevel
(
data
=
{})
{
data
.
method
=
`dj.api.material.scenemarket.findAllLevel`
return
request
(
data
,
"post"
)
}
\ No newline at end of file
\ No newline at end of file
src/views/contentManager/components/uploadFile/index.vue
0 → 100644
View file @
cca8012
<
template
>
<div
class=
"activity-img-box"
>
<div
class=
"upload-img"
>
<el-button
class=
"avatar-uploader-desc-word"
size=
"small"
icon=
"el-icon-puls"
key=
"btn-i"
:disabled=
"!!imageUrlArr.length"
@
click=
"selectFile()"
>
上传文件
</el-button
>
<input
type=
"file"
ref=
"uploadImgRef"
class=
"upload-img"
style=
"opacity: 0; z-index: -1"
:accept=
"accept"
@
change=
"(e) => handleImgChange(e)"
/>
</div>
<template
v-if=
"imageUrlArr && imageUrlArr.length > 0"
>
<div
class=
"file-wrap"
v-for=
"(item, index) in imageUrlArr"
:key=
"index"
>
<div
class=
"file-box"
@
click=
"toOpenPDF(item.image)"
>
<div
class=
"info"
v-if=
"item.imageName"
>
<img
class=
"logo"
:src=
"require('@/assets/pdf.png')"
alt=
""
/>
<span
class=
"name"
>
{{
item
.
imageName
}}
</span>
</div>
<div
class=
"process"
:style=
"
{
width: item.image ? '432px' : (compress * 432) / 100 + 'px'
}"
>
</div>
</div>
<img
v-if=
"item.image"
class=
"del-btn"
:src=
"require('@/assets/icon-delete.png')"
alt=
""
@
click=
"delFile(index)"
/>
</div>
</
template
>
</div>
</template>
<
script
>
import
upload
from
"@/common/upload"
import
{
uploadPDF
}
from
"@/api/sys.base"
export
default
{
props
:
{
picOptions
:
{
type
:
Object
,
default
:
()
=>
{
return
{
width
:
"104px"
,
height
:
"104px"
,
isClose
:
true
,
limitSize
:
10
}
}
},
imageUrlArr
:
{
type
:
Array
,
default
:
()
=>
[
{
name
:
"asdakf.pdf"
,
url
:
"sfdsfjskdf.pdf"
}
]
},
accept
:
{
type
:
String
,
default
:
'.pdf'
},
limit
:
{
type
:
String
,
default
:
"1"
},
index
:
{
type
:
Number
,
default
:
-
1
}
},
data
()
{
return
{
compress
:
0
,
dialogVisibleImg
:
false
,
uploadInfo
:
null
,
uploading
:
false
}
},
methods
:
{
selectFile
()
{
if
(
this
.
uploading
)
{
return
this
.
$message
.
error
(
`文件上传中,请耐心等待文件上传完成`
)
}
this
.
$refs
.
uploadImgRef
.
click
()
},
// 上传图片
handleImgChange
(
e
)
{
var
file
=
e
.
srcElement
.
files
[
0
]
// if (file.type?.indexOf("pdf") == -1) {
// this.$refs.uploadImgRef && (this.$refs.uploadImgRef.value = "")
// this.$message.error(`上传文件不是pdf的格式!`)
// return
// }
// 默认1MB
const
limitSize
=
this
.
picOptions
.
limitSize
||
10
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
if
(
!
isLt
)
{
this
.
$message
.
error
(
`上传文件大小不能超过
${
limitSize
}
MB!`
)
this
.
$refs
.
uploadImgRef
&&
(
this
.
$refs
.
uploadImgRef
.
value
=
""
)
return
}
if
(
this
.
imageUrlArr
.
length
>=
this
.
limit
)
{
this
.
$message
.
error
(
`最多上传
${
this
.
limit
}
个文件`
)
this
.
$refs
.
uploadImgRef
&&
(
this
.
$refs
.
uploadImgRef
.
value
=
""
)
return
}
this
.
$notify
({
title
:
"提示"
,
message
:
`文件上传中,请稍后`
})
this
.
$emit
(
"beforeUpload"
)
const
idx
=
this
.
imageUrlArr
.
length
this
.
$set
(
this
.
imageUrlArr
,
idx
,
{
imageName
:
file
.
name
,
image
:
""
})
this
.
uploading
=
true
this
.
uploadInfo
=
new
upload
({
showprocess
:
true
,
success
:
(
res
)
=>
{
this
.
$notify
({
title
:
"提示"
,
message
:
`文件上传成功`
,
type
:
"success"
})
this
.
$set
(
this
.
imageUrlArr
,
idx
,
{
imageName
:
file
.
name
,
image
:
res
})
this
.
$emit
(
"change"
,
{
arr
:
this
.
imageUrlArr
,
key
:
this
.
picOptions
.
key
,
index
:
this
.
index
})
this
.
uploadEnd
()
},
error
:
(
err
)
=>
{
this
.
uploadEnd
()
}
})
this
.
uploadInfo
.
clickEvent
(
e
.
srcElement
.
files
)
},
uploadEnd
()
{
this
.
uploading
=
false
this
.
$refs
.
uploadImgRef
&&
(
this
.
$refs
.
uploadImgRef
.
value
=
""
)
this
.
$emit
(
"afterUpload"
)
},
toOpenPDF
(
url
)
{
if
(
!
url
)
{
return
this
.
$message
({
type
:
"warning"
,
message
:
"文件正在上传,请稍后预览"
})
}
window
.
open
(
url
)
},
// 删除图片/视频
delFile
(
index
)
{
this
.
imageUrlArr
.
splice
(
index
,
1
)
this
.
$emit
(
"change"
,
{
arr
:
this
.
imageUrlArr
,
key
:
this
.
picOptions
.
key
,
id
:
1
,
index
:
this
.
index
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.file-wrap
{
display
:
flex
;
align-items
:
center
;
.file-box
{
width
:
432px
;
height
:
32px
;
border-radius
:
4px
;
position
:
relative
;
cursor
:
pointer
;
.info
{
height
:
inherit
;
display
:
flex
;
align-items
:
center
;
margin-left
:
8px
;
position
:
relative
;
z-index
:
1
;
.logo
{
margin-right
:
8px
;
}
.name
{
color
:
#1d1d1d
;
display
:
inline-block
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
}
.process
{
position
:
absolute
;
height
:
32px
;
left
:
0
;
top
:
0
;
background
:
#f4f6f7
;
}
}
.del-btn
{
width
:
16px
;
height
:
16px
;
cursor
:
pointer
;
margin-left
:
10px
;
}
}
.activity-img-box
{
max-width
:
600px
;
.pic-box
{
position
:
relative
;
width
:
104px
;
height
:
104px
;
border-radius
:
4px
;
margin-right
:
8px
;
margin-bottom
:
5px
;
&:hover
.mask
{
opacity
:
1
;
}
.pic
{
position
:
absolute
;
object-fit
:
fill
;
}
.photo-activity
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
}
.mask
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
absolute
;
background
:
rgba
(
0
,
0
,
0
,
0.5
);
color
:
#ffffff
;
opacity
:
0
;
top
:
0
;
right
:
0
;
width
:
104px
;
height
:
104px
;
z-index
:
999
;
.pic-pane-close
{
width
:
16px
;
height
:
16px
;
cursor
:
pointer
;
margin-left
:
24px
;
&:first-child
{
margin-left
:
0
;
}
img
{
width
:
100%
;
display
:
block
;
}
}
}
}
.upload-img
{
position
:
relative
;
display
:
inline-block
;
input
{
position
:
absolute
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
z-index
:
1
;
}
}
.avatar-uploader-desc-word
{
font-weight
:
400
;
font-size
:
28
rpx
;
color
:
#666666
;
margin-bottom
:
8px
;
}
.image-dialog
{
::v-deep
{
.el-dialog__header
{
border-bottom
:
0px
;
padding
:
0px
;
}
}
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/contentManager/constant/index.js
View file @
cca8012
...
@@ -22,6 +22,14 @@ export const CONTENT_TYPE_OPTIONS = [
...
@@ -22,6 +22,14 @@ export const CONTENT_TYPE_OPTIONS = [
{
{
id
:
3
,
id
:
3
,
label
:
"富文本"
label
:
"富文本"
},
{
id
:
4
,
label
:
"Excel"
},
{
id
:
5
,
label
:
"Word"
}
}
]
]
// 场景
// 场景
...
@@ -60,6 +68,10 @@ export const CHANNEL_OPTIONS = [
...
@@ -60,6 +68,10 @@ export const CHANNEL_OPTIONS = [
{
{
id
:
2
,
id
:
2
,
label
:
"展业助手"
label
:
"展业助手"
},
{
id
:
3
,
label
:
"场景集市"
}
}
]
]
// 状态
// 状态
...
...
src/views/contentManager/contentAdd.vue
View file @
cca8012
This diff is collapsed.
Click to expand it.
src/views/contentManager/contentDetail.vue
View file @
cca8012
This diff is collapsed.
Click to expand it.
src/views/contentManager/contentManagerList.vue
View file @
cca8012
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
:before-search-fn=
"beforeSearchFn"
>
:before-search-fn=
"beforeSearchFn"
>
<div
slot=
"merchantSlot"
slot-scope=
"scope"
>
<div
slot=
"merchantSlot"
slot-scope=
"scope"
>
<div
v-if=
"scope.scope.showMerchant == 0"
>
全部门店
</div>
<div
v-if=
"scope.scope.showMerchant == 0"
>
全部门店
</div>
<div
v-else-if=
"scope.scope.showMerchant == null"
>
-
</div>
<el-popover
v-else
placement=
"top"
width=
"245"
trigger=
"hover"
>
<el-popover
v-else
placement=
"top"
width=
"245"
trigger=
"hover"
>
<div
class=
"merchant-wrap"
>
<div
class=
"merchant-wrap"
>
<div
<div
...
@@ -289,7 +290,9 @@ export default {
...
@@ -289,7 +290,9 @@ export default {
0
:
"图片"
,
0
:
"图片"
,
1
:
"视频"
,
1
:
"视频"
,
2
:
"PDF"
,
2
:
"PDF"
,
3
:
"富文本"
3
:
"富文本"
,
4
:
"excel"
,
5
:
"word"
}[
cellValue
.
type
]
}[
cellValue
.
type
]
}
}
},
},
...
@@ -315,7 +318,8 @@ export default {
...
@@ -315,7 +318,8 @@ export default {
return
{
return
{
0
:
"培训资料"
,
0
:
"培训资料"
,
1
:
"营销素材"
,
1
:
"营销素材"
,
2
:
"展业助手"
2
:
"展业助手"
,
3
:
"场景集市"
}[
cellValue
.
showChannel
]
}[
cellValue
.
showChannel
]
}
}
},
},
...
...
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