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
8a9a2e5d
Commit
8a9a2e5d
authored
Nov 17, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增菜单响应
parent
debf67cd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
28 deletions
+40
-28
OrderList.vue
src/components/hotel/order/list/OrderList.vue
+2
-2
nav-item.vue
src/components/layout/nav-item.vue
+21
-18
navs.vue
src/components/layout/navs.vue
+2
-4
dictionary.ts
src/config/dictionary.ts
+6
-0
MainLayout.vue
src/layouts/MainLayout.vue
+2
-0
HotelList.vue
src/pages/hotel/HotelList.vue
+3
-1
HotelOrder.vue
src/pages/hotel/HotelOrder.vue
+3
-1
menus.ts
src/utils/menus.ts
+1
-2
No files found.
src/components/hotel/order/list/OrderList.vue
View file @
8a9a2e5d
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</div>
</div>
<div
class=
"q-mt-md row"
>
<div
class=
"q-mt-md row"
>
<q-table
separator=
"vertical"
:hide-bottom=
"true"
dense
:rows=
"x.DetailList"
bordered
:columns=
"cols"
class=
"light-border col
borders
no-shadow text-left"
>
<q-table
separator=
"vertical"
:hide-bottom=
"true"
dense
:rows=
"x.DetailList"
bordered
:columns=
"cols"
class=
"light-border col no-shadow text-left"
>
<template
v-slot:header-cell-Room=
"props"
>
<template
v-slot:header-cell-Room=
"props"
>
<q-th
:props=
"props"
>
<q-th
:props=
"props"
>
<div
class=
"row items-center"
>
<div
class=
"row items-center"
>
...
@@ -245,7 +245,7 @@ export default defineComponent({
...
@@ -245,7 +245,7 @@ export default defineComponent({
})
})
data
.
orders
=
r
.
data
.
data
.
pageData
data
.
orders
=
r
.
data
.
data
.
pageData
data
.
pages
.
pageCount
=
r
.
data
.
data
.
pageCount
data
.
pages
.
pageCount
=
r
.
data
.
data
.
pageCount
}
else
{
}
else
{
message
.
errorMsg
(
r
.
data
.
message
)
message
.
errorMsg
(
r
.
data
.
message
)
}
}
...
...
src/components/layout/nav-item.vue
View file @
8a9a2e5d
<
template
>
<
template
>
<q-expansion-item
class=
"demo"
:class=
"
{ 'nav-parent': activeParent }">
<q-expansion-item
class=
"demo"
:class=
"
{ 'nav-parent': activeParent }"
v-model="activeParent"
>
<template
v-slot:header
>
<template
v-slot:header
>
<q-item-section>
<q-item-section>
<div
class=
"row items-center nav-group"
>
<div
class=
"row items-center nav-group"
>
...
@@ -22,11 +22,12 @@
...
@@ -22,11 +22,12 @@
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Menu
,
MENU_KEYS
}
from
'../../utils/menus'
import
{
Menu
}
from
'../../utils/menus'
import
{
computed
,
defineComponent
,
inject
,
PropType
,
provide
,
reactive
,
toRefs
,
ref
,
watch
}
from
'vue'
import
{
computed
,
defineComponent
,
inject
,
PropType
,
provide
,
reactive
,
toRefs
,
ref
,
watch
}
from
'vue'
import
svgIcon
from
'../global/svg-icon.vue'
import
svgIcon
from
'../global/svg-icon.vue'
import
{
DirtionmaryHelper
}
from
'../../config/dictionary'
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
svgIcon
},
components
:
{
svgIcon
},
name
:
'nav-item'
,
name
:
'nav-item'
,
props
:
{
props
:
{
menu
:
{
menu
:
{
...
@@ -34,22 +35,24 @@ export default defineComponent({
...
@@ -34,22 +35,24 @@ export default defineComponent({
required
:
true
required
:
true
}
}
},
},
setup
(
props
)
{
setup
(
props
)
{
const
activeMenu
=
inject
(
MENU_KEYS
)
as
any
const
activeMenu
=
inject
(
DirtionmaryHelper
.
MENU_KEYS
)
as
any
watch
(
activeMenu
,
(
n
,
o
)
=>
{
if
(
!
activeMenu
.
value
)
data
.
activeParent
=
false
if
(
props
.
menu
.
childs
)
{
let
temp
=
props
.
menu
.
childs
.
find
(
x
=>
x
.
id
==
activeMenu
.
value
)
data
.
activeParent
=
temp
?
true
:
false
}
else
{
data
.
activeParent
=
props
.
menu
.
id
==
activeMenu
.
value
}
})
const
data
=
reactive
({
const
data
=
reactive
({
activeParent
:
computed
(()
=>
{
activeParent
:
false
if
(
!
activeMenu
)
return
false
if
(
props
.
menu
.
childs
)
{
let
temp
=
props
.
menu
.
childs
.
find
(
x
=>
x
.
id
==
activeMenu
.
value
)
return
temp
?
true
:
false
}
else
{
return
props
.
menu
.
id
==
activeMenu
.
value
}
})
})
})
const
methods
=
{
const
methods
=
{
checkMenuHandler
(
id
:
number
)
{
checkMenuHandler
(
id
:
number
)
{
activeMenu
.
value
=
id
activeMenu
.
value
=
id
...
@@ -58,4 +61,4 @@ export default defineComponent({
...
@@ -58,4 +61,4 @@ export default defineComponent({
return
{
...
toRefs
(
data
),
...
methods
,
activeMenu
}
return
{
...
toRefs
(
data
),
...
methods
,
activeMenu
}
}
}
})
})
</
script
>
</
script
>
\ No newline at end of file
src/components/layout/navs.vue
View file @
8a9a2e5d
...
@@ -5,15 +5,13 @@
...
@@ -5,15 +5,13 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
reactive
,
toRefs
,
provide
}
from
'vue'
import
{
defineComponent
,
ref
,
reactive
,
toRefs
}
from
'vue'
import
navItem
from
'./nav-item.vue'
import
navItem
from
'./nav-item.vue'
import
{
useMenus
,
Menu
,
MENU_KEYS
}
from
'../../utils/menus'
import
{
useMenus
,
Menu
}
from
'../../utils/menus'
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
navItem
},
components
:
{
navItem
},
name
:
'navs'
,
name
:
'navs'
,
setup
()
{
setup
()
{
const
activeMenu
=
ref
(
0
)
provide
(
MENU_KEYS
,
activeMenu
)
const
data
=
reactive
({
const
data
=
reactive
({
menus
:
[]
as
Menu
[]
menus
:
[]
as
Menu
[]
})
})
...
...
src/config/dictionary.ts
View file @
8a9a2e5d
...
@@ -8,6 +8,12 @@ const userDictionmary = {
...
@@ -8,6 +8,12 @@ const userDictionmary = {
}
}
class
DirtionmaryHelper
{
class
DirtionmaryHelper
{
/**
* 菜單選項
*/
static
readonly
MENU_KEYS
=
'Current_Menu_Cehck'
/**
/**
* 子頁面傳遞給主界面的標題KEY
* 子頁面傳遞給主界面的標題KEY
*/
*/
...
...
src/layouts/MainLayout.vue
View file @
8a9a2e5d
...
@@ -81,6 +81,8 @@ export default {
...
@@ -81,6 +81,8 @@ export default {
})
})
const
childPageTitle
=
ref
(
''
)
const
childPageTitle
=
ref
(
''
)
provide
(
DirtionmaryHelper
.
PAGE_TITLE_KEY
,
childPageTitle
)
provide
(
DirtionmaryHelper
.
PAGE_TITLE_KEY
,
childPageTitle
)
const
activeMenu
=
ref
(
0
)
provide
(
DirtionmaryHelper
.
MENU_KEYS
,
activeMenu
)
data
.
userInfo
=
getStoreGetter
<
UserGetter
>
(
'user'
,
'getUser'
)
data
.
userInfo
=
getStoreGetter
<
UserGetter
>
(
'user'
,
'getUser'
)
data
.
scrollStyle
=
useScrollModule
().
scrollStyle
data
.
scrollStyle
=
useScrollModule
().
scrollStyle
const
methods
=
{
const
methods
=
{
...
...
src/pages/hotel/HotelList.vue
View file @
8a9a2e5d
...
@@ -19,7 +19,6 @@ export default defineComponent({
...
@@ -19,7 +19,6 @@ export default defineComponent({
components
:
{
svgIcon
,
ListHeader
,
ListTable
},
components
:
{
svgIcon
,
ListHeader
,
ListTable
},
setup
()
{
setup
()
{
const
data
=
reactive
({})
const
data
=
reactive
({})
console
.
log
(
' in '
)
let
{
setTitle
}
=
useMetaModule
()
let
{
setTitle
}
=
useMetaModule
()
const
{
locale
,
t
}
=
useI18n
()
const
{
locale
,
t
}
=
useI18n
()
const
pageTitle
=
inject
(
DirtionmaryHelper
.
PAGE_TITLE_KEY
)
as
any
const
pageTitle
=
inject
(
DirtionmaryHelper
.
PAGE_TITLE_KEY
)
as
any
...
@@ -49,6 +48,9 @@ export default defineComponent({
...
@@ -49,6 +48,9 @@ export default defineComponent({
provide
(
DirtionmaryHelper
.
HOTEL_CAR_LIST
,
HotelCarList
)
provide
(
DirtionmaryHelper
.
HOTEL_CAR_LIST
,
HotelCarList
)
const
updateObj
=
ref
<
any
>
({})
const
updateObj
=
ref
<
any
>
({})
provide
(
DirtionmaryHelper
.
HOTEL_UPDATEHOTEL_CAR
,
updateObj
)
provide
(
DirtionmaryHelper
.
HOTEL_UPDATEHOTEL_CAR
,
updateObj
)
const
menu
=
inject
(
DirtionmaryHelper
.
MENU_KEYS
)
as
any
menu
.
value
=
2
const
methods
=
{
const
methods
=
{
}
}
...
...
src/pages/hotel/HotelOrder.vue
View file @
8a9a2e5d
...
@@ -39,6 +39,8 @@ export default defineComponent({
...
@@ -39,6 +39,8 @@ export default defineComponent({
ContactNumber
:
''
ContactNumber
:
''
})
})
provide
(
DirtionmaryHelper
.
HOTEL_ORDER_SEARCH
,
search
)
provide
(
DirtionmaryHelper
.
HOTEL_ORDER_SEARCH
,
search
)
const
menu
=
inject
(
DirtionmaryHelper
.
MENU_KEYS
)
as
any
menu
.
value
=
3
const
data
=
reactive
({})
const
data
=
reactive
({})
const
methods
=
{}
const
methods
=
{}
...
@@ -50,4 +52,4 @@ export default defineComponent({
...
@@ -50,4 +52,4 @@ export default defineComponent({
<
style
>
<
style
>
</
style
>
</
style
>
\ No newline at end of file
src/utils/menus.ts
View file @
8a9a2e5d
...
@@ -98,5 +98,4 @@ const useMenus={
...
@@ -98,5 +98,4 @@ const useMenus={
return
menus
return
menus
}
}
}
}
const
MENU_KEYS
=
'Current_Menu_Cehck'
export
{
useMenus
,
type
Menu
}
export
{
useMenus
,
type
Menu
,
MENU_KEYS
}
\ No newline at end of file
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