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 12843a42
authored
Oct 22, 2020
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
部分菜单配置
1 parent
df539710
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
198 additions
and
169 deletions
linkwe-ui/src/layout/components/Sidebar/SidebarItem.vue
linkwe-ui/src/main.js
linkwe-ui/src/router/index.js
linkwe-ui/src/store/modules/permission.js
linkwe-ui/src/styles/common.scss
linkwe-ui/src/styles/element-ui.scss
linkwe-ui/src/utils/request.js
linkwe-ui/src/views/contacts/organization.vue
linkwe-ui/src/layout/components/Sidebar/SidebarItem.vue
View file @
12843a4
<
template
>
<
template
>
<div
v-if=
"!item.hidden"
>
<div
v-if=
"!item.hidden"
>
<template
v-if=
"hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"
>
<template
v-if=
"hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"
>
<app-link
v-if=
"onlyOneChild.meta"
:to=
"resolvePath(onlyOneChild.path)"
>
<app-link
v-if=
"onlyOneChild.meta"
:to=
"resolvePath(onlyOneChild.path)"
>
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<el-menu-item
<item
:icon=
"onlyOneChild.meta.icon||(item.meta&&item.meta.icon)"
:title=
"onlyOneChild.meta.title"
/>
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{'submenu-title-noDropdown':!isNest}"
>
<item
:icon=
"onlyOneChild.meta.icon||(item.meta&&item.meta.icon)"
:title=
"onlyOneChild.meta.title"
/>
</el-menu-item>
</el-menu-item>
</app-link>
</app-link>
</
template
>
</
template
>
...
@@ -25,69 +33,72 @@
...
@@ -25,69 +33,72 @@
</template>
</template>
<
script
>
<
script
>
import
path
from
'path'
import
path
from
"path"
;
import
{
isExternal
}
from
'@/utils/validate'
import
{
isExternal
}
from
"@/utils/validate"
;
import
Item
from
'./Item'
import
Item
from
"./Item"
;
import
AppLink
from
'./Link'
import
AppLink
from
"./Link"
;
import
FixiOSBug
from
'./FixiOSBug'
import
FixiOSBug
from
"./FixiOSBug"
;
export
default
{
export
default
{
name
:
'SidebarItem'
,
name
:
"SidebarItem"
,
components
:
{
Item
,
AppLink
},
components
:
{
Item
,
AppLink
},
mixins
:
[
FixiOSBug
],
mixins
:
[
FixiOSBug
],
props
:
{
props
:
{
// route object
// route object
item
:
{
item
:
{
type
:
Object
,
type
:
Object
,
required
:
true
required
:
true
,
},
},
isNest
:
{
isNest
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
basePath
:
{
basePath
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
""
,
}
}
,
},
},
data
()
{
data
()
{
this
.
onlyOneChild
=
null
this
.
onlyOneChild
=
null
;
return
{}
return
{}
;
},
},
methods
:
{
methods
:
{
hasOneShowingChild
(
children
=
[],
parent
)
{
hasOneShowingChild
(
children
=
[],
parent
)
{
const
showingChildren
=
children
.
filter
(
item
=>
{
const
showingChildren
=
children
.
filter
(
(
item
)
=>
{
if
(
item
.
hidden
)
{
if
(
item
.
hidden
)
{
return
false
return
false
;
}
else
{
}
else
{
// Temp set(will be used if only has one showing child)
// Temp set(will be used if only has one showing child)
this
.
onlyOneChild
=
item
this
.
onlyOneChild
=
item
;
return
true
return
true
;
}
}
})
})
;
// When there is only one child router, the child router is displayed by default
// When there is only one child router, the child router is displayed by default
if
(
showingChildren
.
length
===
1
)
{
if
(
showingChildren
.
length
===
1
)
{
return
true
return
true
;
}
}
// Show parent if there are no child router to display
// Show parent if there are no child router to display
if
(
showingChildren
.
length
===
0
)
{
if
(
showingChildren
.
length
===
0
)
{
this
.
onlyOneChild
=
{
...
parent
,
path
:
''
,
noShowingChildren
:
true
}
this
.
onlyOneChild
=
{
...
parent
,
path
:
""
,
noShowingChildren
:
true
};
return
true
return
true
;
}
}
return
false
return
false
;
},
},
resolvePath
(
routePath
)
{
resolvePath
(
routePath
)
{
if
(
isExternal
(
routePath
))
{
if
(
isExternal
(
routePath
))
{
return
routePath
return
routePath
;
}
}
if
(
isExternal
(
this
.
basePath
))
{
if
(
isExternal
(
this
.
basePath
))
{
return
this
.
basePath
return
this
.
basePath
;
}
if
(
/^
\/
/
.
test
(
routePath
))
{
return
routePath
;
}
}
return
path
.
resolve
(
this
.
basePath
,
routePath
)
return
path
.
resolve
(
this
.
basePath
,
routePath
)
;
}
}
,
}
}
,
}
}
;
</
script
>
</
script
>
linkwe-ui/src/main.js
View file @
12843a4
...
@@ -7,7 +7,10 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets
...
@@ -7,7 +7,10 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import
Element
from
'element-ui'
import
Element
from
'element-ui'
import
'./styles/element-variables.scss'
import
'./styles/element-variables.scss'
Vue
.
use
(
Element
,
{
size
:
'small'
});
Vue
.
use
(
Element
,
{
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
...
@@ -18,6 +21,8 @@ import permission from './directive/permission'
...
@@ -18,6 +21,8 @@ import permission from './directive/permission'
import
'./assets/icons'
// icon
import
'./assets/icons'
// icon
import
'./permission'
// permission control
import
'./permission'
// permission control
import
{
getDicts
}
from
"@/api/system/dict/data"
;
import
{
getConfigKey
}
from
"@/api/system/config"
;
import
{
parseTime
,
resetForm
,
addDateRange
,
selectDictLabel
,
selectDictLabels
,
download
,
handleTree
}
from
"@/utils/common"
;
import
{
parseTime
,
resetForm
,
addDateRange
,
selectDictLabel
,
selectDictLabels
,
download
,
handleTree
}
from
"@/utils/common"
;
import
Pagination
from
"@/components/Pagination"
;
import
Pagination
from
"@/components/Pagination"
;
//自定义表格工具扩展
//自定义表格工具扩展
...
@@ -26,6 +31,8 @@ import config from '@/config'
...
@@ -26,6 +31,8 @@ import config from '@/config'
// 全局方法挂载
// 全局方法挂载
window
.
config
=
config
window
.
config
=
config
Vue
.
prototype
.
getDicts
=
getDicts
Vue
.
prototype
.
getConfigKey
=
getConfigKey
Vue
.
prototype
.
parseTime
=
parseTime
Vue
.
prototype
.
parseTime
=
parseTime
Vue
.
prototype
.
resetForm
=
resetForm
Vue
.
prototype
.
resetForm
=
resetForm
Vue
.
prototype
.
addDateRange
=
addDateRange
Vue
.
prototype
.
addDateRange
=
addDateRange
...
@@ -61,10 +68,6 @@ Vue.use(permission)
...
@@ -61,10 +68,6 @@ Vue.use(permission)
* please remove it before going online! ! !
* please remove it before going online! ! !
*/
*/
Vue
.
use
(
Element
,
{
size
:
Cookies
.
get
(
'size'
)
||
'medium'
// set element-ui default size
})
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
new
Vue
({
new
Vue
({
...
...
linkwe-ui/src/router/index.js
View file @
12843a4
...
@@ -55,44 +55,50 @@ export const constantRoutes = [
...
@@ -55,44 +55,50 @@ export const constantRoutes = [
component
:
(
resolve
)
=>
require
([
'@/views/login'
],
resolve
),
component
:
(
resolve
)
=>
require
([
'@/views/login'
],
resolve
),
hidden
:
true
hidden
:
true
},
},
{
// {
path
:
'/customerManage'
,
// path: '/customerManage',
component
:
Layout
,
// component: Layout,
redirect
:
'/customerManage/customer'
,
// redirect: '/customerManage/customer',
meta
:
{
title
:
'客户管理'
,
icon
:
'user'
},
// meta: { title: '客户管理', icon: 'user' },
children
:
[
// children: [
{
// {
path
:
'customer'
,
// path: 'customer',
name
:
'Customer'
,
// name: 'Customer',
component
:
(
resolve
)
=>
require
([
'@/views/customerManage/customer'
],
resolve
),
// component: (resolve) => require(['@/views/customerManage/customer'], resolve),
meta
:
{
title
:
'客户'
,
icon
:
''
}
// meta: { title: '客户', icon: '' }
},
// },
{
// {
path
:
'group'
,
// path: 'customerDetail',
name
:
'CustomerGroup'
,
// hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/customerManage/group'
],
resolve
),
// component: (resolve) => require(['@/views/customerManage/customerDetail'], resolve),
meta
:
{
title
:
'客户群'
,
icon
:
''
}
// meta: { hidden: true, title: '客户', icon: '', activeMenu: '/customerManage/customer' }
},
// },
{
// {
path
:
'groupDetail'
,
// path: 'group',
hidden
:
true
,
// name: 'CustomerGroup',
component
:
(
resolve
)
=>
require
([
'@/views/customerManage/groupDetail'
],
resolve
),
// component: (resolve) => require(['@/views/customerManage/group'], resolve),
meta
:
{
hidden
:
true
,
title
:
'客户群'
,
icon
:
''
,
activeMenu
:
'/customerManage/group'
}
// meta: { title: '客户群', icon: '' }
},
// },
{
// {
path
:
'tag'
,
// path: 'groupDetail',
name
:
'CustomerTag'
,
// hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/customerManage/tag'
],
resolve
),
// component: (resolve) => require(['@/views/customerManage/groupDetail'], resolve),
meta
:
{
title
:
'客户标签'
,
icon
:
''
}
// meta: { hidden: true, title: '客户群', icon: '', activeMenu: '/customerManage/group' }
},
// },
{
// {
path
:
'dimission'
,
// path: 'tag',
name
:
'Dimission'
,
// name: 'CustomerTag',
component
:
(
resolve
)
=>
require
([
'@/views/customerManage/dimission'
],
resolve
),
// component: (resolve) => require(['@/views/customerManage/tag'], resolve),
meta
:
{
title
:
'离职继承'
,
icon
:
''
}
// meta: { title: '客户标签', icon: '' }
},
// },
]
// {
},
// path: 'dimission',
// name: 'Dimission',
// component: (resolve) => require(['@/views/customerManage/dimission'], resolve),
// meta: { title: '离职继承', icon: '' }
// },
// ]
// },
// {
// {
// path: '/groupMessage',
// path: '/groupMessage',
// component: Layout,
// component: Layout,
...
@@ -113,68 +119,68 @@ export const constantRoutes = [
...
@@ -113,68 +119,68 @@ export const constantRoutes = [
// },
// },
// ]
// ]
// },
// },
{
//
{
path
:
'/drainageCode'
,
//
path: '/drainageCode',
component
:
Layout
,
//
component: Layout,
redirect
:
'/drainageCode/staff'
,
//
redirect: '/drainageCode/staff',
meta
:
{
title
:
'引流码'
,
icon
:
'qrcode'
},
//
meta: { title: '引流码', icon: 'qrcode' },
children
:
[
//
children: [
{
//
{
path
:
'staff'
,
//
path: 'staff',
name
:
'CodeStaff'
,
//
name: 'CodeStaff',
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/staff/list'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/staff/list'], resolve),
meta
:
{
title
:
'员工活码'
,
icon
:
''
}
//
meta: { title: '员工活码', icon: '' }
},
//
},
{
//
{
path
:
'staffAdd'
,
//
path: 'staffAdd',
hidden
:
true
,
//
hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/staff/add'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/staff/add'], resolve),
meta
:
{
title
:
'新建员工活码'
,
icon
:
''
,
activeMenu
:
'/drainageCode/staff'
}
//
meta: { title: '新建员工活码', icon: '', activeMenu: '/drainageCode/staff' }
},
//
},
{
//
{
path
:
'staffDetail'
,
//
path: 'staffDetail',
hidden
:
true
,
//
hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/staff/detail'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/staff/detail'], resolve),
meta
:
{
title
:
'员工活码详情'
,
icon
:
''
,
activeMenu
:
'/drainageCode/staff'
}
//
meta: { title: '员工活码详情', icon: '', activeMenu: '/drainageCode/staff' }
},
//
},
{
//
{
path
:
'group'
,
//
path: 'group',
name
:
'CodeGroup'
,
//
name: 'CodeGroup',
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/group/list'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/group/list'], resolve),
meta
:
{
title
:
'客户群活码'
,
icon
:
''
}
//
meta: { title: '客户群活码', icon: '' }
},
//
},
{
//
{
path
:
'groupAdd'
,
//
path: 'groupAdd',
hidden
:
true
,
//
hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/group/add'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/group/add'], resolve),
meta
:
{
title
:
'新增客户群活码'
,
icon
:
''
,
activeMenu
:
'/drainageCode/group'
}
//
meta: { title: '新增客户群活码', icon: '', activeMenu: '/drainageCode/group' }
},
//
},
{
//
{
path
:
'groupDetail'
,
//
path: 'groupDetail',
hidden
:
true
,
//
hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/group/detail'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/group/detail'], resolve),
meta
:
{
title
:
'客户群活码信息'
,
icon
:
''
,
activeMenu
:
'/drainageCode/group'
}
//
meta: { title: '客户群活码信息', icon: '', activeMenu: '/drainageCode/group' }
},
//
},
{
//
{
path
:
'groupBaseInfo'
,
//
path: 'groupBaseInfo',
hidden
:
true
,
//
hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/group/baseInfo'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/group/baseInfo'], resolve),
meta
:
{
title
:
'客户群活码'
,
icon
:
''
,
activeMenu
:
'/drainageCode/group'
}
//
meta: { title: '客户群活码', icon: '', activeMenu: '/drainageCode/group' }
},
//
},
{
//
{
path
:
'welcome'
,
//
path: 'welcome',
name
:
'Welcome'
,
//
name: 'Welcome',
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/welcome/list'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/welcome/list'], resolve),
meta
:
{
title
:
'欢迎语'
,
icon
:
''
}
//
meta: { title: '欢迎语', icon: '' }
},
//
},
{
//
{
path
:
'welcomeAdd'
,
//
path: 'welcomeAdd',
hidden
:
true
,
//
hidden: true,
component
:
(
resolve
)
=>
require
([
'@/views/drainageCode/welcome/add'
],
resolve
),
//
component: (resolve) => require(['@/views/drainageCode/welcome/add'], resolve),
meta
:
{
title
:
'新建欢迎语'
,
icon
:
''
,
activeMenu
:
'/drainageCode/welcome'
}
//
meta: { title: '新建欢迎语', icon: '', activeMenu: '/drainageCode/welcome' }
},
//
},
]
//
]
},
//
},
// {
// {
// path: '/material',
// path: '/material',
// component: Layout,
// component: Layout,
...
@@ -275,34 +281,33 @@ export const constantRoutes = [
...
@@ -275,34 +281,33 @@ export const constantRoutes = [
// },
// },
// ]
// ]
// },
// },
{
// {
path
:
'/contacts'
,
// path: '/contacts',
component
:
Layout
,
// component: Layout,
redirect
:
'/contacts/organization'
,
// redirect: '/contacts/organization',
meta
:
{
title
:
''
,
icon
:
'users'
},
// meta: { title: '通讯录', icon: 'users' },
children
:
[
// children: [
{
// {
path
:
'organization'
,
// path: 'organization',
name
:
'Organization'
,
// name: 'Organization',
component
:
(
resolve
)
=>
require
([
'@/views/contacts/organization'
],
resolve
),
// component: (resolve) => require(['@/views/contacts/organization'], resolve),
meta
:
{
title
:
'组织架构'
,
icon
:
'tree'
}
// meta: { title: '组织架构', icon: 'tree' }
},
// },
]
// ]
},
// },
{
// {
path
:
'/_enterpriseWechat'
,
// path: '/enterpriseWechat',
component
:
Layout
,
// component: Layout,
redirect
:
'/enterpriseWechat'
,
// meta: { title: '', icon: 'wechat' },
meta
:
{
title
:
''
,
icon
:
'wechat'
},
// children: [
children
:
[
// {
{
// path: 'index',
path
:
'/enterpriseWechat'
,
// name: 'EnterpriseWechat',
name
:
'EnterpriseWechat'
,
// component: (resolve) => require(['@/views/enterpriseWechat/list'], resolve),
component
:
(
resolve
)
=>
require
([
'@/views/enterpriseWechat/list'
],
resolve
),
// meta: { title: '企业微信管理', icon: '' }
meta
:
{
title
:
'企业微信管理'
,
icon
:
''
}
// },
},
// ]
]
// },
},
{
{
path
:
'/user'
,
path
:
'/user'
,
...
@@ -357,6 +362,11 @@ export const constantRoutes = [
...
@@ -357,6 +362,11 @@ export const constantRoutes = [
}
}
]
]
},
},
// {
// path: '/test',
// component: (resolve) => require(['@/views/test'], resolve),
// hidden: true
// },
{
{
path
:
'/404'
,
path
:
'/404'
,
component
:
(
resolve
)
=>
require
([
'@/views/error/404'
],
resolve
),
component
:
(
resolve
)
=>
require
([
'@/views/error/404'
],
resolve
),
...
...
linkwe-ui/src/store/modules/permission.js
View file @
12843a4
...
@@ -48,7 +48,7 @@ function filterAsyncRouter(asyncRouterMap) {
...
@@ -48,7 +48,7 @@ function filterAsyncRouter(asyncRouterMap) {
}
}
export
const
loadView
=
(
view
)
=>
{
// 路由懒加载
export
const
loadView
=
(
view
)
=>
{
// 路由懒加载
return
(
resolve
)
=>
require
([
`@/views/
${
view
}
`
],
resolve
)
return
(
resolve
)
=>
require
([
`@/views/
${
view
}
`
],
resolve
)
}
}
export
default
permission
export
default
permission
linkwe-ui/src/styles/common.scss
View file @
12843a4
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
}
}
html
{
html
{
height
:
100%
;
height
:
100%
;
font-size
:
14px
;
}
}
li
{
li
{
...
...
linkwe-ui/src/styles/element-ui.scss
View file @
12843a4
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
}
}
}
}
.el-input--small
{
height
:
32px
;
}
.top-search
{
.top-search
{
.el-input
,
.el-input
,
...
...
linkwe-ui/src/utils/request.js
View file @
12843a4
...
@@ -8,7 +8,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
...
@@ -8,7 +8,7 @@ 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.VUE_APP_BASE_API,
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// 超时
// 超时
timeout
:
10000
timeout
:
10000
})
})
...
...
linkwe-ui/src/views/contacts/organization.vue
View file @
12843a4
...
@@ -11,7 +11,7 @@ export default {
...
@@ -11,7 +11,7 @@ export default {
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
isActivate
:
""
,
isActivate
:
""
,
department
:
""
,
department
:
"
1
"
,
},
},
dateRange
:
[],
dateRange
:
[],
treeData
:
[],
treeData
:
[],
...
@@ -261,8 +261,8 @@ export default {
...
@@ -261,8 +261,8 @@ export default {
>
>
<div
class=
"custom-tree-node"
slot-scope=
"
{ node, data }">
<div
class=
"custom-tree-node"
slot-scope=
"
{ node, data }">
<span>
{{
node
.
label
}}
</span>
<span>
{{
node
.
label
}}
</span>
<span
class=
"fr"
v-if=
"node.level !== 1"
>
<span
class=
"fr"
>
<i
class=
"el-icon-edit"
@
click
.
stop=
"departEdit(data, 1)"
></i>
<i
class=
"el-icon-edit"
v-if=
"node.level !== 1"
@
click
.
stop=
"departEdit(data, 1)"
></i>
<i
class=
"el-icon-plus"
@
click
.
stop=
"departEdit(data, 0)"
></i>
<i
class=
"el-icon-plus"
@
click
.
stop=
"departEdit(data, 0)"
></i>
</span>
</span>
</div>
</div>
...
...
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