epmet 工作端 小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.7 KiB

/*
* @Author: mk 2403457699@qq.com
* @Date: 2024-04-16 15:52:08
* @LastEditors: mk 2403457699@qq.com
* @LastEditTime: 2024-10-12 16:50:55
* @FilePath: \epmet-work-mp\pages\statistics\modules\CrowdPortrait\CrowdPortrait.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import {dictlist, satisfactionCrowdPortrait} from "../../../../utils/statisticsApi";
Component({
properties: {},
data: {
tabList: [{
label: "按省及社区满意度\n调查结果",
value: 'provinceAndSelf'
}, {
label: '按12345热线\n投诉结果',
value: '12345'
}],
tabValue: 'provinceAndSelf',
gender: '',
marriageName: '',
ageClassification: '',
cultureLevel: '',
gridName: '',
monthIncomeLevel: '',
residentTagName: '',
matchPeopleNum: '',
searchParams: '',
typeCondition: 0,
typeConditionList: [],
},
lifetimes: {
ready() {
this.getDisKey()
}
},
methods: {
tabChange({detail}) {
this.setData({
tabValue: this.data.tabList[detail].value
})
this.getData()
},
gotopage() {
wx.navigateTo({
url: '/subpages/statistics/pages/crowdPortrait/crowdPortrait?data=' + this.data.searchParams
})
},
getDisKey() {
dictlist({dictType: "satisfaction_category"}).then(({data}) => {
this.setData({
typeConditionList:data
});
this.getData()
});
},
getData() {
let params = {
queryType: this.data.tabValue
}
console.log(this.data.resultType)
if (this.data.tabValue === "provinceAndSelf") {
params.category = this.data.typeConditionList[this.data.typeCondition].value
}
satisfactionCrowdPortrait(params).then(({data}) => {
this.setData({
gender: data.gender,
marriageName: data.marriageName,
ageClassification: data.ageClassification,
cultureName: data.cultureName,
gridName: data.gridName,
monthIncomeLevel: data.monthIncomeLevel,
residentTagName: data.residentTagName?data.residentTagName.split(','):'',
matchPeopleNum: data.matchPeopleNum,
searchParams: JSON.stringify({...data, ...params})
})
})
}
}
});