Commit bb9fda01 by xinla

--no commit message

1 parent 4e73859b
import request from '@/utils/request'
const service = window.CONFIG.services.system + window.CONFIG.services.wecom + '/group'
export function getDetail (chatId) {
export function getDetail(chatId) {
return request({
url: service + `/chat/chatDetail/${chatId}`,
method: 'get'
method: 'get',
})
}
......@@ -15,17 +15,18 @@ export function getDetail (chatId) {
pageNum 是 当前页
pageSize 是 每页显示条数
groupName 是 群名
groupLeaderName 是 群主,多个使用逗号隔开
groupLeaderName 是 群主姓名,多个使用逗号隔开
userIds 是 群主userId,多个使用逗号隔开
tagIds 是 标签id,多个使用逗号隔开
beginTime:
endTime:
}
*/
export function getList (params) {
export function getList(params) {
return request({
url: service + '/chat/list',
method: 'get',
params
params,
})
}
......@@ -39,19 +40,19 @@ export function getList (params) {
"pageSize": ""
}
*/
export function getMembers (params) {
export function getMembers(params) {
return request({
url: service + '/chat/members',
params
params,
})
}
/**
* 客户群同步接口
*/
export function sync () {
export function sync() {
return request({
url: service + '/chat/synchWeGroup'
url: service + '/chat/synchWeGroup',
})
}
......@@ -70,10 +71,10 @@ export function sync () {
* @param {*} data
* @returns
*/
export function makeGroupTag (data) {
export function makeGroupTag(data) {
return request({
url: service + '/chat/makeGroupTag',
method: 'post',
data
data,
})
}
......@@ -7,7 +7,7 @@ const service = window.CONFIG.services.system + window.CONFIG.services.wecom + '
*/
export function getAnalysisCustomer() {
return request({
url: service + '/customer/getAnalysis'
url: service + '/customer/getAnalysis',
})
}
......@@ -22,7 +22,7 @@ endTime 是 结束时间
export function getTotalCntCustomer(params) {
return request({
url: service + '/customer/getTotalPageCnt',
params
params,
})
}
......@@ -37,7 +37,7 @@ endTime 是 结束时间
export function getUserAvgReplyTimeRank(params) {
return request({
url: service + '/customer/getUserAvgReplyTimeRank',
params
params,
})
}
......@@ -52,7 +52,7 @@ endTime 是 结束时间
export function getUserChatRank(params) {
return request({
url: service + '/customer/getUserChatRank',
params
params,
})
}
......@@ -67,7 +67,7 @@ endTime 是 结束时间
export function dataExportGroup(params) {
return request({
url: service + '/customer/total/export',
params
params,
})
}
......@@ -76,7 +76,7 @@ export function dataExportGroup(params) {
*/
export function getAnalysisGroup() {
return request({
url: service + '/group/getAnalysis'
url: service + '/group/getAnalysis',
})
}
......@@ -91,7 +91,7 @@ endTime 是 结束时间
export function getTotalCntGroup(params) {
return request({
url: service + '/group/getTotalPageCnt',
params
params,
})
}
......@@ -105,8 +105,8 @@ endTime 是 结束时间
*/
export function realDataExportGroup(params) {
return request({
url: service + '/group/real/export',
params
url: service + '/group/total/export',
params,
})
}
......@@ -121,7 +121,7 @@ endTime 是 结束时间
export function getArchiveList(params) {
return request({
url: service + '/archive/details',
params
params,
})
}
......@@ -131,6 +131,6 @@ export function getArchiveList(params) {
*/
export function getAnalysisArchive() {
return request({
url: service + '/archive/getAnalysis'
url: service + '/archive/getAnalysis',
})
}
......@@ -17,13 +17,13 @@ export default {
'达摩盘',
'数据银行',
'微信广告',
'企业微信'
]
'企业微信',
],
},
// 图例
legend: {
type: Array,
default: () => []
default: () => [],
},
// 展示数据集
// 注:二位数组, 其一维数组顺序需要和图例顺序一致,其二维数组顺序需要和X轴数组顺序一致
......@@ -37,19 +37,19 @@ export default {
// ]
series: {
type: Array,
default: () => [[120, 132, 101, 134, 90, 230, 210]]
default: () => [[120, 132, 101, 134, 90, 230, 210]],
},
// 是否为堆叠柱状图
stack: {
type: Boolean,
default: false
default: false,
},
// 自定义图表配置项,使用loadsh.merge(origin, option)和原有的配置进行覆盖合并
// loadsh.merge: https://www.html.cn/doc/lodash/#_mergeobject-sources
option: {
type: Object,
default: null
}
default: null,
},
},
data() {
return {}
......@@ -60,7 +60,7 @@ export default {
this.$nextTick(() => {
this.drawChart()
})
}
},
},
created() {},
mounted() {
......@@ -85,9 +85,9 @@ export default {
stack: this.stack,
barWidth: this.stack ? 40 : 20, // 柱图宽度
emphasis: {
focus: 'series'
focus: 'series',
},
data
data,
}
series.push(obj)
})
......@@ -102,15 +102,15 @@ export default {
backgroundColor: '#505050',
borderWidth: 0,
textStyle: {
color: '#fff'
color: '#fff',
},
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
backgroundColor: '#6a7985',
},
},
},
legend: {
data: this.legend,
......@@ -118,14 +118,14 @@ export default {
y: 'bottom',
icon: 'circle',
itemWidth: 8,
itemHeight: 8
itemHeight: 8,
},
grid: {
left: '20px',
right: '20px',
bottom: '40px',
top: '20px',
containLabel: true
containLabel: true,
},
xAxis: [
{
......@@ -133,37 +133,42 @@ export default {
data: this.xData,
axisLine: {
lineStyle: {
color: '#ccc'
}
color: '#ccc',
},
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
interval: 0,
color: 'rgba(153, 153, 153, 1)' // 横坐标字体颜色
color: 'rgba(153, 153, 153, 1)', // 横坐标字体颜色
},
axisTick: {
// 横坐标刻度
alignWithLabel: true,
show: true
}
}
show: true,
},
},
],
yAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: '#ccc'
}
color: '#ccc',
},
},
axisTick: {
// 横坐标刻度
alignWithLabel: true,
show: true
}
}
show: true,
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
// interval: 0,
color: 'rgba(153, 153, 153, 1)', // 坐标字体颜色
},
},
],
series
series,
}
this.option && merge(option, this.option)
......@@ -172,8 +177,8 @@ export default {
// new ResizeObserver((entries) => {
// this.myChart.resize()
// }).observe(this.$refs.chart)
}
}
},
},
}
</script>
......
......@@ -11,7 +11,7 @@ export default {
// 折线背景渐变色
bgLinearGradient: {
type: Boolean,
default: false
default: false,
},
// X轴坐标数据
xData: {
......@@ -23,13 +23,13 @@ export default {
'2021-12-03',
'2021-12-04',
'2021-12-05',
'2021-12-06'
]
'2021-12-06',
],
},
// 图例; 单个图例可传字符串,实际转换成单元素数组[string]
legend: {
type: [Array, String],
default: () => ['新增客户']
default: () => ['新增客户'],
},
// 展示数据集
// 注:二位数组, 其一维数组顺序需要和图例顺序一致,其二维数组顺序需要和X轴数组顺序一致
......@@ -43,14 +43,14 @@ export default {
// ]
series: {
type: Array,
default: () => [120, 132, 101, 134, 90, 230, 210]
default: () => [120, 132, 101, 134, 90, 230, 210],
},
// 自定义图表配置项,使用loadsh.merge(origin, option)和原有的配置进行覆盖合并
// loadsh.merge: https://www.html.cn/doc/lodash/#_mergeobject-sources
option: {
type: Object,
default: null
}
default: null,
},
},
data() {
return {}
......@@ -61,7 +61,7 @@ export default {
this.$nextTick(() => {
this.drawChart()
})
}
},
},
created() {},
mounted() {
......@@ -88,9 +88,9 @@ export default {
symbol: 'circle', // 数值点类型
symbolSize: 6, // 数值点大小
emphasis: {
focus: 'series'
focus: 'series',
},
data
data,
}
this.bgLinearGradient &&
Object.assign(obj, {
......@@ -104,16 +104,16 @@ export default {
colorStops: [
{
offset: 0,
color: echartColors[index] // 0% 处的颜色
color: echartColors[index], // 0% 处的颜色
},
{
offset: 0.8,
color: 'white' // 100% 处的颜色
}
color: 'white', // 100% 处的颜色
},
],
global: false // 缺省为 false
}
}
global: false, // 缺省为 false
},
},
})
series.push(obj)
})
......@@ -126,7 +126,7 @@ export default {
tooltip: {
textStyle: {
color: '#FFF', // 设置文字颜色
fontSize: 12
fontSize: 12,
},
trigger: 'axis',
backgroundColor: '#505050',
......@@ -134,9 +134,9 @@ export default {
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
backgroundColor: '#6a7985',
},
},
},
legend: {
data: legend,
......@@ -157,20 +157,20 @@ export default {
itemWidth: 16,
// itemHeight: 8,
tooltip: {
show: true
show: true,
},
textStyle: {
color: '#36363A',
fontSize: 12,
lineHeight: 14
}
lineHeight: 14,
},
},
grid: {
left: '3%',
right: '3%',
bottom: '40px',
top: '30px',
containLabel: true
containLabel: true,
},
xAxis: [
{
......@@ -180,33 +180,38 @@ export default {
offset: 5,
axisLine: {
lineStyle: {
color: '#ccc'
}
color: '#ccc',
},
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
// interval: 0,
color: 'rgba(153, 153, 153, 1)' // 横坐标字体颜色
color: 'rgba(153, 153, 153, 1)', // 坐标字体颜色
},
axisTick: {
// 横坐标刻度
alignWithLabel: true,
show: true
}
}
show: true,
},
},
],
yAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: '#ccc'
color: '#ccc',
},
show: false
}
}
show: false,
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
// interval: 0,
color: 'rgba(153, 153, 153, 1)', // 坐标字体颜色
},
},
],
series
series,
}
this.option && merge(option, this.option)
option && this.myChart.setOption(option)
......@@ -214,8 +219,8 @@ export default {
new ResizeObserver((entries) => {
this.myChart.resize()
}).observe(this.$refs.chart)
}
}
},
},
}
</script>
......
......@@ -197,7 +197,7 @@ export default {
let index = this.userList.findIndex((i) => i.userId === key)
index > -1 && this.userList.splice(index, 1)
let order = this.defaultValues.findIndex((i) => i.userId === key)
order > -1 && this.defaultValues.splice(order, 1)
order > -1 && this.defaultValues.slice().splice(order, 1)
},
},
}
......
......@@ -232,15 +232,14 @@ export default {
},
getSelectUser(data) {
this.userArray = data
this.query[this.dialogType] = data.map((e) => e.name).join(',')
this.query[this.dialogType] = data.map((e) => e.userId).join(',')
if (['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(this.type)) {
this.query.chatIds = ''
this.getGroupList({
groupLeaderName: this.query[this.dialogType],
userIds: this.query[this.dialogType],
})
} else {
this.getList()
}
this.getList()
},
exprotTable() {
this.$confirm('是否确认导出吗?', '警告', {
......@@ -292,7 +291,7 @@ export default {
<el-input
v-if="type.toLowerCase().includes('group')"
style="width: 180px"
v-model="query._groupOwners"
:value="userArray.map((e) => e.name) + ''"
readonly
@focus="showDialog('_groupOwners')"
placeholder="请选择群主"
......@@ -323,7 +322,7 @@ export default {
].includes(type)
"
style="width: 180px"
:value="query._users"
:value="userArray.map((e) => e.name) + ''"
readonly
@focus="showDialog('_users')"
placeholder="请选择部门或员工"
......
......@@ -116,15 +116,14 @@ export default {
},
getSelectUser(data) {
this.selectUsers[this.dialogType] = data
this.query[this.dialogType] = data.map((e) => e.name).join(',')
if (this.dialogType === 'customerGroup') {
this.getList(this.dialogType)
} else {
this.query[this.dialogType] = data.map((e) => e.userId).join(',')
if (this.dialogType === 'customerGroupMember') {
this.query.chatIds = ''
this.getGroupList({
groupLeaderName: this.query[this.dialogType],
userIds: this.query[this.dialogType],
})
}
this.getList(this.dialogType)
},
},
}
......@@ -167,7 +166,7 @@ export default {
<div>
<el-input
style="width: 180px"
v-model="query.customerGroup"
:value="selectUsers['customerGroup'].map((e) => e.name) + ''"
readonly
@focus="showDialog('customerGroup')"
placeholder="请选择群主"
......@@ -184,7 +183,7 @@ export default {
<div>
<el-input
style="width: 180px"
v-model="query.customerGroupMember"
:value="selectUsers['customerGroupMember'].map((e) => e.name) + ''"
readonly
@focus="showDialog('customerGroupMember')"
placeholder="请选择群主"
......
......@@ -113,13 +113,14 @@
label-width="120px"
>
<el-form-item label="红包金额(元)" prop="money">
<el-input
type="text"
placeholder="请输入金额"
<el-input-number
placeholder="请输入"
v-model="addForm.money"
:precision="2"
:step="0.1"
:max="200"
:min="0.01"
></el-input>
:min="1"
></el-input-number>
<div class="sub-des">精确到小数点后两位,可输入1~200</div>
</el-form-item>
<el-form-item label="发送场景" prop="sceneType">
......@@ -271,12 +272,12 @@ export default {
addForm: {
sceneType: [],
name: '',
money: '',
money: 1,
},
addRules: {
name: [{ required: true, message: '必填项' }],
money: [
{ required: true, message: '必填项', trigger: 'blur' },
{ required: true, message: '必填项', trigger: 'change' },
{ validator: validateAmount, trigger: 'blur' },
],
sceneType: [{ required: true, message: '必填项', trigger: 'change' }],
......@@ -297,11 +298,13 @@ export default {
},
methods: {
getList() {
getList(this.query).then((res) => {
if (res.code == 200) {
this.list = res.rows
this.total = +res.total
}
getList(this.query).then(({ rows, total }) => {
rows.forEach((e) => {
// 单位换算 分转元
e.money = (e.money / 100).toFixed(2)
})
this.list = rows
this.total = +total
})
},
resetQuery() {
......@@ -309,15 +312,17 @@ export default {
this.getList(1)
},
edit(row) {
this.addForm = Object.assign({ sceneType: [] }, row || {})
this.addForm = Object.assign({}, row || {})
this.addDialogVisible = true
this.$nextTick(() => this.$refs.addForm.clearValidate())
},
addOrUpdate() {
this.$refs.addForm.validate((validate) => {
if (!validate) return
this.addForm.money = Number(this.addForm.money)
addOrUpdate(this.addForm).then((res) => {
let form = Object.assign({}, this.addForm)
// 单位换算 元转分
form.money *= 100
addOrUpdate(form).then((res) => {
this.msgSuccess('操作成功')
this.getList()
this.addDialogVisible = false
......@@ -331,6 +336,9 @@ export default {
async showLimitConfig() {
const { data } = await getLimit()
let { id, singleDayPay, singleCustomerReceiveNum, singleCustomerReceiveMoney } = data
// 单位换算 分转元
singleDayPay /= 100
singleCustomerReceiveMoney /= 100
this.limitForm = { id, singleDayPay, singleCustomerReceiveNum, singleCustomerReceiveMoney }
this.limitDialogVisible = true
this.$nextTick(() => this.$refs.limitForm.clearValidate())
......@@ -338,7 +346,11 @@ export default {
setLimit() {
this.$refs.limitForm.validate((validate) => {
if (!validate) return
setLimit(this.limitForm).then((res) => {
let form = Object.assign({}, this.limitForm)
// 单位换算 元转分
form.singleDayPay *= 100
form.singleCustomerReceiveMoney *= 100
setLimit(form).then((res) => {
this.limitDialogVisible = false
this.msgSuccess('操作成功')
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!