Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigwood
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
bigwood
Commits
7f2fdd0a
Commit
7f2fdd0a
authored
Mar 06, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
eabba234
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
45 deletions
+67
-45
navs.vue
src/components/layout/navs.vue
+43
-28
validate.ts
src/utils/validate.ts
+24
-17
No files found.
src/components/layout/navs.vue
View file @
7f2fdd0a
<
template
>
<q-list
style=
"color:
#9d9da6"
>
<nav-item
:menu=
"x"
v-for=
"x in menus"
></nav-item>
</q-list>
<q-list
style=
"color:
#9d9da6"
>
<nav-item
:menu=
"x"
v-for=
"x in menus"
></nav-item>
</q-list>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
reactive
,
toRefs
,
inject
}
from
'vue'
import
navItem
from
'./nav-item.vue'
import
{
useMenus
,
Menu
}
from
'../../utils/menus'
import
{
DirtionmaryHelper
}
from
'../../config/dictionary'
;
import
{
defineComponent
,
ref
,
reactive
,
toRefs
,
inject
}
from
"vue"
;
import
navItem
from
"./nav-item.vue"
;
import
{
useMenus
,
Menu
}
from
"../../utils/menus"
;
import
{
DirtionmaryHelper
}
from
"../../config/dictionary"
;
export
default
defineComponent
({
components
:
{
navItem
},
name
:
'navs'
,
name
:
"navs"
,
setup
()
{
const
data
=
reactive
({
menus
:
[]
as
Menu
[]
})
menus
:
[]
as
Menu
[],
});
//销售的菜单sell.oytour
const
sellMenuList
=
useMenus
.
getMenus
().
filter
((
x
)
=>
{
return
x
.
id
==
16
;
});
const
typicMenuList
=
[];
//台湾PIC菜单
const
allMenuList
=
useMenus
.
getMenus
();
if
(
allMenuList
&&
allMenuList
.
length
>
0
)
{
allMenuList
.
forEach
((
item
)
=>
{
if
(
item
.
id
!=
16
&&
item
.
id
!=
13
&&
item
.
id
!=
20
)
{
typicMenuList
.
push
(
item
);
}
});
}
// 根据域名渲染菜单
const
menList
=
useMenus
.
getMenus
().
filter
(
x
=>
{
return
x
.
id
==
16
})
// data.menus = !inject(DirtionmaryHelper.DOMAIN_NAME)?menList:useMenus.getMenus()
if
(
inject
(
DirtionmaryHelper
.
DOMAIN_NAME
)
==
'sell.oytour'
)
data
.
menus
=
menList
else
data
.
menus
=
useMenus
.
getMenus
()
if
(
inject
(
DirtionmaryHelper
.
DOMAIN_NAME
)
==
"sell.oytour"
)
{
data
.
menus
=
sellMenuList
;
}
else
if
(
inject
(
DirtionmaryHelper
.
DOMAIN_NAME
)
==
"typic.oytour"
)
{
data
.
menus
=
typicMenuList
;
}
else
{
data
.
menus
=
useMenus
.
getMenus
();
}
return
{
...
toRefs
(
data
)}
}
})
return
{
...
toRefs
(
data
)
};
}
,
})
;
</
script
>
<
style
>
.nav-list
.nav-group
:hover
span
,
.nav-list
.nav-item
:hover
span
,
.nav-list
.nav-item.active
span
,
.nav-list
.nav-group.active
span
,
.parent-name
{
color
:
#
FFFFFF
!important
;
.parent-name
{
color
:
#
ffffff
!important
;
}
.nav-list
.nav-group.active
.svg-icon-nav
g
[
fill
],
.nav-group
:hover
.svg-icon-nav
g
[
fill
],
.nav-item
:hover
.svg-icon-nav
g
[
fill
],
.nav-list
.nav-item.active
.svg-icon-nav
g
[
fill
],
.nav-active
.svg-icon-nav
g
[
fill
],
.nav-parent
.svg-icon-nav
g
[
fill
]
{
fill
:
#
FFFFFF
!important
;
.nav-parent
.svg-icon-nav
g
[
fill
]
{
fill
:
#
ffffff
!important
;
/* color: #FFFFFF !important; */
}
.nav-list
.q-focus-helper
{
.nav-list
.q-focus-helper
{
opacity
:
0
!important
;
}
.nav-active
{
color
:
#FFF
!important
;
.nav-active
{
color
:
#fff
!important
;
transition
:
color
0.2s
ease
;
background-color
:
#2
A2A3C
;
background-color
:
#2
a2a3c
;
}
</
style
>
src/utils/validate.ts
View file @
7f2fdd0a
...
...
@@ -33,18 +33,18 @@ export function validatAlphabetsName(str: string) {
return
reg
.
test
(
str
)
}
export
function
isEmail
(
account
:
string
):
boolean
{
let
serchfind
:
boolean
;
let
regexp
=
new
RegExp
(
/^
(([^
<>()
\[\]\\
.,;:
\[
email protected
]
"]+
(\.[^
<>()
\[\]\\
.,;:
\[
email protected
]
"]+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}
]
)
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
);
serchfind
=
regexp
.
test
(
account
);
return
serchfind
export
function
isEmail
(
account
:
string
):
boolean
{
let
serchfind
:
boolean
;
let
regexp
=
new
RegExp
(
/^
(([^
<>()
\[\]\\
.,;:
\[
email protected
]
"]+
(\.[^
<>()
\[\]\\
.,;:
\[
email protected
]
"]+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}
]
)
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
);
serchfind
=
regexp
.
test
(
account
);
return
serchfind
}
export
function
isPhone
(
account
:
string
):
boolean
{
let
serchfind
:
boolean
;
let
regexp
=
new
RegExp
(
/^
((
13|14|15|16|17|18|19
)[
0-9
]{1}\d{8})
$/
);
serchfind
=
regexp
.
test
(
account
);
return
serchfind
export
function
isPhone
(
account
:
string
):
boolean
{
let
serchfind
:
boolean
;
let
regexp
=
new
RegExp
(
/^
((
13|14|15|16|17|18|19
)[
0-9
]{1}\d{8})
$/
);
serchfind
=
regexp
.
test
(
account
);
return
serchfind
}
/** 比对数组是否相同 */
...
...
@@ -66,11 +66,18 @@ export function compareArray(arrA: any[], arrB: any[]) {
/** 获取当前域名 localhost、pic.oytour.com、sell.oytour.com*/
export
function
getDomainName
()
{
let
domainNameUrl
=
window
.
location
.
hostname
;
if
(
domainNameUrl
==
'localhost'
){
return
'pic.oytour'
}
else
if
(
domainNameUrl
==
'pic.oytour.com'
){
return
'pic.oytour'
}
else
if
(
domainNameUrl
==
'sell.oytour.com'
){
return
'sell.oytour'
}
if
(
domainNameUrl
==
'localhost'
)
{
return
'pic.oytour'
}
else
if
(
domainNameUrl
.
indexOf
(
"192.168.10"
)
>
-
1
)
{
console
.
log
(
"11"
);
return
"typic.oytour"
}
else
if
(
domainNameUrl
==
"typic.oytour.com"
)
{
return
"typic.oytour"
}
else
if
(
domainNameUrl
==
'pic.oytour.com'
)
{
return
'pic.oytour'
}
else
if
(
domainNameUrl
==
'sell.oytour.com'
)
{
return
'sell.oytour'
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment