BUG修改

This commit is contained in:
a0049873 2022-06-24 19:47:00 +08:00
parent 31eee8d607
commit 2bb502921f
4 changed files with 549 additions and 494 deletions

View File

@ -20,7 +20,7 @@
<span class="name-text">{{ item.type }}</span>
</div>
<div class="organization-value">
<span class="num">{{ item.amount }}</span>
<span class="num">{{ item.amount || 0 }}</span>
<span>{{ item.organization }}</span>
</div>
</div>
@ -60,7 +60,7 @@
numberOfResourcesByCategory,
sourceDepartmentStatistics,
} from '@/api/abilityStatistics.js'
import { zywMessage } from '@/api/home'
// import { zywMessage } from '@/api/home'
import * as echarts from 'echarts'
//
let dataList = ref({
@ -76,21 +76,21 @@
])
// let name = ref([])
//
const findZywMessage = () => {
zywMessage().then((res) => {
const { data } = res.data
dataSourceNum.value = data.sxmlcount || 0
snum()
})
}
// const findZywMessage = () => {
// zywMessage().then((res) => {
// const { data } = res.data
// dataSourceNum.value = data.sxmlcount || 0
// snum()
// })
// }
//
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
}
// 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]
})
@ -98,7 +98,7 @@
}
let datas = ref([])
let laiyuanDataList = ref([])
let dataSourceNum = ref(0)
// let dataSourceNum = ref(0)
let bumenSum = ref([])
//-
@ -316,7 +316,8 @@
option && myChart.setOption(option)
}
onMounted(() => {
findZywMessage()
// findZywMessage()
snum()
sourceDepartment()
})
watch(

View File

@ -669,7 +669,7 @@
import {
selectDicStoreAll,
pageWithAttrs,
zywMessage,
// zywMessage,
getDataResource,
} from '@/api/home.js'
import { getSgcList } from '@/api/personalCenter'
@ -1186,21 +1186,21 @@
paramsGetResources.pageNum = val
getAppResources()
}
const findZywMessage = () => {
zywMessage().then((res) => {
console.log('findMessage============>', res)
const { data } = res.data
shujuziyuanqingkuang.value[0].value = data.sxmlcount
shujuziyuanqingkuang.value[1].value = data.yfbfwcount
shujuziyuanqingkuang.value[2].value = data.yfbjk
shujuziyuanqingkuang.value[3].value = new Date().toLocaleString()
})
}
// const findZywMessage = () => {
// zywMessage().then((res) => {
// console.log('findMessage============>', res)
// const { data } = res.data
// shujuziyuanqingkuang.value[0].value = data.sxmlcount
// shujuziyuanqingkuang.value[1].value = data.yfbfwcount
// shujuziyuanqingkuang.value[2].value = data.yfbjk
// shujuziyuanqingkuang.value[3].value = new Date().toLocaleString()
// })
// }
onMounted(() => {
listKey2.value++
console.log('45345345', Cardsname.value, tecHnosphere, appLiCation)
getNewList()
findZywMessage()
// findZywMessage()
// onSearch()
if (!tecHnosphere && !appLiCation) {
getAppResources()
@ -1336,474 +1336,474 @@
})
</script>
<style lang="less" scoped>
.resultListSearchInput-father {
background: #f3f5f9;
padding-left: 0.2rem;
padding-top: 0.2rem;
.resultListSearchInput-son {
background: #fff;
padding: 0.2rem 0.2rem 0rem 0.3rem;
margin-right: 0.2rem;
.hengxian {
width: 100%;
height: 0.01rem;
background: rgba(150, 144, 144, 0.3);
margin-top: 0.2rem;
.resultListSearchInput-father {
background: #f3f5f9;
padding-left: 0.2rem;
padding-top: 0.2rem;
.resultListSearchInput-son {
background: #fff;
padding: 0.2rem 0.2rem 0rem 0.3rem;
margin-right: 0.2rem;
.hengxian {
width: 100%;
height: 0.01rem;
background: rgba(150, 144, 144, 0.3);
margin-top: 0.2rem;
}
}
}
}
.resultListSearchInput {
margin-left: 0.1rem;
:deep(.ant-input) {
width: 4rem;
height: 0.36rem;
background: #fff;
border-radius: 0.04rem;
.resultListSearchInput {
margin-left: 0.1rem;
:deep(.ant-input) {
width: 4rem;
height: 0.36rem;
background: #fff;
border-radius: 0.04rem;
}
:deep(.ant-input-search-button) {
width: 0.8rem;
height: 0.36rem;
background: #0087ff;
border-radius: 0.04rem !important;
font-size: 0.14rem;
font-weight: 400;
color: #fff;
line-height: 0.34rem;
margin-left: 0.1rem;
}
:deep(.ant-input-group-addon) {
left: 0 !important;
}
}
:deep(.ant-input-search-button) {
.button-reset {
border: 0;
outline: none;
width: 0.8rem;
height: 0.36rem;
background: #0087ff;
border-radius: 0.04rem !important;
background: #e1edfa;
border-radius: 0.04rem;
font-size: 0.14rem;
font-weight: 400;
color: #fff;
color: #0087ff;
line-height: 0.34rem;
margin-left: 0.1rem;
}
:deep(.ant-input-group-addon) {
left: 0 !important;
}
}
.button-reset {
border: 0;
outline: none;
width: 0.8rem;
height: 0.36rem;
background: #e1edfa;
border-radius: 0.04rem;
font-size: 0.14rem;
font-weight: 400;
color: #0087ff;
line-height: 0.34rem;
margin-left: 2.5rem;
cursor: pointer;
}
.details-pageconetent {
height: 100%;
width: 100%;
display: flex;
// flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 0.67rem;
position: relative;
background: rgba(245, 243, 243, 0.3);
.details-pageconetent-left {
max-height: 6.9rem;
position: absolute;
width: 2.5rem;
top: 0.17rem;
left: 2.5rem;
margin-right: 0.17rem;
overflow: auto;
}
.top {
min-height: 7.2rem;
position: relative;
width: 10.87rem;
display: flex;
padding-top: 0.2rem;
flex-direction: column;
// align-items: center;
font-size: 0.16rem;
justify-content: left;
margin-left: 2.5rem;
.pagination {
background: #f3f5f9;
padding-bottom: 0.6rem;
cursor: pointer;
}
.details-pageconetent {
height: 100%;
width: 100%;
display: flex;
// flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 0.67rem;
position: relative;
background: rgba(245, 243, 243, 0.3);
.details-pageconetent-left {
max-height: 6.9rem;
position: absolute;
width: 2.5rem;
top: 0.17rem;
left: 2.5rem;
margin-right: 0.17rem;
overflow: auto;
}
.jichusheshi {
// display: flex;
// flex-direction: column;
// justify-content: center;
// padding-top: .4rem;
height: 4.45rem;
// overflow: hidden;
.yunziyuan {
width: 100%;
position: relative;
.shuoming {
position: absolute;
right: 0.2rem;
top: 0.15rem;
font-size: 0.12rem;
}
.yunziyuan-title {
display: flex;
align-items: center;
.tupian {
// width: .89rem;
// height: .74rem;
// background: url('~@/assets/home/yunziyuan.png');
}
.title {
margin-left: 0.1rem;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
}
.fenlei {
display: flex;
margin-left: 0.2rem;
margin-right: 0.3rem;
justify-content: space-between;
}
.keyongziyuan {
display: flex;
justify-content: space-between;
margin-left: 0.3rem;
margin-right: 0.3rem;
div {
display: flex;
div:last-child {
font-weight: 600;
}
}
}
}
.yunziyuan > div {
margin-bottom: 0.1rem;
}
.shipin {
width: 100%;
.shipin-title {
display: flex;
align-items: center;
.tupian {
// width: .56rem;
// height: .5rem;
// background: url('~@/assets/home/shipin.png');
}
.title {
margin-left: 0.1rem;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
}
.fenlei {
display: flex;
margin-left: 0.2rem;
div {
margin-right: 0.6rem;
}
.shuzi {
font-weight: 600;
}
}
}
.shipin > div {
margin-bottom: 0.1rem;
}
}
.jichusheshi > div {
// background: #eaf4ff;
padding-top: 0.1rem;
border-radius: 0.04rem;
margin-bottom: 0.2rem;
padding-bottom: 0.4rem;
}
.shujuziyuan {
display: flex;
flex-direction: column;
justify-content: center;
padding-top: 0.4rem;
.yunziyuan {
width: 100%;
position: relative;
.shuoming {
position: absolute;
right: 0.2rem;
top: 0.15rem;
font-size: 0.12rem;
}
.yunziyuan-title {
display: flex;
align-items: center;
margin-left: 0.2rem;
.tupian {
// width: .51rem;
// height: .5rem;
// background: url('~@/assets/home/shujuziyuan.png');
}
.title {
margin-left: 0.1rem;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
}
.fenlei {
display: flex;
margin-left: 0.2rem;
margin-right: 0.3rem;
justify-content: space-between;
}
.keyongziyuan {
display: flex;
justify-content: space-between;
margin-left: 0.3rem;
margin-right: 0.3rem;
div {
display: flex;
div:last-child {
font-weight: 600;
}
}
}
}
.yunziyuan > div {
margin-bottom: 0.1rem;
}
}
.shujuziyuan > div {
background: #eaf4ff;
padding-top: 0.1rem;
border-radius: 0.04rem;
margin-bottom: 0.2rem;
padding-bottom: 0.4rem;
}
.top-title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.2rem;
font-family: 'Alibaba PuHuiTi';
color: #000000;
line-height: 0.34rem;
.photo {
display: inline-block;
height: 0.44rem;
width: 0.44rem;
margin-right: 0.1rem;
}
div {
margin: 0 0.2rem;
padding: 0 0.1rem;
cursor: pointer;
display: flex;
align-items: center;
}
div:hover {
color: #0087ff;
}
.sel {
font-weight: 600;
color: #0087ff;
border-bottom: 0.02rem solid #0087ff;
}
}
.top-content-father {
.top {
min-height: 7.2rem;
position: relative;
width: 10.87rem;
padding-left: 0.2rem;
// margin-bottom: .2rem;
background: #f3f5f9;
.top-content-son {
background: #fff;
margin: 0rem 0.2rem 0.2rem 0rem;
padding-top: 0.2rem;
padding-bottom: 0.2rem;
display: flex;
padding-top: 0.2rem;
flex-direction: column;
// align-items: center;
font-size: 0.16rem;
justify-content: left;
margin-left: 2.5rem;
.pagination {
background: #f3f5f9;
padding-bottom: 0.6rem;
}
.top-content {
display: flex;
margin-top: 0rem;
span:nth-child(1) {
display: inline-block;
.jichusheshi {
// display: flex;
// flex-direction: column;
// justify-content: center;
// padding-top: .4rem;
height: 4.45rem;
// overflow: hidden;
.yunziyuan {
width: 100%;
position: relative;
// width: .7rem;
line-height: 0.3614rem;
white-space: normal;
text-align: center;
vertical-align: middle;
}
// .top-content-title {
// top: -0.2rem;
// }
.leixingsumfather {
width: 8.1rem;
display: inline-block;
height: 0.3014rem;
overflow: hidden;
// width: 7.18rem;
}
.leixingsumfather2 {
width: 9.2rem;
}
.leixingsum {
display: inline-block;
cursor: pointer;
text-align: center;
margin-top: 0.05rem;
// margin-bottom: .1rem;
.ant-tag-checkable {
width: 0.83rem;
height: 0.25rem;
.shuoming {
position: absolute;
right: 0.2rem;
top: 0.15rem;
font-size: 0.12rem;
}
.yunziyuan-title {
display: flex;
justify-content: center;
align-items: center;
padding-left: 0.05rem;
padding-right: 0.05rem;
float: left;
margin: 0 0.15rem;
font-family: 'AlibabaPuHuiTiR';
font-size: 0.14rem;
color: #333333;
font-weight: 500;
text-align: center;
line-height: 0.14rem;
.tupian {
// width: .89rem;
// height: .74rem;
// background: url('~@/assets/home/yunziyuan.png');
}
.title {
margin-left: 0.1rem;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
}
:deep(.ant-tag-checkable-checked) {
// width: .67rem;
margin-left: 0.15rem;
margin-right: 0.15rem;
text-align: center;
.fenlei {
display: flex;
margin-left: 0.2rem;
margin-right: 0.3rem;
justify-content: space-between;
}
.ant-tag-checkable:active,
.ant-tag-checkable-checked {
width: 0.85rem;
font-family: 'Alibaba PuHuiTi';
.keyongziyuan {
display: flex;
justify-content: space-between;
margin-left: 0.3rem;
margin-right: 0.3rem;
div {
display: flex;
div:last-child {
font-weight: 600;
}
}
}
}
.yunziyuan > div {
margin-bottom: 0.1rem;
}
.shipin {
width: 100%;
.shipin-title {
display: flex;
align-items: center;
.tupian {
// width: .56rem;
// height: .5rem;
// background: url('~@/assets/home/shipin.png');
}
.title {
margin-left: 0.1rem;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
}
.fenlei {
display: flex;
margin-left: 0.2rem;
div {
margin-right: 0.6rem;
}
.shuzi {
font-weight: 600;
}
}
}
.shipin > div {
margin-bottom: 0.1rem;
}
}
.jichusheshi > div {
// background: #eaf4ff;
padding-top: 0.1rem;
border-radius: 0.04rem;
margin-bottom: 0.2rem;
padding-bottom: 0.4rem;
}
.shujuziyuan {
display: flex;
flex-direction: column;
justify-content: center;
padding-top: 0.4rem;
.yunziyuan {
width: 100%;
position: relative;
.shuoming {
position: absolute;
right: 0.2rem;
top: 0.15rem;
font-size: 0.12rem;
}
.yunziyuan-title {
display: flex;
align-items: center;
margin-left: 0.2rem;
.tupian {
// width: .51rem;
// height: .5rem;
// background: url('~@/assets/home/shujuziyuan.png');
}
.title {
margin-left: 0.1rem;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
}
.fenlei {
display: flex;
margin-left: 0.2rem;
margin-right: 0.3rem;
justify-content: space-between;
}
.keyongziyuan {
display: flex;
justify-content: space-between;
margin-left: 0.3rem;
margin-right: 0.3rem;
div {
display: flex;
div:last-child {
font-weight: 600;
}
}
}
}
.yunziyuan > div {
margin-bottom: 0.1rem;
}
}
.shujuziyuan > div {
background: #eaf4ff;
padding-top: 0.1rem;
border-radius: 0.04rem;
margin-bottom: 0.2rem;
padding-bottom: 0.4rem;
}
.top-title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.2rem;
font-family: 'Alibaba PuHuiTi';
color: #000000;
line-height: 0.34rem;
.photo {
display: inline-block;
height: 0.44rem;
width: 0.44rem;
margin-right: 0.1rem;
}
div {
margin: 0 0.2rem;
padding: 0 0.1rem;
cursor: pointer;
display: flex;
align-items: center;
}
div:hover {
color: #0087ff;
}
.sel {
font-weight: 600;
color: #0087ff;
border-bottom: 0.02rem solid #0087ff;
}
}
.top-content-father {
width: 10.87rem;
padding-left: 0.2rem;
// margin-bottom: .2rem;
background: #f3f5f9;
.top-content-son {
background: #fff;
margin: 0rem 0.2rem 0.2rem 0rem;
padding-top: 0.2rem;
padding-bottom: 0.2rem;
}
.top-content {
display: flex;
margin-top: 0rem;
span:nth-child(1) {
display: inline-block;
position: relative;
// width: .7rem;
line-height: 0.3614rem;
white-space: normal;
text-align: center;
vertical-align: middle;
}
// .top-content-title {
// top: -0.2rem;
// }
.leixingsumfather {
width: 8.1rem;
display: inline-block;
height: 0.3014rem;
overflow: hidden;
// width: 7.18rem;
}
.leixingsumfather2 {
width: 9.2rem;
}
.leixingsum {
display: inline-block;
cursor: pointer;
text-align: center;
margin-top: 0.05rem;
// margin-bottom: .1rem;
.ant-tag-checkable {
width: 0.83rem;
height: 0.25rem;
display: flex;
justify-content: center;
align-items: center;
padding-left: 0.05rem;
padding-right: 0.05rem;
float: left;
margin: 0 0.15rem;
font-family: 'AlibabaPuHuiTiR';
font-size: 0.14rem;
color: #333333;
font-weight: 500;
text-align: center;
line-height: 0.14rem;
}
:deep(.ant-tag-checkable-checked) {
// width: .67rem;
margin-left: 0.15rem;
margin-right: 0.15rem;
text-align: center;
}
.ant-tag-checkable:active,
.ant-tag-checkable-checked {
width: 0.85rem;
font-family: 'Alibaba PuHuiTi';
font-weight: 500;
background-color: #0087ff;
color: #ffffff;
border-radius: 0.16rem;
}
}
.active {
font-family: Alibaba PuHuiTi;
font-weight: 500;
background-color: #0087ff;
color: #ffffff;
border-radius: 0.16rem;
}
}
.active {
font-family: Alibaba PuHuiTi;
.top-content:nth-child(1) {
margin-top: 0rem !important;
}
}
}
}
.shrinkTag {
width: 0.5rem;
display: flex;
justify-content: center;
align-items: flex-end;
margin-bottom: 0.05rem;
span {
cursor: pointer;
}
}
.shrink {
height: unset !important;
overflow: unset !important;
}
.talk-monitor {
position: fixed;
bottom: 0.5rem;
right: 0.1rem;
z-index: 9999;
cursor: pointer;
i {
width: 0.64rem;
height: 0.64rem;
display: inline-block;
background: url('~@/assets/home/icon-talk.png');
background-size: cover;
}
}
.top-content-father {
width: 10.87rem;
padding-left: 0.2rem;
// margin-bottom: .2rem;
.top-content {
display: flex;
margin-top: 0.23rem;
span:nth-child(1) {
display: inline-block;
position: relative;
width: 0.68rem;
font-weight: 600;
white-space: normal;
text-align: center;
vertical-align: middle;
font-size: 0.16rem;
margin-left: 0.3rem;
}
// .top-content-title {
// top: -0.2rem;
// }
.leixingsumfather {
width: 7.7rem;
display: inline-block;
height: 0.3014rem;
overflow: hidden;
// width: 7.18rem;
}
.leixingsum {
width: 0.93rem;
display: inline-block;
cursor: pointer;
text-align: center;
margin-top: 0.05rem;
// margin-bottom: .1rem;
.ant-tag-checkable {
width: 0.85rem;
height: 0.25rem;
display: flex;
justify-content: center;
align-items: center;
padding-left: 0.05rem;
padding-right: 0.05rem;
float: left;
margin: 0 0.15rem;
font-family: 'AlibabaPuHuiTiR';
font-size: 0.14rem;
color: #333333;
font-weight: 500;
text-align: center;
line-height: 0.14rem;
}
:deep(.ant-tag-checkable-checked) {
// width: .67rem;
margin-left: 0.15rem;
margin-right: 0.15rem;
text-align: center;
}
.ant-tag-checkable:active,
.ant-tag-checkable-checked {
width: 0.85rem;
font-family: 'Alibaba PuHuiTi';
font-weight: 500;
background-color: #0087ff;
color: #ffffff;
border-radius: 0.16rem;
}
}
.top-content:nth-child(1) {
margin-top: 0rem !important;
}
}
}
}
.shrinkTag {
width: 0.5rem;
display: flex;
justify-content: center;
align-items: flex-end;
margin-bottom: 0.05rem;
span {
cursor: pointer;
}
}
.shrink {
height: unset !important;
overflow: unset !important;
}
.talk-monitor {
position: fixed;
bottom: 0.5rem;
right: 0.1rem;
z-index: 9999;
cursor: pointer;
i {
width: 0.64rem;
height: 0.64rem;
display: inline-block;
background: url('~@/assets/home/icon-talk.png');
background-size: cover;
}
}
.top-content-father {
width: 10.87rem;
padding-left: 0.2rem;
// margin-bottom: .2rem;
.top-content {
display: flex;
margin-top: 0.23rem;
span:nth-child(1) {
display: inline-block;
position: relative;
width: 0.68rem;
font-weight: 600;
white-space: normal;
text-align: center;
vertical-align: middle;
font-size: 0.16rem;
margin-left: 0.3rem;
}
// .top-content-title {
// top: -0.2rem;
// }
.leixingsumfather {
width: 7.7rem;
display: inline-block;
height: 0.3014rem;
overflow: hidden;
// width: 7.18rem;
}
.leixingsum {
width: 0.93rem;
display: inline-block;
cursor: pointer;
text-align: center;
margin-top: 0.05rem;
// margin-bottom: .1rem;
.ant-tag-checkable {
width: 0.85rem;
height: 0.25rem;
display: flex;
justify-content: center;
align-items: center;
padding-left: 0.05rem;
padding-right: 0.05rem;
float: left;
margin: 0 0.15rem;
font-family: 'AlibabaPuHuiTiR';
font-size: 0.14rem;
color: #333333;
font-weight: 500;
text-align: center;
line-height: 0.14rem;
}
:deep(.ant-tag-checkable-checked) {
// width: .67rem;
margin-left: 0.15rem;
margin-right: 0.15rem;
text-align: center;
}
.ant-tag-checkable:active,
.ant-tag-checkable-checked {
width: 0.85rem;
font-family: 'Alibaba PuHuiTi';
.active {
font-family: Alibaba PuHuiTi;
font-weight: 500;
background-color: #0087ff;
color: #ffffff;
border-radius: 0.16rem;
}
}
.active {
font-family: Alibaba PuHuiTi;
font-weight: 500;
background-color: #0087ff;
color: #ffffff;
.top-content:nth-child(1) {
margin-top: 0.41rem !important;
}
}
.top-content:nth-child(1) {
margin-top: 0.41rem !important;
:deep(.ant-card-grid) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
}
}
:deep(.ant-card-grid) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
}
</style>

View File

@ -77,9 +77,10 @@
</template>
<script setup>
import { pageWithAttrs, getDataResource } from '@/api/home.js'
import { ref } from 'vue'
import { ref, reactive } from 'vue'
import { useRouter } from 'vue-router'
import { useStore } from 'vuex'
import mybus from '@/myplugins/mybus'
const store = useStore()
const router = useRouter()
const zjList = ref([])
@ -102,6 +103,14 @@
console.log('dataShowdev==========================>', whoShow)
// eslint-disable-next-line no-undef
const whoShow1 = ref(whoShow)
const interfaceSuccess = ref(0)
const object = reactive({
yyNum: '',
zjNum: '',
jcNum: '',
sjNum: '',
zsNum: '',
})
const getAppResources = (type, obj) => {
paramsGetResources.type = type
if (type === '数据资源' && !whoShow1.value.itShowBaoTou) {
@ -123,6 +132,11 @@
val.createDate = val.fbrq //
})
obj.value = res.data.data.data || []
object.sjNum = res.data.data.rows
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
@ -134,15 +148,43 @@
val.createDate = val.createTime //
})
obj.value = res.data.data.list || []
object.sjNum = res.data.data.total
interfaceSuccess.value++
if (interfaceSuccess.value == 5) {
mybus.emit('chagneNum', object)
}
}
})
} else {
let type = paramsGetResources.type
pageWithAttrs(paramsGetResources).then((res) => {
// console.log('============>', res.data.data.records)
console.log('object个数======>', type)
obj.value = res.data.data.records
switch (type) {
case '组件服务':
assignmentMethod('zjNum', res)
break
case '应用资源':
assignmentMethod('yyNum', res)
break
case '基础设施':
assignmentMethod('jcNum', res)
break
case '知识库':
assignmentMethod('zsNum', res)
break
}
})
}
}
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)
}
}
getAppResources('组件服务', zjList)
getAppResources('应用资源', yyList)
getAppResources('基础设施', jcList)

View File

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