西海岸-支持组件服务-算法分类

This commit is contained in:
guoyue 2022-09-20 13:31:56 +08:00
parent 07fff52e43
commit 7f884528e9
3 changed files with 117 additions and 135 deletions

View File

@ -513,31 +513,35 @@ export default defineComponent({
}
const searchResultListDom = ref(null)
//
const storageSearchInfo = localStorage.getItem('DetailsPageconetent') && JSON.parse(
localStorage.getItem('DetailsPageconetent')
)
const handleSetSearchData = () => {
console.log('storageSearchInfo------------>', storageSearchInfo)
//
if (storageSearchInfo) {
paramsGetResources = Object.assign({}, paramsGetResources, storageSearchInfo)
//
searchValue.value = storageSearchInfo.name;
currentPage.value = storageSearchInfo.pageNum;
currentPageSize.value = storageSearchInfo.pageSize;
paramsGetResources.pageNum = storageSearchInfo.pageNum;
paramsGetResources.pageSize = storageSearchInfo.pageSize;
paramsGetResources.deptIds = storageSearchInfo.deptIds;
paramsGetResources.districtId = storageSearchInfo.districtId;
// 使
nextTick(() => {
searchResultListDom.value.changeCondition({
value: storageSearchInfo.orderField,
orderType: storageSearchInfo.orderType,
}, true)
})
//
let storageSearchInfo = null
const handleSetSearchData = () => {
if (whoShow1.value.itShowXiHaiAn) {
if (localStorage.getItem('DetailsPageconetent')) {
storageSearchInfo = JSON.parse(localStorage.getItem('DetailsPageconetent'));
}
console.log('storageSearchInfo------------>', storageSearchInfo)
//
if (storageSearchInfo) {
paramsGetResources = Object.assign({}, paramsGetResources, storageSearchInfo)
//
searchValue.value = storageSearchInfo.name;
currentPage.value = storageSearchInfo.pageNum;
currentPageSize.value = storageSearchInfo.pageSize;
paramsGetResources.pageNum = storageSearchInfo.pageNum;
paramsGetResources.pageSize = storageSearchInfo.pageSize;
paramsGetResources.deptIds = storageSearchInfo.deptIds;
paramsGetResources.districtId = storageSearchInfo.districtId;
// 使
nextTick(() => {
searchResultListDom.value.changeCondition({
value: storageSearchInfo.orderField,
orderType: storageSearchInfo.orderType,
}, true)
})
}
}
}
@ -631,20 +635,22 @@ export default defineComponent({
paramsGetResources.pageNum = 1
currentPage.value = 1
console.log('点击筛选条件=================>', tag, checked, name)
//
if (tag.dict_label == '智能算法' && checked) {
ListContent.records.splice(2, 1, ListContentCopy.value[2])
} else {
if (name == '组件类型') {
ListContent.records.splice(2, 1)
paramsGetResources.infoList = paramsGetResources.infoList.filter(
(item) => componentTypeArray.includes(item.attrType)
)
// 西-
if (whoShow1.value.itShowXiHaiAn) {
if (tag.dict_label == '智能算法' && checked) {
ListContent.records.splice(2, 1, ListContentCopy.value[2])
} else {
if (name == '组件类型') {
ListContent.records.splice(2, 1)
paramsGetResources.infoList = paramsGetResources.infoList.filter(
(item) => componentTypeArray.includes(item.attrType)
)
}
}
}
ListContent.records.forEach((val) => {
if (!val) {
return;
}
@ -661,10 +667,13 @@ export default defineComponent({
} else {
val.selectedTags && val.selectedTags.splice(val.selectedTags.indexOf(tag.dict_label), 1)
}
//
if ((val.selectedTags.length == 0 && tag.dict_label == '智能算法' && !checked) || (tag.dict_label !== '智能算法' && name == '组件类型')) {
if (ListContentCopy.value[2]) {
ListContentCopy.value[2].selectedTags = []
// 西-
if (whoShow1.value.itShowXiHaiAn) {
if ((val.selectedTags.length == 0 && tag.dict_label == '智能算法' && !checked) || (tag.dict_label !== '智能算法' && name == '组件类型')) {
if (ListContentCopy.value[2]) {
ListContentCopy.value[2].selectedTags = []
}
}
}
}

View File

@ -0,0 +1,46 @@
<template>
<div class="tag-box">
<div class="tag-item" v-for="(item, index) in tagList" :key="index">
{{item}}
</div>
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount, watch, defineProps, defineEmits } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const props = defineProps({
componentServiceTagList: {
type: Object,
default: () => { },
},
})
const tagList = ref([])
onMounted(() => {
tagList.value = props.componentServiceTagList
})
watch(
() => props.componentServiceTagList,
(val) => {
if (val) {
tagList.value = val
}
}
)
</script>
<style lang="less" scoped>
.tag-item {
font-family: 'Alibaba PuHuiTi';
font-weight: 400;
border-radius: 0.12rem;
margin: 0 10px;
padding: 2px 8px;
font-size: 12px;
color: #0087ff;
background: rgba(0, 88, 225, 0.1);
}
</style>

View File

@ -19,10 +19,6 @@
selectCardsname !== '数据资源'
">
{{ item.name }}
<!-- {{orderObj.orderType}}{{orderObj.orderField}} -->
<!-- <span class="arrow" :class="item.value == selData ? 'down' : ''"></span> -->
<!-- {{orderObj.orderType == 'ASC' ? '11' : '22'}} -->
<!-- {{orderObj.orderField == item.value ? '11' : '22'}} -->
<span class="arrow" :class="
orderObj.orderType == 'ASC' &&
orderObj.orderField == item.value
@ -31,7 +27,6 @@
"></span>
</li>
</ul>
<!-- {{JSON.stringify(orderObj)}} -->
</div>
</div>
<div class="result-list" v-for="(item, index) in resourceList.data" :key="item.index">
@ -95,6 +90,8 @@
<div class="header">
<span style="display: flex; align-items: center; width: 680px">
{{ item.name }}
<!-- 西海岸-智能算法-算法类型-标签显示 -->
<ComponentServiceTag v-if="selectCardsname === '组件服务' && whoShow1.itShowXiHaiAn" :componentServiceTagList="getTagList(item)"></ComponentServiceTag>
<!-- 已申请--通过 -->
<svg t="1652322568870" class="icon" viewBox="0 0 3072 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="3062" width="40" height="40" v-if="
@ -159,15 +156,15 @@
<div class="btn">
<div class="bottom" v-if="selectCardsname !== '基础设施'">
<div>
<!-- <div
v-if="
<div
v-if="!whoShow1.itShowXiHaiAn &&
selectCardsname !== '数据资源' &&
selectCardsname !== '融合服务' &&
selectCardsname !== '赋能场景'
"
>
浏览量{{ item.visits || 0 }}
</div> -->
</div>
<div v-if="
selectCardsname !== '数据资源' &&
selectCardsname !== '赋能场景' &&
@ -254,7 +251,8 @@ import { getUser, sgcInsert } from '@/api/home'
import { scInsert, scDel } from '@/api/personalCenter'
import mybus from '@/myplugins/mybus'
import { getHls } from '@/api/home.js'
import IntegrationServiceOrder from './integrationServiceOrder.vue'
import IntegrationServiceOrder from './integrationServiceOrder.vue';
import ComponentServiceTag from './ComponentServiceTag.vue';
export default {
name: '',
props: {
@ -268,98 +266,19 @@ export default {
},
selectCardsname: {
type: String,
default: '组件服务',
},
},
computed: {
dataList() {
const newArr = []
for (let i = 0; i < this.resourceList.data.length; i++) {
let arr = [
{
name: '应用名称',
value: '',
},
{
name: '应用ID',
value: '',
dataResourceId: '',
},
{
name: '应用领域',
value: '',
},
{
name: '组件类型',
value: '',
},
{
name: '技术领域',
value: '',
},
{
name: '共享类型',
value: '',
},
{
name: '共享条件',
value: '',
},
]
arr.map((item) => {
if (item.name === '应用名称') {
item.value = this.resourceList.data[i].name
}
if (item.name === '应用ID') {
item.value = this.resourceList.data[i].id
item.dataResourceId =
this.resourceList.data[i].infoList[0].dataResourceId
}
if (item.name === '应用领域') {
this.resourceList.data[i].infoList.map((aa) => {
aa.attrType === '应用领域' ? (item.value = aa.attrValue) : ''
})
}
if (item.name === '组件类型') {
this.resourceList.data[i].infoList.map((aa) => {
aa.attrType === '组件类型' ? (item.value = aa.attrValue) : ''
})
}
if (item.name === '技术领域') {
this.resourceList.data[i].infoList.map((aa) => {
aa.attrType === '技术领域' ? (item.value = aa.attrValue) : ''
})
}
if (item.name === '共享类型') {
this.resourceList.data[i].infoList.map((aa) => {
aa.attrType === '共享类型' ? (item.value = aa.attrValue) : ''
})
}
if (item.name === '共享条件') {
this.resourceList.data[i].infoList.map((aa) => {
aa.attrType === '共享条件' ? (item.value = aa.attrValue) : ''
})
}
})
newArr.push(arr)
}
console.log('dataList======================>', newArr, this.resourceList)
return newArr
},
isShoppingCartOrNot() {
return ''
default: '应用资源',
},
},
components: {
IntegrationServiceOrder,
ComponentServiceTag,
},
setup(props, context) {
const whoShow1 = whoShow
console.log('whoShow1------------>', whoShow1);
const showKey = ref(0)
let shoppingKey = ref(1)
let orderObj = reactive({
// orderField: 'tdr.create_date',
// orderType: 'ASC',
orderField: '',
orderType: '',
})
@ -367,11 +286,15 @@ export default {
// id
const selList = ref([
{ name: '发布时间', value: 'tdr.create_date', show: true, orderType: 'DESC' },
// { name: '', value: 'visits', show: true, orderType: 'DESC' },
{ name: '浏览量', value: 'visits', show: true, orderType: 'DESC' },
{ name: '申请量', value: 'applyCount', show: true, orderType: 'DESC' },
{ name: '收藏量', value: 'collectCount', show: true, orderType: 'DESC' },
{ name: '评分', value: 'score', show: true, orderType: 'DESC' },
])
// 西-
if(whoShow1.itShowXiHaiAn) {
selList.value = selList.value.filter(v=>v.name !== '浏览量')
}
if (props.selectCardsname === '基础设施') {
selList.value.map((val) => (val.show = false))
} else if (props.selectCardsname === '数据资源') {
@ -389,6 +312,14 @@ export default {
})
}
}
// --
const showTagArray = ['已落地', '需要计算支持']
const getTagList = (item) => {
let _arr = item.infoList.filter((x) => showTagArray.includes(x.attrValue)) || []
let tagArray = _arr.map(v=>v.attrValue)
return tagArray
}
console.log('this.resourceList', props.resourceList.data)
props.resourceList.data.map((val) => {
if (val.infoList) {
@ -576,7 +507,6 @@ export default {
* isFromFather: 是否来自父组件传值
*/
const changeCondition = (item, isFromFather = false) => {
console.log('item, isFromFather------------>', item, isFromFather);
let newType = item.orderType == 'DESC' ? 'ASC' : 'DESC';
if (isFromFather) {
newType = item.orderType;
@ -588,10 +518,6 @@ export default {
selList.value[_index].orderType = newType
}
selList.value = selList.value.splice(0);
nextTick(() => {
console.log('orderObj------------>', orderObj);
console.log('selList------------>', selList.value);
})
mybus.emit('changeCondition', orderObj)
}
@ -737,6 +663,7 @@ export default {
handleAKeyApplication,
integrationServiceOrderDom,
orderObj,
getTagList,
}
},
beforeUnmount() {