协同宣发
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
<div class="fileList" v-if="fileList.length">
|
<div class="fileList" v-if="fileList.length">
|
||||||
<div class="add-item" v-for="(item, index) in fileList" :key="index">
|
<div class="add-item" v-for="(item, index) in fileList" :key="index">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img :src="mapIcon(item.media.type)" />
|
<img :src="mapIcon(item.msgType)" />
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<i @click="removeFile(index)">删除</i>
|
<i @click="removeFile(index)">删除</i>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
:limit="9"
|
:limit="9"
|
||||||
action="/app/wxcp/upload/uploadFile"
|
action="/app/wxcp/upload/uploadFile"
|
||||||
accept=".jpg,.png,.jpeg"
|
accept=".jpg,.png,.jpeg"
|
||||||
:http-request="v => submitUpload(v, 'image')">
|
:http-request="v => submitUpload(v, '1')">
|
||||||
<div class="content-item" trigger>
|
<div class="content-item" trigger>
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/announce/big-img.png" />
|
<img src="https://cdn.cunwuyun.cn/dvcp/announce/big-img.png" />
|
||||||
<p>图片</p>
|
<p>图片</p>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
:limit="9"
|
:limit="9"
|
||||||
action="/app/wxcp/upload/uploadFile"
|
action="/app/wxcp/upload/uploadFile"
|
||||||
accept=".mp4"
|
accept=".mp4"
|
||||||
:http-request="v => submitUpload(v, 'video')">
|
:http-request="v => submitUpload(v, '2')">
|
||||||
<div class="content-item" trigger>
|
<div class="content-item" trigger>
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/announce/big-video.png" />
|
<img src="https://cdn.cunwuyun.cn/dvcp/announce/big-video.png" />
|
||||||
<p>视频</p>
|
<p>视频</p>
|
||||||
@@ -97,13 +97,13 @@
|
|||||||
:limit="9"
|
:limit="9"
|
||||||
action="/app/wxcp/upload/uploadFile"
|
action="/app/wxcp/upload/uploadFile"
|
||||||
accept=".zip、.rar、.doc、.docx、.xls、.xlsx、.ppt、.pptx、.pdf、.txt"
|
accept=".zip、.rar、.doc、.docx、.xls、.xlsx、.ppt、.pptx、.pdf、.txt"
|
||||||
:http-request="v => submitUpload(v, 'file')">
|
:http-request="v => submitUpload(v, '3')">
|
||||||
<div class="content-item" trigger>
|
<div class="content-item" trigger>
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/announce/folder.png" />
|
<img src="https://cdn.cunwuyun.cn/dvcp/announce/folder.png" />
|
||||||
<p>文件</p>
|
<p>文件</p>
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div class="content-item">
|
<div class="content-item" @click="isShowAddLink = true">
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/announce/site.png" />
|
<img src="https://cdn.cunwuyun.cn/dvcp/announce/site.png" />
|
||||||
<p>网页</p>
|
<p>网页</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -144,6 +144,41 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ai-dialog
|
||||||
|
:visible.sync="isShowAddLink"
|
||||||
|
width="920px"
|
||||||
|
title="链接消息"
|
||||||
|
@close="onClose"
|
||||||
|
@onConfirm="onLinkConfirm">
|
||||||
|
<el-form ref="linkForm" :model="linkForm" label-width="110px" label-position="right">
|
||||||
|
<div class="ai-form">
|
||||||
|
<el-form-item label="标题" style="width: 100%;" prop="linkTitle" :rules="[{ required: true, message: '请输入标题', trigger: 'blur' }]">
|
||||||
|
<el-input
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入标题"
|
||||||
|
v-model="linkForm.linkTitle">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="链接" style="width: 100%;" prop="linkUrl" :rules="[{ required: true, message: '请输入链接', trigger: 'blur' }]">
|
||||||
|
<el-input
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入链接"
|
||||||
|
v-model="linkForm.linkUrl">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述" style="width: 100%;" prop="linkDesc" :rules="[{ required: true, message: '请输入描述', trigger: 'blur' }]">
|
||||||
|
<el-input
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model="linkForm.linkDesc">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="封面图" prop="linkPicUrl" style="width: 100%;" :rules="[{ required: true, message: '请上传封面图', trigger: 'change' }]">
|
||||||
|
<ai-uploader :instance="instance" v-model="form.linkPicUrl" :limit="1"></ai-uploader>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -169,6 +204,13 @@
|
|||||||
info: {},
|
info: {},
|
||||||
department: [],
|
department: [],
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
isShowAddLink: false,
|
||||||
|
linkForm: {
|
||||||
|
linkPicUrl: [],
|
||||||
|
linkDesc: '',
|
||||||
|
linkTitle: '',
|
||||||
|
linkUrl: ''
|
||||||
|
},
|
||||||
form: {
|
form: {
|
||||||
content: '',
|
content: '',
|
||||||
choiceTime: '',
|
choiceTime: '',
|
||||||
@@ -218,17 +260,38 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onLinkConfirm () {
|
||||||
|
this.$refs.linkForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.fileList.push({
|
||||||
|
...this.linkForm,
|
||||||
|
linkPicUrl: this.linkPicUrl[0].url,
|
||||||
|
msgType: '4'
|
||||||
|
})
|
||||||
|
|
||||||
|
this.isShowAddLink = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onClose () {
|
||||||
|
this.linkForm.linkPicUrl = []
|
||||||
|
this.linkForm.linkDesc = ''
|
||||||
|
this.linkForm.linkTitle = ''
|
||||||
|
this.linkForm.linkUrl = ''
|
||||||
|
},
|
||||||
|
|
||||||
removeFile (index) {
|
removeFile (index) {
|
||||||
this.fileList.splice(index, 1)
|
this.fileList.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
mapIcon (type) {
|
mapIcon (type) {
|
||||||
return {
|
return {
|
||||||
image: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png',
|
1: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png',
|
||||||
video: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png',
|
2: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png',
|
||||||
folder: 'https://cdn.cunwuyun.cn/dvcp/announce/folder.png',
|
3: 'https://cdn.cunwuyun.cn/dvcp/announce/folder.png',
|
||||||
site: 'https://cdn.cunwuyun.cn/dvcp/announce/site.png',
|
4: 'https://cdn.cunwuyun.cn/dvcp/announce/site.png',
|
||||||
miniapp: 'https://cdn.cunwuyun.cn/dvcp/announce/miniapp.png'
|
5: 'https://cdn.cunwuyun.cn/dvcp/announce/miniapp.png'
|
||||||
}[type]
|
}[type]
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -259,16 +322,22 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
submitUpload (file, type) {
|
submitUpload (file, type) {
|
||||||
|
const fileType = {
|
||||||
|
'1': 'image',
|
||||||
|
'2': 'video',
|
||||||
|
'3': 'file'
|
||||||
|
}[type]
|
||||||
let formData = new FormData()
|
let formData = new FormData()
|
||||||
formData.append('file', file.file)
|
formData.append('file', file.file)
|
||||||
formData.append('type', type)
|
formData.append('type', fileType)
|
||||||
this.instance.post(`/app/wxcp/upload/uploadFile`, formData, {
|
this.instance.post(`/app/wxcp/upload/uploadFile`, formData, {
|
||||||
withCredentials: false
|
withCredentials: false
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
...res.data.file,
|
...res.data.file,
|
||||||
media: res.data.media
|
media: res.data.media,
|
||||||
|
msgType: type
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$message.success('上传成功')
|
this.$message.success('上传成功')
|
||||||
@@ -294,10 +363,6 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onClose () {
|
|
||||||
this.form.explain = ''
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm () {
|
confirm () {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user