Commit 7b140d78 by 姜鹏凯

朋友圈相关列表查询问题修复

1 parent 5767a996
...@@ -61,15 +61,7 @@ ...@@ -61,15 +61,7 @@
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<!-- image:图片;text:文本;video:视频;link:图文 --> <!-- image:图片;text:文本;video:视频;link:图文 -->
<div> <div>
{{ {{ dealType(row.realType) }}
row.contentType === 'image'
? '图片'
: row.contentType === 'text'
? '文本'
: row.contentType === 'video'
? '视频'
: '图文'
}}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -199,14 +191,50 @@ ...@@ -199,14 +191,50 @@
} }
}, },
methods: { methods: {
dealType(type) {
switch (type) {
case 4:
return '文本'
break
case 0:
return '图片'
break
case 9:
return '图文'
break
case 11:
return '小程序'
break
case 12:
return '文章'
break
case 2:
return '视频'
break
case 3:
return '文件'
break
case 5:
return '海报'
break
default:
return '文本'
break
}
},
gotoRoute() { gotoRoute() {
this.$router.push({ this.$router.push({
path: '/customerMaintain/friendCircle/publish' path: '/customerMaintain/friendCircle/publish'
}) })
}, },
setTimeChange(e) { setTimeChange(e) {
if (e) {
this.query.beginTime = moment(e[0]).format('YYYY-MM-DD') this.query.beginTime = moment(e[0]).format('YYYY-MM-DD')
this.query.endTime = moment(e[1]).format('YYYY-MM-DD') this.query.endTime = moment(e[1]).format('YYYY-MM-DD')
} else {
this.query.beginTime = ''
this.query.endTime = ''
}
}, },
detailFn(id) { detailFn(id) {
this.detailDialogVisible = true this.detailDialogVisible = true
...@@ -275,11 +303,10 @@ ...@@ -275,11 +303,10 @@
} }
} }
}, },
mounted() { mounted() {},
created() {
this.query.beginTime = moment(this.value1[0]).format('YYYY-MM-DD') this.query.beginTime = moment(this.value1[0]).format('YYYY-MM-DD')
this.query.endTime = moment(this.value1[1]).format('YYYY-MM-DD') this.query.endTime = moment(this.value1[1]).format('YYYY-MM-DD')
},
created() {
this.value1[1] = moment(new Date()).format('YYYY-MM-DD') this.value1[1] = moment(new Date()).format('YYYY-MM-DD')
this.value1[0] = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD') this.value1[0] = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD')
this.getList() this.getList()
......
...@@ -31,13 +31,13 @@ ...@@ -31,13 +31,13 @@
</el-form> </el-form>
</div> </div>
<div> <div>
<div style="margin:10px 0;display:flex;"> <div style="margin: 10px 0; display: flex;">
<ButtonSync :lastSyncTime="lastSyncTime" @click="syncFn">同步朋友圈</ButtonSync> <ButtonSync :lastSyncTime="lastSyncTime" @click="syncFn">同步朋友圈</ButtonSync>
<div class="time" v-if="lastSyncTime">最近同步:{{ lastSyncTime }}</div> <div class="time" v-if="lastSyncTime">最近同步:{{ lastSyncTime }}</div>
<div class="time" v-else>暂无记录,请手动点击同步</div> <div class="time" v-else>暂无记录,请手动点击同步</div>
</div> </div>
</div> </div>
<el-table ref="table" v-loading="loading" :data="tableData" style="width: 100%"> <el-table ref="table" v-loading="loading" :data="tableData" style="width: 100%;">
<el-table-column show-overflow-tooltip prop="content" label="朋友圈内容"> <el-table-column show-overflow-tooltip prop="content" label="朋友圈内容">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-image <el-image
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
:src="row.content" :src="row.content"
fit="fit" fit="fit"
:preview-src-list="[row.content]" :preview-src-list="[row.content]"
style="width: 100px; height: 100px" style="width: 100px; height: 100px;"
></el-image> ></el-image>
<video <video
v-else-if="row.contentType === 'video'" v-else-if="row.contentType === 'video'"
style="width: 100px; height: 100px" style="width: 100px; height: 100px;"
:src="row.content" :src="row.content"
></video> ></video>
<div v-else>{{ row.content }}</div> <div v-else>{{ row.content }}</div>
...@@ -72,12 +72,7 @@ ...@@ -72,12 +72,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column show-overflow-tooltip prop="creator" label="创建人"></el-table-column> <el-table-column show-overflow-tooltip prop="creator" label="创建人"></el-table-column>
<el-table-column <el-table-column show-overflow-tooltip prop="createTime" width="170px" label="创建时间"></el-table-column>
show-overflow-tooltip
prop="createTime"
width="170px"
label="创建时间"
></el-table-column>
<el-table-column show-overflow-tooltip prop="pointNum" label="点赞数"></el-table-column> <el-table-column show-overflow-tooltip prop="pointNum" label="点赞数"></el-table-column>
<el-table-column show-overflow-tooltip prop="commentNum" label="评论数"></el-table-column> <el-table-column show-overflow-tooltip prop="commentNum" label="评论数"></el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作" align="center" width="100">
...@@ -86,12 +81,7 @@ ...@@ -86,12 +81,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" />
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<SelectUser <SelectUser
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
title="组织架构" title="组织架构"
...@@ -105,13 +95,13 @@ ...@@ -105,13 +95,13 @@
{{ data.other }} {{ data.other }}
</el-form-item> </el-form-item>
<el-form-item :key="index" label=" " v-if="data.annexType === 'video'"> <el-form-item :key="index" label=" " v-if="data.annexType === 'video'">
<div style="display:inline-block;margin-right:10px;"> <div style="display: inline-block; margin-right: 10px;">
<video style="width: 200px; height: 200px" :src="data.annexUrl" controls></video> <video style="width: 200px; height: 200px;" :src="data.annexUrl" controls></video>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :key="index" label=" " v-if="data.annexType === 'link'"> <el-form-item :key="index" label=" " v-if="data.annexType === 'link'">
<div style="display:inline-block;margin-right:10px;"> <div style="display: inline-block; margin-right: 10px;">
<span style="width: 100px; height: 100px">{{ data.annexUrl }}</span> <span style="width: 100px; height: 100px;">{{ data.annexUrl }}</span>
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
...@@ -120,7 +110,7 @@ ...@@ -120,7 +110,7 @@
<div v-for="(data, index) in detail.otherContent"> <div v-for="(data, index) in detail.otherContent">
<el-image <el-image
class="item" class="item"
style="width: 100px; height: 100px" style="width: 100px; height: 100px;"
:preview-src-list="[data.annexUrl]" :preview-src-list="[data.annexUrl]"
v-if="data.annexType === 'image'" v-if="data.annexType === 'image'"
:src="data.annexUrl" :src="data.annexUrl"
...@@ -129,14 +119,10 @@ ...@@ -129,14 +119,10 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="点赞客户:" v-if="detail.pointCustomerName"> <el-form-item label="点赞客户:" v-if="detail.pointCustomerName">
<el-tag v-for="(data, key) in detail.pointCustomerName.split(',')" :key="key">{{ <el-tag v-for="(data, key) in detail.pointCustomerName.split(',')" :key="key">{{ data }}</el-tag>
data
}}</el-tag>
</el-form-item> </el-form-item>
<el-form-item label="评论客户:" v-if="detail.momentCustomerName"> <el-form-item label="评论客户:" v-if="detail.momentCustomerName">
<el-tag v-for="(data, key) in detail.momentCustomerName.split(',')" :key="key">{{ <el-tag v-for="(data, key) in detail.momentCustomerName.split(',')" :key="key">{{ data }}</el-tag>
data
}}</el-tag>
</el-form-item> </el-form-item>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="detailDialogVisible = false">取 消</el-button> <el-button @click="detailDialogVisible = false">取 消</el-button>
...@@ -147,10 +133,10 @@ ...@@ -147,10 +133,10 @@
</div> </div>
</template> </template>
<script> <script>
import SelectUser from '@/components/SelectUser' import SelectUser from '@/components/SelectUser'
import moment from 'moment' import moment from 'moment'
import { getEnterpriceList, syncHMoments, getDetail } from '@/api/circle' import { getEnterpriceList, syncHMoments, getDetail } from '@/api/circle'
export default { export default {
name: 'friend-index', name: 'friend-index',
components: { components: {
SelectUser SelectUser
...@@ -180,8 +166,13 @@ export default { ...@@ -180,8 +166,13 @@ export default {
}, },
methods: { methods: {
setTimeChange(e) { setTimeChange(e) {
if (e) {
this.query.beginTime = moment(e[0]).format('YYYY-MM-DD') this.query.beginTime = moment(e[0]).format('YYYY-MM-DD')
this.query.endTime = moment(e[1]).format('YYYY-MM-DD') this.query.endTime = moment(e[1]).format('YYYY-MM-DD')
} else {
this.query.beginTime = ''
this.query.endTime = ''
}
}, },
detailFn(id) { detailFn(id) {
this.detailDialogVisible = true this.detailDialogVisible = true
...@@ -202,12 +193,12 @@ export default { ...@@ -202,12 +193,12 @@ export default {
getSelectUser(data) { getSelectUser(data) {
this.userArray = data this.userArray = data
this.query.creator = this.userArray this.query.creator = this.userArray
.map(function(obj, index) { .map(function (obj, index) {
return obj.userId return obj.userId
}) })
.join(',') .join(',')
this.name = this.userArray this.name = this.userArray
.map(function(obj, index) { .map(function (obj, index) {
return obj.name return obj.name
}) })
.join(',') .join(',')
...@@ -256,27 +247,24 @@ export default { ...@@ -256,27 +247,24 @@ export default {
// } // }
// } // }
}, },
mounted() { mounted() {},
created() {
this.query.beginTime = moment(this.value1[0]).format('YYYY-MM-DD') this.query.beginTime = moment(this.value1[0]).format('YYYY-MM-DD')
this.query.endTime = moment(this.value1[1]).format('YYYY-MM-DD') this.query.endTime = moment(this.value1[1]).format('YYYY-MM-DD')
},
created() {
this.value1[1] = moment(new Date()).format('YYYY-MM-DD') this.value1[1] = moment(new Date()).format('YYYY-MM-DD')
this.value1[0] = moment(new Date()) this.value1[0] = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD')
.subtract(1, 'months')
.format('YYYY-MM-DD')
this.getList() this.getList()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.time { .time {
margin-left: 20px; margin-left: 20px;
color: #999; color: #999;
font-size: 12px; font-size: 12px;
align-self: flex-end; align-self: flex-end;
} }
.img_list { .img_list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: 330px; width: 330px;
...@@ -286,5 +274,5 @@ export default { ...@@ -286,5 +274,5 @@ export default {
height: 100px; height: 100px;
margin-right: 5px; margin-right: 5px;
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!