消息列表
This commit is contained in:
@@ -61,24 +61,27 @@
|
|||||||
placeholder="选择日期时间">
|
placeholder="选择日期时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="其他类型" style="width: 100%">
|
<!-- <el-form-item label="其他类型" style="width: 100%">
|
||||||
<el-radio-group v-model="form.contentType" @change="onTypeChange">
|
<el-radio-group v-model="form.contentType" @change="onTypeChange">
|
||||||
<el-radio label="image">图片</el-radio>
|
<el-radio label="image">图片</el-radio>
|
||||||
<el-radio label="video">视频</el-radio>
|
<el-radio label="video">视频</el-radio>
|
||||||
<el-radio label="file">附件</el-radio>
|
<el-radio label="file">附件</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<!-- 图片 -->
|
<!-- 图片 -->
|
||||||
<el-form-item label="图片" style="width: 100%" v-if="form.contentType === 'image'">
|
<!-- v-if="form.contentType === 'image'" -->
|
||||||
<ai-uploader :instance="instance" isWechat v-model="files" acceptType=".jpg,.png,.jpeg" :limit="1" url="/app/wxcp/upload/uploadFile?type=image"></ai-uploader>
|
<el-form-item label="图片" style="width: 100%">
|
||||||
|
<ai-uploader :instance="instance" isWechat v-model="imgList" acceptType=".jpg,.png,.jpeg" :limit="1" url="/app/wxcp/upload/uploadFile?type=image"></ai-uploader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 视频 -->
|
<!-- 视频 -->
|
||||||
<el-form-item label="视频" style="width: 100%" v-if="form.contentType === 'video'">
|
<!-- v-if="form.contentType === 'video'" -->
|
||||||
<ai-uploader :instance="instance" fileType="file" isWechat acceptType=".mp4" v-model="files" :limit="1" url="/app/wxcp/upload/uploadFile?type=video"></ai-uploader>
|
<el-form-item label="视频" style="width: 100%">
|
||||||
|
<ai-uploader :instance="instance" fileType="file" isWechat acceptType=".mp4" v-model="videoList" :limit="1" url="/app/wxcp/upload/uploadFile?type=video"></ai-uploader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 附件 -->
|
<!-- 附件 -->
|
||||||
<el-form-item label="附件" style="width: 100%" v-if="form.contentType === 'file'">
|
<!-- v-if="form.contentType === 'file'" -->
|
||||||
<ai-uploader :instance="instance" fileType="file" isWechat v-model="files" :limit="1" url="/app/wxcp/upload/uploadFile?type=file"></ai-uploader>
|
<el-form-item label="附件" style="width: 100%">
|
||||||
|
<ai-uploader :instance="instance" fileType="file" isWechat v-model="filesList" :limit="1" url="/app/wxcp/upload/uploadFile?type=file"></ai-uploader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -104,17 +107,20 @@
|
|||||||
<ai-info-item label="创建者" :value="data.userName" isLine></ai-info-item>
|
<ai-info-item label="创建者" :value="data.userName" isLine></ai-info-item>
|
||||||
<ai-info-item label="发送类型" :value="data.sendType" isLine>{{ data.sendType | format }}</ai-info-item>
|
<ai-info-item label="发送类型" :value="data.sendType" isLine>{{ data.sendType | format }}</ai-info-item>
|
||||||
<ai-info-item label="发送时间" :value="data.sendTime" isLine v-if="data.sendType == 1"></ai-info-item>
|
<ai-info-item label="发送时间" :value="data.sendTime" isLine v-if="data.sendType == 1"></ai-info-item>
|
||||||
<ai-info-item label="群发内容" :value="data.content" isLine></ai-info-item>
|
<div v-for="item in data.fileList" :key="item.id">
|
||||||
<ai-info-item label="图片" isLine v-if="data.contentType == 'image'">
|
<ai-info-item label="群发内容" :value="item.content" isLine v-if="item.contentType == 'text'"></ai-info-item>
|
||||||
<ai-uploader v-model="accessUrlAll" :instance="instance" :limit="1" disabled/>
|
<ai-info-item label="图片" isLine v-if="item.contentType == 'image'">
|
||||||
</ai-info-item>
|
<!-- <ai-uploader v-model="item" :instance="instance" :limit="1" disabled/> -->
|
||||||
<ai-info-item label="视频" isLine v-if="data.contentType == 'video'">
|
</ai-info-item>
|
||||||
<video :src="data.accessUrl"
|
<ai-info-item label="视频" isLine v-if="item.contentType == 'video'">
|
||||||
style="width: 100%; height:100%; object-fit: fill;" muted controls="controls"></video>
|
<video :src="item.accessUrl"
|
||||||
</ai-info-item>
|
style="width: 100%; height:100%; object-fit: fill;" muted controls="controls"></video>
|
||||||
<ai-info-item label="附件" isLine v-if="data.contentType == 'file'">
|
</ai-info-item>
|
||||||
<ai-file-list :fileList="accessUrlAll" ></ai-file-list>
|
<ai-info-item label="附件" isLine v-if="item.contentType == 'file'">
|
||||||
</ai-info-item>
|
<ai-file-list :fileList="accessUrlAll" ></ai-file-list>
|
||||||
|
</ai-info-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ai-wrapper>
|
</ai-wrapper>
|
||||||
</template>
|
</template>
|
||||||
</ai-card>
|
</ai-card>
|
||||||
@@ -143,32 +149,49 @@
|
|||||||
form: {
|
form: {
|
||||||
areaId: '',
|
areaId: '',
|
||||||
tag: '',
|
tag: '',
|
||||||
content: '',
|
|
||||||
contentType: 'text',
|
|
||||||
file: {},
|
|
||||||
accessUrl: '',
|
|
||||||
accessDesc: '',
|
|
||||||
accessTitle: '',
|
|
||||||
accessImgurl: '',
|
|
||||||
accessAppid: '',
|
|
||||||
sendType: '0',
|
sendType: '0',
|
||||||
sendTime: '',
|
sendTime: '',
|
||||||
mediaId: '',
|
content: '',
|
||||||
name: '',
|
contentType: 'text',
|
||||||
|
fileList: [
|
||||||
|
{
|
||||||
|
accessAppid: "",
|
||||||
|
accessDesc: "",
|
||||||
|
accessImgurl: "",
|
||||||
|
accessTitle: "",
|
||||||
|
accessUrl: "",
|
||||||
|
// content: "",
|
||||||
|
contentType: "",
|
||||||
|
createdA: 0,
|
||||||
|
mediaId: ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// file: {},
|
||||||
|
// accessUrl: '',
|
||||||
|
// accessDesc: '',
|
||||||
|
// accessTitle: '',
|
||||||
|
// accessImgurl: '',
|
||||||
|
// accessAppid: '',
|
||||||
|
// mediaId: '',
|
||||||
|
// name: '',
|
||||||
},
|
},
|
||||||
tags: [],
|
tags: [],
|
||||||
subTags: {},
|
subTags: {},
|
||||||
areaId: [],
|
areaId: [],
|
||||||
areaName: [],
|
areaName: [],
|
||||||
|
imgList: [],
|
||||||
|
videoList: [],
|
||||||
|
filesList: [],
|
||||||
files: [],
|
files: [],
|
||||||
areaRootId: '',
|
areaRootId: '',
|
||||||
accessUrlAll: [],
|
accessUrlAll: [],
|
||||||
users: [],
|
users: [],
|
||||||
rules: {
|
rules: {
|
||||||
content: [{ required: true, message: '请输入群发内容', trigger: 'change' }],
|
content: [{ required: true, message: '请输入群发内容'}],
|
||||||
sendType: [{ required: true, message: '请选择群发方式' }],
|
sendType: [{ required: true, message: '请选择群发方式' }],
|
||||||
sendTime: [{ required: true, message: '请选择群发时间' }],
|
sendTime: [{ required: true, message: '请选择群发时间' }],
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -249,31 +272,40 @@
|
|||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
if(this.files.length) {
|
this.form.fileList = []
|
||||||
this.form.accessUrl = this.files[0].url,
|
var contentList = {
|
||||||
this.form.mediaId = this.files[0].media.mediaId
|
content: this.form.content,
|
||||||
}
|
contentType: 'text'
|
||||||
if (this.form.contentType == 'text' && !this.form.content) {
|
|
||||||
return this.$message.error('请输入消息内容')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.form.contentType === 'image' && !this.form.accessUrl) {
|
this.form.fileList.push(contentList)
|
||||||
// return this.$message.error('请上传图片')
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (this.form.contentType === 'video' && !this.form.accessUrl) {
|
|
||||||
// return this.$message.error('请上传视频')
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (this.form.contentType === 'file' && !this.form.accessUrl) {
|
if(this.imgList.length) {
|
||||||
// return this.$message.error('请上传附件')
|
var info = {
|
||||||
// }
|
contentType: 'image',
|
||||||
|
mediaId: this.imgList[0].media.mediaId,
|
||||||
|
accessUrl: this.imgList[0].url
|
||||||
|
}
|
||||||
|
this.form.fileList.push(info)
|
||||||
|
}
|
||||||
|
|
||||||
// if (this.form.sendType == 1) {
|
if(this.videoList.length) {
|
||||||
// if (!this.form.sendTime) {
|
var info = {
|
||||||
// return this.$message.error('请选择时间')
|
contentType: 'video',
|
||||||
// }
|
mediaId: this.videoList[0].media.mediaId,
|
||||||
// }
|
accessUrl: this.videoList[0].url
|
||||||
|
}
|
||||||
|
this.form.fileList.push(info)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.filesList.length) {
|
||||||
|
var info = {
|
||||||
|
contentType: 'file',
|
||||||
|
mediaId: this.filesList[0].media.mediaId,
|
||||||
|
accessUrl: this.filesList[0].url
|
||||||
|
}
|
||||||
|
this.form.fileList.push(info)
|
||||||
|
}
|
||||||
|
|
||||||
this.instance.post(`/app/pushmessage/addOrUpdate`, {
|
this.instance.post(`/app/pushmessage/addOrUpdate`, {
|
||||||
...this.form
|
...this.form
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: "List",
|
name: "List",
|
||||||
props: {
|
props: {
|
||||||
@@ -59,7 +60,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
page: {current: 1, size: 10, total: 0},
|
page: {current: 1, size: 10, total: 0,pages: 0},
|
||||||
id: '',
|
id: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -69,7 +70,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
colConfigs() {
|
colConfigs() {
|
||||||
return [
|
return [
|
||||||
{ prop: "contentType", label: '消息类型', align: "center", width: "250px", formart: v => this.mapType(v) },
|
// { prop: "contentType", label: '消息类型', align: "center", width: "250px", formart: v => this.mapType(v) },
|
||||||
{ slot: 'type' },
|
{ slot: 'type' },
|
||||||
{ prop: "sendType", label: '发送类型', align: "center", width: "250px", formart: v => v == 0 ? '立即发送' : '定时发送'},
|
{ prop: "sendType", label: '发送类型', align: "center", width: "250px", formart: v => v == 0 ? '立即发送' : '定时发送'},
|
||||||
{ prop: "createTime", label: '创建时间', align: "center", width: "250px"},
|
{ prop: "createTime", label: '创建时间', align: "center", width: "250px"},
|
||||||
@@ -77,14 +78,18 @@ export default {
|
|||||||
{ prop: "userName", label: '创建人', align: "center", width: "250px", },
|
{ prop: "userName", label: '创建人', align: "center", width: "250px", },
|
||||||
{ slot: "options" ,},
|
{ slot: "options" ,},
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
...mapState(['user'])
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getTableData() {
|
getTableData() {
|
||||||
this.instance.post("/app/pushmessage/list", null, {
|
this.instance.post(`/app/pushmessage/list?`, null, {
|
||||||
params: {...this.page}
|
params: {
|
||||||
|
...this.page,
|
||||||
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
console.log(res);
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.tableData = res.data.records
|
this.tableData = res.data.records
|
||||||
this.page.total = res.data.total
|
this.page.total = res.data.total
|
||||||
|
|||||||
Reference in New Issue
Block a user