Files
dvcp_v2_webapp/project/sass/apps/Announce/AppAnnounce/components/Add.vue

846 lines
27 KiB
Vue
Raw Normal View History

2022-07-13 09:13:31 +08:00
<template>
2022-07-27 14:47:15 +08:00
<ai-detail class="AppAnnounceAdd" v-loading="isLoading">
2022-07-13 09:13:31 +08:00
<template slot="title">
2022-07-13 16:53:59 +08:00
<ai-title :title="id ? '编辑居民群发' : '添加居民群发'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
2022-07-13 09:13:31 +08:00
</ai-title>
</template>
<template slot="content">
2022-07-13 16:53:59 +08:00
<div class="AppAnnounceDetail-container">
<el-form ref="form" class="left" :model="form" label-width="110px" label-position="right">
<ai-card title="基本信息">
<template #content>
<div class="ai-form">
2022-07-20 16:36:23 +08:00
<el-form-item label="任务名称" prop="taskTitle" style="width: 100%;" :rules="[{ required: true, message: '请输入任务名称', trigger: 'blur' }]">
2022-07-18 17:14:58 +08:00
<el-input size="small" placeholder="请输入任务名称" v-model="form.taskTitle" :maxlength="15" show-word-limit></el-input>
2022-07-13 16:53:59 +08:00
</el-form-item>
2022-07-20 16:36:23 +08:00
<el-form-item label="发送范围" style="width: 100%;" prop="sendScope" :rules="[{ required: true, message: '请选择发送范围', trigger: 'change' }]">
<el-radio-group v-model="form.sendScope" @change="onScopeChange">
2022-07-18 17:14:58 +08:00
<el-radio label="0">全部居民群</el-radio>
<el-radio label="1">按部门选择</el-radio>
<el-radio label="2">按网格选择</el-radio>
2022-07-13 16:53:59 +08:00
</el-radio-group>
</el-form-item>
2022-07-20 16:36:23 +08:00
<el-form-item label="选择群主" v-if="form.sendScope !== '0'" prop="wxGroupsName" style="width: 100%;" :rules="[{ required: true, message: '请选择选择群主', trigger: 'change' }]">
<div class="AppAnnounceDetail-select">
<el-input size="small" class="AppAnnounceDetail-select__input" placeholder="请选择..." disabled v-model="form.wxGroupsName"></el-input>
2022-07-27 09:14:09 +08:00
<div class="select-left" v-if="form.wxGroups.length">
<span v-for="(item, index) in form.wxGroups" :key="index">
<ai-open-data type="userName" :openid="item.groupOwnerId"></ai-open-data>
2022-07-20 16:36:23 +08:00
</span>
</div>
2022-07-27 09:14:09 +08:00
<i v-if="!form.wxGroups.length">请选择</i>
2022-07-20 16:36:23 +08:00
<ai-picker
:instance="instance"
multiple
2022-07-26 15:09:39 +08:00
:ops="{label: form.sendScope === '2' ? 'girdName' : 'name'}"
2022-07-20 16:36:23 +08:00
:action="form.sendScope === '1' ? '/app/wxcp/wxdepartment/departList' : '/app/appgirdinfo/girdList'"
2022-07-20 18:04:06 +08:00
v-model="form.filterCriteria"
2022-07-26 15:09:39 +08:00
@pick="onPick"
2022-07-20 16:36:23 +08:00
@change="onSelcetChange">
<div class="select-right">选择</div>
</ai-picker>
</div>
2022-07-14 14:00:27 +08:00
<div class="tips">
<p>消息预计送达居民群数</p>
2022-07-26 15:09:39 +08:00
<span>{{ groupLen }}</span>
2022-07-18 17:14:58 +08:00
<el-tooltip
placement="top"
content="任务开始后3天内15分钟更新1次3天后访问页面时触发更新1时间最多刷新1次">
<i class="iconfont iconModal_Warning"></i>
</el-tooltip>
2022-07-14 14:00:27 +08:00
</div>
</el-form-item>
2022-07-20 16:36:23 +08:00
<el-form-item label="发送内容" prop="content" style="width: 100%;" :rules="[{ required: true, message: '请输入发送内容', trigger: 'blur' }]">
2022-07-19 10:02:54 +08:00
<el-input size="small" type="textarea" :rows="6" placeholder="请输入文本内容..." v-model="form.content"></el-input>
2022-07-14 14:00:27 +08:00
<div class="add">
2022-07-18 17:14:58 +08:00
<div class="fileList" v-if="fileList.length">
<div class="add-item" v-for="(item, index) in fileList" :key="index">
<div class="left">
2022-07-19 10:58:14 +08:00
<img :src="mapIcon(item.msgType)" />
2022-07-25 11:36:32 +08:00
<span>{{ item.mpTitle || item.name || item.linkTitle }}</span>
2022-07-18 17:14:58 +08:00
</div>
<i @click="removeFile(index)">删除</i>
</div>
</div>
2022-07-14 14:00:27 +08:00
<el-popover
placement="top"
width="340"
offset="0"
trigger="hover">
<div class="add-item" slot="reference" style="width: max-content;">
<img src="https://cdn.cunwuyun.cn/dvcp/announce/add.png" />
<span style="color: #2266FF; font-size: 12px;">添加附件类型</span>
</div>
<div class="AppAnnounceDetail-content-wrapper">
2022-07-18 17:14:58 +08:00
<el-upload
ref="upload"
multiple
:file-list="fileList"
:show-file-list="false"
:before-upload="v => handleChange(v, 10, '.jpg,.png,.jpeg')"
:limit="9"
action="/app/wxcp/upload/uploadFile"
accept=".jpg,.png,.jpeg"
2022-07-19 10:58:14 +08:00
:http-request="v => submitUpload(v, '1')">
2022-07-18 17:14:58 +08:00
<div class="content-item" trigger>
<img src="https://cdn.cunwuyun.cn/dvcp/announce/big-img.png" />
<p>图片</p>
</div>
</el-upload>
<el-upload
ref="upload"
multiple
:file-list="fileList"
:show-file-list="false"
:before-upload="v => handleChange(v, 10, '.mp4')"
:limit="9"
action="/app/wxcp/upload/uploadFile"
accept=".mp4"
2022-07-19 10:58:14 +08:00
:http-request="v => submitUpload(v, '2')">
2022-07-18 17:14:58 +08:00
<div class="content-item" trigger>
<img src="https://cdn.cunwuyun.cn/dvcp/announce/big-video.png" />
<p>视频</p>
</div>
</el-upload>
2022-07-19 10:02:54 +08:00
<el-upload
ref="upload"
multiple
:file-list="fileList"
:show-file-list="false"
2022-07-19 17:31:22 +08:00
:before-upload="v => handleChange(v, 10, '.zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt')"
2022-07-19 10:02:54 +08:00
:limit="9"
action="/app/wxcp/upload/uploadFile"
2022-07-19 17:31:22 +08:00
accept=".zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt"
2022-07-19 10:58:14 +08:00
:http-request="v => submitUpload(v, '3')">
2022-07-19 10:02:54 +08:00
<div class="content-item" trigger>
2022-07-14 14:00:27 +08:00
<img src="https://cdn.cunwuyun.cn/dvcp/announce/folder.png" />
2022-07-19 10:02:54 +08:00
<p>文件</p>
</div>
</el-upload>
2022-07-19 10:58:14 +08:00
<div class="content-item" @click="isShowAddLink = true">
2022-07-14 14:00:27 +08:00
<img src="https://cdn.cunwuyun.cn/dvcp/announce/site.png" />
<p>网页</p>
</div>
2022-07-19 17:31:22 +08:00
<div class="content-item" @click="isShowAddMiniapp = true">
2022-07-14 14:00:27 +08:00
<img src="https://cdn.cunwuyun.cn/dvcp/announce/miniapp.png" />
<p>小程序</p>
</div>
</div>
</el-popover>
</div>
<div class="tips">
<em>从本地上传图片最大支持10MB支持JPG,PNG格式视频最大支持10MB支持MP4格式文件最大支持20MB</em>
</div>
</el-form-item>
2022-07-18 17:14:58 +08:00
<el-form-item label="宣发审批" prop="enableExamine" style="width: 100%;" :rules="[{ required: true, message: '请输入任务名称', trigger: 'blur' }]">
<el-switch
v-model="form.enableExamine"
active-value="1"
inactive-value="0"
active-text="开启后,创建的群发任务需要审批人进行审批">
</el-switch>
</el-form-item>
2022-07-20 16:36:23 +08:00
<el-form-item v-if="form.enableExamine === '1'" label="审批人员" prop="examines" style="width: 100%;" :rules="[{ required: true, message: '请选择审批人员', trigger: 'change' }]">
<div class="AppAnnounceDetail-select">
<el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.examinesName"> </el-input>
<div class="select-left" v-if="form.examines.length">
<span v-for="(item, index) in form.examines" :key="index">
2022-07-20 18:04:06 +08:00
<ai-open-data type="userName" :openid="item.wxOpenUserId"></ai-open-data>
2022-07-20 16:36:23 +08:00
</span>
</div>
<i v-if="!form.examines.length">请选择</i>
<ai-user-get :instance="instance" v-model="form.examines" @change="onUserChange">
<div class="select-right">选择</div>
2022-07-18 17:14:58 +08:00
</ai-user-get>
2022-07-20 16:36:23 +08:00
</div>
2022-07-18 17:14:58 +08:00
</el-form-item>
2022-07-13 16:53:59 +08:00
</div>
</template>
</ai-card>
</el-form>
2022-07-18 17:14:58 +08:00
<div class="right">
2022-07-26 09:26:49 +08:00
<Phone :avatar="user.info.avatar" @close="isShowPhone = false" :isShowClose="false" :content="form.content" :fileList="fileList"></Phone>
2022-07-18 17:14:58 +08:00
</div>
2022-07-19 10:58:14 +08:00
<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' }]">
2022-07-19 17:31:22 +08:00
<ai-uploader :instance="instance" v-model="linkForm.linkPicUrl" :limit="1"></ai-uploader>
</el-form-item>
</div>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowAddMiniapp"
width="920px"
title="小程序消息"
@close="onClose"
@onConfirm="onMiniAppForm">
<el-form ref="miniAppForm" :model="miniAppForm" label-width="130px" label-position="right">
<div class="ai-form">
<el-form-item label="小程序appid" style="width: 100%;" prop="mpAppid" :rules="[{ required: true, message: '小程序appid', trigger: 'blur' }]">
<el-input
size="small"
placeholder="小程序appid"
v-model="miniAppForm.mpAppid">
</el-input>
</el-form-item>
<el-form-item label="小程序page路径" style="width: 100%;" prop="mpPage" :rules="[{ required: true, message: '请输入小程序page路径', trigger: 'blur' }]">
<el-input
size="small"
placeholder="请输入小程序page路径"
v-model="miniAppForm.mpPage">
</el-input>
</el-form-item>
<el-form-item label="标题" style="width: 100%;" prop="mpTitle" :rules="[{ required: true, message: '请输入标题', trigger: 'blur' }]">
<el-input
size="small"
placeholder="请输入标题"
v-model="miniAppForm.mpTitle">
</el-input>
2022-07-19 10:58:14 +08:00
</el-form-item>
2022-07-25 10:39:46 +08:00
<el-form-item label="封面图" prop="media" style="width: 100%;" :rules="[{ required: true, message: '请上传封面图', trigger: 'change' }]">
<ai-uploader url="/app/wxcp/upload/uploadFile?type=image" :instance="instance" isWechat v-model="miniAppForm.media" :limit="1"></ai-uploader>
</el-form-item>
</div>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowDate"
width="590px"
title="定时发送"
@close="onClose"
@onConfirm="onDateForm">
<el-form ref="dateForm" :model="dateForm" label-width="130px" label-position="right">
<div class="ai-form">
<el-form-item label="定时发送时间" style="width: 100%;" prop="choiceTime" :rules="[{ required: true, message: '请选择定时发送时间', trigger: 'change' }]">
<el-date-picker
style="width: 100%;"
v-model="dateForm.choiceTime"
type="datetime"
size="small"
2022-07-25 11:36:32 +08:00
value-format="yyyy-MM-dd HH:mm:ss"
2022-07-25 10:39:46 +08:00
placeholder="请选择定时发送时间">
</el-date-picker>
</el-form-item>
2022-07-19 10:58:14 +08:00
</div>
</el-form>
</ai-dialog>
2022-07-13 16:53:59 +08:00
</div>
2022-07-13 09:13:31 +08:00
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
2022-07-27 14:47:15 +08:00
<el-button type="primary" @click="confirm(0)" style="width: 120px;">通知成员发送</el-button>
2022-07-20 16:36:23 +08:00
<el-button type="primary" @click="confirm(1)">定时发送</el-button>
2022-07-13 09:13:31 +08:00
</template>
</ai-detail>
</template>
<script>
2022-07-26 09:26:49 +08:00
import Phone from './Phone'
2022-07-20 16:36:23 +08:00
import { mapActions, mapState } from 'vuex'
2022-07-13 09:13:31 +08:00
export default {
name: 'Add',
props: {
instance: Function,
dict: Object,
params: Object
},
2022-07-26 09:26:49 +08:00
components: {
Phone
},
2022-07-13 09:13:31 +08:00
data () {
return {
info: {},
department: [],
2022-07-18 17:14:58 +08:00
fileList: [],
2022-07-19 10:58:14 +08:00
isShowAddLink: false,
2022-07-19 17:31:22 +08:00
isShowAddMiniapp: false,
2022-07-25 10:39:46 +08:00
isShowDate: false,
isLoading: false,
2022-07-19 10:58:14 +08:00
linkForm: {
linkPicUrl: [],
linkDesc: '',
linkTitle: '',
linkUrl: ''
},
2022-07-25 10:39:46 +08:00
dateForm: {
choiceTime: ''
},
2022-07-19 17:31:22 +08:00
miniAppForm: {
mpAppid: '',
mpPage: '',
2022-07-25 10:39:46 +08:00
mpTitle: '',
media: []
2022-07-19 17:31:22 +08:00
},
2022-07-13 09:13:31 +08:00
form: {
2022-07-19 10:02:54 +08:00
content: '',
2022-07-18 17:14:58 +08:00
choiceTime: '',
2022-07-19 10:02:54 +08:00
contents: [],
2022-07-18 17:14:58 +08:00
enableExamine: '0',
examines: [],
wxGroups: [],
2022-07-20 16:36:23 +08:00
wxGroupsName: '',
2022-07-18 17:14:58 +08:00
sendScope: '0',
sendType: 0,
2022-07-13 09:13:31 +08:00
name: '',
2022-07-20 18:04:06 +08:00
filterCriteria: [],
2022-07-20 16:36:23 +08:00
taskTitle: '',
examinesName: ''
2022-07-13 09:13:31 +08:00
},
2022-07-26 15:09:39 +08:00
girdNames: '',
2022-07-13 09:13:31 +08:00
id: '',
tagsList: []
}
},
2022-07-20 16:36:23 +08:00
computed: {
2022-07-26 15:09:39 +08:00
...mapState(['user']),
groupLen () {
let i = 0
this.form.wxGroups.forEach(v => {
i = i + v.groupIds.split(',').length
})
return i
}
2022-07-20 16:36:23 +08:00
},
2022-07-13 09:13:31 +08:00
2022-07-20 16:36:23 +08:00
created () {
2022-07-13 09:13:31 +08:00
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
2022-07-20 16:36:23 +08:00
} else {
this.getWxGroups()
2022-07-13 09:13:31 +08:00
}
},
methods: {
2022-07-20 16:36:23 +08:00
...mapActions(['initOpenData', 'transCanvas']),
2022-07-13 09:13:31 +08:00
getInfo (id) {
2022-07-20 18:04:06 +08:00
this.instance.post(`/app/appmasssendingtask/queryDetailById?id=${id}`).then(res => {
2022-07-13 09:13:31 +08:00
if (res.code === 0) {
this.form = {
2022-07-21 09:37:47 +08:00
...this.form,
2022-07-13 09:13:31 +08:00
...res.data,
2022-07-20 18:04:06 +08:00
wxGroupsName: '1',
filterCriteria: res.data.filterCriteria.split(',')
2022-07-13 09:13:31 +08:00
}
2022-07-20 18:04:06 +08:00
2022-07-26 15:09:39 +08:00
if (res.data.girdNames) {
2022-07-26 15:20:16 +08:00
this.girdNames = res.data.girdNames.split(',')
2022-07-26 15:09:39 +08:00
}
2022-07-25 10:39:46 +08:00
this.dateForm.choiceTime = res.data.choiceTime
2022-07-20 18:04:06 +08:00
if (res.data.examines && res.data.examines.length) {
this.form.examines = res.data.examines.map(v => {
return {
...v,
wxOpenUserId: v.examineUserId,
id: v.examineUserId
}
})
this.form.examinesName = '1'
}
const content = res.data.contents.filter(v => v.msgType === '0')
if (content.length) {
2022-07-21 09:37:47 +08:00
this.$set(this.form, 'content', content[0].content)
2022-07-20 18:04:06 +08:00
}
this.fileList = res.data.contents.filter(v => v.msgType !== '0').map(v => {
return {
...v,
...v.sysFile
}
})
2022-07-13 09:13:31 +08:00
}
})
},
2022-07-20 16:36:23 +08:00
onUserChange (e) {
if (e.length) {
this.form.examinesName = '1'
} else {
this.form.wxGroupsName = ''
}
},
onScopeChange (e) {
2022-07-26 15:09:39 +08:00
this.form.filterCriteria = []
this.form.wxGroups = []
this.girdNames = ''
2022-07-20 16:36:23 +08:00
if (e === '0') {
this.getWxGroups()
} else {
2022-07-20 18:04:06 +08:00
this.form.filterCriteria = []
2022-07-20 16:36:23 +08:00
}
},
2022-07-26 15:09:39 +08:00
onPick (e) {
if (this.form.sendScope === '2' && e.length) {
this.girdNames = e.map(v => v.girdName)
}
},
2022-07-20 16:36:23 +08:00
onSelcetChange (e) {
if (e.length) {
this.form.wxGroupsName = '1'
} else {
this.form.wxGroupsName = ''
}
this.getWxGroups()
},
getWxGroups () {
this.instance.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.form.sendScope}`, null, {
data: {
2022-07-20 18:04:06 +08:00
filterCriteria: this.form.filterCriteria.join(',')
2022-07-20 16:36:23 +08:00
},
headers: {'Content-Type': 'application/json;charset=utf-8'},
transformRequest: [function (data) {
2022-07-20 18:04:06 +08:00
return data.filterCriteria
2022-07-20 16:36:23 +08:00
}]
}).then(res => {
if (res.code === 0) {
this.form.wxGroups = res.data
}
})
},
2022-07-19 10:58:14 +08:00
onLinkConfirm () {
this.$refs.linkForm.validate((valid) => {
if (valid) {
this.fileList.push({
...this.linkForm,
2022-07-19 17:31:22 +08:00
linkPicUrl: this.linkForm.linkPicUrl[0].url,
2022-07-19 10:58:14 +08:00
msgType: '4'
})
this.isShowAddLink = false
}
})
},
2022-07-19 17:31:22 +08:00
onMiniAppForm () {
this.$refs.miniAppForm.validate((valid) => {
if (valid) {
this.fileList.push({
...this.miniAppForm,
2022-07-25 10:39:46 +08:00
msgType: '5',
...this.miniAppForm.media[0],
2022-07-25 11:36:32 +08:00
mediaId: this.miniAppForm.media[0].media.mediaId,
sysFileId: this.miniAppForm.media[0].id
2022-07-19 17:31:22 +08:00
})
this.isShowAddMiniapp = false
}
})
},
2022-07-19 10:58:14 +08:00
onClose () {
this.linkForm.linkPicUrl = []
this.linkForm.linkDesc = ''
this.linkForm.linkTitle = ''
this.linkForm.linkUrl = ''
2022-07-19 17:31:22 +08:00
this.miniAppForm.mpAppid = ''
this.miniAppForm.mpPage = ''
this.miniAppForm.mpTitle = ''
2022-07-25 10:39:46 +08:00
this.dateForm.choiceTime = ''
2022-07-19 10:58:14 +08:00
},
2022-07-18 17:14:58 +08:00
removeFile (index) {
this.fileList.splice(index, 1)
},
mapIcon (type) {
return {
2022-07-19 10:58:14 +08:00
1: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png',
2: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png',
3: 'https://cdn.cunwuyun.cn/dvcp/announce/folder.png',
4: 'https://cdn.cunwuyun.cn/dvcp/announce/site.png',
5: 'https://cdn.cunwuyun.cn/dvcp/announce/miniapp.png'
2022-07-18 17:14:58 +08:00
}[type]
},
onBeforeUpload(event) {
return this.onOverSize(event)
},
getExtension(name) {
return name.substring(name.lastIndexOf('.'))
},
handleChange (e, size, accept) {
const isLt10M = e.size / 1024 / 1024 < size
const suffixName = this.getExtension(e.name)
const suffixNameList = accept.split(',')
if (suffixNameList.indexOf(`${suffixName.toLowerCase()}`) === -1) {
this.$message.error(`不支持该格式`)
return false
}
if (!isLt10M) {
this.$message.error(`大小不超过${10}MB!`)
return false
}
return true
},
submitUpload (file, type) {
2022-07-19 10:58:14 +08:00
const fileType = {
'1': 'image',
'2': 'video',
'3': 'file'
}[type]
2022-07-18 17:14:58 +08:00
let formData = new FormData()
formData.append('file', file.file)
2022-07-19 10:58:14 +08:00
formData.append('type', fileType)
2022-07-18 17:14:58 +08:00
this.instance.post(`/app/wxcp/upload/uploadFile`, formData, {
withCredentials: false
}).then(res => {
if (res.code == 0) {
this.fileList.push({
...res.data.file,
2022-07-19 10:58:14 +08:00
media: res.data.media,
2022-07-20 16:36:23 +08:00
msgType: type,
2022-07-20 18:04:06 +08:00
sysFileId: res.data.file.id,
2022-07-20 16:36:23 +08:00
imgPicUrl: res.data.file.url,
mediaId: res.data.media.mediaId
2022-07-18 17:14:58 +08:00
})
this.$message.success('上传成功')
}
})
},
2022-07-25 10:39:46 +08:00
onDateForm () {
this.$refs.dateForm.validate((valid) => {
if (valid) {
this.confirm(1)
}
})
},
2022-07-20 16:36:23 +08:00
confirm (sendType) {
2022-07-13 09:13:31 +08:00
this.$refs.form.validate((valid) => {
if (valid) {
2022-07-26 15:09:39 +08:00
if (!this.form.wxGroups.length) {
return this.$message.error('居民群数量不能为0')
}
2022-07-25 10:39:46 +08:00
if (sendType === 1 && !this.dateForm.choiceTime) {
this.isShowDate = true
2022-07-20 16:36:23 +08:00
return false
}
const contents = [
{
content: this.form.content,
msgType: '0'
},
...this.fileList
]
2022-07-27 14:47:15 +08:00
this.isLoading = true
2022-07-20 16:36:23 +08:00
this.instance.post(`/app/appmasssendingtask/addOrUpdate`, {
...this.form,
id: this.params.id,
wxGroups: this.form.wxGroups,
contents,
2022-07-25 11:36:32 +08:00
sendType,
2022-07-25 10:39:46 +08:00
choiceTime: this.dateForm.choiceTime,
2022-07-20 18:04:06 +08:00
filterCriteria: this.form.filterCriteria.join(','),
2022-07-20 16:36:23 +08:00
examines: this.form.examines.length ? this.form.examines.map(v => {
return {
...v,
examineUserId: v.id
}
}) : []
2022-07-13 09:13:31 +08:00
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
}
2022-07-25 10:39:46 +08:00
this.isLoading = false
}).catch(() => {
this.isLoading = false
2022-07-13 09:13:31 +08:00
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
</script>
2022-07-14 14:00:27 +08:00
<style lang="scss">
.AppAnnounceDetail-content-wrapper {
display: flex;
align-items: center;
.content-item {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 64px;
height: 64px;
line-height: 1;
margin-right: 4px;
text-align: center;
background: #F9F9F9;
border-radius: 2px;
cursor: pointer;
&:hover {
opacity: 0.6;
}
&:last-child {
margin-right: 0;
}
img {
width: 32px;
height: 32px;
margin-bottom: 4px;
}
p {
color: #222;
font-size: 12px;
}
}
}
2022-07-15 10:40:02 +08:00
.AppAnnounceAdd {
2022-07-14 14:00:27 +08:00
.ai-detail__content {
2022-07-13 16:53:59 +08:00
.ai-detail__content--wrapper {
position: relative;
max-width: 100%;
margin: 0;
height: 100%;
overflow: hidden;
}
}
2022-07-20 16:36:23 +08:00
* {
box-sizing: border-box;
}
2022-07-14 14:00:27 +08:00
.add {
display: flex;
flex-direction: column;
padding: 14px 16px;
background: #F9F9F9;
border-radius: 0px 0px 2px 2px;
border: 1px solid #D0D4DC;
border-top: none;
.add-item {
display: flex;
align-items: center;
line-height: 1;
cursor: pointer;
&:hover {
opacity: 0.6;
}
img {
width: 20px;
height: 20px;
margin-right: 2px;
}
span {
color: #222;
font-size: 14px;
}
}
2022-07-18 17:14:58 +08:00
.fileList {
margin-bottom: 12px;
.add-item {
justify-content: space-between;
margin-bottom: 8px;
.left {
display: flex;
align-items: center;
}
i {
font-size: 14px;
cursor: pointer;
font-style: normal;
color: red;
&:hover {
opacity: 0.6;
}
}
&:last-child {
margin-bottom: 0;
}
}
}
2022-07-14 14:00:27 +08:00
}
2022-07-13 16:53:59 +08:00
.AppAnnounceDetail-container {
display: flex;
position: relative;
height: 100%;
padding: 0 20px;
overflow-y: overlay;
.left {
flex: 1;
margin-right: 20px;
}
.right {
position: sticky;
top: 0;
2022-07-14 14:00:27 +08:00
}
2022-07-20 16:36:23 +08:00
.AppAnnounceDetail-select {
display: flex;
align-items: center;
min-height: 32px;
2022-07-21 09:37:47 +08:00
line-height: 1;
2022-07-20 16:36:23 +08:00
background: #F5F5F5;
border-radius: 2px;
border: 1px solid #D0D4DC;
& > i {
flex: 1;
height: 100%;
2022-07-21 09:37:47 +08:00
line-height: 32px;
2022-07-20 16:36:23 +08:00
padding: 0 12px;
color: #888888;
font-size: 14px;
font-style: normal;
2022-07-20 18:04:06 +08:00
border-right: 1px solid #D0D4DC;
2022-07-20 16:36:23 +08:00
background: #fff;
}
.AppAnnounceDetail-select__input {
position: absolute;
left: 0;
top: 0;
z-index: -1;
opacity: 0;
height: 100%;
}
.select-right {
height: 100%;
padding: 0 12px;
color: #222222;
font-size: 12px;
cursor: pointer;
transition: all ease 0.3s;
&:hover {
opacity: 0.5;
}
}
.select-left {
display: flex;
flex-wrap: wrap;
flex: 1;
padding: 5px 0 5px 12px;
border-right: 1px solid #D0D4DC;
background: #fff;
span {
height: 22px;
line-height: 22px;
margin: 0 4px 5px 0;
padding: 0 8px;
font-size: 12px;
color: #222222;
background: #F3F4F7;
border-radius: 2px;
border: 1px solid #D0D4DC;
}
}
}
2022-07-14 14:00:27 +08:00
}
.tips {
display: flex;
align-items: center;
font-size: 14px;
color: #222222;
span {
margin: 0 3px;
color: #2266FF;
}
i {
2022-07-18 17:14:58 +08:00
color: #8899bb;
2022-07-14 14:00:27 +08:00
}
em {
line-height: 20px;
margin-top: 8px;
color: #888888;
font-size: 12px;
font-style: normal;
2022-07-13 16:53:59 +08:00
}
}
}
2022-07-13 09:13:31 +08:00
</style>