Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
east-nanjing-new
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
郭铭瑶
east-nanjing-new
Commits
2159b347
Commit
2159b347
authored
Feb 24, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全局右侧模块切换功能
parent
3a4e25f6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
12 deletions
+63
-12
my-title.vue
src/components/MyComponent/MyTitle/my-title.vue
+8
-2
index.ts
src/store/index.ts
+2
-0
mutations.ts
src/store/mutations.ts
+4
-1
state.ts
src/store/state.ts
+3
-1
main.vue
src/view/main.vue
+15
-4
business-entry.vue
src/view/right/business-entry.vue
+0
-1
public-manage.vue
src/view/right/public-manage.vue
+3
-3
public-service.vue
src/view/right/public-service.vue
+28
-0
No files found.
src/components/MyComponent/MyTitle/my-title.vue
View file @
2159b347
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
v-for=
"btn in btns"
v-for=
"btn in btns"
:key=
"btn.name"
:key=
"btn.name"
:class=
"
{ on: btn.type === curBtn }"
:class=
"
{ on: btn.type === curBtn }"
@click="
curBtn = btn.type
"
@click="
handleThemeSelect(btn.type)
"
>
>
{{
btn
.
name
}}
{{
btn
.
name
}}
</div>
</div>
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
onBeforeUnmount
,
ref
}
from
'vue'
import
{
defineComponent
,
onBeforeUnmount
,
ref
}
from
'vue'
import
{
getDate
,
getTime
}
from
'../util'
import
{
getDate
,
getTime
}
from
'../util'
import
store
from
'@/store'
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'MyTitle'
,
name
:
'MyTitle'
,
...
@@ -45,7 +46,11 @@ export default defineComponent({
...
@@ -45,7 +46,11 @@ export default defineComponent({
},
},
])
])
const
curBtn
=
ref
(
'manage'
)
const
curBtn
=
ref
(
'manage'
)
const
handleThemeSelect
=
(
type
:
string
)
=>
{
if
(
curBtn
.
value
===
type
)
return
curBtn
.
value
=
type
store
.
commit
(
'SET_CURRENT_THEME'
,
type
)
}
timer
.
value
=
setInterval
(()
=>
{
timer
.
value
=
setInterval
(()
=>
{
time
.
value
=
getTime
()
time
.
value
=
getTime
()
})
})
...
@@ -59,6 +64,7 @@ export default defineComponent({
...
@@ -59,6 +64,7 @@ export default defineComponent({
timer
,
timer
,
btns
,
btns
,
curBtn
,
curBtn
,
handleThemeSelect
,
}
}
},
},
})
})
...
...
src/store/index.ts
View file @
2159b347
...
@@ -3,8 +3,10 @@ import state from './state'
...
@@ -3,8 +3,10 @@ import state from './state'
import
mutations
from
'./mutations'
import
mutations
from
'./mutations'
import
actions
from
'./actions'
import
actions
from
'./actions'
export
type
ThemeType
=
'manage'
|
'service'
|
'safety'
export
interface
GlobalStateProps
{
export
interface
GlobalStateProps
{
showLoading
:
boolean
showLoading
:
boolean
curTheme
:
ThemeType
}
}
export
default
createStore
<
GlobalStateProps
>
({
export
default
createStore
<
GlobalStateProps
>
({
state
,
state
,
...
...
src/store/mutations.ts
View file @
2159b347
import
{
GlobalStateProps
}
from
'./index'
import
{
GlobalStateProps
,
ThemeType
}
from
'./index'
export
default
{
export
default
{
SET_LOADING
(
state
:
GlobalStateProps
,
val
:
boolean
):
void
{
SET_LOADING
(
state
:
GlobalStateProps
,
val
:
boolean
):
void
{
state
.
showLoading
=
val
state
.
showLoading
=
val
},
},
SET_CURRENT_THEME
(
state
:
GlobalStateProps
,
val
:
ThemeType
):
void
{
state
.
curTheme
=
val
},
}
}
src/store/state.ts
View file @
2159b347
import
{
GlobalStateProps
}
from
'./index'
export
default
{
export
default
{
showLoading
:
false
,
showLoading
:
false
,
}
curTheme
:
'manage'
,
}
as
GlobalStateProps
src/view/main.vue
View file @
2159b347
...
@@ -10,19 +10,30 @@
...
@@ -10,19 +10,30 @@
<LeftComponent
area=
"left"
/>
<LeftComponent
area=
"left"
/>
</m-animate>
</m-animate>
<m-animate
enter=
"fadeInRight"
leave=
"fadeOutRight"
>
<m-animate
enter=
"fadeInRight"
leave=
"fadeOutRight"
>
<RightComponent
area=
"right"
/>
<PublicManage
v-show=
"curTheme === 'manage'"
area=
"right"
/>
</m-animate>
<m-animate
enter=
"fadeInRight"
leave=
"fadeOutRight"
>
<PublicService
v-show=
"curTheme === 'service'"
area=
"right"
/>
</m-animate>
</m-animate>
</m-grid>
</m-grid>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
import
{
computed
,
defineComponent
}
from
'vue'
import
LeftComponent
from
'./left/left-component.vue'
import
LeftComponent
from
'./left/left-component.vue'
import
RightComponent
from
'./right/right-component.vue'
import
PublicManage
from
'./right/public-manage.vue'
import
PublicService
from
'./right/public-service.vue'
import
store
from
'@/store'
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'Main'
,
name
:
'Main'
,
components
:
{
LeftComponent
,
RightComponent
},
components
:
{
LeftComponent
,
PublicManage
,
PublicService
},
setup
()
{
const
curTheme
=
computed
(()
=>
store
.
state
.
curTheme
)
return
{
curTheme
,
}
},
})
})
</
script
>
</
script
>
...
...
src/view/right/business-entry.vue
View file @
2159b347
...
@@ -12,7 +12,6 @@ import { defineComponent } from 'vue'
...
@@ -12,7 +12,6 @@ import { defineComponent } from 'vue'
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'BussinessEntry'
,
name
:
'BussinessEntry'
,
setup
()
{},
})
})
</
script
>
</
script
>
...
...
src/view/right/
right-component
.vue
→
src/view/right/
public-manage
.vue
View file @
2159b347
<
template
>
<
template
>
<div
class=
"
right-component
"
>
<div
class=
"
public-manage
"
>
<m-card
mode=
"border"
>
<m-card
mode=
"border"
>
<Complain
/>
<Complain
/>
</m-card>
</m-card>
...
@@ -23,7 +23,7 @@ import KeyTask from './key-task.vue'
...
@@ -23,7 +23,7 @@ import KeyTask from './key-task.vue'
import
BussinessEntry
from
'./business-entry.vue'
import
BussinessEntry
from
'./business-entry.vue'
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
RightComponent
'
,
name
:
'
PublicMange
'
,
components
:
{
Complain
,
Demand
,
Analysis
,
KeyTask
,
BussinessEntry
},
components
:
{
Complain
,
Demand
,
Analysis
,
KeyTask
,
BussinessEntry
},
})
})
</
script
>
</
script
>
...
@@ -31,7 +31,7 @@ export default defineComponent({
...
@@ -31,7 +31,7 @@ export default defineComponent({
<
style
lang=
"stylus"
scoped
>
<
style
lang=
"stylus"
scoped
>
@import '../../components/MyComponent/main.styl'
@import '../../components/MyComponent/main.styl'
.
right-component
.
public-manage
$full()
$full()
display flex
display flex
justify-content space-between
justify-content space-between
...
...
src/view/right/public-service.vue
0 → 100644
View file @
2159b347
<
template
>
<div
class=
"public-service"
>
<m-card
mode=
"border"
>
</m-card>
<m-card
mode=
"border"
>
</m-card>
<m-card
mode=
"border"
>
</m-card>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
export
default
defineComponent
({
name
:
'PublicService'
,
setup
()
{},
})
</
script
>
<
style
lang=
"stylus"
scoped
>
@import '../../components/MyComponent/main.styl'
.public-service
$full()
display flex
justify-content space-between
>div
height 100%
width 33%
</
style
>
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