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
811247e8
Commit
811247e8
authored
Nov 14, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
b0ffe0f3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
89 deletions
+87
-89
index.template.html
src/index.template.html
+0
-22
HotelList.vue
src/pages/hotel/HotelList.vue
+3
-3
HotelOrder.vue
src/pages/hotel/HotelOrder.vue
+3
-3
index.ts
src/router/index.ts
+25
-32
routes.ts
src/router/routes.ts
+9
-9
index.ts
src/store/index.ts
+42
-19
utils.ts
src/store/utils.ts
+5
-1
No files found.
src/index.template.html
deleted
100644 → 0
View file @
b0ffe0f3
<!DOCTYPE html>
<html>
<head>
<title><
%=
productName
%
></title>
<meta
charset=
"utf-8"
>
<meta
name=
"description"
content=
"<%= productDescription %>"
>
<meta
name=
"format-detection"
content=
"telephone=no"
>
<meta
name=
"msapplication-tap-highlight"
content=
"no"
>
<meta
name=
"viewport"
content=
"user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"128x128"
href=
"icons/favicon-128x128.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"96x96"
href=
"icons/favicon-96x96.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"32x32"
href=
"icons/favicon-32x32.png"
>
<link
rel=
"icon"
type=
"image/png"
sizes=
"16x16"
href=
"icons/favicon-16x16.png"
>
<link
rel=
"icon"
type=
"image/ico"
href=
"favicon.ico"
>
</head>
<body>
<!-- quasar:entry-point -->
</body>
</html>
src/pages/hotel/HotelList.vue
View file @
811247e8
...
...
@@ -11,11 +11,11 @@
import
useMetaModule
from
'../../module/meta/metaModule'
import
{
useI18n
}
from
'vue-i18n'
import
svgIcon
from
'../../components/global/svg-icon.vue'
import
{
inject
,
provide
,
reactive
,
ref
,
toRefs
}
from
'vue'
import
{
defineComponent
,
inject
,
provide
,
reactive
,
ref
,
toRefs
}
from
'vue'
import
{
DirtionmaryHelper
}
from
'../../config/dictionary'
import
ListHeader
from
'../../components/hotel/list/ListHeader.vue'
import
ListTable
from
'../../components/hotel/list/List-Table.vue'
export
default
{
export
default
defineComponent
(
{
components
:
{
svgIcon
,
ListHeader
,
ListTable
},
setup
()
{
const
data
=
reactive
({})
...
...
@@ -50,7 +50,7 @@ export default {
...
methods
}
}
}
}
)
</
script
>
<
style
></
style
>
src/pages/hotel/HotelOrder.vue
View file @
811247e8
...
...
@@ -8,14 +8,14 @@
</
template
>
<
script
lang=
"ts"
>
import
{
inject
,
provide
,
reactive
,
toRefs
}
from
'vue'
;
import
{
defineComponent
,
inject
,
provide
,
reactive
,
toRefs
}
from
'vue'
;
import
useMetaModule
from
'../../module/meta/metaModule'
import
{
useI18n
}
from
'vue-i18n'
import
{
DirtionmaryHelper
}
from
'../../config/dictionary'
;
import
OrderListHeader
from
'../../components/hotel/order/list/OrderListHeader.vue'
;
import
OrderList
from
'../../components/hotel/order/list/OrderList.vue'
;
export
default
{
export
default
defineComponent
(
{
components
:
{
OrderListHeader
,
OrderList
},
setup
(
props
)
{
console
.
log
(
' in '
)
...
...
@@ -45,7 +45,7 @@ export default {
return
{...
toRefs
(
data
),...
methods
,
search
}
}
}
}
)
</
script
>
<
style
>
...
...
src/router/index.ts
View file @
811247e8
// import { route } from 'quasar/wrappers';
import
{
createMemoryHistory
,
createRouter
,
createWebHashHistory
,
createWebHistory
}
from
'vue-router'
import
routes
from
'./routes'
import
{
StateType
}
from
'./../@types/index'
;
import
{
route
}
from
'quasar/wrappers'
;
import
{
createMemoryHistory
,
createRouter
,
createWebHashHistory
,
createWebHistory
,
}
from
'vue-router'
;
import
routes
from
'./routes'
;
/*
* If not building with SSR mode, you can
...
...
@@ -11,35 +19,20 @@ import routes from './routes'
* with the Router instance.
*/
// export default route(function (/* { store, ssrContext } */) {
// const createHistory = process.env.SERVER
// ? createMemoryHistory
// : (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory);
// const Router = createRouter({
// scrollBehavior: () => ({ left: 0, top: 0 }),
// routes,
// // Leave this as is and make changes in quasar.conf.js instead!
// // quasar.conf.js -> build -> vueRouterMode
// // quasar.conf.js -> build -> publicPath
// history: createHistory(
// process.env.MODE === 'ssr' ? void 0 : process.env.VUE_ROUTER_BASE
// ),
// });
// return Router;
// });
export
default
route
<
StateType
>
(
function
(
/* { store, ssrContext } */
)
{
const
createHistory
=
process
.
env
.
SERVER
?
createMemoryHistory
:
(
process
.
env
.
VUE_ROUTER_MODE
===
'history'
?
createWebHistory
:
createWebHashHistory
);
const
createHistory
=
process
.
env
.
SERVER
?
createMemoryHistory
:
process
.
env
.
VUE_ROUTER_MODE
===
'history'
?
createWebHistory
:
createWebHashHistory
const
Router
=
createRouter
({
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
routes
,
const
Router
=
createRouter
({
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
routes
,
// Leave this as is and make changes in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath
history
:
createHistory
(
process
.
env
.
VUE_ROUTER_BASE
),
});
// Leave this as is and make changes in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath
history
:
createHistory
(
process
.
env
.
MODE
===
'ssr'
?
void
0
:
process
.
env
.
VUE_ROUTER_BASE
)
})
export
default
Router
return
Router
;
});
src/router/routes.ts
View file @
811247e8
...
...
@@ -3,34 +3,34 @@ import { RouteRecordRaw } from 'vue-router'
const
routes
:
RouteRecordRaw
[]
=
[
{
path
:
'/index'
,
component
:
()
=>
import
(
'
../
layouts/MainLayout.vue'
),
component
:
()
=>
import
(
'layouts/MainLayout.vue'
),
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'
../
pages/Index.vue'
)
},
{
path
:
'/hotel'
,
component
:
()
=>
import
(
'
../
pages/hotel/HotelList.vue'
)
},
{
path
:
'/hotel/order'
,
component
:
()
=>
import
(
'../
pages/hotel/HotelOrder.vue'
)
}
{
path
:
''
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/hotel'
,
component
:
()
=>
import
(
'pages/hotel/HotelList.vue'
)
},
{
path
:
'/hotel/order'
,
component
:
()
=>
import
(
'
pages/hotel/HotelOrder.vue'
)
}
]
},
{
path
:
'/auth/login'
,
component
:
()
=>
import
(
'
../
pages/auth/login.vue'
)
component
:
()
=>
import
(
'pages/auth/login.vue'
)
},
{
path
:
'/auth/regist'
,
component
:
()
=>
import
(
'
../
pages/auth/regist.vue'
)
component
:
()
=>
import
(
'pages/auth/regist.vue'
)
},
{
path
:
'/auth/forget'
,
component
:
()
=>
import
(
'
../
pages/auth/forget.vue'
)
component
:
()
=>
import
(
'pages/auth/forget.vue'
)
},
{
path
:
'/auth/newpassword/:code'
,
component
:
()
=>
import
(
'
../
pages/auth/newpassword.vue'
)
component
:
()
=>
import
(
'pages/auth/newpassword.vue'
)
},
// Always leave this as last one,
// but you can also remove it
{
path
:
'/:catchAll(.*)*'
,
component
:
()
=>
import
(
'
../
pages/Error404.vue'
)
component
:
()
=>
import
(
'pages/Error404.vue'
)
}
]
...
...
src/store/index.ts
View file @
811247e8
import
{
createStore
,
createLogger
,
Store
}
from
'vuex'
// import { store } from 'quasar/wrappers'
import
{
InjectionKey
}
from
'vue'
import
{
Router
}
from
'vue-router'
import
{
createStore
,
Store
as
VuexStore
,
useStore
as
vuexUseStore
}
from
'vuex'
import
createPersistedState
from
'vuex-persistedstate'
import
mutations
from
'./mutations'
import
modules
from
'./modules'
import
{
StateType
}
from
'../@types'
import
{
InjectionKey
}
from
'vue'
export
const
key
:
InjectionKey
<
Store
<
StateType
>>
=
Symbol
()
console
.
log
(
modules
)
const
store
:
Store
<
StateType
>
=
createStore
({
strict
:
!!
process
.
env
.
DEBUGGING
,
// provide typings for `this.$store`
declare
module
'@vue/runtime-core'
{
interface
ComponentCustomProperties
{
$store
:
VuexStore
<
StateType
>
}
}
export
const
storeKey
:
InjectionKey
<
VuexStore
<
StateType
>>
=
Symbol
()
declare
module
'vuex'
{
export
interface
Store
<
S
>
{
readonly
$router
:
Router
}
}
const
store
:
VuexStore
<
StateType
>
=
createStore
<
StateType
>
({
mutations
,
actions
:
{},
modules
:
{
...
modules
},
plugins
:
process
.
env
.
NODE_ENV
!==
'production'
?
[
createLogger
(),
createPersistedState
({
paths
:
[
'app'
,
'user'
]
})
]
:
[
createPersistedState
({
paths
:
[
'app'
,
'user'
]
})
]
// enable strict mode (adds overhead!)
// for dev mode and --debug builds only
strict
:
!!
process
.
env
.
DEBUGGING
,
plugins
:
[
createPersistedState
({
paths
:
[
'app'
,
'user'
]
})
]
})
export
default
store
export
function
useStore
()
{
return
vuexUseStore
(
storeKey
)
}
// const store: Store<StateType> = createStore({
// strict: !!process.env.DEBUGGING,
// mutations,
// actions: {},
// modules: { ...modules },
// })
// export default store
src/store/utils.ts
View file @
811247e8
import
store
from
'../store'
import
{
StateType
}
from
'./../@types/index'
;
import
store
from
'../store/index'
// 定义 state 下的 module 值
type
ModuleNameType
=
'app'
|
'console'
|
'user'
...
...
@@ -23,6 +25,7 @@ type ModuleNameType = 'app' | 'console' | 'user'
*/
export
function
setStoreState
<
T
>
(
module
:
ModuleNameType
,
key
:
keyof
T
,
value
:
any
)
{
store
.
commit
({
type
:
module
+
'/__set'
,
key
:
key
,
...
...
@@ -45,5 +48,6 @@ export function dispatchAction<T>(module: ModuleNameType, key: keyof T, value?:
* @example 使用方法如下 const result = getStoreGetter<ConsoleGetterType>('console','list')
*/
export
function
getStoreGetter
<
T
>
(
module
:
ModuleNameType
,
key
:
keyof
T
)
{
console
.
log
(
store
)
return
store
.
getters
[
`
${
module
}
/
${
String
(
key
)}
`
]
}
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