Commit 7a14303c by zhangquan

Merge branch 'v3.21.0' of http://192.168.3.233:8090/saas/scrm-micro-scene into v3.21.0

2 parents d91fbd6a 04d47556
...@@ -1864,6 +1864,7 @@ ...@@ -1864,6 +1864,7 @@
"thread-loader": "^2.1.3", "thread-loader": "^2.1.3",
"url-loader": "^2.2.0", "url-loader": "^2.2.0",
"vue-loader": "^15.9.2", "vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2", "vue-style-loader": "^4.1.2",
"webpack": "^4.0.0", "webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0", "webpack-bundle-analyzer": "^3.8.0",
...@@ -1878,6 +1879,51 @@ ...@@ -1878,6 +1879,51 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true "dev": true
}, },
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"ssri": { "ssri": {
"version": "8.0.1", "version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
...@@ -1886,6 +1932,28 @@ ...@@ -1886,6 +1932,28 @@
"requires": { "requires": {
"minipass": "^3.1.1" "minipass": "^3.1.1"
} }
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },
...@@ -13221,75 +13289,6 @@ ...@@ -13221,75 +13289,6 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-style-loader": { "vue-style-loader": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
......
...@@ -25,11 +25,12 @@ ...@@ -25,11 +25,12 @@
<div <div
:key="cindex" :key="cindex"
class="group" class="group"
v-loading="c.loading"
> >
<div class="title"> <div class="title">
<div class="text flex"> <div class="text flex">
<div class="icon"> <div class="icon">
<img :src="`https://img01.glsx.com.cn/weapp/resource/saas/scrm/data-view-sop-${cindex}.png`"> <img :src="`https://img01.glsx.com.cn/weapp/resource/saas/scrm/data-view-sop-${cindex}.png`" />
</div> </div>
{{ c.title }} {{ c.title }}
</div> </div>
...@@ -40,7 +41,14 @@ ...@@ -40,7 +41,14 @@
></div> ></div>
</div> </div>
</div> </div>
<el-scrollbar class="content"> <div
class="content"
v-infinite-scroll="
() => {
infiniteLoad(cindex, index)
}
"
>
<template v-if="c.list.length"> <template v-if="c.list.length">
<template v-for="(item, ind) in c.list"> <template v-for="(item, ind) in c.list">
<template> <template>
...@@ -59,10 +67,8 @@ ...@@ -59,10 +67,8 @@
</div> </div>
<div class="text"> <div class="text">
<div class="name"> <div class="name">
{{item.customerName || ''}} {{ item.customerName || '' }}
<template v-if="item.wechatNickname"> <template v-if="item.wechatNickname">@{{ item.wechatNickname }}</template>
@{{item.wechatNickname}}
</template>
</div> </div>
{{ item.customerPhone }} {{ item.customerPhone }}
</div> </div>
...@@ -80,7 +86,7 @@ ...@@ -80,7 +86,7 @@
<img src="@/assets/icon/nodata.png" /> <img src="@/assets/icon/nodata.png" />
</div> </div>
</template> </template>
</el-scrollbar> </div>
</div> </div>
</template> </template>
</template> </template>
...@@ -103,7 +109,7 @@ ...@@ -103,7 +109,7 @@
</template> </template>
<template v-else> <template v-else>
<div class="nothing"> <div class="nothing">
<img :src="nothing"> <img :src="nothing" />
暂无数据 暂无数据
</div> </div>
</template> </template>
...@@ -136,19 +142,50 @@ export default { ...@@ -136,19 +142,50 @@ export default {
leftActiveIcon: require('@/assets/icon/left-active.png'), leftActiveIcon: require('@/assets/icon/left-active.png'),
rightIcon: require('@/assets/icon/right.png'), rightIcon: require('@/assets/icon/right.png'),
rightActiveIcon: require('@/assets/icon/right-active.png'), rightActiveIcon: require('@/assets/icon/right-active.png'),
pageNumber: 1, pageNumber: [11],
pageCount: [],
nothing, nothing,
} }
}, },
watch: {
// stageList: {
// handler() {
// this.pageNumber = new Array(this.stageList.length).fill(1);
// this.pageCount = new Array(this.stageList.length).fill(0)
// },
// deep:true,
// immediate:true
// }
},
mounted () { mounted () {
this.refreshTable() this.refreshTable()
}, },
methods: { methods: {
// 下拉加载
async infiniteLoad (cindex, index) {
// console.log(this.pageCount, this.pageNumber)
if (this.viewList[index][cindex].list.length == 0) return
if (this.viewList[index][cindex].list.length == this.pageCount[cindex]) return
this.pageNumber[cindex]++
const params = {
...JSON.parse(JSON.stringify(this.params)),
pageSize: 10,
pageNumber: this.pageNumber[cindex],
sopJourneyStage: this.stageList[cindex].value
}
let { list } = await this.$apis.journey.getCustomersList(params)
list.length &&
list.forEach((e) => {
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day')
})
this.viewList[index][cindex].list = this.viewList[index][cindex].list.concat(list)
},
async refreshTable () { async refreshTable () {
function splitArrayIntoChunks (arr, chunkSize) { function splitArrayIntoChunks (arr, chunkSize) {
const weight = 1 / arr.length const weight = 1 / arr.length
return arr.reduce((result, item, index) => { return arr.reduce((result, item, index) => {
const chunkIndex = Math.floor(index / chunkSize) const chunkIndex = Math.floor(index / chunkSize)
// console.log(index, chunkIndex)
item.width = `${(weight * index + weight) * 100}%` item.width = `${(weight * index + weight) * 100}%`
result[chunkIndex] = result[chunkIndex] || [] result[chunkIndex] = result[chunkIndex] || []
result[chunkIndex].push(item) result[chunkIndex].push(item)
...@@ -157,34 +194,49 @@ export default { ...@@ -157,34 +194,49 @@ export default {
} }
const params = { const params = {
...JSON.parse(JSON.stringify(this.params)), ...JSON.parse(JSON.stringify(this.params)),
pageSize: 9999, pageSize: 10,
pageNumber: this.pageNumber pageNumber: 1
} }
const stageList = this.stageList, const stageList = this.stageList,
arr = [], arr = [],
{ sopJourneyStage } = params { sopJourneyStage } = params
for (let k of stageList) { this.dataViewLoading = false
if (k.value) { for (let k in stageList) {
params.sopJourneyStage = k.value if (stageList[k].value) {
arr.push({
title: stageList[k].label,
list: [],
loading: true
})
this.viewList = splitArrayIntoChunks(arr, 4)
this.dataViewLoading = true
}
}
for (let k in stageList) {
if (stageList[k].value) {
params.sopJourneyStage = stageList[k].value
let list = [] let list = []
if (!sopJourneyStage || sopJourneyStage == stageList[k].value) {
k != 0 && this.$set(this.pageNumber, k - 1, 1)
if (!sopJourneyStage || sopJourneyStage == k.value) { const { list: apiList, total } = await this.$apis.journey.getCustomersList(params)
this.dataViewLoading = false
const { list: apiList } = await this.$apis.journey.getCustomersList(params)
list = apiList list = apiList
k != 0 && this.$set(this.pageCount, k - 1, total)
} }
list.length && list.length &&
list.forEach((e) => { list.forEach((e) => {
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day') e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day')
}) })
arr.push({ this.viewList.forEach(item => {
title: k.label, item.forEach(e => {
list if (!e.list.length && e.title === stageList[k].label) {
e.list = list || []
e.loading = false
}
})
}) })
} }
} }
this.viewList = splitArrayIntoChunks(arr, 4)
this.dataViewLoading = true
}, },
} }
} }
...@@ -247,7 +299,7 @@ export default { ...@@ -247,7 +299,7 @@ export default {
} }
.content { .content {
height: calc(100% - 60px); height: calc(100% - 60px);
overflow-y: scroll; overflow-y: auto;
box-sizing: border-box; box-sizing: border-box;
padding: 16px 16px 8px; padding: 16px 16px 8px;
position: relative; position: relative;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!