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> </template>
<script setup> <script setup>
import { ref, onMounted, watch } from 'vue' import { ref, onMounted, watch } from 'vue'
import { selectTotal } from '@/api/home'
import { import {
numberOfResourcesByCategory, // numberOfResourcesByCategory,
sourceDepartmentStatistics, sourceDepartmentStatistics,
} from '@/api/abilityStatistics.js' } from '@/api/abilityStatistics.js'
// import { zywMessage } from '@/api/home' // import { zywMessage } from '@/api/home'
@ -84,18 +85,64 @@
// }) // })
// } // }
// //
function snum() { // function snum() {
numberOfResourcesByCategory().then((res) => { // numberOfResourcesByCategory().then((res) => {
dataList.value.dataList = res.data.data // dataList.value.dataList = res.data.data
res.data.data.map((item, index) => { // res.data.data.map((item, index) => {
// if (dataList.value.dataList[index].type === '') { // // if (dataList.value.dataList[index].type === '') {
// dataList.value.dataList[index].amount = dataSourceNum.value || 0 // // dataList.value.dataList[index].amount = dataSourceNum.value || 0
// } // // }
dataList.value.dataList[index].organization = '个' // dataList.value.dataList[index].organization = ''
dataList.value.dataList[index].photo = photo.value[index] // 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 datas = ref([])
let laiyuanDataList = ref([]) let laiyuanDataList = ref([])
// let dataSourceNum = ref(0) // let dataSourceNum = ref(0)

View File

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

View File

@ -43,44 +43,44 @@
</div> </div>
</template> </template>
<script setup> <script setup>
// import { selectTotal } from '@/api/home' import { selectTotal } from '@/api/home'
import { ref, onMounted, onBeforeUnmount } from 'vue' import { ref, onMounted, onBeforeUnmount } from 'vue'
import mybus from '@/myplugins/mybus' // import mybus from '@/myplugins/mybus'
const yyNum = ref('') const yyNum = ref('')
const zjNum = ref('') const zjNum = ref('')
const jcNum = ref('') const jcNum = ref('')
const sjNum = ref('') const sjNum = ref('')
const zsNum = ref('') const zsNum = ref('')
mybus.on('chagneNum', (obj) => { // mybus.on('chagneNum', (obj) => {
console.log('更改数据============>', obj) // console.log('============>', obj)
yyNum.value = obj.yyNum // yyNum.value = obj.yyNum
zjNum.value = obj.zjNum // zjNum.value = obj.zjNum
jcNum.value = obj.jcNum // jcNum.value = obj.jcNum
sjNum.value = obj.sjNum // sjNum.value = obj.sjNum
zsNum.value = obj.zsNum // 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
// }
// })
// }) // })
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 = () => { // const findZywMessage = () => {
// zywMessage().then((res) => { // zywMessage().then((res) => {
// // console.log('findMessage============>', res) // // console.log('findMessage============>', res)
@ -92,7 +92,7 @@
// findZywMessage() // findZywMessage()
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
mybus.off('chagneNum') // mybus.off('chagneNum')
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>