Commit d69b5ac7 by xinla

首页接口调试

1 parent 6eaa0a9b
import request from '@/utils/request' import request from '@/utils/request'
// 外部联系人 会话列表 // 外部联系人 会话列表
const getExternalChatList = (fromId) => { const getExternalChatList = fromId => {
return request({ return request({
url: '/chat/msg/selectExternalChatList/' + fromId, url: '/chat/msg/selectExternalChatList/' + fromId,
method: 'get' method: 'get'
...@@ -9,7 +9,7 @@ const getExternalChatList = (fromId) => { ...@@ -9,7 +9,7 @@ const getExternalChatList = (fromId) => {
} }
// 单聊 会话列表 // 单聊 会话列表
const selectAloneChatList = (params) => { const selectAloneChatList = params => {
return request({ return request({
url: '/chat/msg/selectAloneChatList', url: '/chat/msg/selectAloneChatList',
method: 'get', method: 'get',
...@@ -18,14 +18,14 @@ const selectAloneChatList = (params) => { ...@@ -18,14 +18,14 @@ const selectAloneChatList = (params) => {
} }
// 内部联系人列表 // 内部联系人列表
const getInternalChatList = (fromId) => { const getInternalChatList = fromId => {
return request({ return request({
url: '/chat/msg/selectInternalChatList/' + fromId, url: '/chat/msg/selectInternalChatList/' + fromId,
method: 'get' method: 'get'
}) })
} }
const getGroupChatList = (fromId) => { const getGroupChatList = fromId => {
return request({ return request({
url: '/chat/msg/selectGroupChatList/' + fromId, url: '/chat/msg/selectGroupChatList/' + fromId,
method: 'get' method: 'get'
...@@ -40,21 +40,8 @@ const getGroupChatList = (fromId) => { ...@@ -40,21 +40,8 @@ const getGroupChatList = (fromId) => {
// }) // })
// } // }
const indexTable = () => {
return request({
url: '/wecom/page/getCorpBasicData',
method: 'get'
})
}
const indexEchart = () => {
return request({
url: '/wecom/page/getCorpRealTimeData',
method: 'get'
})
}
// 全文检索 会话列表 // 全文检索 会话列表
export const getChatList = (params) => { export const getChatList = params => {
return request({ return request({
url: '/chat/msg/selectFullSearchChatList', url: '/chat/msg/selectFullSearchChatList',
method: 'get', method: 'get',
...@@ -63,7 +50,7 @@ export const getChatList = (params) => { ...@@ -63,7 +50,7 @@ export const getChatList = (params) => {
} }
// 全文检索 导出列表 // 全文检索 导出列表
export const exportList = (params) => { export const exportList = params => {
return request({ return request({
url: '/chat/msg/selectFullSearchChatList/export', url: '/chat/msg/selectFullSearchChatList/export',
method: 'get', method: 'get',
...@@ -73,8 +60,6 @@ export const exportList = (params) => { ...@@ -73,8 +60,6 @@ export const exportList = (params) => {
} }
// //
export const content = { export const content = {
indexEchart,
indexTable,
getExternalChatList, getExternalChatList,
selectAloneChatList, selectAloneChatList,
getInternalChatList, getInternalChatList,
......
import request from '@/utils/request'
export const indexTable = () => {
return request({
url: '/wecom/page/getCorpBasicData',
method: 'get'
})
}
export const indexEchart = () => {
return request({
url: '/wecom/page/getCorpRealTimeData',
method: 'get'
})
}
export const refresh = () => {
return request({
url: '/wecom/page/refresh',
method: 'get'
})
}
...@@ -12,7 +12,12 @@ ...@@ -12,7 +12,12 @@
<span class=" fontgay">最近更新:{{ uptime }}</span> <span class=" fontgay">最近更新:{{ uptime }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row type="flex" class="row-bg" justify="space-between" style="margin-top:35px; text-align: center;"> <el-row
type="flex"
class="row-bg"
justify="space-between"
style="margin-top:35px; text-align: center;"
>
<el-col :span="6" class="col_style">企业成员总数</el-col> <el-col :span="6" class="col_style">企业成员总数</el-col>
<el-col :span="6" class="col_style">客户总人数</el-col> <el-col :span="6" class="col_style">客户总人数</el-col>
<el-col :span="6" class="col_style">客户群总数</el-col> <el-col :span="6" class="col_style">客户群总数</el-col>
...@@ -45,7 +50,12 @@ ...@@ -45,7 +50,12 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row type="flex" class="row-bg" justify="space-between" style="margin-top:30px; text-align: center;"> <el-row
type="flex"
class="row-bg"
justify="space-between"
style="margin-top:30px; text-align: center;"
>
<el-col :span="6">新增客户数</el-col> <el-col :span="6">新增客户数</el-col>
<el-col :span="6">新增客群数</el-col> <el-col :span="6">新增客群数</el-col>
<el-col :span="6">群新增人数</el-col> <el-col :span="6">群新增人数</el-col>
...@@ -57,20 +67,27 @@ ...@@ -57,20 +67,27 @@
justify="space-between" justify="space-between"
style="margin-top:10px;font-size:35px;font-weight:bold;color: #0079DE; text-align: center;" style="margin-top:10px;font-size:35px;font-weight:bold;color: #0079DE; text-align: center;"
> >
<el-col :span="6">{{ erchatsTable.newApplyCnt }}</el-col> <el-col :span="6">{{ erchatsTable.newChatCnt }}</el-col>
<el-col :span="6">{{ erchatsTable.newContactCnt }}</el-col> <el-col :span="6">{{ erchatsTable.newContactCnt }}</el-col>
<el-col :span="6">{{ erchatsTable.newMemberCnt ? erchatsTable.newMemberCnt : 0 }}</el-col> <el-col :span="6">{{
erchatsTable.newMemberCnt ? erchatsTable.newMemberCnt : 0
}}</el-col>
<el-col :span="6">{{ erchatsTable.negativeFeedbackCnt }}</el-col> <el-col :span="6">{{ erchatsTable.negativeFeedbackCnt }}</el-col>
</el-row> </el-row>
<el-row type="flex" class="row-bg" justify="space-between" style="margin-top:10px; text-align: center;"> <el-row
type="flex"
class="row-bg"
justify="space-between"
style="margin-top:10px; text-align: center;"
>
<el-col <el-col
:span="6" :span="6"
:class="{ :class="{
greenicon: Number(erchatsTable.newApplyCntDiff) >= 1, greenicon: Number(erchatsTable.newChatCntDiff) >= 1,
redicon: Number(erchatsTable.newApplyCntDiff) < 0 redicon: Number(erchatsTable.newChatCntDiff) < 0
}" }"
>较{{ time }} >较{{ time }}
<span>{{ erchatsTable.newApplyCntDiff }}</span> <span>{{ erchatsTable.newChatCntDiff }}</span>
</el-col> </el-col>
<el-col <el-col
:span="6" :span="6"
...@@ -133,20 +150,34 @@ ...@@ -133,20 +150,34 @@
<p class="p2">登录时间:{{ parseTime(new Date()) }}</p> <p class="p2">登录时间:{{ parseTime(new Date()) }}</p>
<p class="p1 p3 margint20">LinkWechat 企业微信SCRM</p> <p class="p1 p3 margint20">LinkWechat 企业微信SCRM</p>
<p class="p2 p4">版本信息:开源 <span class="fr">可用期限:永久</span></p> <p class="p2 p4">版本信息:开源 <span class="fr">可用期限:永久</span></p>
<el-row :gutter="20" type="flex" class="row-bg" justify="center" style="text-align:center"> <el-row
:gutter="20"
type="flex"
class="row-bg"
justify="center"
style="text-align:center"
>
<el-col :span="10" class="flexspan"> <el-col :span="10" class="flexspan">
<img src="../assets/index/bzwd.png" /> <img src="../assets/index/bzwd.png" />
<a href="https://www.yuque.com/linkwechat/help"> 帮助手册</a> <a href="https://www.yuque.com/linkwechat/help"> 帮助手册</a>
</el-col> </el-col>
<el-col :span="2"></el-col> <el-col :span="2"></el-col>
<el-col :span="10" class="flexspan" @click.native="msgInfo('《使用手册》正在加急上线中,敬请关注…')" <el-col
:span="10"
class="flexspan"
@click.native="msgInfo('《使用手册》正在加急上线中,敬请关注…')"
><img src="../assets/index/kfsc.png" /> 开发文档</el-col ><img src="../assets/index/kfsc.png" /> 开发文档</el-col
> >
</el-row> </el-row>
</div> </div>
<div class="inedx_r_top_bottom"> <div class="inedx_r_top_bottom">
<span class="inedx_r_top_bottomp1"><img src="../assets/index/gxrz.png" /> 更新日志</span> <span class="inedx_r_top_bottomp1"><img src="../assets/index/gxrz.png" /> 更新日志</span>
<span class="fr" style="color:#0079DE" @click="msgInfo('《更新日志》正在加急上线中,敬请关注…')">更多</span> <span
class="fr"
style="color:#0079DE"
@click="msgInfo('《更新日志》正在加急上线中,敬请关注…')"
>更多</span
>
<ul> <ul>
<li v-for="(index, i) in 3" :key="i" @click="msgInfo('暂无内容')"> <li v-for="(index, i) in 3" :key="i" @click="msgInfo('暂无内容')">
即将上线,敬请期待 <span class="fr">03-26</span> 即将上线,敬请期待 <span class="fr">03-26</span>
...@@ -164,13 +195,17 @@ ...@@ -164,13 +195,17 @@
</div> </div>
<div class="inedx_r_top_bottom" style="text-align:center"> <div class="inedx_r_top_bottom" style="text-align:center">
<p style="text-align:left"> <p style="text-align:left">
<span class="inedx_r_top_bottomp1"> <img src="../assets/index/kfq.png" /> 官方交流</span> <span class="inedx_r_top_bottomp1">
<img src="../assets/index/kfq.png" /> 官方交流</span
>
</p> </p>
<img :src="bossImg" class="img" /> <img :src="bossImg" class="img" />
</div> </div>
<div class="inedx_r_top_bottom" style="text-align:center"> <div class="inedx_r_top_bottom" style="text-align:center">
<p style="text-align:left"> <p style="text-align:left">
<span class="inedx_r_top_bottomp1"> <img src="../assets/index/khq.png" /> 联系客服</span> <span class="inedx_r_top_bottomp1">
<img src="../assets/index/khq.png" /> 联系客服</span
>
</p> </p>
<img :src="bossImg" class="img" /> <img :src="bossImg" class="img" />
</div> </div>
...@@ -179,7 +214,7 @@ ...@@ -179,7 +214,7 @@
</div> </div>
</template> </template>
<script> <script>
import { content as api } from '@/api/conversation/content.js' import * as api from '@/api/index'
import echarts from 'echarts' import echarts from 'echarts'
export default { export default {
name: 'Index', name: 'Index',
...@@ -260,16 +295,17 @@ export default { ...@@ -260,16 +295,17 @@ export default {
default: default:
this.time = '昨天' this.time = '昨天'
this.timeType = 'today' this.timeType = 'today'
this.refresh()
break break
} }
}, },
tableInfo() { tableInfo() {
api.indexTable().then((res) => { api.indexTable().then(res => {
this.table = res.data this.table = res.data
}) })
}, },
erchatInfo() { erchatInfo() {
api.indexEchart().then((res) => { api.indexEchart().then(res => {
this.allData = res.data this.allData = res.data
this.uptime = res.data.updateTime this.uptime = res.data.updateTime
this.erchatsTable = this.allData.today this.erchatsTable = this.allData.today
...@@ -278,29 +314,29 @@ export default { ...@@ -278,29 +314,29 @@ export default {
}, },
serErchat() { serErchat() {
let data = { let data = {
arr0: [],
arr1: [], arr1: [],
arr2: [], arr2: [],
arr3: [], arr3: [],
arr4: [],
xData: [] xData: []
} }
let series = [] let series = []
let colors = ['#088AEE', '#E74E59', '#14BF48', '#FA7216'] let colors = ['#088AEE', '#E74E59', '#14BF48', '#FA7216']
this.erchatsTable.dataList.forEach((a) => { this.erchatsTable.dataList.forEach(a => {
data.xData.push(a.xtime) data.xData.push(a.xtime)
data.arr1.push(a.newApplyCnt) data.arr1.push(a.newContactCnt)
data.arr3.push(a.newMemberCnt) data.arr3.push(a.newMemberCnt)
data.arr2.push(a.newContactCnt) data.arr2.push(a.newContactCnt)
data.arr4.push(a.negativeFeedbackCnt) data.arr0.push(a.negativeFeedbackCnt)
}) })
for (let index = 0; index < 4; index++) { for (let index = 0; index < 4; index++) {
series.push({ series.push({
name: data['arr' + index], name: ['新增客户数', '新增客群数', '群新增人数', '流失客户数'][index],
type: 'line', type: 'line',
stack: '总量', stack: '总量',
smooth: true, smooth: true,
data: data, data: data['arr' + index],
itemStyle: { itemStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
...@@ -317,8 +353,6 @@ export default { ...@@ -317,8 +353,6 @@ export default {
}, },
drawLine(xData, series) { drawLine(xData, series) {
let obj = document.getElementById('echart') let obj = document.getElementById('echart')
obj.style.width = '100%'
obj.style.height = '380px'
let charts = echarts.init(obj) let charts = echarts.init(obj)
let timer = 0 let timer = 0
window.onresize = function() { window.onresize = function() {
...@@ -333,7 +367,7 @@ export default { ...@@ -333,7 +367,7 @@ export default {
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: ['发起申请数', '新增客户数', '群新增人数', '流失客户数'] data: ['新增客户数', '新增客群数', '群新增人数', '流失客户数']
}, },
grid: { grid: {
left: '3%', left: '3%',
...@@ -361,6 +395,11 @@ export default { ...@@ -361,6 +395,11 @@ export default {
}, },
series series
}) })
},
refresh() {
api.refresh().then(res => {
this.erchatInfo()
})
} }
} }
} }
...@@ -394,7 +433,7 @@ export default { ...@@ -394,7 +433,7 @@ export default {
} }
#fatherbox { #fatherbox {
width: 100%; padding-top: 30px;
height: 380px; height: 380px;
overflow-y: scroll; overflow-y: scroll;
overflow: hidden; overflow: hidden;
...@@ -405,7 +444,7 @@ export default { ...@@ -405,7 +444,7 @@ export default {
#echart { #echart {
width: 100%; width: 100%;
height: 380px; height: 100%;
} }
.fr { .fr {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!