Commit 9ce0dc65 by xinlaa

新增群发页面组件交互等

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