BUG修改

This commit is contained in:
a0049873 2022-06-24 20:08:54 +08:00
parent 5cab30d2cc
commit df7c0019f8
3 changed files with 104 additions and 57 deletions

View File

@ -56,8 +56,9 @@
</template>
<script setup>
import { ref, onMounted, watch } from 'vue'
import { selectTotal } from '@/api/home'
import {
numberOfResourcesByCategory,
// numberOfResourcesByCategory,
sourceDepartmentStatistics,
} from '@/api/abilityStatistics.js'
// import { zywMessage } from '@/api/home'
@ -84,18 +85,64 @@
// })
// }
//
function snum() {
numberOfResourcesByCategory().then((res) => {
dataList.value.dataList = res.data.data
res.data.data.map((item, index) => {
// if (dataList.value.dataList[index].type === '') {
// dataList.value.dataList[index].amount = dataSourceNum.value || 0
// }
dataList.value.dataList[index].organization = '个'
dataList.value.dataList[index].photo = photo.value[index]
})
// function snum() {
// numberOfResourcesByCategory().then((res) => {
// dataList.value.dataList = res.data.data
// res.data.data.map((item, index) => {
// // if (dataList.value.dataList[index].type === '') {
// // dataList.value.dataList[index].amount = dataSourceNum.value || 0
// // }
// dataList.value.dataList[index].organization = ''
// dataList.value.dataList[index].photo = photo.value[index]
// })
// })
// }
selectTotal().then((res) => {
console.log('selectTotal===============>', res.data.data)
res.data.data.map((item, index) => {
dataList.value.dataList[index].organization = '个'
dataList.value.dataList[index].photo = photo.value[index]
})
}
res.data.data.total.forEach((val) => {
switch (val.type) {
case '组件服务':
dataList.value.dataList.push({
organization: '个',
photo: require('../../../assets/abilityStatistics/banner-zj.png'),
amount: val.count,
})
break
case '应用资源':
dataList.value.dataList.push({
organization: '个',
photo: require('../../../assets/abilityStatistics/banner-yy.png'),
amount: val.count,
})
break
case '基础设施':
dataList.value.dataList.push({
organization: '个',
photo: require('../../../assets/abilityStatistics/banner-jc.png'),
amount: val.count,
})
break
case '数据资源':
dataList.value.dataList.push({
organization: '个',
photo: require('../../../assets/abilityStatistics/banner-sj.png'),
amount: val.count,
})
break
case '知识库':
dataList.value.dataList.push({
organization: '个',
photo: require('../../../assets/abilityStatistics/banner-zs.png'),
amount: val.count,
})
break
}
})
})
let datas = ref([])
let laiyuanDataList = ref([])
// let dataSourceNum = ref(0)

View File

@ -133,10 +133,10 @@
})
obj.value = res.data.data.data || []
object.sjNum = res.data.data.rows
interfaceSuccess.value++
if (interfaceSuccess.value == 5) {
mybus.emit('chagneNum', object)
}
// interfaceSuccess.value++
// if (interfaceSuccess.value == 5) {
// mybus.emit('chagneNum', object)
// }
} else if (whoShow1.value.itShowXiHaiAn) {
res.data.data.list.forEach((val) => {
val.id = val.serviceId // id
@ -149,10 +149,10 @@
})
obj.value = res.data.data.list || []
object.sjNum = res.data.data.total
interfaceSuccess.value++
if (interfaceSuccess.value == 5) {
mybus.emit('chagneNum', object)
}
// interfaceSuccess.value++
// if (interfaceSuccess.value == 5) {
// mybus.emit('chagneNum', object)
// }
}
})
} else {
@ -179,11 +179,11 @@
}
const assignmentMethod = (type, res) => {
object[type] = res.data.data.total
interfaceSuccess.value++
console.log('object个数======>', object, interfaceSuccess.value, type)
if (interfaceSuccess.value >= 4) {
mybus.emit('chagneNum', object)
}
// interfaceSuccess.value++
// console.log('object======>', object, interfaceSuccess.value, type)
// if (interfaceSuccess.value >= 4) {
// mybus.emit('chagneNum', object)
// }
}
getAppResources('组件服务', zjList)
getAppResources('应用资源', yyList)

View File

@ -43,44 +43,44 @@
</div>
</template>
<script setup>
// import { selectTotal } from '@/api/home'
import { selectTotal } from '@/api/home'
import { ref, onMounted, onBeforeUnmount } from 'vue'
import mybus from '@/myplugins/mybus'
// import mybus from '@/myplugins/mybus'
const yyNum = ref('')
const zjNum = ref('')
const jcNum = ref('')
const sjNum = ref('')
const zsNum = ref('')
mybus.on('chagneNum', (obj) => {
console.log('更改数据============>', obj)
yyNum.value = obj.yyNum
zjNum.value = obj.zjNum
jcNum.value = obj.jcNum
sjNum.value = obj.sjNum
zsNum.value = obj.zsNum
})
// selectTotal().then((res) => {
// console.log('selectTotal===============>', res.data.data)
// res.data.data.total.forEach((val) => {
// switch (val.type) {
// case '':
// zjNum.value = val.count
// break
// case '':
// yyNum.value = val.count
// break
// case '':
// jcNum.value = val.count
// break
// case '':
// sjNum.value = val.count
// break
// case '':
// zsNum.value = val.count
// break
// }
// })
// mybus.on('chagneNum', (obj) => {
// console.log('============>', obj)
// yyNum.value = obj.yyNum
// zjNum.value = obj.zjNum
// jcNum.value = obj.jcNum
// sjNum.value = obj.sjNum
// zsNum.value = obj.zsNum
// })
selectTotal().then((res) => {
console.log('selectTotal===============>', res.data.data)
res.data.data.total.forEach((val) => {
switch (val.type) {
case '组件服务':
zjNum.value = val.count
break
case '应用资源':
yyNum.value = val.count
break
case '基础设施':
jcNum.value = val.count
break
case '数据资源':
sjNum.value = val.count
break
case '知识库':
zsNum.value = val.count
break
}
})
})
// const findZywMessage = () => {
// zywMessage().then((res) => {
// // console.log('findMessage============>', res)
@ -92,7 +92,7 @@
// findZywMessage()
})
onBeforeUnmount(() => {
mybus.off('chagneNum')
// mybus.off('chagneNum')
})
</script>
<style lang="less" scoped>