|
@@ -6,12 +6,12 @@
|
|
|
<el-button style="float: right; padding: 3px 0" type="text" @click="addcontents">添加文章</el-button>
|
|
|
</div>
|
|
|
<div class="main">
|
|
|
- <filterList ref="filterList" :tableData="contents" :filed="filed" @edit="filtereEdit" @delete="filterDelete" @query="filterQuery" :total="Total"></filterList>
|
|
|
+ <filterList ref="filterList" :operation="operation" :tableData="contents" :filed="filed" @user="users" @edit="filtereEdit" @delete="filterDelete" @query="filterQuery" :total="Total"></filterList>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
- <dialogAndDrawer :width="'35%'" :title="title" :visibleSync="visibleSync" v-if="visibleSync" @close="visibleSync = false">
|
|
|
+ <dialogAndDrawer :width="'35%'" :title="title" :visibleSync="visibleSync" v-if="visibleSync" @close="visibleSync = false, lookUser = false">
|
|
|
<template v-slot:windowMain>
|
|
|
- <formData ref="formData" :filed="formfiled" :data="formdata" :rules="formrules" @save="formSave" v-if="visibleSync">
|
|
|
+ <formData v-if="!lookUser" ref="formData" :filed="formfiled" :data="formdata" :rules="formrules" @save="formSave">
|
|
|
<template v-slot:formItem="{ item, formdata }">
|
|
|
<!-- 缩略图 -->
|
|
|
<el-upload
|
|
@@ -40,6 +40,7 @@
|
|
|
</el-upload>
|
|
|
</template>
|
|
|
</formData>
|
|
|
+ <filterList v-else ref="filterList" :tableData="userList" :filter="false" :readOnly="true" :filed="userfiled" @query="userfilterQuery" :total="userTotal"></filterList>
|
|
|
</template>
|
|
|
</dialogAndDrawer>
|
|
|
</div>
|
|
@@ -60,6 +61,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ info: {},
|
|
|
+ lookUser: false,
|
|
|
fileList: [],
|
|
|
myHeaders: { Authorization: token },
|
|
|
title: '',
|
|
@@ -70,6 +73,10 @@ export default {
|
|
|
{ name: 'visit', label: '访问量' }
|
|
|
],
|
|
|
formdata: {},
|
|
|
+ userfiled: [
|
|
|
+ { name: 'name', label: '名称' },
|
|
|
+ { name: 'phone', label: '手机号' }
|
|
|
+ ],
|
|
|
formfiled: [
|
|
|
{ name: 'thumbnail', label: '缩略图', formater: 'slot' },
|
|
|
{ name: 'title', label: '标题' },
|
|
@@ -98,11 +105,16 @@ export default {
|
|
|
content: [
|
|
|
{ required: true, message: '请输入内容', trigger: 'blur' }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ operation: [
|
|
|
+ { name: 'user', label: '读者', icon: 'el-icon-user' },
|
|
|
+ { name: 'edit', label: '修改', icon: 'el-icon-edit' },
|
|
|
+ { name: 'delete', label: '删除', icon: 'el-icon-delete' }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['contentsList', 'Total', 'columnList']),
|
|
|
+ ...mapState(['contentsList', 'Total', 'columnList', 'userList', 'userTotal']),
|
|
|
contents() {
|
|
|
this.contentsList.map(p => {
|
|
|
const findName = this.columnList.find(e => e.code == p.bind);
|
|
@@ -117,7 +129,19 @@ export default {
|
|
|
await this.columnQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['contentsQuery', 'contentsCreate', 'contentsUpdate', 'contentsDelete', 'contentsQuery', 'contentsFetch', 'columnQuery']),
|
|
|
+ ...mapActions(['contentsQuery', 'contentsCreate', 'contentsUpdate', 'contentsDelete', 'contentsQuery', 'contentsFetch', 'columnQuery', 'userQuery']),
|
|
|
+ // 查看读者
|
|
|
+ async users(e) {
|
|
|
+ this.lookUser = true;
|
|
|
+ this.title = '读者列表';
|
|
|
+ this.visibleSync = true;
|
|
|
+ this.info = e;
|
|
|
+ this.userfilterQuery();
|
|
|
+ },
|
|
|
+ // 读者分页查询
|
|
|
+ async userfilterQuery ({ filter = {}, paging = { content: 0, size: 10 } } = {}) {
|
|
|
+ await this.userQuery({ filter: { source: this.info._id }, paging });
|
|
|
+ },
|
|
|
// 添加
|
|
|
addcontents () {
|
|
|
this.formdata = {};
|