西海岸:修复首页--能力汇聚显示错乱bug
This commit is contained in:
parent
140ff7f92c
commit
edf1cb5af9
|
@ -8,65 +8,40 @@
|
|||
<div class="bottom">
|
||||
<div class="item">
|
||||
<div class="zj">组件服务</div>
|
||||
<div
|
||||
class="name"
|
||||
v-for="(item, index) in zjList.slice(0, 5)"
|
||||
:key="item.name"
|
||||
:class="index == 4 ? 'name-last' : ''"
|
||||
@click="selectOne1(item.name)"
|
||||
>
|
||||
<div class="name" v-for="(item, index) in zjList.slice(0, 5)" :key="item.name"
|
||||
:class="index == 4 ? 'name-last' : ''" @click="selectOne1(item.name)">
|
||||
{{ item.name + '-' + item.num + '项' }}
|
||||
</div>
|
||||
<div class="btn" @click="jumpPage('组件服务')">查看更多</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="yy">应用资源</div>
|
||||
<div
|
||||
class="name"
|
||||
v-for="(item, index) in yyList.slice(0, 5)"
|
||||
:key="item.name"
|
||||
:class="index == 4 ? 'name-last' : ''"
|
||||
@click="selectOne11(item.name)"
|
||||
>
|
||||
<div class="name" v-for="(item, index) in yyList.slice(0, 5)" :key="item.name"
|
||||
:class="index == 4 ? 'name-last' : ''" @click="selectOne11(item.name)">
|
||||
{{ item.name + '-' + item.num + '项' }}
|
||||
</div>
|
||||
<div class="btn" @click="jumpPage('应用资源')">查看更多</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="jc">基础设施</div>
|
||||
<div
|
||||
class="name"
|
||||
v-for="(item, index) in jcList.slice(0, 5)"
|
||||
:key="item.name"
|
||||
:class="index == 2 ? 'name-last' : ''"
|
||||
@click="selectOne2(item.name)"
|
||||
>
|
||||
<div class="name" v-for="(item, index) in jcList.slice(0, 5)" :key="item.name"
|
||||
:class="index == 2 ? 'name-last' : ''" @click="selectOne2(item.name)">
|
||||
{{ item.name + '-' + item.num + '项' }}
|
||||
</div>
|
||||
<div class="btn" @click="jumpPage('基础设施')">查看更多</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="sj">数据资源</div>
|
||||
<div
|
||||
class="name"
|
||||
v-for="(item, index) in sjList"
|
||||
:key="item.id"
|
||||
:class="index == 4 ? 'name-last' : ''"
|
||||
@click="selectOne3(item.name)"
|
||||
>
|
||||
<div class="name" v-for="(item, index) in sjList" :key="item.id" :class="index == 4 ? 'name-last' : ''"
|
||||
@click="selectOne3(item.name)">
|
||||
{{ index + 1 }}-{{ item.name }}
|
||||
</div>
|
||||
<div class="btn" @click="jumpPage('数据资源')">查看更多</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="zs">知识库</div>
|
||||
<div
|
||||
class="name"
|
||||
v-for="(item, index) in zsList"
|
||||
:key="item.id"
|
||||
:class="index == 4 ? 'name-last' : ''"
|
||||
@click="openHref(item)"
|
||||
>
|
||||
<div class="name" v-for="(item, index) in zsList" :key="item.id" :class="index == 4 ? 'name-last' : ''"
|
||||
@click="openHref(item)">
|
||||
{{ index + 1 }}-{{ item.name }}
|
||||
</div>
|
||||
<div class="btn" @click="jumpPage('知识库')">查看更多</div>
|
||||
|
@ -76,29 +51,29 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
import {
|
||||
pageWithAttrs,
|
||||
getDataResource,
|
||||
selectInfrastructureList,
|
||||
selectCollectComponentList,
|
||||
selectCollectResourceList
|
||||
} from '@/api/home.js'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useStore } from 'vuex'
|
||||
import { updateVisits, browsingInsert, getSoldierList } from '@/api/home'
|
||||
import { message, Upload } from 'ant-design-vue'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
const store = useStore()
|
||||
const router = useRouter()
|
||||
const zjList = ref([])
|
||||
const jcList = ref([])
|
||||
const sjList = ref([])
|
||||
const yyList = ref([])
|
||||
// 知识库模块数据
|
||||
const zsList = ref([])
|
||||
// const jcList = ref([])
|
||||
const paramsGetResources = {
|
||||
} from '@/api/home.js'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useStore } from 'vuex'
|
||||
import { updateVisits, browsingInsert, getSoldierList } from '@/api/home'
|
||||
import { message, Upload } from 'ant-design-vue'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
const store = useStore()
|
||||
const router = useRouter()
|
||||
const zjList = ref([])
|
||||
const jcList = ref([])
|
||||
const sjList = ref([])
|
||||
const yyList = ref([])
|
||||
// 知识库模块数据
|
||||
const zsList = ref([])
|
||||
// const jcList = ref([])
|
||||
const paramsGetResources = {
|
||||
districtId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
|
@ -107,19 +82,19 @@
|
|||
infoList: [],
|
||||
orderField: 'total', // total 综合 visits 访问量 applyCount 申请量 score 评分 collectCount 收藏量
|
||||
orderType: 'DESC', // ASC 升序 DESC 降序
|
||||
}
|
||||
console.log('dataShowdev==========================>', whoShow)
|
||||
// eslint-disable-next-line no-undef
|
||||
const whoShow1 = ref(whoShow)
|
||||
const interfaceSuccess = ref(0)
|
||||
const object = reactive({
|
||||
}
|
||||
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) => {
|
||||
})
|
||||
const getAppResources = (type, obj) => {
|
||||
paramsGetResources.type = type
|
||||
if (type === '数据资源' && !whoShow1.value.itShowBaoTou) {
|
||||
getDataResource({
|
||||
|
@ -162,7 +137,7 @@
|
|||
if (type == '基础设施') {
|
||||
jcList.value = []
|
||||
selectInfrastructureList().then((res) => {
|
||||
console.log('基础设施==========>', res.data.data)
|
||||
console.log('基础设施------res------>', res);
|
||||
for (const key in res.data.data) {
|
||||
if (whoShow1.value.itShowXiHaiAn) {
|
||||
if (key === '视频资源') {
|
||||
|
@ -208,41 +183,27 @@
|
|||
else if (type == '组件服务') {
|
||||
zjList.value = []
|
||||
selectCollectComponentList().then((res) => {
|
||||
console.log('组件服务----res-------->', res);
|
||||
for (const key in res.data.data) {
|
||||
if (whoShow1.value.itShowXiHaiAn) {
|
||||
if (key === '视频资源') {
|
||||
console.log('key------------>', key);
|
||||
zjList.value.push({
|
||||
name: key,
|
||||
num: res.data.data[key],
|
||||
})
|
||||
}
|
||||
} else {
|
||||
zjList.value.push({
|
||||
name: key,
|
||||
num: res.data.data[key],
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log('zjList------------>', zjList);
|
||||
})
|
||||
}
|
||||
else if (type == '应用资源') {
|
||||
yyList.value = []
|
||||
selectCollectResourceList().then((res) => {
|
||||
console.log('应用资源---res--------->', res);
|
||||
for (const key in res.data.data) {
|
||||
if (whoShow1.value.itShowXiHaiAn) {
|
||||
if (key === '视频资源') {
|
||||
yyList.value.push({
|
||||
name: key,
|
||||
num: res.data.data[key],
|
||||
})
|
||||
}
|
||||
} else {
|
||||
yyList.value.push({
|
||||
name: key,
|
||||
num: res.data.data[key],
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
@ -266,10 +227,10 @@
|
|||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo 获取无人机、单兵设备
|
||||
const getSoldierData = (name) => {
|
||||
// todo 获取无人机、单兵设备
|
||||
const getSoldierData = (name) => {
|
||||
let _params = {
|
||||
type: name,
|
||||
page: 1,
|
||||
|
@ -288,9 +249,9 @@
|
|||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const openHref = (item) => {
|
||||
const openHref = (item) => {
|
||||
console.log(item.id, 'wowowo')
|
||||
console.log(item.visits, 'wowowo')
|
||||
browsingInsert({ resourceId: item.id }).then((res) => {
|
||||
|
@ -308,27 +269,17 @@
|
|||
})
|
||||
}
|
||||
window.open(item.link)
|
||||
// window.open(
|
||||
// window.SITE_CONFIG.previewUrl +
|
||||
// 'hisense_office/onlinePreview?url=' +
|
||||
// btoa(encodeURI(item.fileHref))
|
||||
// )
|
||||
}
|
||||
const assignmentMethod = (type, res) => {
|
||||
}
|
||||
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)
|
||||
getAppResources('数据资源', sjList)
|
||||
getAppResources('知识库', zsList)
|
||||
}
|
||||
getAppResources('组件服务', zjList)
|
||||
getAppResources('应用资源', yyList)
|
||||
getAppResources('基础设施', jcList)
|
||||
getAppResources('数据资源', sjList)
|
||||
getAppResources('知识库', zsList)
|
||||
|
||||
function jumpPage(type) {
|
||||
function jumpPage(type) {
|
||||
// 点击内存入store
|
||||
store.commit('home/selectCardsData', {
|
||||
selectCardsnum: type,
|
||||
|
@ -344,8 +295,8 @@
|
|||
select: type,
|
||||
},
|
||||
})
|
||||
}
|
||||
const selectOne = (id) => {
|
||||
}
|
||||
const selectOne = (id) => {
|
||||
console.log('点击===============》', id)
|
||||
router.push({
|
||||
path: '/details',
|
||||
|
@ -353,8 +304,8 @@
|
|||
id: id,
|
||||
},
|
||||
})
|
||||
}
|
||||
const selectOne1 = (name) => {
|
||||
}
|
||||
const selectOne1 = (name) => {
|
||||
router.push({
|
||||
path: '/DetailsPageconetent',
|
||||
query: {
|
||||
|
@ -362,8 +313,8 @@
|
|||
select: '组件服务',
|
||||
},
|
||||
})
|
||||
}
|
||||
const selectOne11 = (name) => {
|
||||
}
|
||||
const selectOne11 = (name) => {
|
||||
router.push({
|
||||
path: '/DetailsPageconetent',
|
||||
query: {
|
||||
|
@ -371,8 +322,8 @@
|
|||
select: '应用资源',
|
||||
},
|
||||
})
|
||||
}
|
||||
const selectOne2 = (name) => {
|
||||
}
|
||||
const selectOne2 = (name) => {
|
||||
console.log('点击===============》', name)
|
||||
router.push({
|
||||
path: '/DetailsPageconetent',
|
||||
|
@ -381,8 +332,8 @@
|
|||
select: '基础设施',
|
||||
},
|
||||
})
|
||||
}
|
||||
const selectOne3 = (name) => {
|
||||
}
|
||||
const selectOne3 = (name) => {
|
||||
console.log('点击===============》', name)
|
||||
router.push({
|
||||
path: '/DetailsPageconetent',
|
||||
|
@ -391,10 +342,10 @@
|
|||
select: '数据资源',
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.capability-convergence {
|
||||
.capability-convergence {
|
||||
height: 7.2rem;
|
||||
background: url('~@/assets/newHome/Convergence-bg.png') no-repeat;
|
||||
background-size: 100%;
|
||||
|
@ -519,5 +470,5 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue