页面整合
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<section class="AppMassNotification">
|
||||
<keep-alive :include="['List']">
|
||||
<component ref="component" :is="component" :instance="instance" :params="params" :dict="dict" @change="onChange"/>
|
||||
<component ref="component" :is="currentPage" :instance="instance" :params="params" :dict="dict" @change="onChange"/>
|
||||
</keep-alive>
|
||||
</section>
|
||||
</template>
|
||||
@@ -25,22 +25,18 @@ export default {
|
||||
include: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentPage() {
|
||||
const {hash} = this.$route
|
||||
return hash == "#add" ? Add : List
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onChange(data) {
|
||||
if (data.type === "Add") {
|
||||
this.component = "Add";
|
||||
this.params = data.params;
|
||||
}
|
||||
|
||||
if (data.type === "List") {
|
||||
this.component = "List";
|
||||
this.params = data.params;
|
||||
|
||||
this.$nextTick(() => {
|
||||
if (data.isRefresh) {
|
||||
this.$refs.component.getTableData();
|
||||
}
|
||||
});
|
||||
this.$router.push({hash: "#add", query: data.params})
|
||||
} else {
|
||||
this.$router.push({})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<section class="Add">
|
||||
<ai-detail v-if="!params.id">
|
||||
<ai-detail v-if="!$route.query.id">
|
||||
<template slot="title">
|
||||
<ai-title title="群发通知" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
|
||||
</template>
|
||||
@@ -76,15 +76,18 @@
|
||||
</el-form-item>
|
||||
<!-- 图片 -->
|
||||
<el-form-item label="图片" style="width: 100%" v-if="form.contentType == 'image'">
|
||||
<ai-uploader :instance="instance" isWechat v-model="imgList" acceptType=".jpg,.png,.jpeg" :limit="1" url="/app/wxcp/upload/uploadFile?type=image"></ai-uploader>
|
||||
<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 label="视频" style="width: 100%" v-if="form.contentType == 'video'">
|
||||
<ai-uploader :instance="instance" fileType="file" isWechat acceptType=".mp4" v-model="videoList" :limit="1" url="/app/wxcp/upload/uploadFile?type=video"></ai-uploader>
|
||||
<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 label="附件" style="width: 100%" v-if="form.contentType == 'file'">
|
||||
<ai-uploader :instance="instance" fileType="file" isWechat v-model="filesList" :limit="1" url="/app/wxcp/upload/uploadFile?type=file"></ai-uploader>
|
||||
<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>
|
||||
@@ -99,7 +102,7 @@
|
||||
|
||||
</ai-detail>
|
||||
|
||||
<ai-detail class="add" v-if="params.id">
|
||||
<ai-detail class="add" v-if="$route.query.id">
|
||||
<template slot="title">
|
||||
<ai-title title="群发通知详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
|
||||
</template>
|
||||
@@ -143,17 +146,14 @@
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import AiDvWrapper from '../../../../project/dvui/layout/AiDvWrapper/AiDvWrapper.vue';
|
||||
|
||||
export default {
|
||||
components: { AiDvWrapper },
|
||||
name: 'Add',
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
data: {},
|
||||
@@ -190,16 +190,16 @@ export default {
|
||||
users: [],
|
||||
images: [],
|
||||
rules: {
|
||||
content: [{ required: true, message: '请输入群发内容'}],
|
||||
sendType: [{ required: true, message: '请选择群发方式' }],
|
||||
sendTime: [{ required: true, message: '请选择群发时间' }],
|
||||
content: [{required: true, message: '请输入群发内容'}],
|
||||
sendType: [{required: true, message: '请选择群发方式'}],
|
||||
sendTime: [{required: true, message: '请选择群发时间'}],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
tagsChange() {
|
||||
if(this.tags.length) {
|
||||
if (this.tags.length) {
|
||||
return this.form.tag = this.tags.toString();
|
||||
}
|
||||
},
|
||||
@@ -209,20 +209,20 @@ export default {
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
created () {
|
||||
if (this.params.id) {
|
||||
created() {
|
||||
if (this.$route.query.id) {
|
||||
this.getInfo()
|
||||
} else {
|
||||
this.getSubTags()
|
||||
}
|
||||
this.areaRootId = [this.user.info.areaId.substr(0, 6),'000000'].join("")
|
||||
this.areaRootId = [this.user.info.areaId.substr(0, 6), '000000'].join("")
|
||||
},
|
||||
|
||||
filters: {
|
||||
format(value) {
|
||||
if(value == 0) {
|
||||
if (value == 0) {
|
||||
return '立即发送'
|
||||
} else if(value == 1) {
|
||||
} else if (value == 1) {
|
||||
return '定时发送'
|
||||
}
|
||||
}
|
||||
@@ -239,23 +239,23 @@ export default {
|
||||
this.form.wxUserId = val[0].id
|
||||
},
|
||||
// 标签
|
||||
getSubTags () {
|
||||
getSubTags() {
|
||||
this.instance.post(`/app/wxcp/wxcorptag/listAll`).then(res => {
|
||||
if (res?.data) {
|
||||
this.subTags = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
getInfo () {
|
||||
this.instance.post(`/app/pushmessage/detail?id=${this.params.id}`).then(res => {
|
||||
getInfo() {
|
||||
this.instance.post(`/app/pushmessage/detail?id=${this.$route.query.id}`).then(res => {
|
||||
if (res?.data) {
|
||||
this.data = res.data
|
||||
this.images = [{ url: res.data.fileList.filter(e=> e.contentType == "image")[0]?.accessUrl }]
|
||||
this.fileDownLoad = [{ url:res.data.fileList.filter(e=> e.contentType == "file")[0]?.accessUrl }]
|
||||
this.images = [{url: res.data.fileList.filter(e => e.contentType == "image")[0]?.accessUrl}]
|
||||
this.fileDownLoad = [{url: res.data.fileList.filter(e => e.contentType == "file")[0]?.accessUrl}]
|
||||
}
|
||||
})
|
||||
},
|
||||
confirm () {
|
||||
confirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.fileList = []
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
}
|
||||
this.form.fileList.push(contentList)
|
||||
|
||||
if(this.imgList.length) {
|
||||
if (this.imgList.length) {
|
||||
let item = {
|
||||
contentType: 'image',
|
||||
mediaId: this.imgList[0].media.mediaId,
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
this.form.fileList.push(item)
|
||||
}
|
||||
|
||||
if(this.videoList.length) {
|
||||
if (this.videoList.length) {
|
||||
let item = {
|
||||
contentType: 'video',
|
||||
mediaId: this.videoList[0].media.mediaId,
|
||||
@@ -283,7 +283,7 @@ export default {
|
||||
this.form.fileList.push(item)
|
||||
}
|
||||
|
||||
if(this.filesList.length) {
|
||||
if (this.filesList.length) {
|
||||
let item = {
|
||||
contentType: 'file',
|
||||
mediaId: this.filesList[0].media.mediaId,
|
||||
@@ -305,7 +305,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel (isRefresh) {
|
||||
cancel(isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: isRefresh ? true : false
|
||||
@@ -316,11 +316,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.Add {
|
||||
.Add {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ai-card__title {
|
||||
.ai-card__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -335,9 +335,9 @@ export default {
|
||||
color: #888888;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.appletss {
|
||||
.appletss {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -383,21 +383,21 @@ export default {
|
||||
border-color: #2266FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
.tips {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
padding-left: 8px;
|
||||
color: #222222;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item-item__textarea {
|
||||
.el-form-item-item__textarea {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__btn {
|
||||
.el-form-item__btn {
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
left: 12px;
|
||||
@@ -408,15 +408,17 @@ export default {
|
||||
user-select: none;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.tags {
|
||||
.tags {
|
||||
// padding: 10px;
|
||||
.tag_title {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tag_item {
|
||||
margin: 5px 0;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
// padding: 5px 10px;
|
||||
@@ -429,10 +431,11 @@ export default {
|
||||
border-radius: 4px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.active {
|
||||
background: #53bcea;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "List",
|
||||
props: {
|
||||
@@ -60,7 +61,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
page: {current: 1, size: 10, total: 0,pages: 0},
|
||||
page: {current: 1, size: 10, total: 0, pages: 0},
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
@@ -76,15 +77,15 @@ export default {
|
||||
file: "附件"
|
||||
}
|
||||
return [
|
||||
{ prop: "fileList", label: '消息类型', align: "center", width: "250px", formart: v => v?.map(e=> conType[e.contentType]).toString() },
|
||||
{ prop: "fileList", label: '消息类容', align: "center", width: "250px", formart: v => v?.filter(e=> e.contentType == 'text')[0].content },
|
||||
{prop: "fileList", label: '消息类型', align: "center", width: "250px", formart: v => v?.map(e => conType[e.contentType]).toString()},
|
||||
{prop: "fileList", label: '消息类容', align: "center", width: "250px", formart: v => v?.filter(e => e.contentType == 'text')[0].content},
|
||||
// { prop: "fileList", label: '消息内容', align: "center", width: "250px", formart: v => v?.filter(e => e.contentType == 'text')[0].content},
|
||||
// { slot: 'type' },
|
||||
{ prop: "sendType", label: '发送类型', align: "center", width: "250px", formart: v => v == 0 ? '立即发送' : '定时发送'},
|
||||
{ prop: "createTime", label: '创建时间', align: "center", width: "250px"},
|
||||
{ prop: "sendTime", label: '发送时间', align: "center", width: "250px"},
|
||||
{ prop: "userName", label: '创建人', align: "center", width: "250px", },
|
||||
{ slot: "options" ,},
|
||||
{prop: "sendType", label: '发送类型', align: "center", width: "250px", formart: v => v == 0 ? '立即发送' : '定时发送'},
|
||||
{prop: "createTime", label: '创建时间', align: "center", width: "250px"},
|
||||
{prop: "sendTime", label: '发送时间', align: "center", width: "250px"},
|
||||
{prop: "userName", label: '创建人', align: "center", width: "250px",},
|
||||
{slot: "options",},
|
||||
]
|
||||
},
|
||||
...mapState(['user'])
|
||||
@@ -105,7 +106,7 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
mapType (type) {
|
||||
mapType(type) {
|
||||
return {
|
||||
'image': '图片',
|
||||
'video': '视频',
|
||||
@@ -131,6 +132,7 @@ export default {
|
||||
.List {
|
||||
height: 100%;
|
||||
background: #f3f4f5;
|
||||
|
||||
.count {
|
||||
cursor: pointer;
|
||||
color: #2266FF;
|
||||
@@ -142,14 +144,15 @@ export default {
|
||||
}
|
||||
|
||||
}
|
||||
img, video {
|
||||
|
||||
img, video {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 10px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.message-info {
|
||||
.message-info {
|
||||
padding: 8px;
|
||||
min-height: 116px;
|
||||
|
||||
@@ -172,7 +175,7 @@ export default {
|
||||
.message-info__wrapper--right {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -181,7 +184,7 @@ export default {
|
||||
color: #222222;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
}
|
||||
@@ -199,11 +202,11 @@ export default {
|
||||
color: #888888;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.row-content {
|
||||
.row-content {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user