提交 59178fba authored 作者: lihuihui's avatar lihuihui

修改bug

上级 a8390d4e
......@@ -27,8 +27,8 @@ export function deleteTemp(id) {
/**
* 分组列表
*/
export function getGroupList() {
return httpRequest.get('/api/message/v1/messages/groups')
export function getGroupList(params) {
return httpRequest.get('/api/message/v1/messages/groups', { params })
}
/**
* 分组列表详情
......
......@@ -226,6 +226,22 @@ export default {
this.formAll[content[item.channel]].content = item.payload
})
},
computed: {
stepLength () {
return this.form.step3[0]
}
},
watch: {
stepLength() {
const numContent = {
2: 0,
4: 1,
3: 2,
1: 3
}
this.tabIndex = numContent[this.form.step3[0]]
}
},
methods: {
addLog(msg) {
api
......
......@@ -2,7 +2,7 @@
<div class="target-box">
<div class="target-content">
<div class="name">目标用户</div>
<el-select v-model="form.step2" placeholder="请选择">
<el-select v-model="form.step2" placeholder="请选择" @change="selectChange">
<el-option
v-for="item in options"
:key="item.value"
......@@ -29,13 +29,18 @@ export default {
return {
options: [],
value: '',
totalUser: 0
totalUser: 0,
allData: []
}
},
mounted() {
this.groupsList()
},
methods: {
selectChange(val) {
const dataItem = this.allData.find(item => { return item.id === val })
this.totalUser = dataItem.user_total
},
groupsList() {
api
.groupsList()
......@@ -46,7 +51,8 @@ export default {
label: item.name
})
})
this.totalUser = response.data.total
this.allData = response.data.data
// this.totalUser = response.data.total
})
.finally(() => {
})
......
......@@ -14,14 +14,14 @@
</div>
<!-- v-if="form.step1 != ''" -->
<div class="detail-content">
<activity :form="form" v-if="active === 0"></activity>
<target-user :form="form" v-if="active === 1"></target-user>
<trigger :form="form" v-if="active === 2"></trigger>
<send-content :form="form" @clickPrev="clickPrev" @clickNext="clickNext" v-if="active === 3 || active === 4"></send-content>
<activity :form="form" v-show="active === 0"></activity>
<target-user :form="form" v-show="active === 1"></target-user>
<trigger :form="form" v-show="active === 2"></trigger>
<send-content :form="form" @clickPrev="clickPrev" @clickNext="clickNext" v-show="active === 3 || active === 4"></send-content>
</div>
<div class="foot-btn-box" v-if="active != 3 && active != 4">
<div class="foot-btn-box" v-show="active != 3 && active != 4">
<div class="content">
<el-button @click="prevBtn">上一步</el-button>
<el-button @click="prevBtn" v-if="active !== 0">上一步</el-button>
<el-button type="primary" @click="nextBtn">下一步</el-button>
</div>
</div>
......
......@@ -4,13 +4,14 @@
<div class="temp-title">
<div class="search">
<span>名称</span>
<el-input v-model="input" placeholder="请输入事项类型" class="input"></el-input>
<el-input v-model="input" placeholder="请输入模板名称" class="input"></el-input>
<el-button type="primary" class="btn" @click="searchList">搜索</el-button>
</div>
<div class="tool-btn">
<el-button class="btn" @click="createTamp">创建</el-button>
<!-- <el-button class="btn">编辑</el-button> -->
<el-button class="btn" @click="deleteTampList">删除</el-button>
<el-button v-if="selectItem.length" class="btn" @click="deleteTampList">删除</el-button>
<el-button v-else disabled class="btn">删除</el-button>
</div>
</div>
<div class="table-box">
......@@ -67,7 +68,7 @@
<div class="page-box">
<el-pagination
layout="prev, pager, next"
@next-click="nextPage"
@current-change="changePage"
:total="totals">
</el-pagination>
</div>
......@@ -148,8 +149,8 @@ export default {
path: '/msgTemplate/detail'
})
},
nextPage() {
this.page.page++
changePage(n) {
this.page.page = n
this.getMsgTempList(this.page)
},
prevPage() {
......
......@@ -14,24 +14,26 @@
<div class="heads">用户组<i class="el-icon-circle-plus-outline" @click="addGroupPop = true"></i></div>
<ul class="list-box">
<template v-for="(item, index) in groupData.data">
<li :key="index">
<div class="icon" @click="showDetail(item.id)"></div>
<div class="text" @click="showDetail(item.id)">{{ item.name }}</div>
<li :key="index" :class="index === groupActive && 'active'">
<div class="icon" @click="showDetail(item.id, index)"></div>
<div class="text" @click="showDetail(item.id, index)">{{ item.name }}</div>
<i class="el-icon-remove-outline icon-del" @click="delGroup(item.id)"></i>
</li>
</template>
</ul>
<div class="pages">
<el-pagination
:page-size=9
layout="prev, pager, next"
@current-change="changePage"
:total="groupData.total">
</el-pagination>
</div>
</li>
<li class="card card2">
<div class="heads">用户<i class="el-icon-circle-plus-outline" @click="getAddUserList"></i></div>
<div class="heads">用户<i class="el-icon-circle-plus-outline" v-if="groupId !== -1" @click="getAddUserList"></i></div>
<ul class="list-box">
<template v-for="(item, index) in groupUset">
<template v-for="(item, index) in groupUset.data">
<li :key="index">
<div class="icon"></div>
<div class="text">{{ item.nickname }}</div>
......@@ -43,6 +45,8 @@
<div class="pages">
<el-pagination
layout="prev, pager, next"
@current-change="changePage2"
:page-size=9
:total="groupUset.total">
</el-pagination>
</div>
......@@ -51,8 +55,17 @@
<div class="add-user-pop" v-if="addGroupUserPop">
<div class="card">
<div class="title">添加用户</div>
<div class="close" @click="addGroupUserPop = false">关闭</div>
<div class="search">
<el-input v-model="userListSearchInput" placeholder="搜索用户…" class="input"></el-input>
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input style="margin: 0 10px" v-model="userListSearchInput" placeholder="搜索用户…" class="input"></el-input>
<el-button type="primary" class="btn" @click="userListSearch">搜索</el-button>
</div>
<ul>
......@@ -75,6 +88,7 @@
<div class="add-user-pop" v-if="addGroupPop">
<div class="card height-min">
<div class="title">添加分组</div>
<div class="close" @click="addGroupPop = false">关闭</div>
<div class="search">
<el-input v-model="addGrounpInput" placeholder="添加分组" class="input"></el-input>
<el-button type="primary" class="btn" @click="addGroup">添加</el-button>
......@@ -88,6 +102,17 @@ import * as api from '@/api/common.js'
export default {
data() {
return {
options: [{
label: '搜索手机号',
value: 'mobile'
}, {
label: '搜索邮箱',
value: 'email'
}, {
label: '搜索用户名',
value: 'username'
}],
value: 'username',
input: '',
groupData: {},
groupUset: {},
......@@ -96,23 +121,34 @@ export default {
addGrounpInput: '',
userListSearchInput: '',
userList: {},
groupId: -1
groupId: -1,
groupActive: -1
}
},
mounted() {
this.getGroupList()
this.getGroupList({ page: 1, limit: 9 })
},
methods: {
getGroupList() {
changePage2(n) {
this.showDetail(this.groupId, this.groupActive, { page: n, limit: 9 })
},
changePage(n) {
this.getGroupList({ page: n, limit: 9 })
this.groupActive = -1
this.groupId = -1
this.groupUset = []
},
getGroupList(page) {
api
.getGroupList()
.getGroupList(page)
.then(response => {
this.groupData = response.data
})
.finally(() => {
})
},
showDetail(id) {
showDetail(id, index, page = { page: 1, limit: 9 }) {
this.groupActive = index
let isId = 0
if (id) {
this.groupId = id
......@@ -121,9 +157,9 @@ export default {
isId = this.groupId
}
api
.getGroupDetail(isId, { page: 1, limit: 10 })
.getGroupDetail(isId, page)
.then(response => {
this.groupUset = response.data.data
this.groupUset = response.data
})
.finally(() => {
})
......@@ -136,7 +172,7 @@ export default {
.addGroup({ name: this.addGrounpInput })
.then(response => {
if (response.code === 0) {
this.getGroupList()
this.getGroupList({ page: 1, limit: 9 })
this.addGrounpInput = ''
this.addGroupPop = false
}
......@@ -157,9 +193,11 @@ export default {
},
userListSearch() {
api
.userListSearch({ nickname: this.userListSearchInput })
.userListSearch({ [this.value]: this.userListSearchInput })
.then(response => {
if (response.code === 0) {
this.userList = response.data
}
})
.finally(() => {
})
......@@ -253,6 +291,18 @@ export default {
.icon-del{
font-size: 16px;
}
&.active{
.icon{
width: 14px;
height: 14px;
background: url(https://zws-imgs-pub.ezijing.com/static/public/e1449dcafdae05c909db49fd5168cab1.png);
background-size: 100% 100%;
}
.text{
color: #222;
font-weight: bold;
}
}
&:hover{
.icon{
width: 14px;
......@@ -345,6 +395,14 @@ export default {
width: 100%;
height: 100%;
background: rgba(0,0,0,.3);
.close{
position: absolute;
top: 25px;
right: 20px;
color: #428AFF;
font-size: 14px;
cursor: pointer;
}
.card{
padding: 0 20px;
box-sizing: border-box;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论