Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-h5
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 e245e3ec
authored
Jun 09, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
自律规则
1 parent
3d3125d2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
21 deletions
src/components/ModuleSearchLayout.vue
src/router/modules/selfregulating.js
src/store/modules/search.js
src/views/selfregulating/components/DataListLayout.vue
src/views/selfregulating/index.vue
src/views/selfregulating/search.vue
src/components/ModuleSearchLayout.vue
0 → 100644
View file @
e245e3e
<
template
>
<section
class=
"module-search-layout"
>
<nafm-header
:navClass=
"navClass || 'nafmii-head-bg3'"
>
<template
slot=
"bottom"
>
<SearchInput
v-model=
"keyword"
@
search=
"handleSearch"
:placeholder=
"placeholder || $t('home.searchPlaceholder')"
/>
</
template
>
</nafm-header>
<main>
<SearchHistory
:stateKey=
"stateKey"
@
jumpPage=
"handleSearch"
/>
</main>
</section>
</template>
<
script
>
import
SearchInput
from
'./SearchInput'
import
SearchHistory
from
'./SearchHistory'
export
default
{
name
:
'ModuleSearchLayout'
,
components
:
{
SearchInput
,
SearchHistory
},
props
:
{
navClass
:
String
,
placeholder
:
String
,
stateKey
:
String
,
defKeyword
:
String
},
data
()
{
return
{
keyword
:
this
.
defKeyword
}
},
methods
:
{
handleSearch
(
val
)
{
const
param
=
{
stateKey
:
this
.
stateKey
,
value
:
val
}
this
.
$store
.
dispatch
(
'search/APushSearchValue'
,
param
)
this
.
$emit
(
'onSearch'
,
val
)
}
},
}
</
script
>
\ No newline at end of file
src/router/modules/selfregulating.js
View file @
e245e3e
...
...
@@ -4,7 +4,9 @@ const Routers = [
name
:
'SelfRegulating'
,
meta
:
{
title
:
'自律规则'
,
isLogin
:
false
isLogin
:
false
,
keepAlive
:
true
,
keepAlivePage
:
[
'SelfRegulatingSearch'
]
},
component
:
()
=>
import
(
/* webpackChunkName: "SelfRegulating" */
'@/views/selfregulating/index.vue'
)
// 自律规则
},
...
...
src/store/modules/search.js
View file @
e245e3e
...
...
@@ -3,6 +3,7 @@ const Types = {
Home
:
{
size
:
10
},
RegIssue
:
{
size
:
10
},
InfoDisclosure
:
{
size
:
10
},
SelfRegulating
:
{
size
:
10
}
}
import
utils
from
'@/utils/index'
...
...
@@ -11,53 +12,54 @@ export default {
state
:
{
Home
:
[],
RegIssue
:
[],
InfoDisclosure
:
[]
InfoDisclosure
:
[],
SelfRegulating
:
[]
},
mutations
:
{
MSetHistoryDatas
(
state
,
{
key
,
datas
})
{
MSetHistoryDatas
(
state
,
{
key
,
datas
})
{
state
[
key
]
=
datas
},
MSetHomeHistory
(
state
,
datas
)
{
MSetHomeHistory
(
state
,
datas
)
{
state
.
Home
=
datas
},
MSetRegIssueHistory
(
state
,
datas
)
{
MSetRegIssueHistory
(
state
,
datas
)
{
state
.
RegIssue
=
datas
},
MSetInfoDisclosureHistory
(
state
,
datas
)
{
MSetInfoDisclosureHistory
(
state
,
datas
)
{
state
.
InfoDisclosure
=
datas
},
MCleanHistory
(
state
,
stateKey
)
{
MCleanHistory
(
state
,
stateKey
)
{
state
[
stateKey
]
=
[]
}
},
actions
:
{
ACleanHistory
({
commit
},
stateKey
)
{
ACleanHistory
({
commit
},
stateKey
)
{
commit
(
'MCleanHistory'
,
stateKey
)
},
APushSearchValue
({
state
,
commit
},
param
=
{})
{
APushSearchValue
({
state
,
commit
},
param
=
{})
{
const
{
stateKey
,
value
}
=
param
if
(
Object
.
hasOwnProperty
.
call
(
Types
,
stateKey
))
{
const
newDatas
=
pushSearchValue
(
state
[
stateKey
],
value
,
Types
[
stateKey
].
size
)
commit
(
'MSetHistoryDatas'
,
{
key
:
stateKey
,
value
:
newDatas
})
commit
(
'MSetHistoryDatas'
,
{
key
:
stateKey
,
datas
:
newDatas
})
}
},
APushHomeSearchValue
({
state
,
commit
},
val
)
{
APushHomeSearchValue
({
state
,
commit
},
val
)
{
const
newDatas
=
pushSearchValue
(
state
.
Home
,
val
,
Types
.
Home
.
size
)
commit
(
'MSetHomeHistory'
,
newDatas
)
},
APushRegIssueSearchValue
({
state
,
commit
},
val
)
{
APushRegIssueSearchValue
({
state
,
commit
},
val
)
{
const
newDatas
=
pushSearchValue
(
state
.
RegIssue
,
val
,
Types
.
RegIssue
.
size
)
commit
(
'MSetRegIssueHistory'
,
newDatas
)
},
APushInfoDisclosureSearchValue
({
state
,
commit
},
val
)
{
APushInfoDisclosureSearchValue
({
state
,
commit
},
val
)
{
const
newDatas
=
pushSearchValue
(
state
.
InfoDisclosure
,
val
,
Types
.
InfoDisclosure
.
size
)
commit
(
'MSetInfoDisclosureHistory'
,
newDatas
)
},
...
...
@@ -67,7 +69,7 @@ export default {
}
function
pushSearchValue
(
datas
,
value
,
size
)
{
function
pushSearchValue
(
datas
,
value
,
size
)
{
const
newDatas
=
[...
datas
]
if
(
!
utils
.
isNull
(
value
)
&&
newDatas
.
indexOf
(
value
)
===
-
1
)
{
...
...
src/views/selfregulating/components/DataListLayout.vue
View file @
e245e3e
...
...
@@ -21,13 +21,19 @@ export default {
tab
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
}
},
keyword
:
String
},
data
()
{
return
{
isRefresh
:
false
,
}
},
watch
:
{
keyword
(
val
)
{
this
.
isRefresh
=
true
}
},
methods
:
{
handleLoad
(
param
)
{
return
new
Promise
(
resolve
=>
{
...
...
@@ -46,7 +52,7 @@ export default {
}
]
})
},
2
000
);
},
1
000
);
})
}
}
...
...
src/views/selfregulating/index.vue
View file @
e245e3e
...
...
@@ -2,32 +2,35 @@
<div
class=
"self-regulating"
>
<nafm-header
navClass=
"nafmii-head-bg3"
>
<template
slot=
"bottom"
>
<SearchInput
:placeholder=
"$t('home.searchPlaceholder')"
/>
<SearchInput
v-model=
"keyword"
readonly
@
click=
"handleSearch"
:placeholder=
"$t('home.searchPlaceholder')"
/>
<div
class=
"nav-placeholder"
></div>
</
template
>
</nafm-header>
<van-tabs
v-model=
"active"
animated
scrollspy
swipe-threshold=
"3"
class=
"data-tabs"
>
<van-tab
:title=
"item.name"
v-for=
"(item,idx) in tabs"
:key=
"idx"
>
<DataListLayout
:tab=
"item"
/>
<DataListLayout
:
keyword=
"keyword"
:
tab=
"item"
/>
</van-tab>
</van-tabs>
</div>
</template>
<
script
>
import
mixinKeepAlive
from
'@/mixins/mixinKeepAlive'
import
{
KeywordBus
}
from
'@/utils/eventBus'
import
SearchInput
from
'@/components/SearchInput'
import
DataListLayout
from
'./components/DataListLayout'
export
default
{
name
:
'SelfRegulating'
,
mixins
:
[
mixinKeepAlive
],
components
:
{
SearchInput
,
DataListLayout
},
data
()
{
return
{
active
:
0
,
keyword
:
null
,
tabs
:
[]
}
},
methods
:
{
handleTabs
()
{
setTimeout
(()
=>
{
this
.
tabs
=
[
...
...
@@ -39,10 +42,23 @@ export default {
{
id
:
6
,
name
:
'其他'
},
]
},
100
);
},
handleSearch
()
{
this
.
$router
.
push
({
name
:
'SelfRegulatingSearch'
})
},
initKeywordListener
()
{
KeywordBus
.
on
((
val
)
=>
{
this
.
keyword
=
val
})
}
},
mounted
()
{
this
.
handleTabs
()
this
.
initKeywordListener
()
},
destroyed
()
{
KeywordBus
.
off
()
}
}
</
script
>
...
...
src/views/selfregulating/search.vue
View file @
e245e3e
<
template
>
<ModuleSearchLayout
@
onSearch=
"handleSearch"
stateKey=
"SelfRegulating"
/>
</
template
>
<
script
>
import
{
KeywordBus
}
from
'@/utils/eventBus'
import
ModuleSearchLayout
from
'@/components/ModuleSearchLayout'
export
default
{
name
:
'SelfRegulatingSearch'
name
:
'SelfRegulatingSearch'
,
components
:
{
ModuleSearchLayout
},
data
()
{
return
{
}
},
methods
:
{
handleSearch
(
val
)
{
KeywordBus
.
emit
(
val
)
this
.
$router
.
back
();
}
}
}
</
script
>
\ No newline at end of file
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