赋能场景

This commit is contained in:
gaoyuanwei 2022-08-25 20:47:41 +08:00
parent 748b3b72ea
commit d7d2c56ec7
2 changed files with 437 additions and 308 deletions

View File

@ -0,0 +1,92 @@
<template>
<div class="box">
<div class="CanCase">
<div
class="caseBox"
v-for="(item, index) in caseList"
:key="index"
@click="toView('details', item)"
>
<a-image
:preview="false"
:src="
item.fuseAttrList.filter((val) => val.attrType == '服务图片')[0]
.attrValue
"
/>
<h3>{{ item.name }}</h3>
<p>发布时间 {{ item.updateDate }}</p>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { defineProps } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const props = defineProps({
resourceList: {
type: Object,
default: () => {},
},
resourceTotal: {
type: String,
default: '0',
},
selectCardsname: {
type: String,
default: '组件服务',
},
})
const caseList = ref([])
onMounted(() => {
caseList.value = props.resourceList.data
console.log(caseList.value, 'caseList.value')
})
onBeforeUnmount(() => {})
function toView(type, item) {
router.push({
path: '/integrationServicesDetails',
query: {
id: item.id,
},
})
}
</script>
<style lang="less" scoped>
.box {
.CanCase {
margin-top: 0.2rem;
display: grid;
grid-template-columns: 33.33% 33.33% 33.33%;
align-items: center;
justify-items: center;
.caseBox {
width: 3.5rem;
height: 3rem;
box-shadow: 1px 1px 5px 5px rgba(222, 222, 222, 0.152);
background: #ffffff;
border-radius: 0.05rem;
padding: 0.2rem;
margin-bottom: 0.2rem;
cursor: pointer;
img {
width: 3rem;
height: 1.8rem;
}
h3 {
font-size: 0.18rem;
font-weight: bold;
margin-top: 0.1rem;
}
p {
font-size: 0.16rem;
color: #797979;
}
}
}
}
</style>

View File

@ -5,36 +5,71 @@
<div class="top"> <div class="top">
<div class="top-title"> <div class="top-title">
全部 全部
<div v-for="(item, index) in titleName" :key="index" class="tabAll" @click="changeCards(index)" <div
:class="{ sel: index == number }"> v-for="(item, index) in titleName"
:key="index"
class="tabAll"
@click="changeCards(index)"
:class="{ sel: index == number }"
>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> </div>
</div> </div>
<div class="resultListSearchInput-father"> <div class="resultListSearchInput-father" v-if="number === 0">
<div class="resultListSearchInput-son"> <div class="resultListSearchInput-son">
模糊搜索 模糊搜索
<a-input-search v-model:value="searchValue" placeholder="请输入关键词" enter-button="搜索" size="large" <a-input-search
@search="getAppResources" @change="onSearch" class="resultListSearchInput" /> v-model:value="searchValue"
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@search="getAppResources"
@change="onSearch"
class="resultListSearchInput"
/>
<button class="button-reset" @click="chongzhi()">重置</button> <button class="button-reset" @click="chongzhi()">重置</button>
<div class="hengxian"></div> <div class="hengxian"></div>
</div> </div>
</div> </div>
<div v-loading="loadingData"> <div v-loading="loadingData">
<searchResultList v-show="resourceList.data && resourceList.data.length > 0" :key="listKey2" <searchResultList
:resourceList="resourceList" :resourceTotal="resourceTotal" v-if="number === 0"
:selectCardsname="number == 0 ? '融合服务' : '赋能场景'" /> v-show="resourceList.data && resourceList.data.length > 0"
:key="listKey2"
:resourceList="resourceList"
:resourceTotal="resourceTotal"
:selectCardsname="number == 0 ? '融合服务' : '赋能场景'"
/>
<CanAssignCase
v-else
v-show="resourceList.data && resourceList.data.length > 0"
:key="listKey2"
:resourceList="resourceList"
:resourceTotal="resourceTotal"
:selectCardsname="number == 0 ? '融合服务' : '赋能场景'"
/>
<div class="pagination"> <div class="pagination">
<a-pagination v-if="resourceList.data && resourceList.data.length > 0" v-model:current="currentPage" <a-pagination
v-model:pageSize="currentPageSize" show-size-changer show-less-items show-quick-jumper v-if="resourceList.data && resourceList.data.length > 0"
:total="resourceTotal" :page-size-options="pageSizeOptions" @change="pageChange" v-model:current="currentPage"
@showSizeChange="onShowSizeChange" /> v-model:pageSize="currentPageSize"
show-size-changer
show-less-items
show-quick-jumper
:total="resourceTotal"
:page-size-options="pageSizeOptions"
@change="pageChange"
@showSizeChange="onShowSizeChange"
/>
</div> </div>
<div v-if="resourceList.data && resourceList.data.length <= 0" style="margin-top: 2rem"> <div
v-if="resourceList.data && resourceList.data.length <= 0"
style="margin-top: 2rem"
>
<a-empty /> <a-empty />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<home-footer></home-footer> <home-footer></home-footer>
</template> </template>
@ -47,6 +82,7 @@ import { getIntegrationServicesList } from '@/api/home.js'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import HomeHeader from '@/views/home/components/header' import HomeHeader from '@/views/home/components/header'
import searchResultList from '@/views/home/components/searchResultList.vue' import searchResultList from '@/views/home/components/searchResultList.vue'
import CanAssignCase from '@/views/home/components/CanAssignCase.vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
export default defineComponent({ export default defineComponent({
@ -126,8 +162,8 @@ export default defineComponent({
// //
const getIntegrationList = () => { const getIntegrationList = () => {
loadingData.value = true; loadingData.value = true
console.log('获取融合服务列表------------>'); console.log('获取融合服务列表------------>')
let postData = { let postData = {
limit: currentPageSize.value, limit: currentPageSize.value,
page: currentPage.value, page: currentPage.value,
@ -138,17 +174,17 @@ export default defineComponent({
} }
getIntegrationServicesList(postData).then( getIntegrationServicesList(postData).then(
(res) => { (res) => {
loadingData.value = false; loadingData.value = false
if (res.data.code !== 0) { if (res.data.code !== 0) {
return message.error(res.data.msg) return message.error(res.data.msg)
} }
console.log('res.data------------>', res.data); console.log('res.data------------>', res.data)
resourceList.data = res.data.data.list || [] resourceList.data = res.data.data.list || []
resourceTotal.value = res.data.data.total || 0 resourceTotal.value = res.data.data.total || 0
}, },
(err) => { (err) => {
loadingData.value = false; loadingData.value = false
message.error(err) message.error(err)
} }
) )
@ -192,7 +228,7 @@ export default defineComponent({
} }
onMounted(() => { onMounted(() => {
console.log('222----onMounted-------->', 222); console.log('222----onMounted-------->', 222)
listKey2.value++ listKey2.value++
getAppResources() getAppResources()
}) })
@ -235,6 +271,7 @@ export default defineComponent({
HomeHeader, HomeHeader,
HomeFooter, HomeFooter,
searchResultList, searchResultList,
CanAssignCase,
}, },
beforeUnmount() { beforeUnmount() {
mybus.off('paramsGetResources') mybus.off('paramsGetResources')