Commit 44d90b8a by 前端

查看总时长转为时分秒

1 parent 1413d384
......@@ -40,7 +40,8 @@
<div class="analysis-title-block m-b-20">
<img src="@/assets/sop/sop03.png"/>
<div class="analysis-name"> 执行率
<p class="analysis-num"> {{ baseData.sopEventList.length ? selectedEventInfo.eventStatistics.executedRatio : '-' }}%</p></div>
<p class="analysis-num">
{{ baseData.sopEventList.length ? selectedEventInfo.eventStatistics.executedRatio : '-' }}%</p></div>
</div>
</div>
......@@ -65,14 +66,16 @@
</div>
</div>
<!-- <div id="completePie" class="chart-pie"></div>-->
<!-- <div id="completePie" class="chart-pie"></div>-->
</div>
</div>
<p class="m-b-10">客户触达明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="touchListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<GLTable ref="touchListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm"
:tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
......@@ -98,7 +101,7 @@ export default {
selectedEventInfo: {
eventStatistics: {}
},
labelOptUpdate:'',
labelOptUpdate: '',
// 搜索
searchFormData: [
{
......@@ -113,7 +116,7 @@ export default {
changeAttr: (val, targetItem) => {
this.searchForm.eventId = val
this.selectedEventInfo = this.baseData.sopEventList.find(item => item.id == val)
this.labelOptUpdate =this.selectedEventInfo.labelOptUpdate
this.labelOptUpdate = this.selectedEventInfo.labelOptUpdate
this.getBaseInfo()
this.$refs.touchListRef.refreshTable()
}
......@@ -126,49 +129,76 @@ export default {
tableColumns: []
},
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '110',
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '推送人',
prop: 'pusherName'
},
{
label: '推送时间',
prop: 'pusherTime'
},
{
label: '初次查看时间',
prop: 'firstViewDate',
formatter: cellValue => {
return cellValue.firstViewDate ? dayjs(cellValue.firstViewDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '查看次数',
prop: 'viewCount',
formatter: cellValue => {
return cellValue.viewCount || '--'
}
},
{
label: '客户名称',
prop: 'customerName',
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '110',
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '推送人',
prop: 'pusherName'
},
{
label: '推送时间',
prop: 'pusherTime'
},
{
label: '初次查看时间',
prop: 'firstViewDate',
formatter: cellValue => {
return cellValue.firstViewDate ? dayjs(cellValue.firstViewDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '查看次数',
prop: 'viewCount',
formatter: cellValue => {
return cellValue.viewCount || '--'
}
},
{
label: '查看总时长',
prop: 'viewDuration',
formatter: cellValue => {
let secondTime = parseInt(cellValue.viewDuration);// 秒
let minuteTime = 0;// 分
let hourTime = 0;// 小时
if (secondTime > 60) {//如果秒数大于60,将秒数转换成整数
//获取分钟,除以60取整数,得到整数分钟
minuteTime = parseInt(secondTime / 60);
//获取秒数,秒数取佘,得到整数秒数
secondTime = parseInt(secondTime % 60);
//如果分钟大于60,将分钟转换成小时
if (minuteTime > 60) {
//获取小时,获取分钟除以60,得到整数小时
hourTime = parseInt(minuteTime / 60);
//获取小时后取佘的分,获取分钟除以60取佘的分
minuteTime = parseInt(minuteTime % 60);
}
}
let result = "" + parseInt(secondTime) + "s";
if (minuteTime > 0) {
result = "" + parseInt(minuteTime) + "min" + result;
}
if (hourTime > 0) {
result = "" + parseInt(hourTime) + "h" + result;
}
return result
}
},
],
frontColumns:[
],
frontColumns: [
{
label: '群名称',
prop: 'groupName',
......@@ -176,17 +206,17 @@ export default {
],
otherTableColumns: [
{
label: '点赞数',
prop: 'likeCount',
}, {
label: '评论数',
prop: 'commentCount',
}
label: '点赞数',
prop: 'likeCount',
}, {
label: '评论数',
prop: 'commentCount',
}
],
diffsRepeatMode:{
1:'按天',
2:'按周',
3:'按月'
diffsRepeatMode: {
1: '按天',
2: '按周',
3: '按月'
},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
baseData: {
......@@ -215,13 +245,13 @@ export default {
getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({sopId: this.sopId}).then(res => {
this.sopInfo = res
if (this.sopInfo.sopType == 2){
this.tableParams.tableColumns = [...this.frontColumns,...this.tableColumns]
if (this.sopInfo.sopType == 2) {
this.tableParams.tableColumns = [...this.frontColumns, ...this.tableColumns]
}
if (this.sopInfo.sopType == 1){
if(this.selectedEventInfo.pushChannelType == 3) {
if (this.sopInfo.sopType == 1) {
if (this.selectedEventInfo.pushChannelType == 3) {
this.tableParams.tableColumns = this.tableColumns.concat(this.otherTableColumns)
}else {
} else {
this.tableParams.tableColumns = this.tableColumns
}
}
......@@ -252,7 +282,7 @@ export default {
if (this.baseData.sopEventList.length) {
this.baseData.sopEventList.forEach(item => {
item.confName = item.eventStartDate + ' '+ item.eventTime + ' ' + (item.repeatFlag == 'Y' ? this.diffsRepeatMode[item.repeatMode] : '单次') + ' ' + pushChannelTypeList[item.pushChannelType]
item.confName = item.eventStartDate + ' ' + item.eventTime + ' ' + (item.repeatFlag == 'Y' ? this.diffsRepeatMode[item.repeatMode] : '单次') + ' ' + pushChannelTypeList[item.pushChannelType]
// item.confName = item.eventStartDate + (item.repeatFlag == 'Y' ? (''-' + item.eventEndDate' || '') : '') + ' ' + item.eventTime + ' ' + pushChannelTypeList[item.pushChannelType]
})
this.getOptionsList('searchFormData', false)
......@@ -354,6 +384,7 @@ export default {
background: #F9FAFC;
display: flex;
align-items: center;
.analysis-title-block {
display: flex;
//justify-content: space-between;
......@@ -363,12 +394,15 @@ export default {
//line-height: 40px;
font-size: 14px;
color: #666666;
.analysis-name{
.analysis-name {
margin-left: 16px;
color: #333333;
.analysis-tips{
.analysis-tips {
display: flex;
.tips{
.tips {
margin-left: 3px;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!