Commit 0bc87d50 by chenwq

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

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