Commit 9ce0dc65 by xinlaa

新增群发页面组件交互等

1 parent 1b06135b
......@@ -10,10 +10,11 @@ export default {
type: Boolean,
default: false,
},
title: {
type: String,
default: '',
},
// title: {
// type: String,
// default: '',
// },
// 素材类型 0:'文本', 1:'图片'
type: {
type: String,
default: '0',
......@@ -21,18 +22,14 @@ export default {
},
data() {
return {
typeText: ['文本', '图片'],
text: '',
image: '',
}
},
watch: {
type(val) {
val === 'remove' && (this.removeTag = this.selected.slice())
},
},
watch: {},
computed: {
Pvisible: {
get() {
// this.getTree();
return this.visible
},
set(val) {
......@@ -41,7 +38,6 @@ export default {
},
Ptype: {
get() {
// this.getTree();
return this.type
},
set(val) {
......@@ -54,27 +50,29 @@ export default {
methods: {
submit() {
this.Pvisible = false
this.$emit('success', this.Pselected)
this.$emit('success', this.text, this.image, this.file)
},
changeText(data) {
this.text = data
},
changeImage(data) {
this.image = data
},
},
}
</script>
<template>
<el-dialog
:title="`选择${typeText[Ptype]}素材`"
:visible.sync="Pvisible"
width="650px"
>
<el-dialog title="选择素材" :visible.sync="Pvisible" width="650px">
<div>
<el-tabs v-model="Ptype">
<el-tab-pane name="0">
<span slot="label"> <i class="el-icon-date"></i> 文本 </span>
<list type="4"> </list>
<list type="4" @change="changeText"> </list>
</el-tab-pane>
<el-tab-pane name="1">
<span slot="label"> <i class="el-icon-date"></i> 图片 </span>
<list type="0"> </list>
<list type="0" @change="changeImage"> </list>
</el-tab-pane>
<!-- <el-tab-pane name="2">
<span slot="label"> <i class="el-icon-date"></i> 文件 </span>
......
......@@ -39,7 +39,11 @@ export default {
radio: '',
}
},
watch: {},
watch: {
radio(val) {
this.$emit('change', val)
},
},
computed: {},
created() {
this.query.mediaType = this.type
......@@ -121,22 +125,25 @@ export default {
<el-radio-group v-if="type == 0" class="img-wrap" v-model="radio">
<el-radio v-for="(item, index) in list" :label="item.id" :key="index">
<img class="img-li" :src="item.materialUrl" alt />
<div class="ac mt5">{{ item.materialName }}</div>
</el-radio>
</el-radio-group>
</div>
</template>
<style lang="scss" scoped>
.img-wrap {
/deep/.el-radio__input {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
// .img-li {
// width: 115px;
// height: 160px;
// .img-wrap {
// /deep/.el-radio__input {
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-50%, -50%);
// }
// }
.img-li {
width: 160px;
height: 160px;
border-radius: 8px;
border: 1px solid #e6ebf5;
}
</style>
......@@ -33,13 +33,20 @@ export default {
},
watch: {},
computed: {
// 是否显示选择的客户标签
isOnlyTag() {
return this.form.toTag[0] && this.form.pushType == 0
},
// 是否显示选择范围后的文字说明
isSelectedText() {
return this.userParty[0] || this.isOnlyTag
},
// 选择范围后的文字说明
selectedText() {
return `将发送消息给${
this.userParty[0] ? this.userParty[0] + '等部门或成员' : ''
}的${
this.form.toTag[0] && this.form.pushType == 0
? '满足' + this.form.toTag[0] + '等标签的'
: ''
this.userParty[0] ? this.userParty[0] + '等部门或成员的' : ''
}${this.userParty[0] && this.isOnlyTag ? ',且' : ''}${
this.isOnlyTag ? '满足' + this.form.toTag[0] + '等标签的' : ''
}${this.form.pushType == 0 ? '客户' : '客户群'}`
},
},
......@@ -68,7 +75,7 @@ export default {
window.open('#/material/' + contentType[this.activeName])
},
// 选择素材确认按钮
submitSelectMaterial() {},
submitSelectMaterial(text, image, file) {},
},
}
</script>
......@@ -87,10 +94,19 @@ export default {
</el-radio-group>
</el-form-item>
<el-form-item label="发送范围" prop="pushRange">
<el-button type="text" @click="showRangeDialog()">{{
form.pushType == 0 ? '选择发送客户' : '按群主选择客户群'
}}</el-button>
<span v-show="userParty[0] || form.toTag[0]">{{ selectedText }}</span>
<el-button
v-show="!isSelectedText"
type="text"
@click="showRangeDialog()"
>{{
isSelectedText
? '修改'
: form.pushType == 0
? '选择发送客户'
: '按群主选择客户群'
}}</el-button
>
<span v-show="isSelectedText">{{ selectedText }}</span>
</el-form-item>
<el-form-item label="发送时间" prop="settingTime">
<el-date-picker
......@@ -224,7 +240,7 @@ export default {
<SelectMaterial
:visible.sync="dialogVisibleSelectMaterial"
:type="activeName"
:type.sync="activeName"
@success="submitSelectMaterial"
></SelectMaterial>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!