Commit a82b935e by 前端

Merge branch 'v3.14.1' into 'master'

V3.14.1

See merge request !157
2 parents 126d631e 374b8230
...@@ -56,16 +56,35 @@ export default { ...@@ -56,16 +56,35 @@ export default {
handler(val) { handler(val) {
this.dateArray = this.totalData.map(item => item.dateTime) //日期 this.dateArray = this.totalData.map(item => item.dateTime) //日期
this.customerCount = this.totalData.map(item => item.newCustomerCount) this.customerCount = this.totalData.map(item => item.newCustomerCount)
this.customerRatio = this.totalData.map(item => item.customerRatio * 100) this.customerRatio = this.totalData.map(item => this.Solution(item.customerRatio, 100))
this.entmicroCount = this.totalData.map(item => item.newEntmicroCount) this.entmicroCount = this.totalData.map(item => item.newEntmicroCount)
this.entmicroRatio = this.totalData.map(item => item.entmicroRatio * 100) this.entmicroRatio = this.totalData.map(item => this.Solution(item.entmicroRatio, 100))
this.initChart() this.initChart()
} }
} }
}, },
methods: { methods: {
Solution(a, b) {
if (a === 0 || b === 0) return 0 //
let m = 0 //精度
let s1 = a.toString()
let s2 = b.toString()
if (s1.indexOf('.') == -1 && s2.indexOf('.') == -1) {
return a * b
} else {
//计算s1小数点后的位数
m = m + (s1.indexOf('.') >= 0 ? s1.split('.')[1].length : 0)
//计算s2小数点后的位数
m = m + (s2.indexOf('.') >= 0 ? s2.split('.')[1].length : 0)
//除小数点后的所有位数相乘/精度
return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / Math.pow(10, m)
}
},
initChart() { initChart() {
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(this.$refs.myChart) let myChart = this.$echarts.init(this.$refs.myChart)
...@@ -100,7 +119,7 @@ export default { ...@@ -100,7 +119,7 @@ export default {
circleColor = '#FEBE6B' circleColor = '#FEBE6B'
res += `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${circleColor};"></span>` + datas[i].seriesName + ':' + datas[i].data + '人' + '<br/>' res += `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${circleColor};"></span>` + datas[i].seriesName + ':' + datas[i].data + '人' + '<br/>'
} }
if (datas[i].seriesName == '企微客户环比') { if (datas[i].seriesName == '企微客户环比') {
circleColor = '#FE9C1C' circleColor = '#FE9C1C'
res += `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${circleColor};"></span>` + datas[i].seriesName + ':' + datas[i].data + '%' + '<br/>' res += `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${circleColor};"></span>` + datas[i].seriesName + ':' + datas[i].data + '%' + '<br/>'
} }
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
<GLButton size="small" @click="handleExport" fn="导出">导出</GLButton> <GLButton size="small" @click="handleExport" fn="导出">导出</GLButton>
</div> </div>
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams"> <GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams">
<span slot="customerName" slot-scope="scope"> <span slot="customerName" slot-scope="scope">
<GLFull :labelWidth="70" :identification="`node_${scope.scope.id}`">{{ scope.scope.customerName ? scope.scope.customerName : '--' }}</GLFull> <GLFull :labelWidth="70" :identification="`node_${scope.scope.id}`">{{ scope.scope.customerName ? scope.scope.customerName : '--' }}</GLFull>
</span> </span>
<!-- <span slot="customerSex" slot-scope="scope" >--> <!-- <span slot="customerSex" slot-scope="scope" >-->
<span slot="customerSex" slot-scope="scope" > <span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span> <span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span>
</span> </span>
<!-- 企微名称 --> <!-- 企微名称 -->
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
CLIENTSTATUS: this.$Constants.CLIENT_STATUS, CLIENTSTATUS: this.$Constants.CLIENT_STATUS,
searchForm: { searchForm: {
addWay: '', addWay: '',
isJoin: null isJoin: 1
}, },
searchFormTable: {}, searchFormTable: {},
clientManageFormList: [ clientManageFormList: [
...@@ -463,7 +463,7 @@ export default { ...@@ -463,7 +463,7 @@ export default {
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(async (resolve) => { return new Promise(async resolve => {
if (Object.keys(this.$route.query).length && this.queryFlag == 0) { if (Object.keys(this.$route.query).length && this.queryFlag == 0) {
const res = JSON.parse(window.localStorage.getItem('sourceList')) const res = JSON.parse(window.localStorage.getItem('sourceList'))
let add_way = this.$route.query.addWay || '' let add_way = this.$route.query.addWay || ''
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!