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