优化一下这个方法:resetClick type const roleCn = unigetStorageSyncuserInfo; thiscurrentRolePower = JSONparse JSONstringify thisrolesPowerroleCn ; let temp1 = thiscurrentRolePowertyped
resetClick({ type }) { const { roleCn } = uni.getStorageSync('userInfo'); this.currentRolePower = JSON.parse(JSON.stringify(this.rolesPower[roleCn])); const currentType = this.currentRolePower[type]; const datasRange = currentType?.datasRange?.filter(item => item.checked).map(item => item.text).join('、') || ''; const timeRange = currentType?.timeRange?.filter(item => item.checked).map(item => item.text).join('、') || '';
if (type === 'sales') { this.salesTitleText.data = datasRange; this.salesTitleText.time = timeRange; this.getSales(); this.setSalesFilterVisible(); } else if (type === 'kpis') { this.kpisTitleText = datasRange; this.getKpis(); this.setKpiVisible(); } }
原文地址: https://www.cveoy.top/t/topic/X37 著作权归作者所有。请勿转载和采集!