提交 5c95ef2c authored 作者: wangyizheng's avatar wangyizheng

新增用户群相关的接口

新增用户群列表页面
上级 901da092
import httpRequest from '@/utils/axios'
// 用户群列表
export function groupList(params) {
return httpRequest.get('/api/opera/v1/oprations/cgroups', { params })
}
// 添加用户群
export function groupAdd(data) {
return httpRequest.post('/api/opera/v1/oprations/cgroup', data)
}
// 获取用户群详情
export function groupInfo(id, params) {
return httpRequest.get(`/api/opera/v1/oprations/${id}/cgroup`, { params })
}
// 更新用户群信息
export function groupUpdate(id, data) {
return httpRequest.put(`/api/opera/v1/oprations/${id}/cgroup`, data)
}
// 删除用户群
export function groupDelete(id, params) {
return httpRequest.put(`/api/opera/v1/oprations/${id}/cgroup`, { params })
}
...@@ -27,10 +27,13 @@ ...@@ -27,10 +27,13 @@
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
fixed fixed
prop="created_at"
label="日期"> label="日期">
<template slot-scope="scope">
<i class="el-icon-time"></i>
{{ scope.row.created_at }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="图片"> <el-table-column label="用户群图片">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="demo-image__placeholder"> <div class="demo-image__placeholder">
<div class="block"> <div class="block">
...@@ -45,34 +48,43 @@ ...@@ -45,34 +48,43 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="案例名称"> label="用户群名称">
</el-table-column>
<el-table-column
prop="username"
label="姓名">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="用户群相关特征">
prop="department" <template slot-scope="scope">
label="部门"> <div v-if="scope.row.characteristics.length === 0"><span>无用户群相关特征...</span></div>
<div v-else>
<el-button type="text" @click="dialogVisible = true">点击查看用户群特征</el-button>
<el-dialog :title="scope.row.name" :visible.sync="dialogVisible" :modal="false">
<i v-for="characteristic in scope.row.characteristics">
<div v-if="characteristic.context">
{{ characteristic.name + ':'}}
<span v-for="contextInfo in JSON.parse(characteristic.context)"><br/>{{contextInfo.options + '、' + contextInfo.options_info +'. '}}</span>
<br/>
</div>
</i>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="position" prop="updated_at"
label="职位"> label="更新时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="product" prop="operator"
label="营销产品"> label="编辑人">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select size="mini" :value="opera" @change="operation" placeholder="请选择"> <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-option :value="{ tag: 'reach', row: scope.row }" label="触达方案"></el-option> <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
<el-option :value="{ tag: 'group', row: scope.row }" label="用户群"></el-option>
<el-option :value="{ tag: 'detail', row: scope.row }" label="详情"></el-option>
<el-option :value="{ tag: 'delete', row: scope.row }" label="删除"></el-option>
</el-select>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -82,12 +94,40 @@ ...@@ -82,12 +94,40 @@
</template> </template>
<script> <script>
import * as api from '@/api/cgroups'
export default { export default {
name: 'cgroup-index', name: 'cgroup-index',
mounted() {
var caseInfo = this.$route.params
api.groupList({ case_id: caseInfo.id }).then(res => {
console.log(res)
if (res.code === 0) {
console.log(res.data)
this.tableData = res.data
return true
} else {
this.$message.error(res.message)
return false
}
}).catch(error => {
console.log(error)
return false
})
},
data () { data () {
return {} return {
dialogVisible: false,
tableData: []
}
}, },
methods: { methods: {
// 编辑
handleEdit(index, group) {
},
// 删除
handleDelete(index, group) {
}
} }
} }
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论