Commit 0bc87d50 by chenwq

refactor(teamList): 调整组件生命周期并清理冗余代码

将created生命周期钩子替换为mounted,注释掉未实际使用的getStaticData方法
1 parent 9a169558
......@@ -126,7 +126,7 @@ export default {
searchKeyword: ''
}
},
created() {
mounted() {
this.userInfo = (this.$util && this.$util.getUserInfo()) || { name: '' }
// this.getStaticData()
this.onRefresh()
......@@ -142,19 +142,19 @@ export default {
const res = decPart ? `${intFmt}.${decPart}` : intFmt
return isNeg ? `-${res}` : res
},
getStaticData() {
api.getMissionData({}).then(res => {
let { code, data, message } = res
if (code === 0) {
data.staffCount = (data.staffCount ?? '') === '' ? '-' : this.formatThousands(data.staffCount)
data.shopCount = (data.shopCount ?? '') === '' ? '-' : this.formatThousands(data.shopCount)
data.totalValue = (data.totalValue ?? '') === '' ? '-' : this.formatThousands(data.totalValue)
this.staticData = data
} else {
this.$toast && this.$toast(message)
}
})
},
// getStaticData() {
// api.getMissionData({}).then(res => {
// let { code, data, message } = res
// if (code === 0) {
// data.staffCount = (data.staffCount ?? '') === '' ? '-' : this.formatThousands(data.staffCount)
// data.shopCount = (data.shopCount ?? '') === '' ? '-' : this.formatThousands(data.shopCount)
// data.totalValue = (data.totalValue ?? '') === '' ? '-' : this.formatThousands(data.totalValue)
// this.staticData = data
// } else {
// this.$toast && this.$toast(message)
// }
// })
// },
tabClick(index) {
const eventCode = ['supervisor_dayTask_tab', 'supervisor_weeklyTask_tab', 'supervisor_monthlyTask_tab', 'supervisor_specificTask_tab']
if (this.$track) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!