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

党员筛选

parent 96a3fd57
......@@ -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() {
......
......@@ -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
......
......@@ -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
......
......@@ -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) => {
......
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