Commit 4141b512 by 姜鹏凯

Merge branch 'develop' into v2.5.x

2 parents 58582a6d bf41b840
Showing 68 changed files with 682 additions and 618 deletions
......@@ -19,3 +19,4 @@ velocity.log
.DS_Store
logs
.m2
linkwe-taskMobile/dist/
# 开发环境配置
ENV = 'development'
# 基础api(根据实际情况,自行配置,下为示例)
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
# 路由基础路径
VUE_APP_BASE_URL = '/'
\ No newline at end of file
# 生产环境配置
ENV = 'production'
# 基础api
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/prod-api'
# 路由基础路径
VUE_APP_BASE_URL = '/mobile/'
\ No newline at end of file
# 测试环境配置
# 打包环境变量
NODE_ENV = 'production'
# 运行环境变量
VUE_APP_ENV = 'test'
# 基础api
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
# 路由基础路径
VUE_APP_BASE_URL = '/devMobile/'
const envs = {
development: {
BASE_URL: '/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/dev-api',
},
test: {
BASE_URL: '/devMobile/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/dev-api',
},
production: {
BASE_URL: '/mobile/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/prod-api',
},
}
let env = envs[process.env.VUE_APP_ENV]
module.exports = env
......@@ -6,7 +6,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test": "vue-cli-service build --mode test",
"test": "vue-cli-service build --ENV=test",
"lint": "vue-cli-service lint"
},
"dependencies": {
......
......@@ -8,8 +8,9 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>
<%= htmlWebpackPlugin.options.title %>
仟微助手
</title>
<script src="./static/config.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
</head>
......
// 用于无打包配置,会覆盖系统相关配置
// window.lwConfig = {
// // BASE_URL: '/', // 路由基础路径
// // BASE_API: 'http://demo.linkwechat.cn/prod-api',
// }
......@@ -50,7 +50,7 @@ export function getUserInfo(code, agentId) {
* @returns
*/
export function getUserOpenid(code) {
return request({ url: `http://demo.linkwechat.cn:8070/weixin/auth/getToken?code=${code}` })
return request({ url: `/weixin/auth/getToken?code=${code}` })
}
/**
......@@ -59,7 +59,7 @@ export function getUserOpenid(code) {
*/
export function getWechatUserInfo(openId) {
return request({
url: `http://demo.linkwechat.cn:8070/weixin/auth/getUserInfo`,
url: `/weixin/auth/getUserInfo`,
params: {
openId,
lang: 'zh_CN',
......
import env from '../env'
// 系统常量
const common = {
SYSTEM_NAME: '仟微助手',
SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM 仟微助手',
COMPANY_NAME: '仟微科技',
COMPANY_NAME_ALL: '仟微科技',
// COPYRIGHT: 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.',
// LOGO_DARK: env.BASE_URL + 'static/LOGO_DARK.png',
// LOGO_LIGHT: env.BASE_URL + 'static/LOGO_LIGHT.png',
// LOGO_TEXT_DARK: env.BASE_URL + 'static/LOGO_TEXT_DARK.png',
// LOGO_TEXT_LIGHT: env.BASE_URL + 'static/LOGO_TEXT_LIGHT.png',
// QRCODE_CONTACT_US: env.BASE_URL + 'static/QRCODE_CONTACT_US.png',
// QRCODE_CUSTOMER_SERVICE: env.BASE_URL + 'static/QRCODE_CUSTOMER_SERVICE.png',
// IS_PUBLISH_DIALOG: true, // 是否显示发布弹窗
IS_VCONSOLE: true, // 是否显示发布弹窗
APPID: 'wx863c031a74f589a0', // 微信公众号id
}
const config = {
appId: 'wx863c031a74f589a0', // 微信公众号id
cookieExpires: 1, //token在Cookie中存储的天数,默认1天
homeName: 'home', //默认打开的首页的路由name值,默认为home
services: {
wecom: '/wecom',
},
}
window.lwConfig = Object.assign(env, common, window.lwConfig || {}, config)
document.title = window.lwConfig.SYSTEM_NAME
window.CONFIG = config
export default config
import Vue from 'vue'
import config from '@/config'
import './config'
import '@/assets/icon/iconfont.css'
window.CONFIG = config
import 'normalize.css/normalize.css'
import Vant from 'vant'
......@@ -18,12 +16,12 @@ import router from './router'
import store from './store'
import VConsole from 'vconsole'
process.env.NODE_ENV === 'production' && new VConsole()
window.lwConfig.IS_VCONSOLE && new VConsole()
Vue.config.productionTip = false
new Vue({
router,
store,
render: (h) => h(App)
render: (h) => h(App),
}).$mount('#app')
......@@ -33,11 +33,12 @@ td {
padding: 0;
}
body,input, select, textarea /* for ie */ {
font: 14px Microsoft YaHei, '宋体', arial, -apple-system, 'PingFang SC', 'Helvetica Neue',
Helvetica, 'DejaVu Sans', 'Lucida Grande', Tahoma, 'Hiragino Sans GB', STHeiti, SimSun,
sans-serif;
font: 14px "PingFang SC", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Source Han Sans", "Noto Sans CJK Sc", "Microsoft YaHei", "Microsoft Jhenghei", sans-serif;
line-height: 1.15;
color: #333; /*touch-action: none*/
background: #fff;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} /** 设置默认字体 **/
header,
section,
......
......@@ -69,7 +69,7 @@ export async function getWxCode() {
}
//缓存中没有用户信息,进入授权流程
let appid = window.CONFIG.appId // 公众号appid
let appid = window.lwConfig.APPID // 公众号appid
// let appid = 'wx8bfe6bc2ca5c45ae' // 公众号appid
let code = getQueryValue('code') //是否存在code
let local = window.location.origin.includes('localhost')
......
......@@ -78,5 +78,5 @@ function createAxios(baseURL) {
// const httpRequest = createAxios()
export default createAxios(
process.env.NODE_ENV === 'development' ? '/api' : process.env.VUE_APP_BASE_API
process.env.NODE_ENV === 'development' ? '/api' : window.lwConfig.BASE_API
)
......@@ -27,7 +27,7 @@ export default {
methods: {
getWxCode() {
try {
let appid = window.CONFIG.appId // 公众号appid
let appid = window.lwConfig.APPID // 公众号appid
// let appid = 'wx8bfe6bc2ca5c45ae' // 公众号appid
alert(2)
let code = getQueryValue('code') //是否存在code
......
......@@ -4,24 +4,24 @@ import {
getCollectionList,
addCollection,
cancleCollection,
getMaterialMediaId
getMaterialMediaId,
} from '@/api/chat'
export default {
components: {},
props: {
sideId: {
type: String,
default: ''
default: '',
},
// mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
mediaType: {
type: String,
default: '0'
default: '0',
},
keyword: {
type: String,
default: ''
}
default: '',
},
},
data() {
return {
......@@ -39,19 +39,19 @@ export default {
'2': '视频',
'3': '普通文件',
'4': '文本',
'5': '海报'
}
'5': '海报',
},
}
},
watch: {
userId() {
this.getList(1)
}
},
},
computed: {
userId() {
return this.$store.state.userId
}
},
},
created() {
this.getList()
......@@ -76,7 +76,7 @@ export default {
mediaType: this.mediaType,
pageSize,
pageNum,
keyword
keyword,
})
: getCollectionList({ userId: this.userId, pageSize, pageNum, keyword })
)
......@@ -116,7 +116,7 @@ export default {
this.$toast.loading({
message: '正在发送...',
duration: 0,
forbidClick: true
forbidClick: true,
})
let entry = undefined
let _this = this
......@@ -139,13 +139,13 @@ export default {
2: 'video',
3: 'file',
4: 'text',
5: 'image'
5: 'image',
}
switch (data.mediaType) {
case '4':
default:
mes.text = {
content: data.content //文本内容
content: data.content, //文本内容
}
break
case '0':
......@@ -155,7 +155,7 @@ export default {
let dataMediaId = {
url: data.materialUrl,
type: msgtype[data.mediaType],
name: data.materialName
name: data.materialName,
}
let resMaterialId = await getMaterialMediaId(dataMediaId)
if (!resMaterialId.data) {
......@@ -163,7 +163,7 @@ export default {
return
}
mes[msgtype[data.mediaType]] = {
mediaid: resMaterialId.data.media_id //
mediaid: resMaterialId.data.media_id, //
}
break
// case '5':
......@@ -190,12 +190,13 @@ export default {
_this.$dialog({ message: 'err' + JSON.stringify(err) })
}
wx.invoke('sendChatMessage', mes, function(resSend) {
if (resSend.err_msg == 'sendChatMessage:ok') {
//发送成功 sdk会自动弹出成功提示,无需再加
// _this.$toast('发送成功')
} else {
// if (resSend.err_msg == 'sendChatMessage:ok') {
// //发送成功 sdk会自动弹出成功提示,无需再加
// // _this.$toast('发送成功')
// } else
if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(resSend.err_msg) < 0) {
//错误处理
// _this.$dialog({ message: '发送失败:' + JSON.stringify(resSend) })
_this.$dialog({ message: '发送失败:' + JSON.stringify(resSend) })
}
})
_this.$toast.clear()
......@@ -210,12 +211,12 @@ export default {
this.$toast.loading({
message: 'loading...',
duration: 0,
forbidClick: true
forbidClick: true,
})
// collection 是否收藏 0未收藏 1 已收藏
;(data.collection == 1 ? cancleCollection : addCollection)({
userId: this.userId,
materialId: data.materialId
materialId: data.materialId,
})
.then(() => {
data.collection = [1, 0][data.collection]
......@@ -226,8 +227,8 @@ export default {
this.$toast('操作失败')
console.log(err)
})
}
}
},
},
}
</script>
......
......@@ -77,19 +77,19 @@ export default {
props: {
task: {
type: Object,
required: true
required: true,
},
// true: 已处理 false: 未处理
state: {
type: Boolean,
required: true
required: true,
},
isAdmin: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
......@@ -110,8 +110,8 @@ export default {
query: {
taskId: this.task.ruleId,
active: active === 1 ? 1 : 0,
taskType: 2
}
taskType: 2,
},
})
},
......@@ -123,7 +123,7 @@ export default {
this.$toast.loading({
message: '正在发送...',
duration: 0,
forbidClick: true
forbidClick: true,
})
// mes.link || delete mes.link
......@@ -142,7 +142,7 @@ export default {
(this.task.materialList &&
this.task.materialList[0] &&
this.task.materialList[0].materialUrl) ||
' ' // 封面
' ', // 封面
},
async function(res) {
if (res.err_msg == 'shareToExternalChat:ok') {
......@@ -158,13 +158,9 @@ export default {
// this.$emit('refresh')
// })
_this.$toast.clear()
this.$emit('refresh')
} else {
if (res.err_code == 1) {
// 用户取消发送
} else {
_this.$dialog({ message: 'shareToExternalChat失败:' + JSON.stringify(res) })
}
_this.$emit('refresh')
} else if ('shareToExternalChat:cancel'.indexOf(res.err_msg) < 0) {
_this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
}
_this.$toast.clear()
}
......@@ -172,7 +168,7 @@ export default {
} catch (error) {
this.$dialog({ message: '代码错误:' + JSON.stringify(error.message) })
}
}
},
// touchStart() {
// clearTimeout(this.copyEvent)
......@@ -236,7 +232,7 @@ export default {
if (this.doneMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人'
}
},
},
mounted() {
......@@ -249,7 +245,7 @@ export default {
this.clipboard.on('error', (e) => {
this.showCopy = false
})
}
},
}
</script>
......
......@@ -51,15 +51,15 @@ export default {
props: {
task: {
type: Object,
required: true
}
required: true,
},
},
data() {
return {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null,
touch: false
touch: false,
}
},
methods: {
......@@ -68,29 +68,24 @@ export default {
this.$toast.loading({
message: '正在发送...',
duration: 0,
forbidClick: true
forbidClick: true,
})
try {
let news = {
link: this.groupCodeUrl,
title: this.task.taskName,
desc: this.task.welcomeMsg,
imgUrl: this.imgUrl
imgUrl: this.imgUrl,
}
wx.invoke(
'sendChatMessage',
{
msgtype: 'news',
news
news,
},
function(res) {
if (res.err_msg == 'sendChatMessage:ok') {
} else {
if (res.err_code == 1) {
// 用户取消发送
} else {
_this.$dialog({ message: 'sendChatMessage失败:' + JSON.stringify(res) })
}
if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(res.err_msg) < 0) {
_this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
}
_this.$toast.clear()
}
......@@ -111,7 +106,7 @@ export default {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
}
},
},
computed: {
keywords() {
......@@ -123,16 +118,24 @@ export default {
let groupCodeInfo = this.task.groupCodeInfo
if (window.location.hash[0] === '#') {
return (
window.location.origin + window.location.pathname + '#/groupCode?id=' + (groupCodeInfo && groupCodeInfo.id)
window.location.origin +
window.location.pathname +
'#/groupCode?id=' +
(groupCodeInfo && groupCodeInfo.id)
)
}
return window.location.origin + window.location.pathname + '#/groupCode?id=' + (groupCodeInfo && groupCodeInfo.id)
return (
window.location.origin +
window.location.pathname +
'#/groupCode?id=' +
(groupCodeInfo && groupCodeInfo.id)
)
},
imgUrl() {
let groupCodeInfo = this.task.groupCodeInfo
return groupCodeInfo && groupCodeInfo.codeUrl ? groupCodeInfo.codeUrl : ''
}
},
},
mounted() {
this.clipboard = new ClipboardJS('.copy-btn_' + this.task.taskId)
......@@ -144,7 +147,7 @@ export default {
this.clipboard.on('error', (e) => {
this.showCopy = false
})
}
},
}
</script>
......
......@@ -53,19 +53,19 @@ export default {
props: {
task: {
type: Object,
required: true
required: true,
},
// true: 已处理 false: 未处理
state: {
type: Boolean,
required: true
required: true,
},
isAdmin: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
......@@ -73,7 +73,7 @@ export default {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null,
touch: false
touch: false,
}
},
......@@ -86,8 +86,8 @@ export default {
query: {
taskId: this.task.taskId,
active: active === 1 ? 1 : 0,
taskType: 1
}
taskType: 1,
},
})
},
......@@ -100,7 +100,7 @@ export default {
title: this.task.taskName,
desc: this.task.welcomeMsg,
link: this.groupCodeUrl,
imgUrl: this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl
imgUrl: this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl,
},
function(res) {
if (res.err_msg == 'shareToExternalContact:ok') {
......@@ -111,7 +111,8 @@ export default {
.catch(() => {
this.$emit('refresh')
})
} else {
} else if ('shareToExternalContact:cancel'.indexOf(res.err_msg) < 0) {
_this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
}
}
)
......@@ -129,7 +130,7 @@ export default {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
}
},
},
computed: {
......@@ -202,7 +203,7 @@ export default {
'groupCode?id=' +
(groupCodeInfo && groupCodeInfo.id)
)
}
},
},
mounted() {
......@@ -215,7 +216,7 @@ export default {
this.clipboard.on('error', (e) => {
this.showCopy = false
})
}
},
}
</script>
......
......@@ -223,7 +223,7 @@ export default {
}
delete form.code
let formQueryString = obj2query(form)
let baseUrl = location.protocol + '//' + location.host + process.env.VUE_APP_BASE_URL
let baseUrl = location.protocol + '//' + location.host + window.lwConfig.BASE_URL
let redPacketUrl = `${baseUrl}?${formQueryString}#/redPacketReceive`
// msgtype 文本(“text”),图片(“image”),视频(“video”),文件(“file”),H5(“news”)和小程序(“miniprogram”)
......
......@@ -115,7 +115,7 @@ export default {
let form = {
orderNo: this.redPacket.orderId, // 订单id
openId: this.openId, // 客户公众号id
appId: window.CONFIG.appId, // 微信公众号id
appId: window.lwConfig.APPID, // 微信公众号id
chatId: this.redPacket.chatId, // 客户企微id
externalUserid: this.redPacket.externalUserid, // 客户企微id
receiveName: this.receiveName,
......@@ -135,7 +135,7 @@ export default {
let form = {
orderNo: this.redPacket.orderId, // 订单id
openId: this.openId, // 客户公众号id
appId: window.CONFIG.appId, // 微信公众号id
appId: window.lwConfig.APPID, // 微信公众号id
chatId: this.redPacket.chatId, // 客户群企微id
// externalUserid: this.redPacket.externalUserid, // 客户企微id
}
......
......@@ -4,8 +4,14 @@ const resolve = (dir) => {
return path.join(__dirname, dir)
}
process.env.VUE_APP_TITLE = require('./package.json').description
//读取npm指令 process.argv 获取⾃定义参数
let argvs = process.argv.filter((e) => e.includes('='))
for (const iterator of argvs) {
let diyArg = iterator.split('=')
process.env['VUE_APP_' + diyArg[0].slice(2)] = diyArg[1]
}
process.env.VUE_APP_ENV = process.env.VUE_APP_ENV || process.env.NODE_ENV
const env = require('./env')
// 项目部署基础
// 默认情况下,我们假设你的应用将被部署在域的根目录下,
// 例如:https://www.my-app.com/
......@@ -15,7 +21,7 @@ process.env.VUE_APP_TITLE = require('./package.json').description
// 需要将它改为'/my-app/'
module.exports = {
publicPath: process.env.VUE_APP_BASE_URL || '/',
publicPath: env.BASE_URL || '/',
outputDir: 'dist', // 打包名称
// 打包时不生成.map文件
productionSourceMap: false,
......@@ -30,27 +36,27 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
['/api']: {
target: process.env.VUE_APP_BASE_API,
target: env.BASE_API,
changeOrigin: true,
pathRewrite: {
['^/api']: ''
}
}
['^/api']: '',
},
},
},
disableHostCheck: true
disableHostCheck: true,
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [path.resolve(__dirname, './src/styles/varibles.less')]
}
patterns: [path.resolve(__dirname, './src/styles/varibles.less')],
},
},
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
}
'@': resolve('src'),
},
},
},
chainWebpack(config) {
config.plugin('preload').tap(() => [
......@@ -58,8 +64,8 @@ module.exports = {
rel: 'preload',
// to ignore runtime.js
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}
include: 'initial',
},
])
config.when(process.env.NODE_ENV !== 'development', (config) => {
......@@ -69,8 +75,8 @@ module.exports = {
.use('script-ext-html-webpack-plugin', [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}
inline: /runtime\..*\.js$/,
},
])
.end()
......@@ -87,24 +93,24 @@ module.exports = {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
chunks: 'initial', // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-vant', // split vant into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?vant(.*)/ // in order to adapt to cnpm
test: /[\\/]node_modules[\\/]_?vant(.*)/, // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
reuseExistingChunk: true,
},
},
})
config.optimization.runtimeChunk('single')
})
}
},
}
# 开发环境配置
ENV = 'development'
# 基础api(根据实际情况,自行配置,下为示例)
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
VUE_APP_SYSTEM_API = '/dev-api'
VUE_APP_KF_API = '/dev-kf'
# 路由基础路径
VUE_APP_BASE_URL = '/'
\ No newline at end of file
# 生产环境配置
ENV = 'production'
# 基础api
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/prod-api'
VUE_APP_SYSTEM_API = '/prod-api'
VUE_APP_KF_API = '/prod-kf'
# 路由基础路径
VUE_APP_BASE_URL = '/'
\ No newline at end of file
# 测试环境配置
# 打包环境变量
NODE_ENV = 'production'
# 运行环境变量
VUE_APP_ENV = 'test'
# 基础api
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
VUE_APP_SYSTEM_API = '/dev-api'
VUE_APP_KF_API = '/dev-kf'
# 路由基础路径
VUE_APP_BASE_URL = '/dev/'
// 环境变量
const envs = {
development: {
DOMAIN: 'http://demo.linkwechat.cn',
BASE_URL: '/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/prod-api',
SYSTEM_API: '/prod-api',
KF_API: '/prod-kf',
},
test: {
DOMAIN: 'http://demo.linkwechat.cn',
BASE_URL: '/dev/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/dev-api',
SYSTEM_API: '/dev-api',
KF_API: '/dev-kf',
},
production: {
DOMAIN: 'http://demo.linkwechat.cn',
BASE_URL: '/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/prod-api',
SYSTEM_API: '/prod-api',
KF_API: '/prod-kf',
},
}
const env = envs[process.env.VUE_APP_ENV || process.env.NODE_ENV]
module.exports = env
......@@ -6,7 +6,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test": "vue-cli-service build --mode test",
"test": "vue-cli-service build --ENV=test",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
......
......@@ -6,11 +6,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<!-- <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=wI3zLlyN01Ej3ZD6ZD4WiuoE8N6AC6Lm"></script> -->
<title>
<%= VUE_APP_TITLE %>
</title>
<script src="./static/config.js"></script>
<style>
html,
body,
......
// 用于无打包配置,会覆盖系统相关配置
// window.lwConfig = {
// // SYSTEM_NAME: 'LinkWeChat',
// // SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM',
// // COMPANY_NAME: '仟微科技',
// // COMPANY_NAME_ALL: '仟微科技',
// // LOGO_DARK: '/static/LOGO_DARK.png',
// // LOGO_LIGHT: '/static/LOGO_LIGHT.png',
// // LOGO_TEXT_DARK: '/static/LOGO_TEXT_DARK.png',
// // LOGO_TEXT_LIGHT: '/static/LOGO_TEXT_LIGHT.png',
// // POST_QRCODE: '/static/POST_QRCODE.png',
// // COPYRIGHT: 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.',
// // DOMAIN: 'http://demo.linkwechat.cn',
// // BASE_URL: '/', // 路由基础路径
// // BASE_API: 'http://demo.linkwechat.cn/prod-api',
// // SYSTEM_API: '/prod-api',
// // KF_API: '/prod-kf',
// }
......@@ -7,7 +7,7 @@ export function upload(data) {
return request({
url: service + '/uploadFile2Cos',
method: 'POST',
data
data,
})
}
......@@ -21,7 +21,7 @@ export function upload(data) {
*/
export function download(url, name) {
return (
process.env.VUE_APP_DOMAIN +
window.lwConfig.DOMAIN +
window.CONFIG.services.system +
`/common/download/url?url=${url}&name=${name}`
)
......@@ -43,6 +43,6 @@ export function uploadDataURL(dataURL) {
url: window.CONFIG.services.system + '/common/uploadFile2Cos',
method: 'post',
processData: false,
data
data,
})
}
import request from '@/utils/request'
const service = process.env.VUE_APP_KF_API
const service = window.lwConfig.KF_API
// 同步客服
export function setAsync () {
export function setAsync() {
return request({
url: service + '/wecom/kf/list/async'
url: service + '/wecom/kf/list/async',
})
}
// 客服接待人员列表
export function getMemeberInCustomer (data) {
export function getMemeberInCustomer(data) {
return request({
url: service + '/wecom/kf/servicer/list',
params: data
params: data,
})
}
// 客服列表
export function getList (params) {
export function getList(params) {
console.log(service)
return request({
url: service + '/wecom/kf/list',
params
params,
})
}
// 新增客服
export function addService (data) {
export function addService(data) {
return request({
url: service + '/wecom/kf/add',
method: 'post',
data: data
data: data,
})
}
// 客服编辑
export function editService (data) {
export function editService(data) {
return request({
url: service + '/wecom/kf/edit/account',
method: 'post',
data: data
data: data,
})
}
// 删除客服
export function remove (id) {
export function remove(id) {
return request({
url: service + '/wecom/kf/delete/' + id,
method: 'delete'
method: 'delete',
})
}
// 客服详情
export function getDetail (id) {
export function getDetail(id) {
return request({
url: service + '/wecom/kf/get/' + id
url: service + '/wecom/kf/get/' + id,
})
}
// 批量下载场景二维码
export function downloadBatch (ids) {
export function downloadBatch(ids) {
return request({
url: service + "/wecom/kf/scenes/batch/download",
url: service + '/wecom/kf/scenes/batch/download',
params: {
ids: ids
ids: ids,
},
responseType: 'blob'
responseType: 'blob',
})
}
// 场景列表
export function getSceneList (params) {
export function getSceneList(params) {
return request({
url: service + '/wecom/kf/scenes/list',
params
params,
})
}
// 新增场景
export function addScene (data) {
export function addScene(data) {
return request({
url: service + '/wecom/kf/scenes/add',
data: data,
method: 'post'
method: 'post',
})
}
// 编辑场景
export function editScene (data) {
export function editScene(data) {
return request({
url: service + '/wecom/kf/scenes/edit',
data: data,
method: 'put'
method: 'put',
})
}
// 删除场景
export function deleteScene (ids) {
export function deleteScene(ids) {
console.log(33333)
return request({
url: service + '/wecom/kf/scenes/delete/' + ids,
method: 'delete'
method: 'delete',
})
}
// 咨询记录列表
export function getResultList (params) {
export function getResultList(params) {
return request({
url: service + '/wecom/kf/record/list',
params
params,
})
}
// 咨询记录导出
export function exportResult (params) {
export function exportResult(params) {
return request({
url: service + '/wecom/kf/record/export',
params: params
params: params,
})
}
// 咨询记录详情
export function getResultDetail (params) {
export function getResultDetail(params) {
return request({
url: service + '/wecom/kf/record/detail',
params: params
params: params,
})
}
// 场景分析 抬头数据
export function getSceneTotal () {
export function getSceneTotal() {
return request({
url: service + '/wecom/kf/statistic/scene/getAnalysis'
url: service + '/wecom/kf/statistic/scene/getAnalysis',
})
}
// 场景分析 数据趋势 客户总数/实时数据
export function getLineChartTotal (params) {
export function getLineChartTotal(params) {
return request({
url: service + '/wecom/kf/statistic/scene/getRealCnt',
params
params,
})
}
// 场景分析 访问场景 top5
export function getBarTop5Total (params) {
export function getBarTop5Total(params) {
return request({
url: service + '/wecom/kf/statistic/scene/getRankCnt',
params
params,
})
}
// 场景分析 数据报表
export function getTableTotal (params) {
export function getTableTotal(params) {
return request({
url: service + '/wecom/kf/statistic/scene/getRealPageCnt',
params
params,
})
}
// 场景分析 数据报表 导出
export function getTableExport (params) {
export function getTableExport(params) {
return request({
url: service + '/wecom/kf/statistic/scene/real/export',
params
params,
})
}
// 咨询分析 抬头数据
export function getConsultTotal () {
export function getConsultTotal() {
return request({
url: service + '/wecom/kf/statistic/consult/getAnalysis'
url: service + '/wecom/kf/statistic/consult/getAnalysis',
})
}
// 咨询分析 数据趋势 客户总数/实时数据
export function getConsultLineChartTotal (params) {
export function getConsultLineChartTotal(params) {
return request({
url: service + '/wecom/kf/statistic/consult/getRealCnt',
params
params,
})
}
// 咨询分析 访问场景 top5
export function getConsultBarTop5Total (params) {
export function getConsultBarTop5Total(params) {
return request({
url: service + '/wecom/kf/statistic/consult/getRankCnt',
params
params,
})
}
// 咨询分析 数据报表
export function getConsultTableTotal (params) {
export function getConsultTableTotal(params) {
return request({
url: service + '/wecom/kf/statistic/consult/getRealPageCnt',
params
params,
})
}
// 咨询分析 数据报表 导出
export function getConsultTableExport (params) {
export function getConsultTableExport(params) {
return request({
url: service + '/wecom/kf/statistic/consult/real/export',
params
params,
})
}
\ No newline at end of file
}
......@@ -33,7 +33,7 @@ export default {
<template>
<div class="preview ac">
<div class="top">小微</div>
<div class="small">仟微科技-企微</div>
<div class="small">{{ lwConfig.COMPANY_NAME || '仟微科技' }}-企微</div>
<div class="time">凌晨2:20</div>
<ul class="msg-ul">
<li class="flex msg-li">
......@@ -50,7 +50,7 @@ export default {
size="small"
:src="require('@/assets/image/profile.jpg')"
></el-avatar>
<div class="msg" style="line-height: 0; padding: 5px;">
<div class="msg" style="line-height: 0; padding: 5px">
<slot></slot>
</div>
</li>
......@@ -70,7 +70,7 @@ export default {
size="small"
:src="require('@/assets/image/profile.jpg')"
></el-avatar>
<div class="msg" style="line-height: 0; padding: 5px;">
<div class="msg" style="line-height: 0; padding: 5px">
<slot name="image" v-bind:image="image"></slot>
</div>
</li>
......
......@@ -8,32 +8,32 @@ export default {
props: {
fileUrl: {
type: String,
default: ''
default: '',
},
fileName: {
type: String,
default: ''
default: '',
},
// 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file)
type: {
type: String,
default: '0'
default: '0',
},
// 上传文件大小不能超过 maxSize MB
maxSize: {
type: Number,
default: 2
default: 2,
},
// 图片的宽高像素限制 [width(number), height(number)],默认null不限制
maxImgPx: {
type: Array,
default: null // () => [100, 100]
default: null, // () => [100, 100]
},
// 限制允许上传的文件格式 eg:["bmp", "jpg", "png", "jpeg", "gif"]
format: {
type: Array,
default: null
}
default: null,
},
// beforeUpload: {
// type: Function,
// default: function() {
......@@ -44,19 +44,19 @@ export default {
data() {
return {
loading: false,
action: process.env.VUE_APP_BASE_API + '/common/uploadFile2Cos',
action: window.lwConfig.BASE_API + '/common/uploadFile2Cos',
// (this.type == 0
// ? '/wecom/material/uploadimg'
// : '/common/uploadFile2Cos'),
headers: window.CONFIG.headers,
domain: process.env.VUE_APP_BASE_API
domain: window.lwConfig.BASE_API,
}
},
watch: {},
computed: {
accept() {
return ['image/*', 'amr/*', 'video/*', '*'][this.type]
}
},
},
created() {},
mounted() {},
......@@ -195,8 +195,8 @@ export default {
onError(err, file, fileList) {
this.loading = false
this.$message.error('上传文件失败')
}
}
},
},
}
</script>
......
import { getToken } from '@/utils/auth'
import env from '../env'
// 系统常量
const common = {
SYSTEM_NAME: 'LinkWeChat',
SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM',
COMPANY_NAME: '仟微科技',
COMPANY_NAME_ALL: '仟微科技',
// LOGO_DARK: env.BASE_URL + 'static/LOGO_DARK.png',
// LOGO_LIGHT: env.BASE_URL + 'static/LOGO_LIGHT.png',
// LOGO_TEXT_DARK: env.BASE_URL + 'static/LOGO_TEXT_DARK.png',
LOGO_TEXT_LIGHT: env.BASE_URL + 'static/LOGO_TEXT_LIGHT.png',
POST_QRCODE: env.BASE_URL + 'static/POST_QRCODE.png',
// QRCODE_CONTACT_US: env.BASE_URL + 'static/QRCODE_CONTACT_US.png',
// QRCODE_CUSTOMER_SERVICE: env.BASE_URL + 'static/QRCODE_CUSTOMER_SERVICE.png',
COPYRIGHT: 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.',
IS_PUBLISH_DIALOG: true, // 是否显示发布弹窗
}
window.lwConfig = Object.assign(env, common, window.lwConfig || {})
document.title = window.lwConfig.SYSTEM_NAME_ALL
window.CONFIG = {
/**
......@@ -31,8 +51,8 @@ window.CONFIG = {
services: {
wecom: '/wecom',
kf: process.env.VUE_APP_KF_API,
system: process.env.VUE_APP_SYSTEM_API,
kf: window.lwConfig.KF_API,
system: window.lwConfig.SYSTEM_API,
common: '/common',
},
......@@ -54,7 +74,7 @@ document.addEventListener(
let target = e.target
let src = target.attributes.getNamedItem('src').value
if (target.tagName.toUpperCase() === 'IMG' && src && !src.includes('http')) {
target.src = process.env.VUE_APP_BASE_API + src
target.src = window.lwConfig.BASE_API + src
}
},
true
......
......@@ -5,7 +5,7 @@
import store from '@/store'
export default {
inserted(el, binding, vnode) {
inserted (el, binding, vnode) {
const { value } = binding
const all_permission = "*:*:*";
const permissions = store.getters && store.getters.permissions
......@@ -18,7 +18,7 @@ export default {
})
if (!hasPermissions) {
el.parentNode && el.parentNode.removeChild(el)
// el.parentNode && el.parentNode.removeChild(el)
}
} else {
throw new Error(`请设置操作权限标签值`)
......
<template>
<div class="logo-container" :class="{ collapse: collapse }">
<transition name="sidebarLogoFade">
<router-link
v-if="collapse"
key="collapse"
class="sidebar-logo-link"
to="/"
>
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<!-- <h1 v-else class="sidebar-title">{{ title }}</h1> -->
</router-link>
......@@ -19,8 +14,6 @@
</template>
<script>
import logoImg from '@/assets/logo/logo.png'
export default {
name: 'SidebarLogo',
props: {
......@@ -32,7 +25,7 @@ export default {
data() {
return {
title: process.env.VUE_APP_TITLE,
logo: logoImg,
logo: this.lwConfig.LOGO_TEXT_LIGHT,
}
},
}
......@@ -59,7 +52,8 @@ export default {
width: 100%;
& .sidebar-logo {
// height: 32px;
max-height: 35px;
max-width: 170px;
vertical-align: middle;
margin-right: 12px;
}
......
......@@ -41,17 +41,16 @@
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
仟微
<!-- <img :src="avatar" class="user-avatar"> -->
<img :src="avatar" class="user-avatar">
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<el-dropdown-item @click.native="setting = true">
<!-- <el-dropdown-item @click.native="setting = true">
<span>布局设置</span>
</el-dropdown-item>
</el-dropdown-item> -->
<el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
......@@ -100,7 +99,7 @@ export default {
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = process.env.VUE_APP_BASE_URL
location.href = window.lwConfig.BASE_URL
})
})
},
......@@ -167,24 +166,22 @@ export default {
}
.avatar-container {
margin-right: 30px;
margin-right: 10px;
.avatar-wrapper {
position: relative;
color: #fff;
.user-avatar {
cursor: pointer;
width: 40px;
height: 40px;
width: 35px;
height: 35px;
border-radius: 10px;
vertical-align: middle;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 5px;
font-size: 12px;
font-size: 14px;
margin-left: 5px;
}
}
}
......
......@@ -14,7 +14,7 @@
<div class="main-container">
<div v-show="$route.name !== '首页'">
<hamburger id="hamburger-container" class="hamburger-container" />
<span class="slogan">仟微科技 |</span>
<span class="slogan">{{ lwConfig.COMPANY_NAME || '仟微科技' }} |</span>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
</div>
......@@ -23,9 +23,9 @@
<tags-view v-if="needTagsView" />
</div> -->
<app-main />
<right-panel v-if="showSettings">
<!-- <right-panel v-if="showSettings">
<settings />
</right-panel>
</right-panel> -->
</div>
</div>
</div>
......@@ -51,7 +51,7 @@ export default {
RightPanel,
Settings,
Sidebar,
TagsView
TagsView,
},
mixins: [ResizeMixin],
computed: {
......@@ -59,7 +59,7 @@ export default {
...mapState({
sidebar: (state) => state.app.sidebar,
device: (state) => state.app.device,
showSettings: (state) => state.settings.showSettings
showSettings: (state) => state.settings.showSettings,
// needTagsView: (state) => state.settings.tagsView,
// fixedHeader: (state) => state.settings.fixedHeader,
}),
......@@ -68,15 +68,15 @@ export default {
hideSidebar: !this.sidebar.opened || this.$route.path == '/index',
openSidebar: this.sidebar.opened && this.$route.path !== '/index',
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
mobile: this.device === 'mobile',
}
}
},
},
methods: {
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
}
}
},
},
}
</script>
......
import Vue from 'vue'
// require('promise.prototype.finally').shim()
import '../env'
import Cookies from 'js-cookie'
......@@ -9,14 +10,14 @@ import Element from 'element-ui'
import './styles/element-variables.scss'
Vue.use(Element, {
size: Cookies.get('size') || 'small' // set element-ui default size
size: Cookies.get('size') || 'small', // set element-ui default size
})
import '@/styles/common.scss' // common css
import '@/styles/index.scss' // global css
import 'video.js/dist/video-js.css'
import config from '@/config'
import '@/config'
import App from './App'
import store from './store'
import router from './router'
......@@ -32,7 +33,7 @@ import {
selectDictLabel,
selectDictLabels,
download,
handleTree
handleTree,
} from '@/utils/common'
import Pagination from '@/components/Pagination'
......@@ -62,6 +63,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.lwConfig = window.lwConfig
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: 'success' })
......@@ -97,9 +99,9 @@ VueAMap.initAMapApiLoader({
'AMap.ToolBar',
'AMap.MapType',
'AMap.PolyEditor',
'AMap.CircleEditor'
'AMap.CircleEditor',
],
v: '1.4.4'
v: '1.4.4',
})
/**
......@@ -117,5 +119,5 @@ new Vue({
el: '#app',
router,
store,
render: (h) => h(App)
render: (h) => h(App),
})
......@@ -8,7 +8,7 @@ const user = {
companyName: '',
avatar: '',
roles: [],
permissions: []
permissions: [],
},
mutations: {
......@@ -26,7 +26,7 @@ const user = {
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
}
},
},
actions: {
......@@ -58,7 +58,7 @@ const user = {
const avatar =
user.avatar == ''
? require('@/assets/image/profile.jpg')
: process.env.VUE_APP_BASE_API + user.avatar
: window.lwConfig.BASE_API + user.avatar
if (res.roles && res.roles.length > 0) {
// 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
......@@ -101,8 +101,8 @@ const user = {
removeToken()
resolve()
})
}
}
},
},
}
export default user
......@@ -313,27 +313,6 @@ aside {
color: #888888;
}
/* image */
.img-circle {
border-radius: 50%;
}
.img-lg {
width: 120px;
height: 120px;
}
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 180px;
height: 180px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
/* 拖拽列样式 */
.sortable-ghost {
opacity: 0.8;
......
......@@ -2,7 +2,7 @@
* 通用js方法封装处理
*/
const baseURL = process.env.VUE_APP_BASE_API
const baseURL = window.lwConfig.BASE_API
// 日期格式化
export function parseTime(time, pattern) {
......@@ -31,7 +31,7 @@ export function parseTime(time, pattern) {
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
a: date.getDay(),
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
......
......@@ -8,9 +8,9 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: process.env.NODE_ENV === 'development' ? 'api' : process.env.VUE_APP_DOMAIN,
baseURL: process.env.NODE_ENV === 'development' ? 'api' : window.lwConfig.DOMAIN,
// 超时
timeout: 10000
timeout: 10000,
})
// request拦截器
service.interceptors.request.use(
......@@ -41,10 +41,10 @@ service.interceptors.response.use(
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
}).then(() => {
store.dispatch('LogOut').then(() => {
location.href = process.env.VUE_APP_BASE_URL
location.href = window.lwConfig.BASE_URL
})
})
}
......@@ -61,11 +61,11 @@ service.interceptors.response.use(
if (process.env.NODE_ENV === 'development') {
Message({
message: `后端错误:接口:${res.config.url},${code}错误:${msg}`,
type: 'error'
type: 'error',
})
} else {
Notification.error({
title: msg
title: msg,
})
}
return Promise.reject()
......@@ -85,7 +85,7 @@ service.interceptors.response.use(
Message({
message: `${msg}:${config.url}`,
type: 'error',
duration: 5 * 1000
duration: 5 * 1000,
})
return Promise.reject()
}
......
......@@ -3,18 +3,18 @@ import { getToken } from '@/utils/auth'
const mimeMap = {
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
zip: 'application/zip'
zip: 'application/zip',
}
const baseUrl = process.env.VUE_APP_BASE_API
const baseUrl = window.lwConfig.BASE_API
export function downLoadZip(str, filename) {
var url = baseUrl + str
axios({
method: 'get',
url: url,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(res => {
headers: { Authorization: 'Bearer ' + getToken() },
}).then((res) => {
resolveBlob(res, mimeMap.zip)
})
}
......
......@@ -159,7 +159,7 @@
<div class="inedx_r_top_t">
<p class="p1">{{ $store.state.user.companyName }},欢迎登陆本系统</p>
<p class="p2">登录时间:{{ parseTime(new Date()) }}</p>
<p class="p1 p3 margint20">LinkWechat 企业微信SCRM</p>
<p class="p1 p3 margint20">{{ lwConfig.SYSTEM_NAME_ALL || 'LinkWechat 企业微信SCRM' }}</p>
<p class="p2 p4">
版本信息:开源
<span class="fr">可用期限:永久</span>
......@@ -243,56 +243,56 @@ export default {
{
name: '企业客户',
url: '/customerManage/customer',
img: require('@/assets/index/kehgl.png')
img: require('@/assets/index/kehgl.png'),
},
{
name: '员工活码',
url: '/drainageCode/staff',
img: require('@/assets/index/neircd.png')
img: require('@/assets/index/neircd.png'),
},
{
name: '新增群发',
url: '/customerMaintain/groupMessage/add',
img: require('@/assets/index/renwb.png')
img: require('@/assets/index/renwb.png'),
},
{
name: '任务宝',
url: '/application/taskGroup',
img: require('@/assets/index/xiaoxqf.png')
img: require('@/assets/index/xiaoxqf.png'),
},
{
name: '新客拉群',
url: '/communityOperating/newCustomer',
img: require('@/assets/index/yuanghm.png')
img: require('@/assets/index/yuanghm.png'),
},
{
name: '素材中心',
url: '/customerMaintain/material',
img: require('@/assets/index/zidgl.png')
img: require('@/assets/index/zidgl.png'),
},
{
name: '关键词群',
url: '/communityOperating/keywords',
img: require('@/assets/index/yuanghm.png')
img: require('@/assets/index/yuanghm.png'),
},
{
name: '会话存档',
url: '/riskControl/conversation/content',
img: require('@/assets/index/zidgl.png')
}
img: require('@/assets/index/zidgl.png'),
},
],
table: {
userCount: 0,
customerCount: 0,
groupCount: 0,
groupMemberCount: 0
groupMemberCount: 0,
},
erchatsTable: {},
allData: {},
time: '昨天',
uptime: '',
timeType: 'today',
durationCount: 2600
durationCount: 2600,
}
},
mounted() {
......@@ -308,7 +308,7 @@ export default {
let json = {
today: '昨天',
week: '上周',
month: '上月'
month: '上月',
}
this.time = json[type]
this.erchatsTable = this.allData[type]
......@@ -341,7 +341,7 @@ export default {
arr1: [],
arr2: [],
arr3: [],
xData: []
xData: [],
}
let series = []
this.erchatsTable.dataList.forEach((a) => {
......@@ -367,8 +367,8 @@ export default {
// }
// },
textStyle: {
color: '#fff' // 主标题文字的颜色。
}
color: '#fff', // 主标题文字的颜色。
},
})
}
this.drawLine(data.xData, series)
......@@ -386,16 +386,16 @@ export default {
charts.setOption({
color: ['#088AEE', '#E74E59', '#14BF48', '#FA7216'],
tooltip: {
trigger: 'axis'
trigger: 'axis',
},
legend: {
data: ['新增客户数', '新增客群数', '群新增人数', '流失客户数']
data: ['新增客户数', '新增客群数', '群新增人数', '流失客户数'],
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
containLabel: true,
},
xAxis: {
type: 'category',
......@@ -403,19 +403,19 @@ export default {
data: xData,
axisLine: {
lineStyle: {
color: '#ccc'
}
}
color: '#ccc',
},
},
},
yAxis: {
type: 'value',
axisLine: {
lineStyle: {
color: '#ccc'
}
}
color: '#ccc',
},
},
},
series
series,
})
},
refresh() {
......@@ -440,8 +440,8 @@ export default {
} else {
return '-'
}
}
}
},
},
}
</script>
<style lang="scss" scoped>
......
......@@ -12,7 +12,7 @@ export default {
SelectTag,
SelectPoster,
TargetSelectUser: SelectUser,
SelectQrCode
SelectQrCode,
},
data() {
return {
......@@ -20,7 +20,7 @@ export default {
taskName: '',
fissInfo: '',
fissNum: '',
dateRange: ''
dateRange: '',
},
groupForm: {
taskFissionStaffs: [],
......@@ -35,10 +35,10 @@ export default {
welcomeMsg: '',
rewardUrl: '',
rewardImageUrl: '',
rewardRule: ''
rewardRule: '',
},
// rewardImageUrlTemp: '',
action: process.env.VUE_APP_BASE_API + window.CONFIG.services.wecom + '/fission/upload',
action: window.lwConfig.BASE_API + window.CONFIG.services.wecom + '/fission/upload',
headers: window.CONFIG.headers,
ruleForm: {
taskName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
......@@ -47,9 +47,9 @@ export default {
fissNum: [
{ required: true, message: '请输入数量', trigger: 'blur' },
// { pattern: /^[1-9]+$/, message: '请输入数字', trigger: 'blur' },
{ pattern: /^[1-9]\d*$/, message: '请输入数字', trigger: 'blur' }
{ pattern: /^[1-9]\d*$/, message: '请输入数字', trigger: 'blur' },
],
dateRange: [{ required: true, message: '时间不可为空', trigger: 'blur' }]
dateRange: [{ required: true, message: '时间不可为空', trigger: 'blur' }],
},
dialogVisibleSelectUser: false,
dialogVisibleSelectTag: false,
......@@ -57,7 +57,7 @@ export default {
dialogVisibleSelectGroupCode: false,
selectTagType: '',
pageType: 'add',
taskDetail: {}
taskDetail: {},
}
},
created() {
......@@ -84,7 +84,7 @@ export default {
console.log('验证通过,提交表单')
let params = {
...this.query,
...this.groupForm
...this.groupForm,
}
params.startTime = params.dateRange[0]
params.overTime = params.dateRange[1]
......@@ -95,8 +95,8 @@ export default {
{
staffId: '',
staffName: '',
staffType: 3
}
staffType: 3,
},
]
}
delete params.sendType
......@@ -124,11 +124,11 @@ export default {
if (res.code == 200) {
this.$message({
message: '新增成功',
type: 'success'
type: 'success',
})
// taskApi.sendFission(JSON.parse(res.msg).id)
this.$router.push({
path: '/application/groupFission'
path: '/application/groupFission',
})
}
//
......@@ -139,10 +139,10 @@ export default {
if (res.code == 200) {
this.$message({
message: '修改成功',
type: 'success'
type: 'success',
})
this.$router.push({
path: '/application/groupFission'
path: '/application/groupFission',
})
// taskApi.sendFission(JSON.parse(res.msg).id)
}
......@@ -161,7 +161,7 @@ export default {
taskName: res.data.taskName,
fissInfo: res.data.fissInfo,
fissNum: res.data.fissNum,
dateRange: [res.data.startTime + ' 00:00:00', res.data.overTime + ' 00:00:00']
dateRange: [res.data.startTime + ' 00:00:00', res.data.overTime + ' 00:00:00'],
}
this.query = query
this.groupForm = {
......@@ -179,7 +179,7 @@ export default {
welcomeMsg: res.data.welcomeMsg,
rewardUrl: res.data.rewardUrl,
rewardImageUrl: res.data.rewardImageUrl,
rewardRule: res.data.rewardRule
rewardRule: res.data.rewardRule,
}
})
},
......@@ -191,13 +191,13 @@ export default {
selectParam = {
staffId: item.userId,
staffName: item.name,
staffType: 2
staffType: 2,
}
} else {
selectParam = {
staffId: item.id,
staffName: item.name,
staffType: 1
staffType: 1,
}
}
return selectParam
......@@ -238,13 +238,13 @@ export default {
}
return isJPG || isPNG
}
},
},
computed: {
arrayTarget() {
return [].concat({ id: this.groupForm.fissionTargetId })
}
}
},
},
}
</script>
......@@ -415,7 +415,7 @@ export default {
<el-form-item label="兑奖规则" prop="rewardRule">
<el-input
type="textarea"
style="border:none;resize:none;width:364px"
style="border: none; resize: none; width: 364px"
v-model="groupForm.rewardRule"
maxlength="100"
>
......
......@@ -10,7 +10,7 @@ export default {
SelectUser,
SelectTag,
SelectPoster,
TargetSelectUser: SelectUser
TargetSelectUser: SelectUser,
},
data() {
return {
......@@ -18,7 +18,7 @@ export default {
taskName: '',
fissInfo: '',
fissNum: '',
dateRange: ''
dateRange: '',
},
groupForm: {
taskFissionStaffs: [],
......@@ -33,9 +33,9 @@ export default {
welcomeMsg: '',
rewardUrl: '',
rewardImageUrl: '',
rewardRule: ''
rewardRule: '',
},
action: process.env.VUE_APP_BASE_API + window.CONFIG.services.wecom + '/fission/upload',
action: window.lwConfig.BASE_API + window.CONFIG.services.wecom + '/fission/upload',
headers: window.CONFIG.headers,
ruleForm: {
taskName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
......@@ -43,9 +43,9 @@ export default {
fissionTargetId: [{ required: true, message: '请选择员工', trigger: 'blur' }],
fissNum: [
{ required: true, message: '请输入数量', trigger: 'blur' },
{ pattern: /^[1-9]\d*$/, message: '请输入数字', trigger: 'blur' }
{ pattern: /^[1-9]\d*$/, message: '请输入数字', trigger: 'blur' },
],
dateRange: [{ required: true, message: '时间不可为空', trigger: 'blur' }]
dateRange: [{ required: true, message: '时间不可为空', trigger: 'blur' }],
},
dialogVisibleSelectUser: false,
dialogVisibleSelectTag: false,
......@@ -53,7 +53,7 @@ export default {
dialogVisibleTargetStff: false,
selectTagType: '',
pageType: 'add',
taskDetail: {}
taskDetail: {},
}
},
created() {
......@@ -80,7 +80,7 @@ export default {
console.log('验证通过,提交表单')
let params = {
...this.query,
...this.groupForm
...this.groupForm,
}
params.startTime = params.dateRange[0]
params.overTime = params.dateRange[1]
......@@ -91,8 +91,8 @@ export default {
{
staffId: '',
staffName: '',
staffType: 3
}
staffType: 3,
},
]
}
delete params.sendType
......@@ -121,11 +121,11 @@ export default {
if (res.code == 200) {
this.$message({
message: '新增成功',
type: 'success'
type: 'success',
})
// taskApi.sendFission(JSON.parse(res.msg).id)
this.$router.push({
path: 'taskGroup'
path: 'taskGroup',
})
}
//
......@@ -136,10 +136,10 @@ export default {
if (res.code == 200) {
this.$message({
message: '修改成功',
type: 'success'
type: 'success',
})
this.$router.push({
path: 'taskGroup'
path: 'taskGroup',
})
// taskApi.sendFission(JSON.parse(res.msg).id)
}
......@@ -158,7 +158,7 @@ export default {
taskName: res.data.taskName,
fissInfo: res.data.fissInfo,
fissNum: res.data.fissNum,
dateRange: [res.data.startTime + ' 00:00:00', res.data.overTime + ' 00:00:00']
dateRange: [res.data.startTime + ' 00:00:00', res.data.overTime + ' 00:00:00'],
}
this.query = query
this.groupForm = {
......@@ -176,7 +176,7 @@ export default {
welcomeMsg: res.data.welcomeMsg,
rewardUrl: res.data.rewardUrl,
rewardImageUrl: res.data.rewardImageUrl,
rewardRule: res.data.rewardRule
rewardRule: res.data.rewardRule,
}
})
},
......@@ -188,13 +188,13 @@ export default {
selectParam = {
staffId: item.userId,
staffName: item.name,
staffType: 2
staffType: 2,
}
} else {
selectParam = {
staffId: item.id,
staffName: item.name,
staffType: 1
staffType: 1,
}
}
return selectParam
......@@ -235,8 +235,8 @@ export default {
}
return isJPG || isPNG
}
}
},
},
}
</script>
......@@ -408,7 +408,7 @@ export default {
<el-form-item label="兑奖规则" prop="rewardRule">
<el-input
type="textarea"
style="border:none;resize:none;width:364px"
style="border: none; resize: none; width: 364px"
v-model="groupForm.rewardRule"
maxlength="100"
>
......
......@@ -16,7 +16,7 @@ export default {
createBy: '', // 创建人
keywords: '', // 关键词
beginTime: '', // 创建开始时间
endTime: '' // 创建结束时间
endTime: '', // 创建结束时间
},
queryCreateByName: '',
dateRange: [], // 添加日期
......@@ -27,7 +27,7 @@ export default {
dialogHowToConfig: false,
disabled: false,
loading: false,
clipboard: null
clipboard: null,
}
},
watch: {
......@@ -39,7 +39,7 @@ export default {
} else {
;[this.query.beginTime, this.query.endTime] = dateRange
}
}
},
},
created() {
this.getList(1)
......@@ -57,7 +57,7 @@ export default {
this.$notify({
title: '成功',
message: '链接已复制到剪切板,可粘贴。',
type: 'success'
type: 'success',
})
})
......@@ -88,7 +88,7 @@ export default {
goRoute(id) {
this.$router.push({
path: 'keywordsAev',
query: { id: id }
query: { id: id },
})
},
// 重置查询参数
......@@ -105,7 +105,7 @@ export default {
this.$confirm('确认删除当前数据?删除操作无法撤销,请谨慎操作。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
const ids = this.multiSelect.map((t) => t.taskId)
......@@ -124,7 +124,7 @@ export default {
this.$confirm('确认删除当前数据?删除操作无法撤销,请谨慎操作。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
remove(id + '').then((res) => {
......@@ -154,8 +154,8 @@ export default {
// 处理多选
handleSelectionChange(val) {
this.multiSelect = val
}
}
},
},
}
</script>
......@@ -311,13 +311,14 @@ export default {
title="配置方法"
:visible.sync="dialogHowToConfig"
width="500px"
style="margin-bottom: 7vh;"
style="margin-bottom: 7vh"
:close-on-click-modal="false"
>
<div class="help">
<div class="step">
<p>
1、登录企业微信官方后台,进入应用管理,点击 LinkWeChat,再点击【配置到聊天工具栏】。
1、登录企业微信官方后台,进入应用管理,点击
{{ lwConfig.SYSTEM_NAME || 'LinkWeChat' }},再点击【配置到聊天工具栏】。
</p>
<el-image :src="require('@/assets/example/keywordHelp1.png')"></el-image>
</div>
......@@ -326,16 +327,12 @@ export default {
<el-image :src="require('@/assets/example/keywordHelp2.png')"></el-image>
</div>
<div class="step">
<p>
3、点击【配置页面】后,在弹窗中,输入页面名称及链接,并确定即可。进入配置页面。
</p>
<p>3、点击【配置页面】后,在弹窗中,输入页面名称及链接,并确定即可。进入配置页面。</p>
<el-image :src="require('@/assets/example/keywordHelp3.png')"></el-image>
</div>
</div>
<div slot="footer">
<el-button type="primary" @click="dialogHowToConfig = false">
我知道了
</el-button>
<el-button type="primary" @click="dialogHowToConfig = false"> 我知道了 </el-button>
</div>
</el-dialog>
</div>
......
......@@ -7,31 +7,31 @@
<el-tab-pane label="敏感词设置" name="2">
<set-sensitive-word />
</el-tab-pane>
<el-tab-pane label="敏感行为警告" name="3">
<!-- <el-tab-pane label="敏感行为警告" name="3">
<alarming-sensitive />
</el-tab-pane>
</el-tab-pane> -->
</el-tabs>
</div>
</template>
<script>
import alarmingSensitive from './alarmingSensitive.vue'
// import alarmingSensitive from './alarmingSensitive.vue'
import sensitiveList from './sensitiveList.vue'
import setSensitiveWord from './setSensitiveWord'
export default {
components: {
sensitiveList,
setSensitiveWord,
alarmingSensitive
// alarmingSensitive
},
data() {
return {
activeName: '1'
activeName: '1',
}
},
methods: {
// handleClick(tab, event) {
// console.log(tab, event);
// }
}
},
}
</script>
......@@ -6,7 +6,7 @@
<img class="login-bg3" src="@/assets/image/login_bg3.png" alt="" />
<div class="login-form-wrap">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">LinkWeChat</h3>
<h3 class="title">{{ lwConfig.SYSTEM_NAME }}</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
......@@ -80,7 +80,9 @@
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2021 LinkWeChat All Rights Reserved.</span>
<span>{{
lwConfig.COPYRIGHT || 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.'
}}</span>
</div>
<!-- <el-dialog
......@@ -165,9 +167,9 @@ export default {
this.getCode()
this.getCookie()
process.env.NODE_ENV !== 'development' &&
window.lwConfig.IS_PUBLISH_DIALOG &&
this.$alert(
'LinkWeChat V2.5 正式发布公测,遇到使用上的问题欢迎提交 Issue,我们将光速修复。',
'LinkWeChat V2.5 已正式发布,遇到使用上的问题欢迎提交 Issue,我们将光速修复。',
'提示',
{
confirmButtonText: '确定',
......@@ -212,7 +214,7 @@ export default {
this.$store
.dispatch('Login', this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || process.env.VUE_APP_BASE_URL })
this.$router.push({ path: this.redirect || window.lwConfig.BASE_URL })
})
.catch(() => {
this.loading = false
......
......@@ -8,7 +8,7 @@ export default {
name: 'Poster',
components: {
MaPage,
SelectMaterial
SelectMaterial,
},
data() {
return {
......@@ -17,7 +17,7 @@ export default {
dialogVisibleSelectMaterial: false,
dialog: {
preview: false, // 预览弹出显示隐藏
edit: false // 编辑弹出显示隐藏
edit: false, // 编辑弹出显示隐藏
},
rangeErrorMsg: '',
form: {},
......@@ -25,32 +25,32 @@ export default {
title: {
required: true,
message: '请输入海报名称',
trigger: 'blur'
trigger: 'blur',
},
categoryId: {
required: true,
message: '请选择分类'
message: '请选择分类',
},
type: {
required: true,
message: '请选择海报类型'
message: '请选择海报类型',
},
status: {
required: true,
message: '请选择是否启用'
}
message: '请选择是否启用',
},
},
srcList: [],
ids: [], // 选中数组
previewImg: '', // 预览图片地址
activeObject: {},
fontColor: ''
fontColor: '',
}
},
watch: {
fontColor(hex) {
this.setAttr('fill', hex)
}
},
},
created() {},
mounted() {},
......@@ -76,7 +76,7 @@ export default {
type: data.type,
status: data.status,
backgroundImgPath: data.backgroundImgPath,
posterJSON: JSON.parse(data.otherField)
posterJSON: JSON.parse(data.otherField),
}
this.posterSubassemblyList = data.posterSubassemblyList || []
} else {
......@@ -87,7 +87,7 @@ export default {
type: '1', // 海报类型
status: 0, // 是否启用 0 启用 1 不启用
backgroundImgPath: '', // 图片url
mediaId: '' // 图片id
mediaId: '', // 图片id
}
this.posterSubassemblyList = []
}
......@@ -121,16 +121,16 @@ export default {
deleteBtn.style.display = 'block'
}
canvas.on('selection:created', function(e) {
canvas.on('selection:created', function (e) {
addDeleteBtn(e.target.lineCoords.tr.x, e.target.lineCoords.tr.y)
})
canvas.on('selection:updated', function(e) {
canvas.on('selection:updated', function (e) {
addDeleteBtn(e.target.lineCoords.tr.x, e.target.lineCoords.tr.y)
})
//通用事件另外写法
canvas.on({
'mouse:down': function(e) {
'mouse:down': function (e) {
if (e.target != undefined) {
var ob = canvas.getActiveObject()
if (ob) {
......@@ -150,11 +150,11 @@ export default {
borderDashArray: [3, 3],
snapAngle: 45, //在45度时自动保持到45的倍数
snapThreshold: 5,
centeredRotation: true
centeredRotation: true,
})
}
}
}
},
})
//是否拖动
......@@ -186,19 +186,19 @@ export default {
// }
// })
canvas.on('object:modified', function(e) {
canvas.on('object:modified', function (e) {
addDeleteBtn(e.target.lineCoords.tr.x, e.target.lineCoords.tr.y)
})
canvas.on('object:scaling', function(e) {
canvas.on('object:scaling', function (e) {
deleteBtn.style.display = 'none'
})
canvas.on('object:moving', function(e) {
canvas.on('object:moving', function (e) {
deleteBtn.style.display = 'none'
})
canvas.on('object:rotating', function(e) {
canvas.on('object:rotating', function (e) {
deleteBtn.style.display = 'none'
})
canvas.on('mouse:wheel', function(e) {
canvas.on('mouse:wheel', function (e) {
deleteBtn.style.display = 'none'
})
......@@ -220,7 +220,7 @@ export default {
let activeObject = canvas.getActiveObject()
if (activeObject) {
this.$confirm('是否确认删除吗?', '警告', {
type: 'warning'
type: 'warning',
}).then(() => {
canvas.remove(activeObject)
this.activeObject = null
......@@ -262,7 +262,7 @@ export default {
left: 100,
top: 100,
borderDashArray: [3, 3],
customType: { text: 1, image: 2, qrcode: 3 }[type] // 自定义类型 1 固定文本 2 固定图片 3 二维码图片
customType: { text: 1, image: 2, qrcode: 3 }[type], // 自定义类型 1 固定文本 2 固定图片 3 二维码图片
}
switch (type) {
case 'text':
......@@ -276,15 +276,12 @@ export default {
case 'image':
case 'qrcode':
new fabric.Image.fromURL(
type == 'image' ? obj : 'http://demo.linkwechat.cn/lib/qrCode.png',
(img) => {
img.set(options)
// img.scale(this.canvas.width / img.width / 2)
img.scaleToWidth(200)
this.canvas.add(img).setActiveObject(img)
}
)
new fabric.Image.fromURL(type == 'image' ? obj : window.lwConfig.POST_QRCODE, (img) => {
img.set(options)
// img.scale(this.canvas.width / img.width / 2)
img.scaleToWidth(200)
this.canvas.add(img).setActiveObject(img)
})
break
default:
......@@ -300,9 +297,9 @@ export default {
},
remove(id) {
this.$confirm('是否确认删除吗?', '警告', {
type: 'warning'
type: 'warning',
})
.then(function() {
.then(function () {
return removePoster(id)
})
.then(() => {
......@@ -370,7 +367,7 @@ export default {
rotate: vo.angle,
order: i, // 层级
// categoryId: 0, // 分类ID (不需要传了)
verticalType: 2 // 居中方式后端让写死2
verticalType: 2, // 居中方式后端让写死2
}
posterSubList.push(posData)
i++
......@@ -379,7 +376,7 @@ export default {
;(form.id ? updatePoster : addPoster)(
Object.assign(
{
posterSubassemblyList: posterSubList
posterSubassemblyList: posterSubList,
},
form
)
......@@ -397,8 +394,8 @@ export default {
})
}
})
}
}
},
},
}
</script>
......@@ -461,7 +458,7 @@ export default {
:close-on-click-modal="false"
>
<div class="poster-edit-dialog fxbw">
<div style="width: 30%;">
<div style="width: 30%">
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="海报名称" prop="title">
<el-input v-model="form.title" maxlength="10" show-word-limit></el-input>
......@@ -472,7 +469,7 @@ export default {
v-model="form.categoryId"
:options="$refs.page.treeData[0].children"
:props="$refs.page.groupProps"
style="width: 100%;"
style="width: 100%"
></el-cascader>
<!-- <el-select
v-model="form.categoryId"
......@@ -527,7 +524,7 @@ export default {
<el-form-item label="背景图片" :required="true" :error="rangeErrorMsg">
<div v-if="form.backgroundImgPath">
<el-image
style="width: 100px; height: 100px; cursor: pointer;border-radius: 6px;"
style="width: 100px; height: 100px; cursor: pointer; border-radius: 6px"
:src="form.backgroundImgPath"
fit="fit"
>
......@@ -549,8 +546,7 @@ export default {
<div style="">
<div id="canvas-wrap">
<i class="el-icon-error" id="deleteBtn"></i>
<canvas id="canvas" width="300" height="500" style="border: 1px solid #ddd;">
</canvas>
<canvas id="canvas" width="300" height="500" style="border: 1px solid #ddd"> </canvas>
</div>
<div id="tbody-containerui-image-editor-controls">
<ul class="menu">
......
<template>
<div v-loading="loading" :style="'height:'+ height">
<iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
<div v-loading="loading" :style="'height:' + height">
<iframe :src="src" frameborder="no" style="width: 100%; height: 100%" scrolling="auto" />
</div>
</template>
<script>
export default {
name: "Druid",
name: 'Druid',
data() {
return {
src: process.env.VUE_APP_BASE_API + "/druid/index.html",
height: document.documentElement.clientHeight - 94.5 + "px;",
loading: true
};
src: window.lwConfig.BASE_API + '/druid/index.html',
height: document.documentElement.clientHeight - 94.5 + 'px;',
loading: true,
}
},
mounted: function() {
mounted: function () {
setTimeout(() => {
this.loading = false;
}, 230);
const that = this;
this.loading = false
}, 230)
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 94.5 + "px;";
};
}
};
that.height = document.documentElement.clientHeight - 94.5 + 'px;'
}
},
}
</script>
......@@ -159,7 +159,7 @@
<div class="inedx_r_top_t">
<p class="p1">{{ $store.state.user.companyName }},欢迎登陆本系统</p>
<p class="p2">登录时间:{{ parseTime(new Date()) }}</p>
<p class="p1 p3 margint20">LinkWechat 企业微信SCRM</p>
<p class="p1 p3 margint20">{{ lwConfig.SYSTEM_NAME_ALL || 'LinkWechat 企业微信SCRM' }}</p>
<p class="p2 p4">
版本信息:开源
<span class="fr">可用期限:永久</span>
......@@ -239,56 +239,56 @@ export default {
{
name: '企业客户',
url: '/customerManage/customer',
img: require('@/assets/index/kehgl.png')
img: require('@/assets/index/kehgl.png'),
},
{
name: '员工活码',
url: '/drainageCode/staff',
img: require('@/assets/index/neircd.png')
img: require('@/assets/index/neircd.png'),
},
{
name: '新增群发',
url: '/customerMaintain/groupMessage/add',
img: require('@/assets/index/renwb.png')
img: require('@/assets/index/renwb.png'),
},
{
name: '任务宝',
url: '/application/taskGroup',
img: require('@/assets/index/xiaoxqf.png')
img: require('@/assets/index/xiaoxqf.png'),
},
{
name: '新客拉群',
url: '/communityOperating/newCustomer',
img: require('@/assets/index/yuanghm.png')
img: require('@/assets/index/yuanghm.png'),
},
{
name: '素材中心',
url: '/customerMaintain/material',
img: require('@/assets/index/zidgl.png')
img: require('@/assets/index/zidgl.png'),
},
{
name: '关键词群',
url: '/communityOperating/keywords',
img: require('@/assets/index/yuanghm.png')
img: require('@/assets/index/yuanghm.png'),
},
{
name: '会话存档',
url: '/riskControl/conversation/content',
img: require('@/assets/index/zidgl.png')
}
img: require('@/assets/index/zidgl.png'),
},
],
table: {
userCount: 0,
customerCount: 0,
groupCount: 0,
groupMemberCount: 0
groupMemberCount: 0,
},
erchatsTable: {},
allData: {},
time: '昨天',
uptime: '',
timeType: 'today',
durationCount: 2600
durationCount: 2600,
}
},
mounted() {
......@@ -304,7 +304,7 @@ export default {
let json = {
today: '昨天',
week: '上周',
month: '上月'
month: '上月',
}
this.time = json[type]
this.erchatsTable = this.allData[type]
......@@ -337,7 +337,7 @@ export default {
arr1: [],
arr2: [],
arr3: [],
xData: []
xData: [],
}
let series = []
this.erchatsTable.dataList.forEach((a) => {
......@@ -363,8 +363,8 @@ export default {
// }
// },
textStyle: {
color: '#fff' // 主标题文字的颜色。
}
color: '#fff', // 主标题文字的颜色。
},
})
}
this.drawLine(data.xData, series)
......@@ -382,16 +382,16 @@ export default {
charts.setOption({
color: ['#088AEE', '#E74E59', '#14BF48', '#FA7216'],
tooltip: {
trigger: 'axis'
trigger: 'axis',
},
legend: {
data: ['新增客户数', '新增客群数', '群新增人数', '流失客户数']
data: ['新增客户数', '新增客群数', '群新增人数', '流失客户数'],
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
containLabel: true,
},
xAxis: {
type: 'category',
......@@ -399,19 +399,19 @@ export default {
data: xData,
axisLine: {
lineStyle: {
color: '#ccc'
}
}
color: '#ccc',
},
},
},
yAxis: {
type: 'value',
axisLine: {
lineStyle: {
color: '#ccc'
}
}
color: '#ccc',
},
},
},
series
series,
})
},
refresh() {
......@@ -436,8 +436,8 @@ export default {
} else {
return '-'
}
}
}
},
},
}
</script>
<style lang="scss" scoped>
......
<template>
<div>
<img v-bind:src="options.img" @click="editCropper()" title="点击上传头像" class="img-circle img-lg" />
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened">
<img
v-bind:src="options.img"
@click="editCropper()"
title="点击上传头像"
class="img-circle img-lg"
/>
<el-dialog
:title="title"
:visible.sync="open"
width="800px"
append-to-body
@opened="modalOpened"
>
<el-row>
<el-col :xs="24" :md="12" :style="{height: '350px'}">
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
<vue-cropper
ref="cropper"
:img="options.img"
:info="true"
:outputType="options.outputType"
:autoCrop="options.autoCrop"
:autoCropWidth="options.autoCropWidth"
:autoCropHeight="options.autoCropHeight"
......@@ -16,7 +28,7 @@
v-if="visible"
/>
</el-col>
<el-col :xs="24" :md="12" :style="{height: '350px'}">
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
<div class="avatar-upload-preview">
<img :src="previews.url" :style="previews.img" />
</div>
......@@ -25,26 +37,31 @@
<br />
<el-row>
<el-col :lg="2" :md="2">
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
<el-upload
action="#"
:http-request="requestUpload"
:show-file-list="false"
:before-upload="beforeUpload"
>
<el-button size="small">
上传
<i class="el-icon-upload el-icon--right"></i>
</el-button>
</el-upload>
</el-col>
<el-col :lg="{span: 1, offset: 2}" :md="2">
<el-col :lg="{ span: 1, offset: 2 }" :md="2">
<el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
</el-col>
<el-col :lg="{span: 1, offset: 1}" :md="2">
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
<el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
</el-col>
<el-col :lg="{span: 1, offset: 1}" :md="2">
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
<el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
</el-col>
<el-col :lg="{span: 1, offset: 1}" :md="2">
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
<el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
</el-col>
<el-col :lg="{span: 2, offset: 6}" :md="2">
<el-col :lg="{ span: 2, offset: 6 }" :md="2">
<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
</el-col>
</el-row>
......@@ -53,16 +70,16 @@
</template>
<script>
import store from "@/store";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
import store from '@/store'
import { VueCropper } from 'vue-cropper'
import { uploadAvatar } from '@/api/system/user'
export default {
components: { VueCropper },
props: {
user: {
type: Object
}
type: Object,
},
},
data() {
return {
......@@ -71,74 +88,97 @@ export default {
// 是否显示cropper
visible: false,
// 弹出层标题
title: "修改头像",
title: '修改头像',
options: {
outputType: 'png', // 裁剪生成图片的格式 jpeg, png, webp
img: store.getters.avatar, //裁剪图片的地址
autoCrop: true, // 是否默认生成截图框
autoCropWidth: 200, // 默认生成截图框宽度
autoCropHeight: 200, // 默认生成截图框高度
fixedBox: true // 固定截图框大小 不允许改变
fixedBox: true, // 固定截图框大小 不允许改变
},
previews: {}
};
previews: {},
}
},
methods: {
// 编辑头像
editCropper() {
this.open = true;
this.open = true
},
// 打开弹出层结束时的回调
modalOpened() {
this.visible = true;
this.visible = true
},
// 覆盖默认的上传行为
requestUpload() {
},
requestUpload() {},
// 向左旋转
rotateLeft() {
this.$refs.cropper.rotateLeft();
this.$refs.cropper.rotateLeft()
},
// 向右旋转
rotateRight() {
this.$refs.cropper.rotateRight();
this.$refs.cropper.rotateRight()
},
// 图片缩放
changeScale(num) {
num = num || 1;
this.$refs.cropper.changeScale(num);
num = num || 1
this.$refs.cropper.changeScale(num)
},
// 上传预处理
beforeUpload(file) {
if (file.type.indexOf("image/") == -1) {
this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
if (file.type.indexOf('image/') == -1) {
this.msgError('文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。')
} else {
const reader = new FileReader();
reader.readAsDataURL(file);
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
this.options.img = reader.result;
};
this.options.img = reader.result
}
}
},
// 上传图片
uploadImg() {
this.$refs.cropper.getCropBlob(data => {
let formData = new FormData();
formData.append("avatarfile", data);
uploadAvatar(formData).then(response => {
this.$refs.cropper.getCropBlob((data) => {
let formData = new FormData()
formData.append('avatarfile', data)
uploadAvatar(formData).then((response) => {
if (response.code === 200) {
this.open = false;
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
store.commit('SET_AVATAR', this.options.img);
this.msgSuccess("修改成功");
this.open = false
this.options.img = window.lwConfig.BASE_API + response.imgUrl
store.commit('SET_AVATAR', this.options.img)
this.msgSuccess('修改成功')
}
this.visible = false;
});
});
this.visible = false
})
})
},
// 实时预览
realTime(data) {
this.previews = data;
}
}
};
</script>
\ No newline at end of file
this.previews = data
},
},
}
</script>
<style lang="scss" scoped>
.img-circle {
border-radius: 50%;
}
.img-lg {
width: 120px;
height: 120px;
border: 1px solid #ddd;
}
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 180px;
height: 180px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
</style>
<template>
<div v-loading="loading" :style="'height:'+ height">
<iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
<div v-loading="loading" :style="'height:' + height">
<iframe :src="src" frameborder="no" style="width: 100%; height: 100%" scrolling="auto" />
</div>
</template>
<script>
export default {
name: "Swagger",
name: 'Swagger',
data() {
return {
src: process.env.VUE_APP_BASE_API + "/swagger-ui.html",
height: document.documentElement.clientHeight - 94.5 + "px;",
loading: true
};
src: window.lwConfig.BASE_API + '/swagger-ui.html',
height: document.documentElement.clientHeight - 94.5 + 'px;',
loading: true,
}
},
mounted: function() {
mounted: function () {
setTimeout(() => {
this.loading = false;
}, 230);
const that = this;
this.loading = false
}, 230)
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 94.5 + "px;";
};
}
};
that.height = document.documentElement.clientHeight - 94.5 + 'px;'
}
},
}
</script>
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
//读取npm指令 process.argv 获取⾃定义参数
let argvs = process.argv.filter((e) => e.includes('='))
for (const iterator of argvs) {
let diyArg = iterator.split('=')
process.env['VUE_APP_' + diyArg[0].slice(2)] = diyArg[1]
}
const env = require('./env')
process.env.VUE_APP_TITLE = require('./package.json').description
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
......@@ -13,11 +20,11 @@ module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.xx.cn/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.xx.cn/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.VUE_APP_BASE_URL || '/',
publicPath: env.BASE_URL || '/',
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
// assetsDir: 'static',
// 是否开启eslint保存检测,有效值:ture | false | 'error'
lintOnSave: process.env.NODE_ENV === 'development',
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
......@@ -31,30 +38,30 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
['/api']: {
target: process.env.VUE_APP_DOMAIN,
target: env.DOMAIN,
changeOrigin: true,
pathRewrite: {
['^/api']: ''
}
}
['^/api']: '',
},
},
},
disableHostCheck: true
disableHostCheck: true,
// https: true,
},
css: {
loaderOptions: {
sass: {
//依次导入的公用的scss变量,公用的scss混入,共用的默认样式
prependData: `@import "./src/styles/variables.scss";`
}
}
prependData: `@import "./src/styles/variables.scss";`,
},
},
},
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
}
'@': resolve('src'),
},
},
},
chainWebpack(config) {
// 修复HMR
......@@ -69,7 +76,7 @@ module.exports = {
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
symbolId: 'icon-[name]',
})
.end()
......@@ -78,8 +85,8 @@ module.exports = {
rel: 'preload',
// to ignore runtime.js
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}
include: 'initial',
},
])
// when there are many pages, it will cause too many meaningless requests
......@@ -92,8 +99,8 @@ module.exports = {
.use('script-ext-html-webpack-plugin', [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}
inline: /runtime\..*\.js$/,
},
])
.end()
......@@ -110,27 +117,27 @@ module.exports = {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
chunks: 'initial', // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
reuseExistingChunk: true,
},
},
})
config.optimization.runtimeChunk('single'),
{
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
to: './' //到根目录下
to: './', //到根目录下
}
})
}
},
}
const baseUrl = window.location.origin.includes('localhost')
? window.location.origin
: 'http://demo.linkwechat.cn:8090'
: 'http://demo.linkwechat.cn/prod-api'
// 'http://106.13.201.219'
// const baseUrl = window.location.origin+'/mock/11'
// const baseUrl = 'http://47.112.117.15:40001/mock/11'
......@@ -25,7 +25,7 @@ const request = (url, params, method = 'get') => {
// console.log(err.status)
alert(url + ',错误码:' + err.status)
reject(err)
}
},
})
})
}
......
......@@ -8,8 +8,8 @@ export function getUrlParam(name) {
return null
}
export function getWxCode() {
// let appid = 'wx863c031a74f589a0' // 公众号appid
let appid = 'wx8bfe6bc2ca5c45ae' // 公众号appid
let appid = 'wx863c031a74f589a0' // 公众号appid
// let appid = 'wxa57479bcd3f15461' // 公众号appid
let code = getUrlParam('code') //是否存在code
let local = window.location.origin.includes('localhost')
? 'http://h5.linkwechat.cn/test.html'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!