Commit f0138be1 authored by 郭铭瑶's avatar 郭铭瑶 🤘

党员筛选

parent 96a3fd57
...@@ -164,7 +164,7 @@ export default class IatRecorder { ...@@ -164,7 +164,7 @@ export default class IatRecorder {
} }
// 获取浏览器录音权限成功的回调 // 获取浏览器录音权限成功的回调
const getMediaSuccess = (stream) => { const getMediaSuccess = (stream) => {
console.log('getMediaSuccess') // console.log('getMediaSuccess')
// 创建一个用于通过JavaScript直接处理音频 // 创建一个用于通过JavaScript直接处理音频
this.scriptProcessor = this.audioContext.createScriptProcessor(0, 1, 1) this.scriptProcessor = this.audioContext.createScriptProcessor(0, 1, 1)
this.scriptProcessor.onaudioprocess = (e) => { this.scriptProcessor.onaudioprocess = (e) => {
...@@ -183,7 +183,7 @@ export default class IatRecorder { ...@@ -183,7 +183,7 @@ export default class IatRecorder {
const getMediaFail = (e) => { const getMediaFail = (e) => {
alert('请求麦克风失败') alert('请求麦克风失败')
console.log(e) // console.log(e)
this.audioContext && this.audioContext.close() this.audioContext && this.audioContext.close()
this.audioContext = undefined this.audioContext = undefined
// 关闭websocket // 关闭websocket
...@@ -326,7 +326,7 @@ export default class IatRecorder { ...@@ -326,7 +326,7 @@ export default class IatRecorder {
} }
if (jsonData.code !== 0) { if (jsonData.code !== 0) {
this.webSocket.close() this.webSocket.close()
console.log(`${jsonData.code}:${jsonData.message}`) // console.log(`${jsonData.code}:${jsonData.message}`)
} }
} }
start() { start() {
......
...@@ -65,17 +65,22 @@ ...@@ -65,17 +65,22 @@
> >
<template #suffix></template> <template #suffix></template>
</n-input-number> </n-input-number>
<n-space justify="end"> <n-space :justify="ageTips ? 'space-between' : 'end'">
<n-button size="tiny" @click="resetMember('age')"> <span v-if="ageTips" class="num-tips">
重置 已筛选出{{ ageTips }}位党员
</n-button> </span>
<n-button <n-space>
size="tiny" <n-button size="tiny" @click="resetMember('age')">
type="primary" 重置
@click="searchMember('age')" </n-button>
> <n-button
筛选 size="tiny"
</n-button> type="primary"
@click="searchMember('age')"
>
筛选
</n-button>
</n-space>
</n-space> </n-space>
</div> </div>
<div> <div>
...@@ -99,17 +104,22 @@ ...@@ -99,17 +104,22 @@
:is-date-disabled="disableDateEnd" :is-date-disabled="disableDateEnd"
/> />
</n-space> </n-space>
<n-space justify="end"> <n-space :justify="dateTips ? 'space-between' : 'end'">
<n-button size="tiny" @click="resetMember('date')"> <span v-if="dateTips" class="num-tips">
重置 已筛选出{{ dateTips }}位党员
</n-button> </span>
<n-button <n-space>
size="tiny" <n-button size="tiny" @click="resetMember('date')">
type="primary" 重置
@click="searchMember('date')" </n-button>
> <n-button
筛选 size="tiny"
</n-button> type="primary"
@click="searchMember('date')"
>
筛选
</n-button>
</n-space>
</n-space> </n-space>
</div> </div>
</div> </div>
...@@ -454,35 +464,23 @@ function resetMember(type) { ...@@ -454,35 +464,23 @@ function resetMember(type) {
switch (type) { switch (type) {
case 'age': case 'age':
partyAge.value = null partyAge.value = null
ageTips.value = ''
break break
case 'date': case 'date':
partyStart.value = null partyStart.value = null
partyEnd.value = null partyEnd.value = null
dateTips.value = ''
break break
default: default:
break break
} }
const pointData: any[] = [] store.commit('SET_MAP_POINTS')
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)
} }
const ageTips = ref('')
const dateTips = ref('')
async function searchMember(type) { async function searchMember(type) {
member.value.forEach((item) => (item.checked = false)) member.value.forEach((item) => (item.checked = false))
organization.value.forEach((item) => (item.checked = false))
const query: string[] = [ const query: string[] = [
`paths @ "党组织编号" && string @ "${store.state.auth.code}"`, `paths @ "党组织编号" && string @ "${store.state.auth.code}"`,
] ]
...@@ -520,42 +518,54 @@ async function searchMember(type) { ...@@ -520,42 +518,54 @@ async function searchMember(type) {
const memData = await useFetchMember({ const memData = await useFetchMember({
q: query.join(','), 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[] = [] const pointData: any[] = []
total.forEach((item: any[]) => { memData.forEach(({ extra }) => {
if (!item || item.length === 0) return pointData.push({
pointData.push( 上海2000纬度:
...item.map(({ extra }) => ({ extra['上海2000纬度'] ||
上海2000纬度: extra['居住地上海2000纬度'] ||
extra['上海2000纬度'] || extra['党组织上海2000纬度'],
extra['居住地上海2000纬度'] || 上海2000经度:
extra['党组织上海2000纬度'], extra['上海2000经度'] ||
上海2000经度: extra['居住地上海2000经度'] ||
extra['上海2000经度'] || extra['党组织上海2000经度'],
extra['居住地上海2000经度'] || ...extra,
extra['党组织上海2000经度'], })
...extra,
})),
)
}) })
store.commit('SET_MAP_POINTS', pointData) store.commit('SET_MAP_POINTS', pointData)
} }
const orgPointData = ref<any>([])
watch( watch(
[() => organization.value, () => member.value], [() => organization.value, () => member.value],
async ([organization, member]) => { async ([organization, member]) => {
const pointData: any[] = [] const pointData: any[] = []
const orgKeys = organization.filter((e) => e.checked).map((e) => e.key) const orgKeys = organization.filter((e) => e.checked).map((e) => e.key)
const memKeys = member.filter((e) => e.checked).map((e) => e.key) const memKeys = member.filter((e) => e.checked).map((e) => e.key)
if (memKeys && memKeys.length > 0) { if ((memKeys && memKeys.length > 0) || (orgKeys && orgKeys.length > 0)) {
partyAge.value = null resetMember('age')
partyStart.value = null resetMember('date')
partyEnd.value = null
} }
const orgData = await Promise.all( const orgData = await Promise.all(
orgKeys.map((key) => getDetail('organization', key)), orgKeys.map((key) => getDetail('organization', key)),
) )
orgPointData.value = orgData
const memData = await Promise.all( const memData = await Promise.all(
memKeys.map((key) => getDetail('member', key)), memKeys.map((key) => getDetail('member', key)),
) )
...@@ -810,6 +820,8 @@ watch( ...@@ -810,6 +820,8 @@ watch(
font-family $font-ping-medium font-family $font-ping-medium
.input .input
margin .05rem 0 margin .05rem 0
.num-tips
color $font
#geo-filter #geo-filter
.nav .nav
padding .03rem .1rem padding .03rem .1rem
......
...@@ -343,7 +343,6 @@ import useVoiceRecorder from '@/hooks/useVoiceRecorder' ...@@ -343,7 +343,6 @@ import useVoiceRecorder from '@/hooks/useVoiceRecorder'
const { result, toggleRecorder, status, resetRecorder } = useVoiceRecorder() const { result, toggleRecorder, status, resetRecorder } = useVoiceRecorder()
const activityDescribtion = ref('') const activityDescribtion = ref('')
watch([() => result.value, () => status.value], ([txt, sta]) => { watch([() => result.value, () => status.value], ([txt, sta]) => {
console.log(sta, txt)
if (!txt) return if (!txt) return
if (sta === 'end') { if (sta === 'end') {
activityDescribtion.value = detailData.value.attachment activityDescribtion.value = detailData.value.attachment
......
...@@ -35,7 +35,6 @@ const resetMap = () => { ...@@ -35,7 +35,6 @@ const resetMap = () => {
store.commit('SET_MAP_POINTS') store.commit('SET_MAP_POINTS')
} }
const setBoundary = ({ type, name }: { type: string; name: string }) => { const setBoundary = ({ type, name }: { type: string; name: string }) => {
console.log(type, name)
if (!map.value) return if (!map.value) return
switch (type) { switch (type) {
case 'building': case 'building':
...@@ -105,7 +104,6 @@ watch( ...@@ -105,7 +104,6 @@ watch(
const data = checkSamePositionPoints( const data = checkSamePositionPoints(
points.map((point) => JSON.parse(JSON.stringify(point))) || [], points.map((point) => JSON.parse(JSON.stringify(point))) || [],
) )
console.log('--', data)
const redPoints: any[] = [] const redPoints: any[] = []
const bluePoints: any[] = [] const bluePoints: any[] = []
data.forEach((item) => { data.forEach((item) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment