Commit 5bb4d4fe by 怪兽?别跑

企业话术接口传参调整

1 parent e2737b26
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<!--话术中心的数据明细 --> <!--话术中心的数据明细 -->
<div class="margin-top: 10px;"> <div class="margin-top: 10px;">
<el-table :data="tableList" style="width: 100%"> <el-table :data="tableList" style="width: 100%;">
<el-table-column prop="name" label="素材" align="left"> <el-table-column prop="name" label="素材" align="left">
<template #default="{ row }"> <template #default="{ row }">
<span class="title">{{ row.materialName }}</span> <span class="title">{{ row.materialName }}</span>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image> <el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image>
</div> </div>
<!-- 图文 --> <!-- 图文 -->
<div v-if="row.mediaType === '9'" style="display: flex"> <div v-if="row.mediaType === '9'" style="display: flex;">
<el-image v-if="row.coverUrl" :src="row.coverUrl" fit="contain" class="imgsize"></el-image> <el-image v-if="row.coverUrl" :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
<div class="icon-style" v-else> <div class="icon-style" v-else>
<svg-icon class="icon-style" icon="imgText"></svg-icon> <svg-icon class="icon-style" icon="imgText"></svg-icon>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
</div> </div>
<!-- 文章 --> <!-- 文章 -->
<div v-if="row.mediaType === '12'" style="display: flex"> <div v-if="row.mediaType === '12'" style="display: flex;">
<el-image v-if="row.coverUrl" :src="row.coverUrl" fit="contain" class="imgsize"></el-image> <el-image v-if="row.coverUrl" :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
<div class="icon-style" v-else> <div class="icon-style" v-else>
<svg-icon class="icon-style" icon="article"></svg-icon> <svg-icon class="icon-style" icon="article"></svg-icon>
...@@ -35,21 +35,22 @@ ...@@ -35,21 +35,22 @@
<span class="twosplice mt10">{{ coverContent(row.digest) }}</span> <span class="twosplice mt10">{{ coverContent(row.digest) }}</span>
</div> </div>
<!-- 视频 --> <!-- 视频 -->
<div v-if="row.mediaType === '2'" style="display: flex"> <div v-if="row.mediaType === '2'" style="display: flex;">
<el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
<span class="twosplice mt10">{{ coverContent(row.digest) }}</span> <span class="twosplice mt10">{{ coverContent(row.digest) }}</span>
</div> </div>
<!-- 文件 --> <!-- 文件 -->
<div v-if="row.mediaType === '3'" style="display: flex"> <div v-if="row.mediaType === '3'" style="display: flex;">
<!-- <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> --> <!-- <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> -->
<svg-icon <svg-icon
class="icon-style" class="icon-style"
:icon="row.materialUrl ? filType(row.materialUrl) : ''" :icon="row.materialUrl ? filType(row.materialUrl) : ''"
v-if="row.materialUrl"></svg-icon> v-if="row.materialUrl"
></svg-icon>
<span class="twosplice mt10">{{ coverContent(row.digest) }}</span> <span class="twosplice mt10">{{ coverContent(row.digest) }}</span>
</div> </div>
<!-- 海报 --> <!-- 海报 -->
<div v-if="row.mediaType === '5'" style="display: flex"> <div v-if="row.mediaType === '5'" style="display: flex;">
<el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image> <el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image>
<span class="twosplice mt10">{{ coverContent(row.digest) }}</span> <span class="twosplice mt10">{{ coverContent(row.digest) }}</span>
</div> </div>
...@@ -90,8 +91,9 @@ ...@@ -90,8 +91,9 @@
:title="send ? '发送明细' : '查看明细'" :title="send ? '发送明细' : '查看明细'"
v-model="dialogVisible" v-model="dialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="60%"> width="60%"
<el-table v-loading="loading" :data="detailList" style="width: 100%"> >
<el-table v-loading="loading" :data="detailList" style="width: 100%;">
<!-- 发送明细 --> <!-- 发送明细 -->
<template v-if="send"> <template v-if="send">
<el-table-column prop="sendBy" label="发送员工" align="center" min-width="100" /> <el-table-column prop="sendBy" label="发送员工" align="center" min-width="100" />
...@@ -105,7 +107,8 @@ ...@@ -105,7 +107,8 @@
:src="scope.row.viewAvatar" :src="scope.row.viewAvatar"
fit="contain" fit="contain"
class="imgsize" class="imgsize"
v-if="scope.row.viewAvatar"></el-image> v-if="scope.row.viewAvatar"
></el-image>
{{ scope.row.viewBy }} {{ scope.row.viewBy }}
</template> </template>
</el-table-column> </el-table-column>
...@@ -121,7 +124,8 @@ ...@@ -121,7 +124,8 @@
align="center" align="center"
min-width="100" min-width="100"
prop="viewDurationCpt" prop="viewDurationCpt"
show-overflow-tooltip /> show-overflow-tooltip
/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button text @click="goDetail(scope.row)" v-if="scope.row.isCustomer">客户详情</el-button> <el-button text @click="goDetail(scope.row)" v-if="scope.row.isCustomer">客户详情</el-button>
...@@ -134,151 +138,163 @@ ...@@ -134,151 +138,163 @@
:total="total" :total="total"
v-model:page="query.pageNum" v-model:page="query.pageNum"
v-model:limit="query.pageSize" v-model:limit="query.pageSize"
@pagination="getTableChangeSize()" /> @pagination="getTableChangeSize()"
/>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getTableDetail } from '@/api/contentCenter/common.js' import { getTableDetail } from '@/api/contentCenter/common.js'
export default { export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
detailList: [], // 发送/查看明细 detailList: [], // 发送/查看明细
send: true, send: true,
query: { query: {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1
}, },
total: 0, total: 0,
loading: false, loading: false
}
},
props: {
tableList: {
type: Array,
default: [],
},
// 1素材中心 2企业话术 3客服话术
resourceType: {
type: Number,
default: null,
},
},
methods: {
// 查看人数
viewNum(row) {
this.dialogVisible = true
this.query.detailsType = 2
this.query.contentId = row.id
this.query.talkId = row.talkId
this.detailList = []
this.getTableChangeSize()
this.send = false
},
// 发送人数
sendNum(row) {
this.send = true
this.dialogVisible = true
this.query.detailsType = 1
this.query.contentId = row.id
this.query.talkId = row.talkId
this.detailList = []
this.getTableChangeSize()
},
getTableChangeSize() {
this.loading = true
this.query.resourceType = this.resourceType
getTableDetail(this.query).then((res) => {
this.detailList = res.rows
this.total = Number(res.total)
this.loading = false
})
},
goDetail(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId },
})
},
deltype(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
} }
}, },
filType(file) { props: {
let filecontent = JSON.parse(JSON.stringify(file)) timeObj: {
filecontent = filecontent.split('.') type: Object,
let type = filecontent[filecontent.length - 1] default: {
if (type === 'pdf') { beginTime: '',
return 'pdf' endTime: ''
} else if (['doc', 'docx'].includes(type)) { }
return 'word' },
} else if (['ppt', 'pptx', 'pps', 'pptsx'].includes(type)) { tableList: {
return 'ppt' type: Array,
} else { default: []
return '' },
// 1素材中心 2企业话术 3客服话术
resourceType: {
type: Number,
default: null
} }
}, },
// 超过50个。。。展示 methods: {
coverContent(str) { // 查看人数
if (str && str.length > 50) { viewNum(row) {
str = str.substr(0, 50) + '...' this.dialogVisible = true
this.query.detailsType = 2
this.query.contentId = row.id
this.query.talkId = row.talkId
this.query.beginTime = this.timeObj.beginTime
this.query.endTime = this.timeObj.endTime
this.detailList = []
this.getTableChangeSize()
this.send = false
},
// 发送人数
sendNum(row) {
this.send = true
this.dialogVisible = true
this.query.detailsType = 1
this.query.contentId = row.id
this.query.talkId = row.talkId
this.query.beginTime = this.timeObj.beginTime
this.query.endTime = this.timeObj.endTime
this.detailList = []
this.getTableChangeSize()
},
getTableChangeSize() {
this.loading = true
this.query.resourceType = this.resourceType
getTableDetail(this.query).then((res) => {
this.detailList = res.rows
this.total = Number(res.total)
this.loading = false
})
},
goDetail(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId }
})
},
deltype(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
}
},
filType(file) {
let filecontent = JSON.parse(JSON.stringify(file))
filecontent = filecontent.split('.')
let type = filecontent[filecontent.length - 1]
if (type === 'pdf') {
return 'pdf'
} else if (['doc', 'docx'].includes(type)) {
return 'word'
} else if (['ppt', 'pptx', 'pps', 'pptsx'].includes(type)) {
return 'ppt'
} else {
return ''
}
},
// 超过50个。。。展示
coverContent(str) {
if (str && str.length > 50) {
str = str.substr(0, 50) + '...'
}
return str
} }
return str }
}, }
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.icon-style { .icon-style {
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
.title { .title {
width: 80%; width: 80%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
font-weight: bold; font-weight: bold;
color: var(--font-black-7); color: var(--font-black-7);
font-size: 12px; font-size: 12px;
} }
.imgsize { .imgsize {
width: 50px; width: 50px;
height: 50px; height: 50px;
margin-right: 10px; margin-right: 10px;
} }
.scriptNum { .scriptNum {
font-size: 14px; font-size: 14px;
color: var(--color); color: var(--color);
cursor: pointer; cursor: pointer;
} }
</style> </style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="data-content"> <div class="data-content">
<div class="chart-content"> <div class="chart-content">
<search-title @search="getLineData"></search-title> <search-title @search="getLineData"></search-title>
<chart-line style="height: 300px" :legend="legend" :xData="xdata" :series="series"></chart-line> <chart-line style="height: 300px;" :legend="legend" :xData="xdata" :series="series"></chart-line>
</div> </div>
</div> </div>
</div> </div>
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
</div> </div>
<div> <div>
<div> <div>
<search-title :showToday="true" @search="getTableData" style="margin-top: 20px"></search-title> <search-title :showToday="true" @search="getTableData" style="margin-top: 20px;"></search-title>
</div> </div>
<div class="data-content" style="margin-top: 20px"> <div class="data-content" style="margin-top: 20px;">
<DataDetail :tableList="tableList" :resourceType="2" /> <DataDetail :tableList="tableList" :timeObj="query" :resourceType="2" />
</div> </div>
</div> </div>
</div> </div>
...@@ -35,191 +35,191 @@ ...@@ -35,191 +35,191 @@
</template> </template>
<script> <script>
import { getCount } from '@/api/contentCenter/common.js' import { getCount } from '@/api/contentCenter/common.js'
import { getTalkMaterial } from '@/api/contentCenter/scriptCenter.js' import { getTalkMaterial } from '@/api/contentCenter/scriptCenter.js'
import PreviewClient from '@/components/previewInMobileClient.vue' import PreviewClient from '@/components/previewInMobileClient.vue'
import ChartBar from '@/components/ChartBar.vue' import ChartBar from '@/components/ChartBar.vue'
import ChartLine from '@/components/ChartLine.vue' import ChartLine from '@/components/ChartLine.vue'
import SearchTitle from '../components/SearchTitle.vue' import SearchTitle from '../components/SearchTitle.vue'
import DataDetail from '@/views/contentCenter/components/DataDetail.vue' import DataDetail from '@/views/contentCenter/components/DataDetail.vue'
export default { export default {
components: { components: {
SearchTitle, SearchTitle,
ChartLine, ChartLine,
ChartBar, ChartBar,
PreviewClient, PreviewClient,
DataDetail, DataDetail
}, },
data() { data() {
return { return {
detailForm: {}, //详情请求参数 detailForm: {}, //详情请求参数
submitLoading: false, submitLoading: false,
typeTitle: [ typeTitle: [
'图片', '图片',
'语音', '语音',
'视频', '视频',
'文件', '文件',
'文本', '文本',
'海报', '海报',
'活码', '活码',
'人群', '人群',
'旅程', '旅程',
'图文', '图文',
'链接', '链接',
'小程序', '小程序',
'文章', '文章'
], ],
disabled: true, disabled: true,
mobForm: { mobForm: {
welcomeMsg: '', welcomeMsg: '',
materialMsgList: [], materialMsgList: [],
userIds: '', userIds: '',
userNames: '', userNames: ''
},
exportLoading: false,
// barLegend1: ['访问客户总数'],
// barLegend2: ['咨询客户总数'],
form: {}, // 素材表单
legend: ['发送次数', '查看次数', '查看人数'],
xdata: [],
series: [],
activeName: 'first',
cardData: [
{
title: '发送总次数 ',
value: 0,
noArrow: true,
},
{
title: '查看总次数',
value: 0,
},
{
title: '查看总人数',
value: 0,
},
{
title: '今日发送次数',
value: 0,
},
{
title: '今日查看次数',
value: 0,
}, },
{ exportLoading: false,
title: '今日查看人数', // barLegend1: ['访问客户总数'],
value: 0, // barLegend2: ['咨询客户总数'],
form: {}, // 素材表单
legend: ['发送次数', '查看次数', '查看人数'],
xdata: [],
series: [],
activeName: 'first',
cardData: [
{
title: '发送总次数 ',
value: 0,
noArrow: true
},
{
title: '查看总次数',
value: 0
},
{
title: '查看总人数',
value: 0
},
{
title: '今日发送次数',
value: 0
},
{
title: '今日查看次数',
value: 0
},
{
title: '今日查看人数',
value: 0
}
],
total: 0,
query: {
pageSize: 10,
pageNum: 1
}, },
], tableList: [],
total: 0, loading: false,
query: { searchData: {},
pageSize: 10, bar1: [],
pageNum: 1, bar2: [],
}, value1: [],
tableList: [], value2: [],
loading: false, tableSearch: {},
searchData: {}, treeData: [{}], // 树
bar1: [], talkId: ''
bar2: [], }
value1: [],
value2: [],
tableSearch: {},
treeData: [{}], // 树
talkId: '',
}
},
methods: {
contentChange(e) {
this.mobForm.welcomeMsg = e
},
getTableData(data) {
this.query.talkId = this.talkId
this.query.beginTime = data.beginTime
this.query.endTime = data.endTime
this.getTableChangeSize()
},
getLineData(data) {
// this.searchData = data
data.talkId = this.talkId
data.moduleType = 2
data.talkType = 0
data.resourceType = 2
this.legend = ['发送次数', '查看次数', '查看人数']
// this.$forceUpdate()
getCount(data).then((res) => {
this.cardData[0].value = res.data.sendTotalNum
this.cardData[1].value = res.data.viewTotalNum
this.cardData[2].value = res.data.viewByTotalNum
this.cardData[3].value = res.data.sendTodayNum
this.cardData[4].value = res.data.viewTotalTodayNum
this.cardData[5].value = res.data.viewByTotalTodayNum
this.xdata = []
this.series = []
let arr1 = []
let arr2 = []
let arr3 = []
if (res.data && res.data.contentAxisVoList.length) {
res.data.contentAxisVoList.forEach((dd) => {
this.xdata.push(dd.dateStr)
arr1.push(dd.sendNum)
arr2.push(dd.viewNum)
arr3.push(dd.viewByNum)
})
this.series = [arr1, arr2, arr3]
}
})
}, },
getTableChangeSize() { methods: {
this.loading = true contentChange(e) {
this.query.talkType = 0 this.mobForm.welcomeMsg = e
this.query.resourceType = 2 },
getTalkMaterial(this.query).then((res) => { getTableData(data) {
this.tableList = res.data this.query.talkId = this.talkId
// this.total = Number(res.total) this.query.beginTime = data.beginTime
this.loading = false this.query.endTime = data.endTime
}) this.getTableChangeSize()
},
getLineData(data) {
// this.searchData = data
data.talkId = this.talkId
data.moduleType = 2
data.talkType = 0
data.resourceType = 2
this.legend = ['发送次数', '查看次数', '查看人数']
// this.$forceUpdate()
getCount(data).then((res) => {
this.cardData[0].value = res.data.sendTotalNum
this.cardData[1].value = res.data.viewTotalNum
this.cardData[2].value = res.data.viewByTotalNum
this.cardData[3].value = res.data.sendTodayNum
this.cardData[4].value = res.data.viewTotalTodayNum
this.cardData[5].value = res.data.viewByTotalTodayNum
this.xdata = []
this.series = []
let arr1 = []
let arr2 = []
let arr3 = []
if (res.data && res.data.contentAxisVoList.length) {
res.data.contentAxisVoList.forEach((dd) => {
this.xdata.push(dd.dateStr)
arr1.push(dd.sendNum)
arr2.push(dd.viewNum)
arr3.push(dd.viewByNum)
})
this.series = [arr1, arr2, arr3]
}
})
},
getTableChangeSize() {
this.loading = true
this.query.talkType = 0
this.query.resourceType = 2
getTalkMaterial(this.query).then((res) => {
this.tableList = res.data
// this.total = Number(res.total)
this.loading = false
})
}
}, },
}, created() {
created() { this.talkId = this.$route.query.talkId
this.talkId = this.$route.query.talkId }
}, }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: var(--font-white, #fff); color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
margin-left: 20px; margin-left: 20px;
} }
.data-content { .data-content {
margin-top: 10px;
.chart-content {
margin-top: 10px; margin-top: 10px;
.my_button { .chart-content {
float: right; margin-top: 10px;
.my_button {
float: right;
}
.column {
display: flex;
.column-item {
flex: 1;
}
}
} }
.column { .search-content {
display: flex; display: flex;
.column-item { justify-content: space-between;
flex: 1; }
} .table-content {
margin-top: 10px;
} }
} }
.search-content {
display: flex;
justify-content: space-between;
}
.table-content {
margin-top: 10px;
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!