Commit 44d90b8a by 前端

查看总时长转为时分秒

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