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.
 

116 lines
2.6 KiB

// subpages/communitySelfInsp/pages/synthesis/synthesis.js
const app = getApp()
import {getSynthesis} from '../../../../utils/api'
Page({
/**
* 页面的初始数据
*/
data: {
agencyName:'',//组织名称
tableData:[],
monthName:'',//月份
personQty:'',//提交人数
synthesisScore:'',//综合得分
inspRecordId:'',//自查表Id
fontSize:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
})
this.getSynthesis()
},
getSynthesis(){
let parm = {
period:'2023-09',
inspRecordId:''
}
getSynthesis(parm).then(res=>{
this.setData({
tableData:res.data.categoryDatas,
monthName:res.data.monthName,
synthesisScore:res.data.synthesisScore,
personQty:res.data.personQty,
agencyName:res.data.agencyName,
inspRecordId:res.data.inspRecordId
})
const textContent = res.data.agencyName; // 替换为你实际的内容
if (textContent.length > 5) { // 选择一个合适的长度作为调整字体大小的标准
this.setData({
fontSize: '38rpx' // 选择一个适当的较小字体大小
});
}
}).catch((err)=>{
console.log(err);
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
toDissatisfactionDetails(e){
console.log(e);
let category = e.currentTarget.dataset.item.satisfactionCategory
wx.navigateTo({
url: `/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails?inspRecordId=${this.data.inspRecordId}&category=${category}`,
})
},
back(){
wx.navigateBack({
delta: 1
})
},
})