Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6e2066a3
authored
Aug 08, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
合并release开源部分
1 parent
95abc7ae
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
148 additions
and
80 deletions
vue3-lw-pc/src/api/common.js
vue3-lw-pc/src/layout/components/AppMain.vue
vue3-lw-pc/src/layout/components/Sidebar/index.vue
vue3-lw-pc/src/layout/components/TopBar/TopMenu.vue
vue3-lw-pc/src/router/routes.js
vue3-lw-pc/src/styles/element-ui.scss
vue3-lw-pc/src/utils/common.js
vue3-lw-pc/src/utils/request.js
vue3-lw-pc/src/api/common.js
View file @
6e2066a
// import { request } from '@/utils/request'
// import { requestOpen } from '@/utils/request'
// const { get, post, put, del: _del } = request
// const { get, post, put, del: _del } = requestOpen
// const serve = '/serve'
// /**
// /**
// * 列表
// * 列表
// * @param {*} data
// * @param {*} data
// */
// */
// export function getList(data) {
// export function getList(data) {
//
get(service + '/statistic', data
)
//
return get(`${serve}/get/${id}`
)
// }
// }
// // 详情
// // 详情
...
@@ -15,7 +17,7 @@
...
@@ -15,7 +17,7 @@
// // 删除
// // 删除
// export function del(id) {
// export function del(id) {
//
return _del(service + '/delete/' + id
)
//
return _del(`${serve}/delete/${id}`
)
// }
// }
// /**
// /**
...
@@ -24,12 +26,12 @@
...
@@ -24,12 +26,12 @@
// * @returns
// * @returns
// */
// */
// export function add(data) {
// export function add(data) {
//
return post(service + '/add'
, data)
//
return post(`${serve}/add`
, data)
// }
// }
// // 修改
// // 修改
// export function update(data) {
// export function update(data) {
//
return put(service + '/update/' + id
, data)
//
return put(`${serve}/update`
, data)
// }
// }
import
{
decryptAES
}
from
'@/utils/jsencrypt'
import
{
decryptAES
}
from
'@/utils/jsencrypt'
...
...
vue3-lw-pc/src/layout/components/AppMain.vue
View file @
6e2066a
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
</keep-alive>
</keep-alive>
</transition>
</transition>
</router-view>
</router-view>
<div
v-loading=
"loading"
class=
"micro-app-wrap h
eight
100"
v-show=
"isActiveMicroApp"
>
<div
v-loading=
"loading"
class=
"micro-app-wrap h100"
v-show=
"isActiveMicroApp"
>
<div
id=
"micro-app"
class=
"h
eight
100"
></div>
<div
id=
"micro-app"
class=
"h100"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -61,14 +61,12 @@ export default {
...
@@ -61,14 +61,12 @@ export default {
// start({
// start({
// sandbox: { experimentalStyleIsolation: true },
// sandbox: { experimentalStyleIsolation: true },
// })
// })
// // 挂在window供下面微服务使用
// // 挂在window供下面微服务使用
// window.lwConfig.$store = {
// window.lwConfig.$store = {
// dispatch: (_, s) => {
// dispatch: (_, s) => {
// this.$store.setBusininessDesc(s)
// this.$store.setBusininessDesc(s)
// },
// },
// }
// }
// // 初始化 state
// // 初始化 state
// // const actions = initGlobalState({ token: getToken() })
// // const actions = initGlobalState({ token: getToken() })
// // actions.onGlobalStateChange((state, prev) => {
// // actions.onGlobalStateChange((state, prev) => {
...
...
vue3-lw-pc/src/layout/components/Sidebar/index.vue
View file @
6e2066a
...
@@ -13,19 +13,10 @@
...
@@ -13,19 +13,10 @@
:key=
"route.path + index"
:key=
"route.path + index"
:item=
"route"
:item=
"route"
level=
"1"
level=
"1"
:base-path=
"r
oute.path
"
/>
:base-path=
"r
esolvePath(route.path)
"
/>
</el-menu>
</el-menu>
</el-scrollbar>
</el-scrollbar>
<div
class=
"serve-card"
@
click=
"$refs.serveDialog.$data.dialogVisible = true"
>
LinkWeChat
<br
/>
官方服务包
<br
/>
正式上线啦!
</div>
<ServeDialog
ref=
"serveDialog"
/>
<div
class=
"card"
>
<div
class=
"card"
>
<el-tooltip
content=
"文档手册"
effect=
"dark"
placement=
"top"
>
<el-tooltip
content=
"文档手册"
effect=
"dark"
placement=
"top"
>
<div
class=
"card-item"
>
<div
class=
"card-item"
>
...
@@ -79,14 +70,15 @@
...
@@ -79,14 +70,15 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
path
from
'path-browserify'
import
{
mapState
}
from
'pinia'
import
{
mapState
}
from
'pinia'
import
stores
from
'@/stores'
import
stores
from
'@/stores'
import
SidebarItem
from
'./SidebarItem'
import
SidebarItem
from
'./SidebarItem'
import
ServeDialog
from
'./ServeDialog'
//
import ServeDialog from './ServeDialog'
export
default
{
export
default
{
components
:
{
SidebarItem
,
ServeDialog
},
components
:
{
SidebarItem
},
computed
:
{
computed
:
{
// ...mapState(['settings']),
// ...mapState(['settings']),
...
mapState
(
stores
,
[
'permission_routes'
,
'sidebarRouters'
,
'sidebar'
]),
...
mapState
(
stores
,
[
'permission_routes'
,
'sidebarRouters'
,
'sidebar'
]),
...
@@ -115,6 +107,9 @@ export default {
...
@@ -115,6 +107,9 @@ export default {
goto
(
url
)
{
goto
(
url
)
{
window
.
open
(
url
)
window
.
open
(
url
)
},
},
resolvePath
(
pathStr
)
{
return
path
.
resolve
(
this
.
sidebarRouters
.
parentRoute
.
path
,
pathStr
)
},
},
},
}
}
</
script
>
</
script
>
...
...
vue3-lw-pc/src/layout/components/TopBar/TopMenu.vue
View file @
6e2066a
...
@@ -23,7 +23,7 @@ export default {
...
@@ -23,7 +23,7 @@ export default {
// 顶部显示菜单
// 顶部显示菜单
topMenus
()
{
topMenus
()
{
let
topMenus
=
[]
let
topMenus
=
[]
this
.
r
outers
.
map
((
menu
)
=>
{
this
.
topbarR
outers
.
map
((
menu
)
=>
{
if
(
menu
.
hidden
!==
true
)
{
if
(
menu
.
hidden
!==
true
)
{
// 兼容顶部栏一级菜单内部跳转 (you bug)
// 兼容顶部栏一级菜单内部跳转 (you bug)
// if (menu.path === '/') {
// if (menu.path === '/') {
...
@@ -35,8 +35,8 @@ export default {
...
@@ -35,8 +35,8 @@ export default {
})
})
return
topMenus
return
topMenus
},
},
r
outers
()
{
topbarR
outers
()
{
console
.
log
(
this
.
$store
.
permission
.
topbarRouters
)
//
console.log(this.$store.permission.topbarRouters)
return
this
.
$store
.
permission
.
topbarRouters
return
this
.
$store
.
permission
.
topbarRouters
},
},
// 激活的/高亮的一级菜单路径 eg:/drainageCode
// 激活的/高亮的一级菜单路径 eg:/drainageCode
...
@@ -93,10 +93,11 @@ export default {
...
@@ -93,10 +93,11 @@ export default {
},
},
// 当前激活的侧边栏菜单
// 当前激活的侧边栏菜单
activeRoutes
(
path
)
{
activeRoutes
(
path
)
{
let
activeRoute
=
this
.
r
outers
.
find
((
e
)
=>
e
.
path
==
path
)
let
activeRoute
=
this
.
topbarR
outers
.
find
((
e
)
=>
e
.
path
==
path
)
let
routes
=
(
activeRoute
&&
activeRoute
.
children
)
||
[]
let
routes
=
(
activeRoute
&&
activeRoute
.
children
)
||
[]
if
(
routes
.
length
>
0
)
{
if
(
routes
.
length
>
0
)
{
this
.
$store
.
permission
.
sidebarRouters
=
routes
this
.
$store
.
permission
.
sidebarRouters
=
routes
this
.
$store
.
permission
.
sidebarRouters
.
parentRoute
=
activeRoute
}
}
return
routes
return
routes
},
},
...
...
vue3-lw-pc/src/router/routes.js
View file @
6e2066a
/* Layout */
/* Layout */
import
{
RouterView
}
from
'vue-router'
import
{
h
}
from
'vue'
import
Layout
from
'@/layout/index.vue'
import
Layout
from
'@/layout/index.vue'
import
visitor
from
'@/layout/visitor.vue'
import
visitor
from
'@/layout/visitor.vue'
const
routerView
=
{
render
:
()
=>
h
(
RouterView
),
}
/**
/**
* Note: 路由配置项
* Note: 路由配置项
*
*
...
@@ -52,41 +56,98 @@ export let fixedRoutes = [
...
@@ -52,41 +56,98 @@ export let fixedRoutes = [
// },
// },
// ],
// ],
// },
// },
// {
// path: '/drainageCode/customerService',
// component: Layout,
// hidden: true,
// meta: {
// title: '客服管理',
// },
// children: [
// {
// path: 'add',
// name: 'service-add',
// component: () => import('@/views/customerService/customerServiceManage/add'),
// meta: {
// title: '新建客服',
// activeMenu: '/drainageCode/customerService/index',
// breadcrumb: true,
// },
// },
// {
// path: 'detail',
// name: 'service-add-detail',
// component: () => import('@/views/customerService/customerServiceManage/detail'),
// meta: {
// title: '客服详情',
// activeMenu: '/drainageCode/customerService/index',
// breadcrumb: true,
// },
// },
// ],
// },
]
]
// 开发环境路由,总后台配置完菜单务必删除或注释,只在开发环境生效
// 开发环境路由,总后台配置完菜单务必删除或注释,只在开发环境生效
if
(
process
.
env
.
VUE_APP_ENV
===
'development'
)
{
if
(
process
.
env
.
NODE_ENV
===
'development'
||
process
.
env
.
VUE_APP_ENV
===
'development'
)
{
fixedRoutes
=
fixedRoutes
.
concat
()
let
devRoutes
=
[
{
path
:
'/dev'
,
component
:
Layout
,
redirect
:
'/dev/saleInsight'
,
meta
:
{
title
:
'开发菜单'
,
},
children
:
[
// {
// path: '/dev/saleInsight',
// component: routerView,
// redirect: '/dev/saleInsight/clueAnalysis',
// meta: {
// title: '销售洞察',
// },
// children: [
// {
// path: 'clueAnalysis',
// component: () => import('@/views/clue/clueAnalysis/index'),
// meta: {
// title: '线索分析',
// },
// },
// ],
// },
// {
// path: '/dev/privateIncubation',
// component: routerView,
// meta: {
// title: '私域孵化',
// },
// children: [
// {
// path: 'clueHighseas',
// component: routerView,
// redirect: '/dev/privateIncubation/clueHighseas/index',
// meta: {
// title: '线索公海',
// },
// children: [
// {
// path: 'index',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/index'),
// meta: {
// title: '',
// },
// },
// {
// path: 'addEdit',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/addEdit'),
// meta: {
// title: '新建公海',
// },
// },
// {
// path: 'highseasStatistics',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/highseasStatistics'),
// meta: {
// title: '公海统计',
// },
// },
// {
// path: 'clueDetail',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/clueDetail'),
// meta: {
// title: '客户详情',
// },
// },
// ],
// },
// {
// path: 'clueTemplate',
// component: () => import('@/views/clue/clueTemplate/index'),
// meta: {
// title: '线索模板',
// },
// },
// ],
// },
],
},
]
fixedRoutes
=
fixedRoutes
.
concat
(
devRoutes
)
}
}
// 公共路由
// 公共路由
...
...
vue3-lw-pc/src/styles/element-ui.scss
View file @
6e2066a
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
// color: var(--font-white, #fff);
// color: var(--font-white, #fff);
// }
// }
// }
// }
.el-button
{
.el-button
:not
(
.el-button--small
,
.el-button--large
)
{
padding
:
9px
19px
;
padding
:
9px
19px
;
}
}
.el-button
:not
(
.is-text
)
{
.el-button
:not
(
.is-text
)
{
...
@@ -292,6 +292,7 @@
...
@@ -292,6 +292,7 @@
.el-form-item
.el-form-item
{
.el-form-item
.el-form-item
{
margin-bottom
:
18px
;
margin-bottom
:
18px
;
}
}
.el-form-item__content
{
.el-form-item__content
{
display
:
block
;
display
:
block
;
}
}
...
@@ -320,6 +321,11 @@
...
@@ -320,6 +321,11 @@
.el-input-number
{
.el-input-number
{
width
:
100%
;
width
:
100%
;
}
}
// 会导致提示信息被滚动隐藏
// .el-form-item:last-child {
// margin-bottom: 0;
// }
}
}
// 重置el-form-item hover样式
// 重置el-form-item hover样式
.no-hover-form
.el-form-item
{
.no-hover-form
.el-form-item
{
...
...
vue3-lw-pc/src/utils/common.js
View file @
6e2066a
...
@@ -98,24 +98,26 @@ export function selectDictLabels(datas, value, separator) {
...
@@ -98,24 +98,26 @@ export function selectDictLabels(datas, value, separator) {
/**
/**
* 下载bolb文件
* 下载bolb文件
* @param {*} blob bolo源数据
* @param {*} blob bolo源数据
必需
* @param {*} type 文件类型
* @param {*} type 文件类型
必需
* @param {*} downloadName 下载文件名,需含文件后缀名
* @param {*} downloadName 下载文件名,需含文件后缀名
可选
*/
*/
export
function
downloadBlob
(
blob
,
type
,
downloadName
)
{
export
function
downloadBlob
(
blob
,
downloadName
,
type
)
{
const
typeDict
=
{
if
(
blob
&&
downloadName
)
{
excel
:
'application/vnd.ms-excel'
,
const
typeDict
=
{
zip
:
'application/zip'
,
excel
:
'application/vnd.ms-excel'
,
image
:
'application/image'
,
zip
:
'application/zip'
,
image
:
'application/image'
,
}
type
&&
(
blob
=
new
Blob
([
blob
],
{
type
:
typeDict
[
type
]
||
type
}))
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
const
a
=
document
.
createElement
(
'a'
)
// 创建a标签
a
.
href
=
url
a
.
download
=
dateFormat
(
new
Date
(),
'YYYY-MM-DD HH-mm-ss-'
)
+
downloadName
// 下载文件名,不能包含英文 : 冒号
a
.
click
()
a
.
remove
()
URL
.
revokeObjectURL
(
url
)
// 释放内存
}
}
blob
=
new
Blob
([
blob
],
{
type
:
typeDict
[
type
]
||
type
})
let
url
=
window
.
URL
.
createObjectURL
(
blob
)
const
a
=
document
.
createElement
(
'a'
)
// 创建a标签
a
.
href
=
url
a
.
download
=
dateFormat
(
new
Date
(),
'YYYY-MM-DD HH:mm:ss-'
)
+
downloadName
// 下载文件名,不能包含英文 : 冒号
a
.
click
()
a
.
remove
()
URL
.
revokeObjectURL
(
url
)
// 释放内存
}
}
// 通用下载方法 系统内部
// 通用下载方法 系统内部
...
...
vue3-lw-pc/src/utils/request.js
View file @
6e2066a
...
@@ -8,10 +8,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
...
@@ -8,10 +8,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// setToken('eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRfaWQiOjI2LCJ1c2VyX3R5cGUiOiI1IiwidXNlcl9pZCI6MjU5LCJ3ZUFwcFNlY3JldCI6IjY0YjRjNWRiMzg3MjA2Nzc2ZDRmYWJlMjEwNWMwNTc1IiwibG9naW5fdHlwZSI6IkxpbmtXZUNoYXRBUEkiLCJ1c2VyX25hbWUiOiLlp5zpuY_lh68iLCJ1c2VyX2tleSI6ImRmNTdmYzY4LWI2ZTYtNDVmNS04N2UzLWY4YzA5ZTZiNzFiOSIsIndlQXBwSWQiOiJ3eDg2M2MwMzFhNzRmNTg5YTAiLCJjb3JwX25hbWUiOiLku5_lvq7np5HmioAiLCJjb3JwX2lkIjoid3c2MjJmYzg1MmY3OWMzZjEzIn0.X5To1L7fJRBEIxmP6Dvp2XTpvWHwz8Ey6ODAeyk_owlFj_JywVjfpodDk0B7bGjRXE16nNpab0L9f3eF_-WGPQ')
// setToken('eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRfaWQiOjI2LCJ1c2VyX3R5cGUiOiI1IiwidXNlcl9pZCI6MjU5LCJ3ZUFwcFNlY3JldCI6IjY0YjRjNWRiMzg3MjA2Nzc2ZDRmYWJlMjEwNWMwNTc1IiwibG9naW5fdHlwZSI6IkxpbmtXZUNoYXRBUEkiLCJ1c2VyX25hbWUiOiLlp5zpuY_lh68iLCJ1c2VyX2tleSI6ImRmNTdmYzY4LWI2ZTYtNDVmNS04N2UzLWY4YzA5ZTZiNzFiOSIsIndlQXBwSWQiOiJ3eDg2M2MwMzFhNzRmNTg5YTAiLCJjb3JwX25hbWUiOiLku5_lvq7np5HmioAiLCJjb3JwX2lkIjoid3c2MjJmYzg1MmY3OWMzZjEzIn0.X5To1L7fJRBEIxmP6Dvp2XTpvWHwz8Ey6ODAeyk_owlFj_JywVjfpodDk0B7bGjRXE16nNpab0L9f3eF_-WGPQ')
// 创建axios实例
// 创建axios实例
function
requestFactory
(
baseURL
)
{
function
requestFactory
(
getway
=
''
)
{
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
// axios中请求配置有baseURL选项,表示请求URL公共部分
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL
:
process
.
env
.
NODE_ENV
===
'development'
?
'/api'
:
baseURL
,
baseURL
:
(
process
.
env
.
NODE_ENV
===
'development'
?
'/api'
:
window
.
lwConfig
.
BASE_API
)
+
getway
,
// 超时
// 超时
timeout
:
100000
,
timeout
:
100000
,
})
})
...
@@ -112,7 +112,7 @@ function requestFactory(baseURL) {
...
@@ -112,7 +112,7 @@ function requestFactory(baseURL) {
return
put
(
url
,
data
,
config
)
return
put
(
url
,
data
,
config
)
}
}
let
del
=
service
.
del
let
del
=
service
.
del
ete
service
.
del
=
(
url
,
params
,
config
=
{})
=>
{
service
.
del
=
(
url
,
params
,
config
=
{})
=>
{
return
del
(
url
,
{
params
,
...
config
})
return
del
(
url
,
{
params
,
...
config
})
}
}
...
@@ -120,4 +120,7 @@ function requestFactory(baseURL) {
...
@@ -120,4 +120,7 @@ function requestFactory(baseURL) {
return
service
return
service
}
}
export
default
requestFactory
(
window
.
lwConfig
.
BASE_API
)
// 创建常用网关接口请求
export
const
requestOpen
=
requestFactory
(
window
.
lwConfig
.
services
.
wecom
)
export
default
requestFactory
()
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment