Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
huamu
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
郭铭瑶
huamu
Commits
0686eb66
Commit
0686eb66
authored
Sep 10, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
光荣在党50年及党心暖我心数据筛选
parent
8018de08
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
41 deletions
+63
-41
api.ts
src/ajax/api.ts
+1
-0
useExportFile.ts
src/hooks/useExportFile.ts
+4
-3
useFetch.ts
src/hooks/useFetch.ts
+7
-0
filter-drawer.vue
src/view/components/filter-drawer.vue
+51
-38
No files found.
src/ajax/api.ts
View file @
0686eb66
...
...
@@ -34,4 +34,5 @@ export default {
STREET
:
'af3ce0b6-f32d-4914-a336-bb7f6398ff85'
,
BUILDING
:
'e08e40c6-a15c-447d-8f9e-786216d93443'
,
ATTACHMENT
:
'988fc63e-fa55-4729-851d-24c4355213f2'
,
TAG
:
'54344e11-c0d3-40d5-8f99-771066249328'
,
}
src/hooks/useExportFile.ts
View file @
0686eb66
...
...
@@ -30,9 +30,10 @@ function createDocument(data: any[], labelKey: string) {
return
{
children
:
[
createHeading
(
item
[
labelKey
]),
...
keys
.
map
((
key
)
=>
createText
(
`
${
key
}
:
${
arrayToString
(
item
[
key
])}
`
),
),
...
keys
.
map
((
key
)
=>
{
if
(
key
===
'居住地址'
)
return
createText
(
''
)
return
createText
(
`
${
key
}
:
${
arrayToString
(
item
[
key
])}
`
)
}),
],
}
}),
...
...
src/hooks/useFetch.ts
View file @
0686eb66
...
...
@@ -71,3 +71,10 @@ export async function useFetchAttachment(params: QueryProps) {
})
return
res
&&
res
.
data
&&
res
.
data
.
result
}
export
async
function
useFetchTag
(
params
:
QueryProps
)
{
const
res
=
await
ajax
.
get
({
url
:
api
.
TAG
,
params
,
})
return
res
&&
res
.
data
&&
res
.
data
.
result
}
src/view/components/filter-drawer.vue
View file @
0686eb66
...
...
@@ -22,7 +22,7 @@
:default-expanded-names=
"['1', '2']"
>
<template
#
arrow
>
<n-icon
size=
".
1
rem"
>
<n-icon
size=
".
08
rem"
>
<CaretForward
/>
</n-icon>
</
template
>
...
...
@@ -89,7 +89,7 @@
<n-tabs
v-model:value=
"curGeo"
type=
"line"
size=
"small"
>
<n-tab-pane
name=
"社区"
tab=
"社区"
class=
"geo-list"
>
<div
v-for=
"(item, i) in
list1
"
v-for=
"(item, i) in
areas
"
:key=
"i"
:class=
"{ on: curArea === item }"
@
click=
"setArea(item)"
...
...
@@ -160,8 +160,14 @@
<
script
lang=
"ts"
setup
>
import
store
from
'@/store'
import
{
computed
,
onMounted
,
ref
,
watch
}
from
'vue'
import
{
useFetchOrg
,
useFetchMember
}
from
'@/hooks/useFetch'
import
{
useFetchOrg
,
useFetchMember
,
useFetchTag
,
useFetchArea
,
}
from
'@/hooks/useFetch'
import
useExportFile
from
'@/hooks/useExportFile'
import
dayjs
from
'@/util/dayjs'
import
{
CaretForward
,
ArrowBack
,
ArrowForward
}
from
'@vicons/ionicons5'
import
exportIcon
from
'@images/export.svg'
import
dot
from
'@images/dot.svg'
...
...
@@ -171,46 +177,27 @@ const close = () => store.commit('SET_FILTER_DRAWER', false)
const
curTab
=
ref
(
'tag'
)
const
organization
=
ref
<
{
name
:
string
;
checked
:
boolean
}[]
>
([])
const
getOrgTags
=
async
()
=>
{
const
res
=
(
await
useFetchOrg
({
a
:
'id,count'
,
keys
:
'标签'
,
const
fetchTags
=
async
(
type
:
string
)
=>
{
const
res
=
await
useFetchTag
({
keys
:
'标签名称'
,
q
:
`paths @ "所属模块" && string == "
${
type
}
"`
,
})
)?.
filter
((
e
:
any
)
=>
!!
e
[
'标签'
])
organization
.
value
=
res
.
map
((
item
:
any
)
=>
({
name
:
item
[
'标签'
],
return
res
.
map
((
item
:
any
)
=>
({
name
:
item
[
'标签名称'
],
checked
:
false
,
}))
}
const
organization
=
ref
<
{
name
:
string
;
checked
:
boolean
}[]
>
([])
const
getOrgTags
=
async
()
=>
{
organization
.
value
=
await
fetchTags
(
'党组织'
)
}
const
member
=
ref
<
{
name
:
string
;
checked
:
boolean
}[]
>
([])
const
getMemberTags
=
async
()
=>
{
const
res
=
(
await
useFetchMember
({
a
:
'id,count'
,
keys
:
'标签'
,
})
)?.
filter
((
e
:
any
)
=>
!!
e
[
'标签'
])
const
tags
:
string
[]
=
[]
res
.
forEach
((
item
:
any
)
=>
{
tags
.
push
(...
item
[
'标签'
])
})
member
.
value
=
Array
.
from
(
new
Set
(
tags
)).
map
((
tag
:
string
)
=>
({
name
:
tag
,
checked
:
false
,
}))
member
.
value
=
await
fetchTags
(
'党员'
)
}
const
list1
=
[
'牡丹社区'
,
'XX社区1'
,
'XX社区2'
,
'XX社区3'
,
'XX社区4'
,
'XX社区5'
,
]
const
areas
=
ref
([])
const
list2
=
[
'某某居委1'
,
'某某居委2'
,
...
...
@@ -227,10 +214,19 @@ const list3 = [
'某某小区5'
,
'某某小区6'
,
]
const
getAreas
=
async
()
=>
{
areas
.
value
=
(
await
useFetchArea
({
a
:
'id,count'
,
keys
:
'所属社区'
,
})
).
map
((
item
:
any
)
=>
item
[
'所属社区'
])
}
onMounted
(()
=>
{
getOrgTags
()
getMemberTags
()
getAreas
()
})
const
getDetail
=
async
(
type
:
string
,
name
:
string
)
=>
{
...
...
@@ -242,9 +238,26 @@ const getDetail = async (type: string, name: string) => {
})
break
case
'member'
:
if
(
name
===
'光荣在党50年'
)
{
const
date
=
[
dayjs
().
subtract
(
59
,
'year'
).
format
(
'YYYY-MM-DD'
),
dayjs
().
subtract
(
50
,
'year'
).
format
(
'YYYY-MM-DD'
),
]
console
.
log
(
'---'
,
date
)
res
=
await
useFetchMember
({
q
:
`paths @ "加入中共党组织日期" && string >= "
${
date
[
0
]}
",paths @ "加入中共党组织日期" && string <= "
${
date
[
1
]}
"`
,
})
}
else
if
(
name
===
'党心暖我心'
)
{
const
date
=
dayjs
().
subtract
(
60
,
'year'
).
format
(
'YYYY-MM-DD'
)
res
=
await
useFetchMember
({
q
:
`paths @ "加入中共党组织日期" && string <= "
${
date
}
"`
,
})
}
else
{
res
=
await
useFetchMember
({
q
:
`paths @ "标签" && string == "
${
name
}
"`
,
})
}
break
default
:
break
...
...
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