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
f0138be1
Commit
f0138be1
authored
Oct 21, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
党员筛选
parent
96a3fd57
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
68 deletions
+77
-68
iat-recorder.js
src/util/iat-recorder.js
+3
-3
filter-drawer.vue
src/view/components/filter-drawer.vue
+74
-62
new-activity-drawer.vue
src/view/components/new-activity-drawer.vue
+0
-1
main.vue
src/view/main.vue
+0
-2
No files found.
src/util/iat-recorder.js
View file @
f0138be1
...
...
@@ -164,7 +164,7 @@ export default class IatRecorder {
}
// 获取浏览器录音权限成功的回调
const
getMediaSuccess
=
(
stream
)
=>
{
console
.
log
(
'getMediaSuccess'
)
//
console.log('getMediaSuccess')
// 创建一个用于通过JavaScript直接处理音频
this
.
scriptProcessor
=
this
.
audioContext
.
createScriptProcessor
(
0
,
1
,
1
)
this
.
scriptProcessor
.
onaudioprocess
=
(
e
)
=>
{
...
...
@@ -183,7 +183,7 @@ export default class IatRecorder {
const
getMediaFail
=
(
e
)
=>
{
alert
(
'请求麦克风失败'
)
console
.
log
(
e
)
//
console.log(e)
this
.
audioContext
&&
this
.
audioContext
.
close
()
this
.
audioContext
=
undefined
// 关闭websocket
...
...
@@ -326,7 +326,7 @@ export default class IatRecorder {
}
if
(
jsonData
.
code
!==
0
)
{
this
.
webSocket
.
close
()
console
.
log
(
`
${
jsonData
.
code
}
:
${
jsonData
.
message
}
`
)
//
console.log(`${jsonData.code}:${jsonData.message}`)
}
}
start
()
{
...
...
src/view/components/filter-drawer.vue
View file @
f0138be1
...
...
@@ -65,7 +65,11 @@
>
<
template
#
suffix
>
年
</
template
>
</n-input-number>
<n-space
justify=
"end"
>
<n-space
:justify=
"ageTips ? 'space-between' : 'end'"
>
<span
v-if=
"ageTips"
class=
"num-tips"
>
已筛选出{{ ageTips }}位党员
</span>
<n-space>
<n-button
size=
"tiny"
@
click=
"resetMember('age')"
>
重置
</n-button>
...
...
@@ -77,6 +81,7 @@
筛选
</n-button>
</n-space>
</n-space>
</div>
<div>
<p>
入党日期筛选
</p>
...
...
@@ -99,7 +104,11 @@
:is-date-disabled=
"disableDateEnd"
/>
</n-space>
<n-space
justify=
"end"
>
<n-space
:justify=
"dateTips ? 'space-between' : 'end'"
>
<span
v-if=
"dateTips"
class=
"num-tips"
>
已筛选出{{ dateTips }}位党员
</span>
<n-space>
<n-button
size=
"tiny"
@
click=
"resetMember('date')"
>
重置
</n-button>
...
...
@@ -111,6 +120,7 @@
筛选
</n-button>
</n-space>
</n-space>
</div>
</div>
<div
class=
"list"
>
...
...
@@ -454,35 +464,23 @@ function resetMember(type) {
switch
(
type
)
{
case
'age'
:
partyAge
.
value
=
null
ageTips
.
value
=
''
break
case
'date'
:
partyStart
.
value
=
null
partyEnd
.
value
=
null
dateTips
.
value
=
''
break
default
:
break
}
const
pointData
:
any
[]
=
[]
orgPointData
.
value
.
forEach
((
item
:
any
[])
=>
{
if
(
!
item
||
item
.
length
===
0
)
return
pointData
.
push
(
...
item
.
map
(({
extra
})
=>
({
上海
2000
纬度
:
extra
[
'上海2000纬度'
]
||
extra
[
'居住地上海2000纬度'
]
||
extra
[
'党组织上海2000纬度'
],
上海
2000
经度
:
extra
[
'上海2000经度'
]
||
extra
[
'居住地上海2000经度'
]
||
extra
[
'党组织上海2000经度'
],
...
extra
,
})),
)
})
store
.
commit
(
'SET_MAP_POINTS'
,
pointData
)
store
.
commit
(
'SET_MAP_POINTS'
)
}
const
ageTips
=
ref
(
''
)
const
dateTips
=
ref
(
''
)
async
function
searchMember
(
type
)
{
member
.
value
.
forEach
((
item
)
=>
(
item
.
checked
=
false
))
organization
.
value
.
forEach
((
item
)
=>
(
item
.
checked
=
false
))
const
query
:
string
[]
=
[
`paths @ "党组织编号" && string @ "
${
store
.
state
.
auth
.
code
}
"`
,
]
...
...
@@ -520,12 +518,28 @@ async function searchMember(type) {
const
memData
=
await
useFetchMember
({
q
:
query
.
join
(
','
),
})
const
total
=
[...
orgPointData
.
value
,
...
memData
]
if
(
type
===
'age'
)
{
ageTips
.
value
=
(
await
useFetchMember
({
q
:
query
.
join
(
','
),
a
:
'id,count'
,
})
)?.[
0
]?.
__aggregate__
+
''
dateTips
.
value
=
''
}
else
if
(
type
===
'date'
)
{
dateTips
.
value
=
(
await
useFetchMember
({
q
:
query
.
join
(
','
),
a
:
'id,count'
,
})
)?.[
0
]?.
__aggregate__
+
''
ageTips
.
value
=
''
}
const
pointData
:
any
[]
=
[]
total
.
forEach
((
item
:
any
[])
=>
{
if
(
!
item
||
item
.
length
===
0
)
return
pointData
.
push
(
...
item
.
map
(({
extra
})
=>
({
memData
.
forEach
(({
extra
})
=>
{
pointData
.
push
({
上海
2000
纬度
:
extra
[
'上海2000纬度'
]
||
extra
[
'居住地上海2000纬度'
]
||
...
...
@@ -535,27 +549,23 @@ async function searchMember(type) {
extra
[
'居住地上海2000经度'
]
||
extra
[
'党组织上海2000经度'
],
...
extra
,
})),
)
})
})
store
.
commit
(
'SET_MAP_POINTS'
,
pointData
)
}
const
orgPointData
=
ref
<
any
>
([])
watch
(
[()
=>
organization
.
value
,
()
=>
member
.
value
],
async
([
organization
,
member
])
=>
{
const
pointData
:
any
[]
=
[]
const
orgKeys
=
organization
.
filter
((
e
)
=>
e
.
checked
).
map
((
e
)
=>
e
.
key
)
const
memKeys
=
member
.
filter
((
e
)
=>
e
.
checked
).
map
((
e
)
=>
e
.
key
)
if
(
memKeys
&&
memKeys
.
length
>
0
)
{
partyAge
.
value
=
null
partyStart
.
value
=
null
partyEnd
.
value
=
null
if
((
memKeys
&&
memKeys
.
length
>
0
)
||
(
orgKeys
&&
orgKeys
.
length
>
0
))
{
resetMember
(
'age'
)
resetMember
(
'date'
)
}
const
orgData
=
await
Promise
.
all
(
orgKeys
.
map
((
key
)
=>
getDetail
(
'organization'
,
key
)),
)
orgPointData
.
value
=
orgData
const
memData
=
await
Promise
.
all
(
memKeys
.
map
((
key
)
=>
getDetail
(
'member'
,
key
)),
)
...
...
@@ -810,6 +820,8 @@ watch(
font-family $font-ping-medium
.input
margin .05rem 0
.num-tips
color $font
#geo-filter
.nav
padding .03rem .1rem
...
...
src/view/components/new-activity-drawer.vue
View file @
f0138be1
...
...
@@ -343,7 +343,6 @@ import useVoiceRecorder from '@/hooks/useVoiceRecorder'
const
{
result
,
toggleRecorder
,
status
,
resetRecorder
}
=
useVoiceRecorder
()
const
activityDescribtion
=
ref
(
''
)
watch
([()
=>
result
.
value
,
()
=>
status
.
value
],
([
txt
,
sta
])
=>
{
console
.
log
(
sta
,
txt
)
if
(
!
txt
)
return
if
(
sta
===
'end'
)
{
activityDescribtion
.
value
=
detailData
.
value
.
attachment
...
...
src/view/main.vue
View file @
f0138be1
...
...
@@ -35,7 +35,6 @@ const resetMap = () => {
store
.
commit
(
'SET_MAP_POINTS'
)
}
const
setBoundary
=
({
type
,
name
}:
{
type
:
string
;
name
:
string
})
=>
{
console
.
log
(
type
,
name
)
if
(
!
map
.
value
)
return
switch
(
type
)
{
case
'building'
:
...
...
@@ -105,7 +104,6 @@ watch(
const
data
=
checkSamePositionPoints
(
points
.
map
((
point
)
=>
JSON
.
parse
(
JSON
.
stringify
(
point
)))
||
[],
)
console
.
log
(
'--'
,
data
)
const
redPoints
:
any
[]
=
[]
const
bluePoints
:
any
[]
=
[]
data
.
forEach
((
item
)
=>
{
...
...
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