Commit 10d1993a by 姜鹏凯

Merge branch 'v2.5.x'

2 parents afcafc9a 30b21cf2
Showing 40 changed files with 242 additions and 231 deletions
# 开发环境配置
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',
// }
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>
......
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
}, },
function(res) { function(res) {
if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(res.err_msg) < 0) { if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(res.err_msg) < 0) {
_this.$dialog({ message: 'sendChatMessage失败:' + JSON.stringify(res) }) _this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
} }
_this.$toast.clear() _this.$toast.clear()
} }
......
...@@ -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')
}) })
} },
} }
...@@ -3,9 +3,9 @@ const envs = { ...@@ -3,9 +3,9 @@ const envs = {
development: { development: {
DOMAIN: 'http://demo.linkwechat.cn', DOMAIN: 'http://demo.linkwechat.cn',
BASE_URL: '/', // 路由基础路径 BASE_URL: '/', // 路由基础路径
BASE_API: 'http://demo.linkwechat.cn/dev-api', BASE_API: 'http://demo.linkwechat.cn/prod-api',
SYSTEM_API: '/dev-api', SYSTEM_API: '/prod-api',
KF_API: '/dev-kf', KF_API: '/prod-kf',
}, },
test: { test: {
DOMAIN: 'http://demo.linkwechat.cn', DOMAIN: 'http://demo.linkwechat.cn',
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
// // SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM', // // SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM',
// // COMPANY_NAME: '仟微科技', // // COMPANY_NAME: '仟微科技',
// // COMPANY_NAME_ALL: '仟微科技', // // COMPANY_NAME_ALL: '仟微科技',
// // LOGO_DARK_URL: 'http://demo.linkwechat.cn/public/LOGO_DARK_URL.png', // // LOGO_DARK: '/static/LOGO_DARK.png',
// // LOGO_LIGHT_URL: 'http://demo.linkwechat.cn/public/LOGO_LIGHT_URL.png', // // LOGO_LIGHT: '/static/LOGO_LIGHT.png',
// // LOGO_TEXT_DARK_URL: 'http://demo.linkwechat.cn/public/LOGO_TEXT_DARK_URL.png', // // LOGO_TEXT_DARK: '/static/LOGO_TEXT_DARK.png',
// // LOGO_TEXT_LIGHT_URL: 'http://demo.linkwechat.cn/public/LOGO_TEXT_LIGHT_URL.png', // // LOGO_TEXT_LIGHT: '/static/LOGO_TEXT_LIGHT.png',
// // POST_QRCODE: '/static/POST_QRCODE.png',
// // COPYRIGHT: 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.', // // COPYRIGHT: 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.',
// // DOMAIN: 'http://demo.linkwechat.cn', // // DOMAIN: 'http://demo.linkwechat.cn',
// // BASE_URL: '/', // 路由基础路径 // // BASE_URL: '/', // 路由基础路径
......
<script> <script>
import { getTree, getList } from '@/api/organization' import { getTree, getList } from '@/api/organization'
import { createUniqueString } from '@/utils' import { createUniqueString } from '@/utils'
export default { export default {
name: 'SelectUser', name: 'SelectUser',
components: {}, components: {},
props: { props: {
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
// 必须含有userId和name属性 // 必须含有userId和name属性
validator(val) { validator (val) {
return val.every((e) => e.userId && e.name) return val.every((e) => e.userId && e.name)
}, },
}, },
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
destroyOnClose: Boolean, destroyOnClose: Boolean,
}, },
data() { data () {
return { return {
treeData: [], treeData: [],
userList: [], userList: [],
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
} }
}, },
watch: { watch: {
defaultValues(value) { defaultValues (value) {
const checkedUserList = [] const checkedUserList = []
if (!Array.isArray(value) || value.length == 0) { if (!Array.isArray(value) || value.length == 0) {
this.userList = [] this.userList = []
...@@ -62,42 +62,48 @@ export default { ...@@ -62,42 +62,48 @@ export default {
this.userList = checkedUserList this.userList = checkedUserList
} }
}, },
Pvisible(val) { Pvisible (val) {
val && val &&
this.$refs.tree && this.$refs.tree &&
this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.userId || e.id)) this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.userId || e.id))
if (this.$refs.tree) {
setTimeout(() => {
this.$refs.tree &&
this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.userId || e.id))
}, 300);
}
}, },
}, },
computed: { computed: {
Pvisible: { Pvisible: {
get() { get () {
return this.visible return this.visible
}, },
set(val) { set (val) {
this.$emit('update:visible', val) this.$emit('update:visible', val)
}, },
}, },
defaultProps() { defaultProps () {
let that = this let that = this
return { return {
label: 'name', label: 'name',
children: 'children', children: 'children',
disabled(data, node) { disabled (data, node) {
return ( return (
(that.isOnlyLeaf && data.isParty) || (that.isOnlyLeaf && data.isParty) ||
that.disabledValues.some((e) => e == (data.userId || data.id)) that.disabledValues.some((e) => e == (data.userId || data.id))
) )
}, },
isLeaf(data, node) { isLeaf (data, node) {
return !data.id return !data.id
}, },
} }
}, },
}, },
created() {}, created () { },
mounted() {}, mounted () { },
methods: { methods: {
treeFormat(list) { treeFormat (list) {
let dealOptions = [] let dealOptions = []
list.forEach((one) => { list.forEach((one) => {
let findIndex = list.findIndex((item) => { let findIndex = list.findIndex((item) => {
...@@ -116,7 +122,7 @@ export default { ...@@ -116,7 +122,7 @@ export default {
}) })
return dealOptions return dealOptions
}, },
loadNode(node, resolve) { loadNode (node, resolve) {
if (node.level === 0) { if (node.level === 0) {
if (!Array.isArray(this.defaultValues) || this.defaultValues.length == 0) { if (!Array.isArray(this.defaultValues) || this.defaultValues.length == 0) {
this.userList = [] this.userList = []
...@@ -139,10 +145,11 @@ export default { ...@@ -139,10 +145,11 @@ export default {
// }) // })
node.data.children && rows.push(...node.data.children) node.data.children && rows.push(...node.data.children)
resolve(rows) resolve(rows)
this.$refs.tree.setCheckedKeys(this.userList.map((e) => e.userId || e.id))
}) })
} }
}, },
handleTree(data) { handleTree (data) {
return data.map((i) => { return data.map((i) => {
if (i.id) { if (i.id) {
i.userId = i.id i.userId = i.id
...@@ -152,7 +159,7 @@ export default { ...@@ -152,7 +159,7 @@ export default {
}) })
}, },
// 选择变化 // 选择变化
handleCheckChange(data, checked, indeterminate) { handleCheckChange (data, checked, indeterminate) {
// console.log(arguments) // console.log(arguments)
if (checked) { if (checked) {
if (this.isSigleSelect) { if (this.isSigleSelect) {
...@@ -175,7 +182,7 @@ export default { ...@@ -175,7 +182,7 @@ export default {
// console.log(data, checked, indeterminate); // console.log(data, checked, indeterminate);
this.userList = this.unique(this.userList) this.userList = this.unique(this.userList)
}, },
unique(arr) { unique (arr) {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
for (var j = i + 1; j < arr.length; j++) { for (var j = i + 1; j < arr.length; j++) {
if (arr[i].userId.split('_')[0] == arr[j].userId.split('_')[0]) { if (arr[i].userId.split('_')[0] == arr[j].userId.split('_')[0]) {
...@@ -187,12 +194,12 @@ export default { ...@@ -187,12 +194,12 @@ export default {
return arr return arr
}, },
// 确 定 // 确 定
submit() { submit () {
this.Pvisible = false this.Pvisible = false
this.$emit('success', [...this.userList]) this.$emit('success', [...this.userList])
}, },
// 取消选择 // 取消选择
cancle(key) { cancle (key) {
this.$refs.tree.setChecked(key, false) this.$refs.tree.setChecked(key, false)
let index = this.userList.findIndex((i) => i.userId === key) let index = this.userList.findIndex((i) => i.userId === key)
index > -1 && this.userList.splice(index, 1) index > -1 && this.userList.splice(index, 1)
...@@ -200,31 +207,14 @@ export default { ...@@ -200,31 +207,14 @@ export default {
order > -1 && this.defaultValues.slice().splice(order, 1) order > -1 && this.defaultValues.slice().splice(order, 1)
}, },
}, },
} }
</script> </script>
<template> <template>
<el-dialog <el-dialog :title="title" :visible.sync="Pvisible" :close-on-click-modal="false" :destroy-on-close="destroyOnClose">
:title="title"
:visible.sync="Pvisible"
:close-on-click-modal="false"
:destroy-on-close="destroyOnClose"
>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12" :xs="24"> <el-col :span="12" :xs="24">
<div class="head-container"> <div class="head-container">
<el-tree <el-tree node-key="userId" ref="tree" lazy accordion show-checkbox :check-on-click-node="false" :expand-on-click-node="true" :load="loadNode" :props="defaultProps" :check-strictly="isOnlyLeaf" @check-change="handleCheckChange"></el-tree>
node-key="userId"
ref="tree"
lazy
accordion
show-checkbox
:check-on-click-node="false"
:expand-on-click-node="true"
:load="loadNode"
:props="defaultProps"
:check-strictly="isOnlyLeaf"
@check-change="handleCheckChange"
></el-tree>
<!-- :default-checked-keys=" <!-- :default-checked-keys="
defaultValues.map((e) => (isOnlyLeaf ? e.userId : e.userId || e.id)) defaultValues.map((e) => (isOnlyLeaf ? e.userId : e.userId || e.id))
" --> " -->
...@@ -247,9 +237,9 @@ export default { ...@@ -247,9 +237,9 @@ export default {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.user-list { .user-list {
.el-row { .el-row {
line-height: 26px; line-height: 26px;
} }
} }
</style> </style>
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import LOGO_TEXT_LIGHT_URL from '@/assets/logo/logo.png'
import env from '../env' import env from '../env'
// 系统常量 // 系统常量
const common = { const common = {
...@@ -7,10 +6,13 @@ const common = { ...@@ -7,10 +6,13 @@ const common = {
SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM', SYSTEM_NAME_ALL: 'LinkWechat 企业微信SCRM',
COMPANY_NAME: '仟微科技', COMPANY_NAME: '仟微科技',
COMPANY_NAME_ALL: '仟微科技', COMPANY_NAME_ALL: '仟微科技',
// LOGO_DARK_URL: 'http://demo.linkwechat.cn/public/LOGO_DARK_URL.png', // LOGO_DARK: env.BASE_URL + 'static/LOGO_DARK.png',
// LOGO_LIGHT_URL: 'http://demo.linkwechat.cn/public/LOGO_LIGHT_URL.png', // LOGO_LIGHT: env.BASE_URL + 'static/LOGO_LIGHT.png',
// LOGO_TEXT_DARK_URL: 'http://demo.linkwechat.cn/public/LOGO_TEXT_DARK_URL.png', // LOGO_TEXT_DARK: env.BASE_URL + 'static/LOGO_TEXT_DARK.png',
LOGO_TEXT_LIGHT_URL, 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.', COPYRIGHT: 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.',
IS_PUBLISH_DIALOG: true, // 是否显示发布弹窗 IS_PUBLISH_DIALOG: true, // 是否显示发布弹窗
} }
......
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
data() { data() {
return { return {
title: process.env.VUE_APP_TITLE, title: process.env.VUE_APP_TITLE,
logo: this.lwConfig.LOGO_TEXT_LIGHT_URL, logo: this.lwConfig.LOGO_TEXT_LIGHT,
} }
}, },
} }
......
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
<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>
...@@ -166,24 +166,22 @@ export default { ...@@ -166,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;
} }
} }
} }
......
...@@ -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>
......
...@@ -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;
......
...@@ -14,24 +14,24 @@ ...@@ -14,24 +14,24 @@
</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>
...@@ -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://scrm.xxzhtc.cn/public/qrCode.png',
(img) => {
img.set(options) img.set(options)
// img.scale(this.canvas.width / img.width / 2) // img.scale(this.canvas.width / img.width / 2)
img.scaleToWidth(200) img.scaleToWidth(200)
this.canvas.add(img).setActiveObject(img) this.canvas.add(img).setActiveObject(img)
} })
)
break break
default: default:
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
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"
...@@ -89,6 +90,7 @@ export default { ...@@ -89,6 +90,7 @@ export default {
// 弹出层标题 // 弹出层标题
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, // 默认生成截图框宽度
...@@ -157,3 +159,26 @@ export default { ...@@ -157,3 +159,26 @@ export default {
}, },
} }
</script> </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>
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
}, },
data() { data() {
return { return {
logo: this.lwConfig.LOGO_TEXT_LIGHT_URL, logo: this.lwConfig.LOGO_TEXT_LIGHT,
idGlobal: 100, idGlobal: 100,
formConf, formConf,
inputComponents, inputComponents,
......
...@@ -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!