Commit 9e5157be by 前端

Merge branch 'v2.11.0' into 'master'

V2.11.0

See merge request !47
2 parents 937e9793 4d5e3da5
Showing 55 changed files with 5227 additions and 105 deletions
......@@ -4,6 +4,11 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
},
"@babel/code-frame": {
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
......@@ -3085,16 +3090,6 @@
"integrity": "sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg==",
"dev": true
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
......@@ -3121,24 +3116,12 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
......@@ -3232,15 +3215,6 @@
"strip-ansi": "^6.0.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz",
......@@ -3289,30 +3263,6 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"loader-utils": {
"version": "2.0.2",
"resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
}
}
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
......@@ -4056,6 +4006,14 @@
"integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==",
"dev": true
},
"axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": {
"follow-redirects": "^1.14.0"
}
},
"babel-eslint": {
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz",
......@@ -4835,7 +4793,7 @@
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="
},
"check-types": {
"version": "8.0.3",
......@@ -5623,7 +5581,7 @@
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="
},
"crypto-browserify": {
"version": "3.12.0",
......@@ -7732,9 +7690,9 @@
}
},
"glsx-common": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.0.4.tgz",
"integrity": "sha512-EgWFYUmDk6axzEi6uq5FmYd8nPD7DDg2Vi5kepNMX7YS/cg4bLNBdGCp4iZe2SYFIx3U5O7yKf9fI/aWewCVxw==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
......@@ -7742,18 +7700,10 @@
"sha1": "^1.1.1"
},
"dependencies": {
"axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": {
"follow-redirects": "^1.14.0"
}
},
"qs": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
......@@ -7761,21 +7711,23 @@
}
},
"glsx-components": {
"version": "1.5.2",
"resolved": "https://registry.npmmirror.com/glsx-components/-/glsx-components-1.5.2.tgz",
"integrity": "sha512-5/LaPu0B1uT7Kzl6oyIqyFT/NXIz2w7HNstiRtHaUQN1waSrPPPtzRRwywJg6CSSL+p994NaqPRnX696NAYzKg==",
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.3.tgz",
"integrity": "sha512-tj/2DSGKpbwrlP7ByBZQrgEgCcmrP2iR8p/BafY6BFr0/q4sJuxQx6of586rJuoVUasRveIIuFmUcLCkBSnQFA==",
"requires": {
"@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"glsx-common": "^1.4.9",
"vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vuedraggable": "^2.24.3"
},
"dependencies": {
"element-ui": {
"version": "2.15.9",
"resolved": "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.9.tgz",
"integrity": "sha512-dx45nQLt4Hn87/Z9eRr3ex6KFZbxlFAwEU3QoW3wA5EsYftvHTyL9Pq7VnXXD7hu1Eiaup2jcs6kp+/VSFmXuA==",
"version": "2.15.10",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.10.tgz",
"integrity": "sha512-jmD++mU2wKXbisvx4fxOl2mHaU+HWHTAq/3Wf8x9Bwyu4GdDZPLABb+CGi3DWN6fPqdgRcd74aX39DO+YHObLw==",
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
......@@ -7784,6 +7736,25 @@
"resize-observer-polyfill": "^1.5.0",
"throttle-debounce": "^1.0.1"
}
},
"glsx-common": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
"qs": "^6.10.1",
"sha1": "^1.1.1"
}
},
"qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
}
}
},
......@@ -13018,6 +12989,11 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true
},
"set-promise-interval": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/set-promise-interval/-/set-promise-interval-1.0.8.tgz",
"integrity": "sha512-5wo1ft1mOaYCUhxFfbWeqKj7brn95KWaqex/si+4b6N6E/aKpq0dsSm+lAwKBXAMqsAUgcWT7asZeXNq7+fULA=="
},
"set-value": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
......@@ -13066,7 +13042,7 @@
"sha1": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz",
"integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=",
"integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==",
"requires": {
"charenc": ">= 0.0.1",
"crypt": ">= 0.0.1"
......@@ -14596,6 +14572,85 @@
}
}
},
"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,
"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,
"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,
"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,
"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
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": 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
},
"loader-utils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"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,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.3.tgz",
......
......@@ -12,9 +12,10 @@
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.2",
"glsx-common": "^2.0.4",
"glsx-components": "^1.5.3",
"lodash": "^4.17.21",
"set-promise-interval": "^1.0.8",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3",
......
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 13:59:56
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-10 14:33:27
* @FilePath: \scrm-micro-authorize\public\index.html
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
......@@ -5,6 +13,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="no-referrer">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>微前端子应用:博客</title>
</head>
......
import { http, http2 } from '@/main'
// 获取验证码
const getLoginQcCode = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getLoginQcCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 验证二维码是否失效
const getQcCodeDetail = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getQcCodeDetail'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const wechatDepositList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositList'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getLoginQcCode,
getQcCodeDetail,
wechatDepositList
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 15:23:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-04 09:38:21
* @FilePath: \scrm-micro-authorize\src\api\modules\common.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default { pictureUpload }
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const customerList = params => {
params.type = 1
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerGroupList = params => {
params.type = 2
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${path}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const detail = params => {
params.type = 2
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const findLordGroup = params => {
params.method = 'entmicro.api.staff.findLordGroup'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => {
// params.method = 'scrm.api.datahub.label.querylabeltree'
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const groupList = params => {
params.method = 'entmicro.api.customer.group.list.by.merchant'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerCount = params => {
params.method = 'entmicro.api.mass.detail.customer.filter.count'
// return http({
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 客户群发、客户群群发基本信息详情
const customerDetail = params => {
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发统计
const detailStatistic = params => {
params.method = `${path}detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发统计
const groupDetailStatistic = params => {
params.method = `${path}group.detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发员工列表
const staffList = params => {
params.method = `${path}staff.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发客户列表
const customerDetailList = params => {
params.method = `${path}customer.list.page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发列表
const groupDetailList = params => {
params.method = `${path}group.detail.sender.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 根据id提醒用户 ,列表
const listRemindOperate = params => {
params.method = `${path}listRemindOperate`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 详情页客户群提醒
const remindUserGroup = params => {
params.method = `${path}remindUserGroup`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const groupDetailUpdate = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const followerType = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const followerEcho = params => {
params.method = 'entmicro.api.mass.follower.echo'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新客户群发客户列表
const renewDetailList = params => {
params.method = `${path}update.merchant`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 客户群发统计
const renewStatistic = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
customerList,
customerGroupList,
insert,
detail,
remindUserGroup,
listRemindOperate,
listDepartmentTree,
querylabeltree,
groupList,
customerCount,
customerDetail,
detailStatistic,
groupDetailStatistic,
staffList,
customerDetailList,
groupDetailList,
getMerchant,
getCard,
getCoupon,
merchant,
merchantOpen,
getPackage,
getActivity,
nameVaild,
getStatus,
templatePage,
templateSave,
templateUpdate,
createdNameList,
templateDetail,
groupDetailUpdate,
findLordGroup,
followerType,
queryCrowdtree,
followerEcho,
getGroupListApi,
getMaterialListApi,
renewDetailList,
renewStatistic
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 14:42:45
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-09-30 14:13:48
* @FilePath: \scrm-micro-authorize\src\api\modules\friendGroup.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http, http_common } from '@/main'
//朋友圈群发任务多条件分页查询
const conditionPage = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.condition.page'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//朋友圈群发任务新建
const batchmomentSave = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.save'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//发送记录分页查询
const batchmomentRecord = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.record.page'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
//企微高级群发创建门店列表
const merchantList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const compressionUpload = params => {
return http_common({
url: 'https://scrm.test.glsx.com.cn/rpc-scrm-entmicro-container/file/upload',
// url: 'http://192.168.3.145:8186/rpc-scrm-entmicro-container/video/compression/upload',
method: 'POST',
data: params,
sign: false
})
}
export default {
merchantList,
conditionPage,
batchmomentRecord,
batchmomentSave,
compressionUpload
}
import { http, http2 } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const batchmessagingRecord = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 企微群发查看预计群发人数
const batchmessagingCustomercount = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.customercount'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 企微群发任务创建
const atchmessagingCreate = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create'
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const recordSend = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record.send'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
querylabeltree,
queryCrowdtree,
batchmessagingRecord,
batchmessagingCustomercount,
atchmessagingCreate,
getStoreList,
recordSend
}
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
//权益卡
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//权益卡
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//是否开通权益
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//优惠券
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//套餐
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//秒杀活动
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 众筹模式活动
const crowdfundingActivity = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//模板列表
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板保存
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板更新
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板创建人
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCard,
merchant,
getActivity,
getPackage,
getMerchant,
getCoupon,
merchantOpen,
getGroupListApi,
getMaterialListApi,
templatePage,
createdNameList,
templateUpdate,
templateSave,
templateDetail,
crowdfundingActivity
}
......@@ -3,8 +3,8 @@
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2022-04-25 11:31:28
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-09-23 09:40:29
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
......@@ -19,7 +19,7 @@ export const fetchConfig = function(isEnv = true) {
// }
//return window.fetch('https://', {}).then(res => res.json())
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -3,8 +3,8 @@
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-02-16 14:49:58
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-09-21 16:49:04
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
......@@ -15,7 +15,8 @@ import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
Vue.config.silent = true
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
\ No newline at end of file
export const http_common = params => Vue.prototype.$http_common(params)
export default {
methods: {
merchantList() {
const params = {
pageNum: 1,
pageSize: 10000
}
return this.$apis.friendGroup.merchantList(params)
}
}
}
/*
* @Author: your name
* @Date: 2022-02-10 19:00:41
* @LastEditTime: 2022-07-11 18:35:19
* @LastEditors: huyue
* @LastEditTime: 2022-11-04 09:38:04
* @LastEditors: yangming yangming@didihu.com.cn
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-pay\src\setup\qiankun.js
*/
......@@ -15,6 +15,7 @@ import ElementUI from 'element-ui'
import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/public.scss'
import render from './render'
import GLEditor from 'glsx-components/src/packages/Editor'
let routes = []
let router = null
let instance = null
......@@ -23,6 +24,7 @@ Vue.use(GLTable)
Vue.use(GLCombiForm)
Vue.use(GLFooter)
Vue.use(GLTableButton)
Vue.use(GLEditor)
Vue.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, sign_common, secret, request_common } = await fetchConfig(true) //globalState.configSwitch
......@@ -30,6 +32,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
// const response_custom = Object.assign({}, { ...response, code_success_value: 'true', data_key: 'result', code_key: 'success' })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
......
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-08-25 14:14:44
* @FilePath: \scrm\scrm-base\src\store\index.js
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 13:59:56
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-09-22 09:41:50
* @FilePath: \scrm-micro-authorize\src\store\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from 'vue'
import Vuex from 'vuex'
......
......@@ -20,8 +20,8 @@ export default {
commit('SET_PAGE_SIZE', data)
},
// 设置token
setToken({ commit }, data) {
commit('SET_TOKEN', data)
setToken(context, data) {
console.log(context, data)
}
}
}
/*
* @Author: your name
* @Date: 2022-02-16 18:09:07
* @LastEditTime: 2022-02-16 18:09:07
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-09-28 15:55:01
* @LastEditors: yangming yangming@didihu.com.cn
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-wechat\src\utils\data.js
*/
const MODEL = {
1: '集团企微模式',
2: '单店企微模式'
1: '集团企微模式',
2: '单店企微模式'
}
export {
MODEL
}
\ No newline at end of file
export { MODEL }
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
import { Message } from 'element-ui'
let util = {}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function(sign = '-') {
let day = new Date()
let month = day.getMonth() + 1
let date = day.getDate()
if (month < 10) month = '0' + month
if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date
return s
}
util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1
let year = new Date().getFullYear()
let arr = new Array()
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1
month = month + 12
}
if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function(time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function(dateStr, separator) {
if (!separator) {
separator = '-'
}
var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0])
var month
//处理月份为04这样的情况
if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1))
} else {
month = parseInt(dateArr[1])
}
var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day)
return date
}
util.getDay = function(num, str = '-') {
var today = new Date()
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
export default util
<template>
<div class="container">
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<div class="header-text">已激活列表</div>
<div>
<el-button class="table-btn" @click="handleqrCode" :size="size" type="primary" plain mode="el-button">
企微接入授权
</el-button>
</div>
</div>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm"
:tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="staffName" slot-scope="scope">
<div class="staffName">
<span>{{ scope.scope.staffName }}</span>
<span class="entmicroName" v-if="scope.scope.entmicroName">@{{ scope.scope.entmicroName }}</span>
</div>
</div>
<div slot="loginStatus" slot-scope="scope">
<div class="loginStatus">
<span class="cycle"
:style="{ background: scope.scope.loginStatus == '1' ? '#2CCA74' : scope.scope.loginStatus == '0' ? '#999999' : '' }"></span>
{{ scope.scope.loginStatus == '1' ? '在线' : scope.scope.loginStatus == '0' ? '离线' : '--' }}
</div>
</div>
</GLTable>
<GLDialog :title="'授权登入二维码'" mode="small" :visible.sync="qrCodeVisible">
<div v-loading="addLoading" class="qrIMGbox">
<img class="qrIMG" :src="qrcodeUrl"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" disabled v-if="!show" class="count">{{ count }} s</el-button>
<el-button type="primary" size="small" v-if="show" @click="getCode">刷新</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import setPromiseInterval, { clearPromiseInterval } from 'set-promise-interval'
import {utils} from 'glsx-common'
export default {
name: 'collocation',
data() {
return {
url,
show: true,
count: '',
timer: null,
verifyQRCodeFailsToOpen: false,
addLoading: false,
qrCodeInterval: null,
qrCodeIntervalList: [],
qrcodeUrl: '',
qrCodeVisible: false,
qrcodeId: '',
searchForm: {
loginStatus: ''
},
searchFormData: [
{
label: '所属企微',
name: 'entmicroName',
type: 'input',
isClear: true
},
{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true
},
{
label: '手机号码',
name: 'staffPhone',
type: 'input',
isClear: true
},
{
label: '状态',
name: 'loginStatus',
type: 'select',
optionList: [
{
label: '全部',
value: ''
},
{
label: '在线',
value: 1
},
{
label: '离线',
value: 0
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
}
],
tableParams: {
listName: 'data',
tableColumns: [
{
label: '员工企微',
prop: 'staffName',
addHtml: 'staffName',
minwidth: 110
},
{
label: '手机号码',
prop: 'staffPhone',
minwidth: 110
},
{
label: '所属门店',
prop: 'merchantName',
minwidth: 110
},
{
label: '最后同步时间',
prop: 'lastLoginTime',
minwidth: 110
},
{
label: '状态',
prop: 'loginStatus',
addHtml: 'loginStatus',
minwidth: 110
}
]
},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'},
getListApi: this.$apis.collocation.wechatDepositList
}
},
methods: {
handleSearch() {
this.$refs.activeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
},
async handleqrCode() {
this.addLoading = true
this.qrCodeVisible = true
this.verifyQRCodeFailsToOpen = false
await this.$apis.collocation
.getLoginQcCode({})
.then(res => {
this.addLoading = false
;(this.verifyQRCodeFailsToOpen = true), (this.qrcodeUrl = `data:image/png;base64,${res.qcCodeUrl}`)
this.qrcodeId = res.id
})
.catch(err => {
this.qrCodeVisible = false
this.clearAllInterval()
})
},
clearAllInterval() {
console.log(this.qrCodeIntervalList)
this.qrCodeIntervalList.length && this.qrCodeIntervalList.forEach(item => {
clearInterval(item)
})
clearPromiseInterval(this.qrCodeInterval)
this.qrCodeIntervalList = [];
this.qrCodeInterval = null;
},
verifyQRCodeIsInvalid() {
this.qrCodeInterval = setPromiseInterval(() => this.qrcodeTimeoutApi(), 15000)
this.qrCodeIntervalList.push(this.qrCodeInterval)
},
getCode() {
this.clearAllInterval()
this.handleqrCode()
const TIME_COUNT = 10;
if (!this.timer) {
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
} else {
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000)
}
},
async qrcodeTimeoutApi() {
await this.$apis.collocation.getQcCodeDetail({id: this.qrcodeId}).then(res => {
if (res == true) {
this.$message({
type: 'error',
message: '二维码已失效,请刷新'
})
this.verifyQRCodeFailsToOpen = false
clearInterval(this.qrCodeInterval)
return
}
})
}
},
computed: {
listenChange() {
const {verifyQRCodeFailsToOpen, qrCodeVisible} = this
return {verifyQRCodeFailsToOpen, qrCodeVisible}
}
},
watch: {
listenChange(val) {
if (val.qrCodeVisible == true && val.verifyQRCodeFailsToOpen == true) {
this.verifyQRCodeIsInvalid()
} else {
this.clearAllInterval()
}
}
}
}
</script>
<style lang="scss" scoped>
/deep/ {
.el-table th > .cell {
padding: 0 16px;
}
}
.container {
padding: 20px;
background-color: #fff;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
.qrIMGbox {
display: flex;
align-items: center;
justify-content: center;
.qrIMG {
width: 150px;
height: 150px;
}
}
/deep/ .loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.staffName {
display: flex;
align-items: center;
.entmicroName {
font-size: 12px;
color: #fb8f28;
}
}
}
</style>
<template>
<div>
<el-drawer title="发送记录" :visible.sync="drawVisible" direction="rtl" size="50%">
<div class="horizon"></div>
<div class="drawer-body">
<div class="record-panel">
<div class="record-border">
<div class="record-status">发送成功</div>
<div class="record-num">{{ successCount }}</div>
</div>
<div class="record-border">
<div class="record-status">发送失败</div>
<div class="record-num">{{ failCount }}</div>
</div>
</div>
<GLTable ref="proGroupRef" @refreshTable="getListData" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" :pageConf="pageConf">
<div slot="status" slot-scope="scope">
<span style="color: #EB4E4E" v-if="scope.scope.status == 2">发送失败</span>
<span style="color: #2CCA74" v-else-if="scope.scope.status == 3">发送成功</span>
</div>
</GLTable>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
data() {
return {
successCount: 0,
failCount: 0,
drawVisible: false,
tableData: [],
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '员工',
prop: 'staffName',
minwidth: 240
},
{
label: '发送时间',
prop: 'sendTime',
minwidth: 180
},
{
label: '发送结果',
prop: 'status',
addHtml: 'status',
minwidth: 180
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
getListData() {
this.loading = true
const params = {
pageSize: this.$refs.proGroupRef.page.pageSize,
pageNum: this.$refs.proGroupRef.page.pageNum,
id: this.recordId
}
this.$apis.friendGroup.batchmomentRecord(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.data
this.tableTotal = res.count
}
})
},
init(row) {
const { id, successCount = 0, failCount = 0 } = row
this.recordId = id
this.successCount = successCount
this.failCount = failCount
this.drawVisible = true
this.$nextTick(() => {
this.getListData()
})
}
}
}
</script>
<style scoped lang="scss">
.drawer-body {
padding: 20px;
}
.horizon {
width: 100%;
height: 1px;
background: #e8e8ea;
}
.record-panel {
display: flex;
.record-border {
width: 50%;
height: 66px;
padding: 8px 20px;
background: #ffffff;
border: 1px solid #e8e8ea;
border-radius: 4px;
box-sizing: border-box;
margin-bottom: 16px;
&:first-child {
margin-right: 20px;
.record-num {
color: #2cca74;
}
}
.record-status {
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
line-height: 22px;
}
.record-num {
font-size: 20px;
color: #eb4e4e;
letter-spacing: 0;
line-height: 24px;
margin-top: 6px;
}
}
}
</style>
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>仅筛选有外部客户联系人的成员</span>
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<el-popover ref="popover" placement="bottom" width="215" trigger="click" v-model="popoverVisible" @show="onShowPopover" @hide="onHidePopover">
<el-tree class="select-tree" :data="treeData" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
<el-input v-model="searchForm.department" slot="reference" :size="size" readonly placeholder="请选择所在门店/部门" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" @keyup.enter.native="search"></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;">
<el-input :size="size" v-model.trim="searchForm.name" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item style="margin-bottom: 0;">
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px;">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
</div>
</div>
<div class="member-checked">
<el-checkbox v-model="checked" @change="checkChange">仅看跟进专员</el-checkbox>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['selectData', 'taskMerchantId'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerName',
formatter: cellValue => {
return cellValue.followerName ? cellValue.followerName : '-'
}
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: []
}
},
watch: {
taskMerchantId() {
this.listDepartmentTree(false)
}
},
mounted() {
console.log(this)
this.listDepartmentTree(false, true)
},
methods: {
selectionTable(val) {
console.log(val)
this.innerTags = val
// this.$emit('selectTable', val)
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
listDepartmentTree(isFollowerStaff, status) {
const selectData = this.$common.utils.deepClone(status ? this.selectData : this.innerTags)
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isEntmicroCustomer = true
params.isFollowerStaff = isFollowerStaff
params.loginStatus = 1
params.queryMerchantId = this.taskMerchantId
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
this.$refs.empTable.$refs.salelistMutiTable.clearSelection()
if (selectData && selectData.length) {
selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
console.log(data)
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
// this.loading = true
console.log(keyword, data, this.tableEmpData)
if (data instanceof Array) {
if (keyword) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
console.log(this.allTreeData, '---')
this.tableEmpData = this.allTreeData
}
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
checkChange(val) {
console.log(val)
this.searchForm = {}
this.listDepartmentTree(val)
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-size: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
<template>
<div>
<div class="container">
<div class="title">新建朋友圈</div>
<div class="info-box">
<div class="info-content gl-form-page">
<el-form class="basic-form" :model="basicForm" label-width="154px" :rules="basicRules" ref="groupForm">
<el-form-item prop="taskName" label="群发名称:" size="small">
<el-input v-model="basicForm.taskName" placeholder="请输入群发名称"></el-input>
</el-form-item>
<el-form-item prop="taskMerchantId" label="选择门店:" size="small">
<el-select filterable v-model="basicForm.taskMerchantId" placeholder="请选择门店">
<el-option v-for="item in optionsMe" :key="item.msgMerchantId" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="userList">
<label slot="label" class="required">选择员工:</label>
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
选择员工
</el-button>
<div class="sale-select" v-show="basicForm.userList && basicForm.userList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.userList" :key="idx" closable :disable-transitions="false" @close="remove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
<div v-show="empErrorShow" class="el-form-item__error">请选择员工</div>
</el-form-item>
<el-form-item prop="attachmentList" class="attachment-panel">
<label slot="label" class="required">朋友圈内容:</label>
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item>
</el-form>
</div>
</div>
<GLDialog bigTitle="选择成员" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm" @onCancel="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :taskMerchantId="basicForm.taskMerchantId"></SelectMember>
</GLDialog>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
import { utils } from 'glsx-common'
import department from '@/mixins/department'
import SelectMember from './components/selectMember.vue'
import * as dayjs from 'dayjs'
export default {
mixins: [department],
components: {
SelectMember
},
data() {
return {
optionsMe: [],
addLoading: false,
taggingList: [],
previewView: [],
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
limitSize: 10, //限制图片大小
limitNum: 9, //限制图片数量
// limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度
Isdraggable: true, //图片拖拽
uploadApi: this.$apis.common.pictureUpload
},
{
name: '视频',
funcName: '',
type: 'video',
limitSize: 10, //限制视频大小
togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
limitNum: 1, //限制视频数量
limitWidth: 1280, //限制视频宽度
limitHeight: 720, //限制视频高度
limitTime: 30, //限制视频时长
uploadApi: this.$apis.common.pictureUpload
}
// {
// name: '模板',
// type: 'message',
// funName: 'message',
// getSearchApi: this.$apis.welcomeword.createdNameList,
// templateApi: this.$apis.welcomeword.templatePage,
// templateUpdateApi: this.$apis.welcomeword.templateUpdate,
// templateSaveApi: this.$apis.welcomeword.templateSave,
// templateDetailApi: this.$apis.welcomeword.templateDetail
// }
],
basicForm: {
userList: [],
taskName: '',
taskMerchantId: ''
},
attachmentShow: false,
empErrorShow: false,
attachmentText: '请输入朋友圈内容',
basicRules: {
taskMerchantId: [{ required: true, message: '请选择门店', trigger: 'change' }],
taskName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }]
},
membersVisible: false,
groupList: [],
key: new Date(),
dialogVisible: false,
previewFlag: false,
selectData: [],
// 是否有修改筛选成员
isUpdate: true,
tagging: [],
groupNumber: 0,
dateOptions: {
disabledDate(time) {
let now = new Date()
now.setTime(now.getTime() - 3600 * 1000 * 24)
return time.getTime() < now
}
},
timeOptions: {
selectableRange: '00:00:00 - 23:59:59'
},
editStatus: false,
firstFlag: true,
footerLeft: 40,
footerWidth: 500,
viewLoading: false
}
},
watch: {
basicForm: {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.userList'() {
this.empErrorShow = false
}
},
async mounted() {
console.log(this.size)
// this.SET_TOKEN(888)
const merchantList = await this.merchantList()
this.optionsMe = merchantList ? merchantList : []
},
methods: {
// uploadFile(e) {
// const files = e.target.files
// var formData = new FormData()
// formData.append('file', files[0])
// // formData.append('picWidth', 1080)
// // formData.append('picHeight', 1920)
// // fetch('http://192.168.1.170:8086/rpc-scrm-entmicro-container/picture/compression/upload', {
// // method: 'post',
// // body: formData
// // })
// // window
// // .axios({
// // url: 'http://192.168.3.101:8186/rpc-scrm-entmicro-container/file/upload',
// // method: 'post',
// // data: formData
// // })
// // .then(res => {
// // console.log(res)
// // })
// this.$apis.friendGroup.compressionUpload({ file: files[0] }).then(res => {
// console.log(res)
// })
// },
previewForm(val) {
this.previewView = val
this.attachmentShow = false
},
openMembers() {
this.membersVisible = !this.membersVisible
},
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/friendGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/friendGroup/index')
}
},
// 成员弹窗
handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
if (this.$refs.membersForm.innerTags.length) {
// this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.userList
this.openMembers()
this.isUpdate = true
this.editStatus = true
} else {
this.$message({
type: 'error',
message: '请选择成员'
})
}
},
remove(val, idx) {
if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
this.key = new Date()
}
this.isUpdate = true
},
handleSubmit: utils.debounce(function() {
this.$refs.groupForm.validate(valid => {
if (valid) {
if (this.basicForm.userList.length == 0) {
this.empErrorShow = true
return
}
const previewList = this.$refs.welcome.previewList
if (previewList.length == 0) {
this.attachmentShow = true
return
}
if (previewList.length != 0) {
this.basicForm.attachmentList = previewList
}
let staffIds = this.basicForm.userList.map(item => {
return item.staffId
})
let attachmentList = this.$refs.welcome.previewList
const material = previewList.filter(item => item.attType != ATT_TYPE.TEXT)
let materialType = 0
if (material && material.length > 0) {
switch (material[0].attType) {
case ATT_TYPE.IMAGE:
materialType = 1
break
case ATT_TYPE.VEDIO:
materialType = 3
break
case ATT_TYPE.ACTIVITY:
materialType = 4
break
}
}
if (material.length > 1) {
materialType = 2
}
const { taskName, taskMerchantId } = this.basicForm
const taskMerchantName = this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName
let params = {
materialType,
attachmentList,
staffIds,
taskName,
taskMerchantName,
taskMerchantId
}
this.addLoading = true
this.$apis.friendGroup.batchmomentSave(params).then(res => {
this.addLoading = false
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.$router.push('/friendGroup/index')
}
})
}
})
}, 300)
}
}
</script>
<style lang="scss" scoped>
.container {
margin-bottom: 16px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
// padding: 20px;
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
> span {
font-size: 14px;
color: #999999;
margin-left: 10px;
font-weight: 100;
}
}
.attachment-panel {
/deep/ .btn-group-panel {
height: 40px;
padding: 0px 0px 0px 20px;
}
}
.tips-text {
display: flex;
// align-items: center;
justify-self: center;
color: #000;
font-size: 14px;
padding: 6px 16px;
margin-top: 10px;
background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px;
line-height: 24px;
min-width: 488px;
max-width: 844px;
width: auto;
box-sizing: border-box;
.tips-icon {
width: 14px;
height: 14px;
margin: 6px 8px 0 0;
}
}
.info-box {
.basic-form {
padding: 32px 0 20px 20px;
}
}
.form-tips {
font-size: 12px;
color: #999;
}
.preview {
margin-right: 24px;
margin-bottom: 100px;
}
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: #5850ff;
}
}
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
// background: #fff !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
/deep/ {
.el-form-item .el-form-item {
margin-bottom: 22px;
}
.required {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4 px;
}
.el-loading-spinner {
transform: translateY(8px);
}
.el-scrollbar {
padding-bottom: 10px;
}
.welcome-box {
min-width: 488px;
max-width: 844px;
width: auto !important;
}
}
.group-content {
padding: 22px 0 20px;
}
</style>
<!-- 商品管理-集团 -->
<template>
<div class="marketing pro-group">
<div class="m-b-20 friend-title">
<div>
<GLButton :size="size" class="el-icon-plus" type="primary" fn="新建朋友圈群发" @click="handleEdit(1)">新建朋友圈群发</GLButton>
<!-- <el-button :size="size" type="primary" class="el-icon-plus" fn="新建朋友圈群发" @click="handleEdit(1)">新建朋友圈群发</el-button> -->
</div>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable v-loading="loading" ref="proGroupRef" @refreshTable="handleSearch" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div class="loginStatus" slot="sendStatus" slot-scope="scope">
<span class="cycle" :style="{ background: scope.scope.sendStatus == '2' ? '#2CCA74' : scope.scope.sendStatus == '-1' ? '#EB4E4E' : scope.scope.sendStatus == '1' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendStatus == '2' ? '已完成' : scope.scope.sendStatus == '-1' ? '发送失败' : scope.scope.sendStatus == '1' ? '发送中' : '' }}
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<draw-record ref="drawForm"></draw-record>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import drawRecord from './components/drawRecord'
import { utils } from 'glsx-common'
import department from '@/mixins/department'
export default {
mixins: [department],
name: 'friendGroup',
components: {
drawRecord
},
data() {
return {
size: 'small',
loading: false,
url: url,
// 下架
isDownVisible: false,
downForm: {
id: '',
offReason: '',
goodsStatus: 0
},
downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
},
updatedTime: '',
// 分享
isShareVisible: false,
shareForm: {},
searchForm: {
momentName: '',
createDate: [],
merchantName: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '群发名称',
name: 'momentName',
type: 'input'
},
{
label: '群发门店',
name: 'merchantName',
type: 'select',
noFilter: false,
optionList: [],
optionId: 'msgMerchantId',
optionLabel: 'msgMerchantName'
},
{
label: '群发时间',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '发送记录',
attrs: {
type: 'text'
},
condition: row => {
return row.sendStatus == 2
},
listeners: {
click: this.handleRecord
}
}
],
// 表格
tableData: [],
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '群发名称',
prop: 'momentName',
minwidth: 240
},
{
label: '群发门店',
prop: 'merchantName',
minwidth: 180
},
{
label: '发送员工数',
prop: 'staffCount',
minwidth: 180
},
{
label: '创建时间',
prop: 'createdTime',
minwidth: 180
},
{
label: '发送状态',
name: 'sendStatus',
addHtml: 'sendStatus',
minwidth: 120
},
{
label: '发送成功',
prop: 'successCount',
minwidth: 110
},
{
label: '发送失败',
prop: 'failCount',
minwidth: 110
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
async mounted() {
this.getListData()
const merchantList = await this.merchantList()
const index = this.searchFormData.findIndex(item => item.name == 'merchantName')
this.searchFormData[index].optionList = merchantList ? merchantList.data : []
this.searchFormData[index].optionList.unshift({ msgMerchantId: null, msgMerchantName: '全部' })
},
methods: {
handleRecord(row) {
this.$refs.drawForm.init(row)
},
getListData() {
this.loading = true
const params = {
...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.proGroupRef.page.pageSize,
pageNum: this.$refs.proGroupRef.page.pageNum
}
if (params.createDate && params.createDate.length > 0) {
params.startTime = dayjs(params.createDate[0]).format('YYYY-MM-DD') + ' 00:00:00'
params.endTime = dayjs(params.createDate[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
this.$apis.friendGroup.conditionPage(params).then(res => {
this.loading = false
if (res) {
this.tableData = res.data
this.tableTotal = res.count
}
})
},
getParams() {},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// addOrEdit:1-新增;2-编辑;3-查看
// groupOrStore:1-集团;2-门店
handleEdit(row) {
var params = {
id: row.id
}
this.$router.push({
path: '/friendGroup/friendGroupAdd',
query: params
})
},
handleDetail(row) {
var params = {
id: row.id
}
this.$router.push({
path: '/friendGroup/friendGroupDetail',
query: params
})
},
getTimeStatus(val) {
const time = new Date().getTime()
let sendTime = new Date(val).getTime()
if (sendTime - time > 2 * 60 * 1000) {
return true
} else {
return false
}
},
handleDetailTips() {
this.$message.error('未到朋友圈发送时间,无法查看详情')
},
handleCancel(row) {
const time = new Date().getTime()
const sendTime = new Date(row.sendTime).getTime()
if (sendTime - time < 2 * 60 * 1000) {
this.$message.error('任务临近发送时间,无法取消')
return
}
this.$apis.friendGroup
.momentCancel({
id: row.id
})
.then(res => {
this.getListData()
this.$message({
type: 'success',
message: '取消成功'
})
// this.$set(this.employeelist[index], 'remindStatus', true)
})
},
dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate()
this.isDownVisible = !this.isDownVisible
},
handleDownClose() {
this.dwonVisibleChange()
this.downForm = {
id: '',
offReason: '',
goodsStatus: 0
}
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
handleSearch() {
this.getListData()
},
handleReset() {
this.searchForm = {
taskName: '',
createDate: [],
merchantName: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped lang="scss">
/deep/ {
.el-table th > .cell {
padding: 0 16px;
}
.el-date-editor {
width: 210px !important;
}
}
.container {
background: #fff;
padding: 20px;
margin-top: 16px;
}
.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.friend-title {
display: flex;
justify-content: space-between;
align-items: center;
color: #666666;
.title {
.info-refresh {
font-size: 14px;
color: #5850ff;
cursor: pointer;
margin-left: 20px;
.wait-status {
transition: all ease-in 1s;
transform: rotate(360deg);
}
}
.info-time {
font-size: 14px;
color: #7d7d7d;
margin-left: 10px;
}
}
span {
font-size: 14px;
margin-left: 10px;
font-weight: 100;
}
}
.attachmentList-box {
display: flex;
align-items: center;
.attachmentList-image {
width: 36px;
height: 36px;
margin-right: 5px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 24px;
.image-num {
font-size: 14px;
z-index: 10;
}
.image-panel {
position: absolute;
width: 36px;
height: 36px;
top: 0px;
left: 0px;
img {
width: 36px;
height: 36px;
}
}
.el-icon-reading {
position: absolute;
font-size: 24px;
top: 5px;
left: 5px;
color: #fff;
}
&.attachmentList-video {
background: rgba($color: #000000, $alpha: 0.7);
position: relative;
img {
position: absolute;
top: 6px;
left: 6px;
width: 24px;
height: 24px;
}
}
> img {
position: absolute;
top: 0px;
left: 0px;
width: 36px;
height: 36px;
}
}
.attachmentList-text {
font-size: 14px;
text-align: left;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
</style>
<template>
<div class>
<div class="container">
<div>
<div class="title">基础信息</div>
<div class="info-box">
<div class="info-content gl-form-page">
<el-form class="basic-form" :model="basicForm" :rules="basicRules" ref="basicForm" label-width="154px">
<el-form-item label="群发名称:" prop="groupName">
<el-input size="small" v-model="basicForm.groupName" placeholder="请输入群发名称"></el-input>
</el-form-item>
<el-form-item label="选择门店:" prop="selectStore" class="settingSelect">
<!-- <SearchDropDown :label="'msgMerchantName'" :value="'msgMerchantId'"></SearchDropDown>-->
<el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore" placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
<el-radio :label="1">标签筛选</el-radio>
<el-radio :label="2">人群筛选</el-radio>
</el-radio-group>
<div v-show="basicForm.selectType == 1">
<div class="selectedLabel">
<el-button size="small" @click="openLabel">
<i class="el-icon-plus"></i>
选择标签
</el-button>
<div class="selectLen" v-show="taggingList.length != 0">
(已选
<span class="num">{{ taggingList.length }}</span>
个标签)
</div>
</div>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span>
</div>
</div>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px">
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd">
{{ isSelectCrowd ? '继续选择' : '选择人群' }}
</el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable :disable-transitions="false" @close="removeCrowd(t, i)">
{{ t.crowdName }}
</el-tag>
</div>
</div>
</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips">
人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。
</div>
<div class="filter-footer">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
<div class="group-content">
<el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="154px">
<el-form-item prop="contentList">
<label slot="label" class="required">群发内容:</label>
<GLEditor ref="welcome" :form="'customer'" style="line-height: 12px;" :btnList="btnList"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="resetMerchantId" :dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId" :selectCrowdData="basicForm.crowdList"></SelectCrowd>
</div>
</template>
<script>
const combineType = {
label: 2,
crowd: 1
}
import emoji from '@/utils/emo'
import SelectCrowd from './components/selectCrowd.vue'
import SelectLabel from './components/SelectLabel.vue'
// import SearchDropDown from './components/searchDropDown/index'
import * as dayjs from 'dayjs'
export default {
components: {
SelectLabel,
SelectCrowd
// SearchDropDown
},
data() {
return {
resetMerchantId: '',
msgMerchantName: '',
// 新建按钮加载
addLoading: false,
// 标签/人群筛选数组
taggingList: [],
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
uploadApi: this.$apis.common.pictureUpload
},
{
name: '活动',
type: 'activity',
funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.welcomeword.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.welcomeword.getPackage,
params: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.welcomeword.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
},
{
itemName: '无忧服务',
itemValue: 6,
itemType: 'merchant',
getInterfaceApi: this.$apis.welcomeword.merchant,
merchantOpen: {
merchantOpenApi: this.$apis.welcomeword.merchantOpen,
params: {
merchantId: this.$globalState.session.merchantId
}
},
params: {
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '众筹活动',
itemValue: 7,
itemType: 'crowdfunding',
getInterfaceApi: this.$apis.welcomeword.crowdfundingActivity,
params: {
currentPage: 1,
activityStatus: 2
}
}
]
},
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi,
params: {
merchant: this.$globalState.session.merchantId
}
},
{
name: '模板',
type: 'message',
funName: 'message',
getSearchApi: this.$apis.welcomeword.createdNameList,
templateApi: this.$apis.welcomeword.templatePage,
templateUpdateApi: this.$apis.welcomeword.templateUpdate,
templateSaveApi: this.$apis.welcomeword.templateSave,
templateDetailApi: this.$apis.welcomeword.templateDetail,
params: {
merchant: this.$globalState.session.merchantId
}
}
],
attachmentShow: false,
attachmentText: '',
basicRules: {
groupName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }],
selectStore: [{ required: true, message: '请选择门店', trigger: 'change' }],
selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }]
},
basicForm: {
groupName: '',
selectStore: '',
selectType: 1,
crowdList: []
},
groupList: [],
selectData: [],
// 是否有修改筛选成员
isUpdate: true,
tagging: [],
groupNumber: 0,
editStatus: false,
firstFlag: true,
footerLeft: 40,
footerWidth: 500,
viewLoading: false,
isSelectCrowd: false,
pageData: {
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum: 1,
pageSize: 40
},
dataItems: []
}
},
watch: {
basicForm: {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.selectType'(newVal, oldVal) {
if (oldVal == 2 || newVal == 2) {
this.basicForm.userList = []
this.selectData = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
}
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
this.loadUpData()
},
methods: {
async loadUpData() {
const params = {
pageNum: 1,
pageSize: 10000
}
await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.dataItems = res || []
})
},
selectChange(val) {
// 选择门店时,替换欢迎语组件当中的所有merchantId
this.btnList.forEach(item => {
if (item.params && item.params.hasOwnProperty('merchant')) {
item.params.merchant = val
}
if (item.funParams && Object.prototype.toString.call(item.funParams) === '[object Array]') {
item.funParams.forEach(funArr => {
if (funArr.params && funArr.params.hasOwnProperty('merchantId')) {
funArr.params.merchantId = val
}
if (funArr.merchantOpen && funArr.merchantOpen.params && funArr.merchantOpen.params.hasOwnProperty('merchantId')) {
funArr.merchantOpen.params.merchantId = val
}
})
}
})
this.tagging = []
this.taggingList = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
this.isUpdate = true
this.resetMerchantId = val
this.msgMerchantName = val && this.dataItems.find(item => item.msgMerchantId == val).msgMerchantName
},
// 返回
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/wechatGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/wechatGroup/index')
}
},
// 打开标签筛选弹框
openLabel() {
if (!this.basicForm.selectStore) {
this.$message({
type: 'error',
message: '请先选择门店'
})
return
}
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
// 提交
async handleSubmit() {
const params = this.getBaseInfo()
// 统计群发人数
await this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.groupNumber = res
}
})
.catch(err => {
this.groupNumber = 0
})
this.$refs.basicForm.validate(valid => {
if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
this.$message({
type: 'error',
message: '请选择标签'
})
return
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
this.$message({
type: 'error',
message: '请选择人群'
})
return
}
this.attachmentShow = true
const previewList = this.$refs.welcome.previewList
if (previewList.length != 0) {
this.basicForm.contentList = previewList
}
if (this.basicForm.contentList && this.basicForm.contentList.length && this.basicForm.contentList[0].attType == 1 && this.basicForm.contentList[0].attContent != '') {
if (this.basicForm.contentList.length > 9) {
return (this.attachmentText = '附件不可超过9个')
} else {
this.attachmentText = ''
this.attachmentShow = false
}
} else {
return (this.attachmentText = '请输入群发内容')
}
if (this.groupNumber == '0') {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
this.$refs.groupForm.validate(async v => {
if (v) {
const params = this.getBaseInfo()
params.type = 1
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const contentList = previewList.map(item => {
if (item.attType == 1) {
const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
item.attContent = replaceImg.substring(0, 600)
} else if (item.attType == 7) {
if (item.attContent.title) {
item.attType = 4
params.crowdFunding = true
}
item.attContent = JSON.stringify(item.attContent)
}
return item
})
params.contentList = contentList
this.addLoading = true
await this.$apis.wechatGroup.atchmessagingCreate(params).then(res => {
if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
// this.$tracker.track(Object.assign({}, { pageName: '群发助手', name: '新建客户群发', params }))
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false
this.$router.push('/wechatGroup/index')
})
}
})
}
})
},
// 选择标签
handleSelect(val) {
this.isUpdate = true
this.tagging = val
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
},
// 删除标签筛选标签
removeTag(tag, idx1, idx) {
tag.labelList.splice(idx1, 1)
if (tag.labelList.length == 0) {
this.tagging.splice(idx, 1)
}
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
this.isUpdate = true
},
// 删除人群筛选标签
removeCrowd(item, index) {
this.basicForm.crowdList.splice(index, 1)
this.getCrowdData(this.basicForm.crowdList)
if (!this.basicForm.crowdList.length) {
this.basicForm.userList = []
this.selectData = this.basicForm.userList
this.isUpdate = true
this.isSelectCrowd = false
}
this.key = new Date()
},
getBaseInfo() {
let params = {
customerType: this.basicForm.selectType,
msgName: this.basicForm.groupName,
msgMerchantId: this.basicForm.selectStore,
msgMerchantName: this.msgMerchantName
}
if (params.customerType == 1) {
params.combineType = combineType.label
params.labelList = this.taggingList
} else if (params.customerType == 2) {
params.crowdList = this.basicForm.crowdList
params.combineType = combineType.crowd
}
return params
},
// 查看群发人数
viewMembers() {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
return this.$message({
type: 'error',
message: '请选择标签'
})
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
return this.$message({
type: 'error',
message: '请选择人群'
})
}
const params = this.getBaseInfo()
this.viewLoading = true
this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.isUpdate = false
this.groupNumber = res
} else {
this.isUpdate = true
}
this.viewLoading = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
this.isUpdate = false
})
},
// 选择客户change事件
radioChange(val) {
this.isSelectCrowd = false
this.isUpdate = true
this.tagging = []
this.taggingList = []
},
// 人群筛选弹窗
selectCrowd() {
if (!this.basicForm.selectStore) {
this.$message({
type: 'error',
message: '请先选择门店'
})
return
}
this.$refs.selectCrowd.init(this.basicForm.crowdList)
},
// 获取人群数据(根据人群筛选获取群发账号人群数据)
getCrowdData(val) {
this.isUpdate = true
if (val.length) {
this.isSelectCrowd = true
this.basicForm.crowdList = val
} else {
this.basicForm.userList = []
this.basicForm.crowdList = []
this.selectData = []
this.isSelectCrowd = false
this.editStatus = true
this.key = new Date()
}
}
}
}
</script>
<style lang="scss" scoped>
.container {
margin-bottom: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
// padding: 20px;
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
}
.info-box {
display: inline-flex;
width: 100%;
padding-bottom: 30px;
align-items: flex-end;
justify-content: space-between;
.info-content {
// width: calc(100% - 360px);
width: 66%;
padding-right: 20px;
//.filter-box {
// // margin-left: 120px;
// margin-bottom: 10px;
// min-width: 656px;
// background-color: #f7f7f7;
//
// .filter-memeber {
// padding: 20px 20px 20px 0;
//
// // border-bottom: 1px solid #dcdfe6;
// .el-form {
// padding: 0;
// }
// }
//}
.filter-footer {
display: flex;
// padding: 14px 20px;
justify-content: space-between;
align-items: center;
color: #999;
font-size: 14px;
.filter-number {
display: inline-block;
line-height: 20px;
padding: 7px 14px;
background-color: #e6e9ff;
color: #333;
margin-top: 8px;
span {
color: #5850ff;
cursor: pointer;
}
}
}
.basic-form {
padding: 32px 0 20px 20px;
.settingSelect {
/deep/ input {
height: 35px;
}
}
.selectedLabel {
display: flex;
.selectLen {
margin-left: 20px;
font-size: 14px;
color: #666666;
.num {
color: #5850ff;
}
}
}
}
}
}
.form-tips {
font-size: 12px;
color: #999;
}
.preview {
flex: 1;
margin-right: 24px;
margin-bottom: 58px;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: #5850ff;
}
}
.sale-select {
display: flex;
align-items: center;
// width: 50%;
}
.input-tag-wrapper {
max-height: 75px;
min-width: 488px;
max-width: 844px;
width: auto;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 8px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
// width: 50%;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 6px;
// background: #fff !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
/deep/ {
//.el-form-item .el-form-item {
// margin-bottom: 22px;
//}
.required {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.el-loading-spinner {
transform: translateY(8px);
}
.el-scrollbar {
padding-bottom: 10px;
}
.gl-form-page .el-form .welcome-box {
min-width: 488px;
max-width: 844px;
width: auto;
}
}
.group-content {
padding: 0 0 20px 0;
}
.tips-text {
font-size: 12px;
color: #f56c6c;
// margin-left: 20px;
line-height: 20px;
padding-bottom: 4px;
}
.crowd-tips {
color: #999999;
font-size: 12px;
line-height: 16px;
}
/deep/ .content .btn-group {
line-height: 14px;
}
/deep/ .el-select {
.el-select__caret:first-child::before {
content: '\e6e1';
}
.is-focus {
.el-select__caret:first-child {
transform: rotateZ(0deg);
}
}
}
</style>
<template>
<div class="tag-main">
<GLDialog :bigTitle="'选择标签'" :visible.sync="dialogVisible" mode="big" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }"
@click.self="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll"
@change="handleCheckAllChange(item.checkAll, index)">{{
item.labelGroup.name
}}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)
</el-checkbox>
<el-tag :size="size" class="tag-show">{{ item.labelType }}</el-tag>
<div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked"
@change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-checkbox class="check-text" :label="itm">{{ itm.name }}</el-checkbox>
<div slot="content">{{ itm.name }}</div>
</el-tooltip>
</div>
</el-checkbox-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRetSelect">
<template v-for="(tag, idx) in item.tagChecked">
<el-tag :title="tag.name" type="info" class="tag-selected-item" :key="idx" v-if="tag" closable
:disable-transitions="false" @close="remove(item, idx)">
{{ tag.name }}
</el-tag>
</template>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import {utils} from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'activityModel',
props: {
resetMerchantId: {
type: String,
default: ''
}
},
data() {
return {
loading: false,
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRetSelect: [],
labelTreeRets: []
}
},
watch: {
labelTreeRetSelect: {
handler() {
this.selectNum = 0
this.labelTreeRetSelect.forEach(item => {
this.selectNum += item.tagChecked.length
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
this.loading = true
this.$apis.wechatGroup
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.resetMerchantId ? this.resetMerchantId : this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
// labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType == '企业标签' ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelList = []
item.labelList.forEach(x => {
labelList.push(x.id)
})
this.$nextTick(() => {
tag.tagChecked = tag.labelList.filter(i => labelList.includes(i.id))
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else {
const labelTreeRets = res.labelTreeRets || []
this.labelTreeRets = labelTreeRets.map(item => {
return {
labelType: item.labelType == '企业标签' ? (this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签') : item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
this.labelTreeRets.forEach((item, index) => {
this.labelTreeRetSelect.forEach(itm => {
if (itm.labelGroup.id == item.labelGroup.id && itm.tagChecked.length > 0) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
this.$nextTick(() => {
this.handleCheckedChange(itm.tagChecked, index, 1)
})
}
})
})
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
}
this.$nextTick(() => {
this.loading = false
})
})
},
handleClose() {
this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) {
items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
}
if (item.tagChecked.length == 0) {
this.$nextTick(() => {
item.checkAll = false
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked.length) {
return {
labelGroup: item.labelGroup,
labelList: item.tagChecked
}
}
})
.filter(item => item)
this.$emit('tagSelected', labelTreeRets)
},
//全选
handleCheckAllChange(val, index) {
if (val) {
this.labelTreeRets[index].tagChecked = []
this.labelTreeRets[index].labelList.forEach(item => {
this.labelTreeRets[index].tagChecked.push(item)
})
} else {
this.labelTreeRets[index].tagChecked = []
}
this.labelTreeRets[index].isIndeterminate = false
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
},
//选中
handleCheckedChange(value, index, status) {
let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
if (!status) {
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
}
},
// 重置
handleReset() {
this.labelGroupName = ''
this.querylabeltree()
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 40px;
display: flex;
flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
display: flex;
align-items: center;
}
}
}
}
}
.tag-show {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba(88, 80, 255, 0.1);
}
.checkbox-group-box {
overflow: auto;
}
.tag-selected-box {
// min-height: 200px;
overflow: auto;
}
</style>
import { http } from '@/main'
const URL = 'rop-scrm-entmicro/router'
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getStoreList
}
<template>
<el-select ref="selectRef" clearable filterable remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore" v-model="inputVal" placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item[label]" :value="item[value]"></el-option>
</el-select>
</template>
<script>
import { getStoreList } from './api'
export default {
name: 'SearchDropDown',
props: ['inputBoxSearchValue', 'label', 'value'],
data() {
return {
searchContentStorage: '',
inputVal: '',
dataItems: [],
arrBack:[],
totalNum:'',
pageData: {
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum: 1,
pageSize: 10
}
}
},
directives: {
/** 下拉框懒加载 */
'el-select-loadmore': {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
},
mounted() {
this.loadUpData(this.pageData)
},
watch: {
// 'inputVal'(newVal, oldVal) {
// console.log(newVal,oldVal)
// // if (oldVal !== newVal) {
// // this.dataItems = []
// // this.loadUpData({
// // pageNum: 1,
// // pageSize: 10
// // },newVal)
// // }
// }
'inputVal': {
handler(val) {
console.log(val)
if (!val) {
this.dataItems = []
this.loadUpData({
pageNum: 1,
pageSize: 10
})
}
}
}
},
methods: {
async loadUpData(pageData, searchVal) {
let params = {
...pageData,
merchantName: searchVal
}
await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.totalNum = res.count
this.arrBack = res.data
})
this.dataItems = [...this.dataItems,...this.arrBack]
},
loadmore() {
this.pageData.pageNum++
let acquireCount = this.pageData.pageNum * this.pageData.pageSize
if (acquireCount - this.totalNum >= this.pageData.pageSize){
return
}
if (this.searchContentStorage) {
this.loadUpData(this.pageData, this.searchContentStorage)
} else {
this.loadUpData(this.pageData, '') //类似于分页查询
}
},
// 远程搜索
async remoteMethod(searchValue) {
console.log(this.inputVal)
if (searchValue !== '') {
this.searchContentStorage = searchValue
this.dataItems = []
this.timer = setTimeout(() => {
this.loadUpData(this.pageData, searchValue)
}, 300)
} else {
this.dataItems = []
this.loadUpData({
pageNum: 1,
pageSize: 10
},'')
}
},
// 根据所选商户获取品牌和地址
async selectChange(label) {
if (label) {
let obj = this.dataItems.filter(el => {
return el['incomingDisplayLabel'] == label
})
}
}
}
}
</script>
<style scoped></style>
<template>
<div>
<GLDialog :bigTitle="'人群筛选'" mode="big" :visible.sync="crowdVisible" v-if="crowdVisible">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" clearable
placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal"
:layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf"
:noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<!-- <div class="member-name">人群({{ innerTags.length }}项)</div> -->
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false"
@close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="width: 68px;" size="small" @click="crowdVisible = false">取 消</el-button>
<el-button style="width: 68px;" size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
props: {
resetMerchantId: {
type: String,
default: ''
}
},
data() {
return {
url: 0,
crowdVisible: false,
searchForm: {keyword: ''},
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc',
width: '200',
line: 1
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
})
},
getCrowdList(page = {pageNum: 1, pageSize: 10}) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.resetMerchantId ? this.resetMerchantId : this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.wechatGroup.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList({pageNum: 1, pageSize: 10})
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = {keyword: {}}
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: calc(100% - 286px);
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
// height: 40vh;
overflow-y: auto;
}
.el-pagination {
margin-top: 0;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 480px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
//border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: 100%;
display: flex;
align-items: center;
max-height: 557px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/ {
.el-dialog__title {
font-weight: 600;
}
.el-dialog__header {
padding: 20px;
}
.el-dialog__headerbtn {
height: 30px;
.el-dialog__close {
width: 24px;
height: 24px;
font-size: 24px;
}
}
.el-pagination {
padding-left: 20px;
border-top: 1px solid #e8e8ea;
padding-top: 16px;
}
.el-table:before {
display: none;
}
}
</style>
<template>
<div>
<GLDialog :mode="'big'" class="gl-form-min" bigTitle="选择门店" :visible.sync="storeDiaVisible" @close="clearStaff">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="门店名称:">
<el-input v-model="searchForm.storeName" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label="门店编号:">
<el-input v-model="searchForm.storeNum" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" class="gap8" @click="findNotActiveStaff">查询</el-button>
<el-button plain :size="size" class="btn-three" @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">员工列表</div>
<div class="member-content">
<div class="table-content" style="max-height: 456px;">
<GLTable :hasPage="false" v-loading="loading" ref="activateTable" :tableData="tableActiveData" :tableParams="tableParams" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="openJoinStatusString" class="dot" slot-scope="scope">
<div :class="status[scope.scope.openJoinStatusString]"></div>
<span v-if="scope.scope.openJoinStatusString == '未开启'">未开启</span>
<span v-if="scope.scope.openJoinStatusString == '已开启'">已开启</span>
<span v-if="scope.scope.openJoinStatusString == '未授权'">未授权</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选列表</div>
<div class="member-context">
<div class="member-name">已选({{ innerTags.length }}项)</div>
<el-button type="text" @click="clearStaff">清空</el-button>
</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="tag in innerTags" :key="tag.userId" type="info" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="closeDia">取 消</el-button>
<el-button size="small" type="primary" @click="activeStaff" :loading="butLoading">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
const status = {
未开启: 'dot3',
已开启: 'dot2',
未授权: 'dot3'
}
const options = [
{
value: 0,
label: '未开启'
},
{
value: 1,
label: '已开启'
},
{
value: 2,
label: '未授权'
}
]
export default {
name: 'ActivateDia',
props: ['selectData'],
data() {
return {
url: url,
butLoading: false,
searchForm: {
storeName: '',
storeNum: ''
},
checked: '',
treeData: [],
options: options,
status,
storeDiaVisible: false,
defaultProps: {
children: 'children',
label: 'departmentName'
},
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '启用状态',
prop: 'openJoinStatusString',
addHtml: 'openJoinStatusString'
}
]
},
// 未激活员工表信息
tableActiveData: [],
innerTags: [],
// 账号信息
activeInfo: {}
}
},
mounted() {},
methods: {
init(row) {
this.activeInfo = row
this.storeDiaVisible = true
this.findNotActiveStaff()
},
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {
storeName: '',
storeNum: ''
}
this.findNotActiveStaff()
},
findNotActiveStaff() {
const { corpId, merchantId } = this.activeInfo
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
corpId,
merchantId
}
this.loading = true
this.$apis.accountConfig.findNotActiveStaff(params).then(res => {
if (res.code == 0) {
this.tableActiveData = res.data
this.loading = false
} else {
this.loading = false
this.$message({
message: res.message,
type: 'error',
customClass: 'global-messageZindex'
})
}
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
remove(item) {
this.$refs.activateTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.activateTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
// 激活员工
activeStaff() {
if (!this.innerTags.length) {
this.$message({
message: '未选中员工,无法激活',
type: 'error',
customClass: 'global-messageZindex'
})
return
}
var userIdList = []
this.innerTags.forEach(item => {
userIdList.push(item.userId)
})
const { merchantId, corpId } = this.activeInfo
var params = {
corpId,
merchantId,
userIdList
}
this.butLoading = true
this.$apis.accountConfig.activeAccount(params).then(res => {
if (res.code == '0') {
this.butLoading = false
this.storeDiaVisible = false
var txt = '<p>已激活&nbsp;' + `${res.data ? res.data : 0}` + '&nbsp;个</p>'
this.$confirm(txt, '提示', {
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,
showCancelButton: false,
confirmButtonClass: 'confirmbtn',
type: 'success',
customClass: 'gl-message-box confirm-btn',
callback: action => {
if (res.data && res.data > 0) {
this.$emit('activeStaff')
}
}
})
} else {
this.butLoading = false
this.$message.error(res.message)
}
})
},
// 清空右侧选择员工
clearStaff() {
this.$refs.activateTable.$refs.salelistMutiTable.clearSelection()
this.innerTags = []
},
// 关闭弹窗
closeDia() {
this.clearStaff()
this.storeDiaVisible = false
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 400;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-size: 500;
}
}
.member-left {
width: 70%;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 30%;
margin-left: 14px;
.member-context {
display: flex;
justify-content: space-between;
padding: 11px 8px 11px 16px;
border: 1px solid #eee;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 72px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
/deep/ .el-tag--info {
background: #fafbfe;
border-radius: 4px;
border: 1px solid #e8e8ea;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
.global-messageZindex {
z-index: 3000 !important;
}
</style>
<template>
<div>
<div class="createANewGroupBtn">
<GLButton fn="新建群发" @click="addSendGroup" :size="size" type="primary" mode="el-button">
<i class="el-icon-plus"></i>
新建群发
</GLButton>
</div>
<div class="container">
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchFormTable" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="optionBtns" slot-scope="scope">
<div v-if="scope.scope.sendState == '1'">
<span class="sendRecord" @click="traceRecord(scope.scope)">发送记录</span>
</div>
</div>
<div slot="sendState" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : '' }}
</div>
</div>
</GLTable>
</div>
<el-drawer size="50%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction">
<div class="horizon"></div>
<div class="sendRecordDrawerbox">
<div v-for="(item, index) in sendRecordDrawer.traceFailandSuccess" :key="index" class="itemContent">
<div>
<p class="title">{{ item.title }}</p>
<p class="num" :style="{ color: item.color }">{{ item.num }}</p>
</div>
</div>
</div>
<div class="liststyle">
<GLTable ref="sendRecordDrawerRef" :noDataImg="url" :getListApi="sendRecordDrawer.getListApi" :searchForm="sendRecordDrawer.searchForm" :tableParams="sendRecordDrawer.tableParams" :pageConf="sendRecordDrawer.pageConf">
<div slot="sendResult" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendResult == true ? '#2CCA74' : scope.scope.sendResult == false ? '#EB4E4E' : '' }"></span>
{{ scope.scope.sendResult == true ? '成功' : scope.scope.sendResult == false ? '失败' : '' }}
</div>
</div>
</GLTable>
</div>
</el-drawer>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'collocation',
data() {
return {
url,
sendRecordDrawer: {
isVisible: false,
direction: 'rtl',
traceFailandSuccess: [
{
title: '发送成功',
id: '1',
num: '',
color: '#2CCA74'
},
{
title: '发送失败',
id: '2',
num: '',
color: '#EB4E4E '
}
],
searchForm: {
msgId: ''
},
tableParams: {
listName: 'data',
tableColumns: [
{
label: '客户',
prop: 'customerName'
},
{
label: '发送时间',
prop: 'sendTime'
},
{
label: '发送结果',
prop: 'sendResult',
addHtml: 'sendResult'
}
]
},
getListApi: this.$apis.wechatGroup.recordSend,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
},
searchForm: {},
searchFormData: [
{
label: '群发名称',
name: 'msgName',
type: 'input',
isClear: true
},
{
label: '群发时间',
name: 'daterange',
type: 'datePicker',
isClear: true,
valueFormat: 'yyyy-MM-dd',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
label: '群发门店',
name: 'msgMerchantName',
type: 'input',
isClear: true
}
],
searchFormTable: {},
tableParams: {
listName: 'data',
tableColumns: [
{
label: '群发名称',
prop: 'msgName',
width: 170,
line: 1
},
{
label: '群发门店',
prop: 'msgMerchant',
width: 170,
line: 1
},
{
label: '客户数',
prop: 'customerCount',
width: 80
},
{
label: '标签/人群',
prop: 'labelCrowdName',
width: 220,
line: 1
},
{
label: '创建时间',
prop: 'createTime',
width: 280,
line: 1
},
{
label: '发送状态',
prop: 'sendState',
addHtml: 'sendState',
},
{
label: '发送成功',
prop: 'successCompletion'
},
{
label: '发送失败',
prop: 'failCompletion'
},
{
label: '操作',
prop: 'optionBtns',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
getListApi: this.$apis.wechatGroup.batchmessagingRecord
}
},
methods: {
handleSearch() {
this.$refs.activeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {}
this.handleSearch()
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.startTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.startTime) delete params.startTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise(async resolve => {
this.searchFormTable = this.getParams()
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
},
// 跳转新建群发
addSendGroup() {
this.$router.push('/wechatGroup/addWechatGroup')
},
async traceRecord(scope) {
const { msgId, successCompletion, failCompletion } = scope
this.sendRecordDrawer.traceFailandSuccess[0].num = successCompletion
this.sendRecordDrawer.traceFailandSuccess[1].num = failCompletion
this.sendRecordDrawer.searchForm.msgId = msgId
this.sendRecordDrawer.isVisible = true
this.$nextTick(() => {
this.$refs.sendRecordDrawerRef.refreshTable()
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/.el-drawer.rtl{
overflow: scroll;
}
/deep/ {
.el-table th > .cell {
padding: 0 16px;
}
}
.el-table--border .el-table__cell:first-child .cell, .el-table .cell{
padding-right: 10px;
}
.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.createANewGroupBtn {
margin-bottom: 16px;
}
.container {
padding: 20px;
background-color: #fff;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
.sendRecord {
color: #5850ff;
cursor: pointer;
}
/deep/.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
}
.horizon {
width: 100%;
height: 1px;
background: #e8e8ea;
}
.sendRecordDrawerbox {
padding: 20px;
display: flex;
justify-content: space-between;
.itemContent {
width: 46%;
padding: 8px 0 8px 20px;
border: 1px solid #e8e8ea;
}
.title {
color: #666666;
font-size: 14px;
margin-bottom: 8px;
}
.num {
font-size: 20px;
font-width: 600;
}
}
.liststyle{
padding: 0 20px;
}
</style>
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-09-15 13:59:56
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-17 10:21:09
* @FilePath: \scrm-micro-authorize\vue.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
......@@ -5,9 +13,10 @@ const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
module.exports = {
outputDir: `dist/child/${packageName}`,
outputDir: `dist`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!