赋能场景

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,373 +5,410 @@
<div class="top">
<div class="top-title">
全部
<div v-for="(item, index) in titleName" :key="index" class="tabAll" @click="changeCards(index)"
:class="{ sel: index == number }">
<div
v-for="(item, index) in titleName"
:key="index"
class="tabAll"
@click="changeCards(index)"
:class="{ sel: index == number }"
>
<span>{{ item.name }}</span>
</div>
</div>
<div class="resultListSearchInput-father">
<div class="resultListSearchInput-father" v-if="number === 0">
<div class="resultListSearchInput-son">
模糊搜索
<a-input-search v-model:value="searchValue" placeholder="请输入关键词" enter-button="搜索" size="large"
@search="getAppResources" @change="onSearch" class="resultListSearchInput" />
<a-input-search
v-model:value="searchValue"
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@search="getAppResources"
@change="onSearch"
class="resultListSearchInput"
/>
<button class="button-reset" @click="chongzhi()">重置</button>
<div class="hengxian"></div>
</div>
</div>
<div v-loading="loadingData">
<searchResultList v-show="resourceList.data && resourceList.data.length > 0" :key="listKey2"
:resourceList="resourceList" :resourceTotal="resourceTotal"
:selectCardsname="number == 0 ? '融合服务' : '赋能场景'" />
<searchResultList
v-if="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">
<a-pagination v-if="resourceList.data && resourceList.data.length > 0" v-model:current="currentPage"
v-model:pageSize="currentPageSize" show-size-changer show-less-items show-quick-jumper
:total="resourceTotal" :page-size-options="pageSizeOptions" @change="pageChange"
@showSizeChange="onShowSizeChange" />
<a-pagination
v-if="resourceList.data && resourceList.data.length > 0"
v-model:current="currentPage"
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 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 />
</div>
</div>
</div>
</div>
<home-footer></home-footer>
</template>
<script>
import HomeFooter from '@/views/newHome/components/Footer'
import mybus from '@/myplugins/mybus'
import { defineComponent, reactive, ref, toRefs, onMounted, watch } from 'vue'
import HomeFooter from '@/views/newHome/components/Footer'
import mybus from '@/myplugins/mybus'
import { defineComponent, reactive, ref, toRefs, onMounted, watch } from 'vue'
import { getIntegrationServicesList } from '@/api/home.js'
import { useRouter } from 'vue-router'
import HomeHeader from '@/views/home/components/header'
import searchResultList from '@/views/home/components/searchResultList.vue'
import { message } from 'ant-design-vue'
import { getIntegrationServicesList } from '@/api/home.js'
import { useRouter } from 'vue-router'
import HomeHeader from '@/views/home/components/header'
import searchResultList from '@/views/home/components/searchResultList.vue'
import CanAssignCase from '@/views/home/components/CanAssignCase.vue'
import { message } from 'ant-design-vue'
export default defineComponent({
setup() {
//
const loading = ref(true)
const currentPage = ref(1)
const currentPageSize = ref(5)
const pageSizeOptions = ref(['5', '10', '20', '50'])
const router = useRouter()
const select = router.currentRoute.value.query.select
const searchValue = ref('')
const Cardsname = ref(select)
const resourceList = reactive({ data: [] })
const resourceTotal = ref(0)
const current = ref(1)
const loadingData = ref(false)
//
const titleName = ref([
{
name: '打包模式',
},
{
name: '赋能场景',
},
])
const number = ref(0)
//
let listKey = ref(0)
//
const listKey2 = ref(0)
//
const paramsGetResources = {
pageNum: 1,
pageSize: currentPageSize.value,
type: titleName.value[number.value].name,
name: '',
orderField: 'create_date', // total visits 访 applyCount score collectCount
orderType: 'DESC', // ASC DESC
}
const changeCards = (val) => {
console.log(val)
number.value = val
chongzhi()
}
//
const onSearch = () => {
loading.value = true
currentPage.value = 1
}
//
const chongzhi = () => {
loading.value = true
//
searchValue.value = ''
export default defineComponent({
setup() {
//
currentPage.value = 1
currentPageSize.value = 5
//
paramsGetResources.pageNum = 1
paramsGetResources.pageSize = 5
paramsGetResources.orderField = 'create_date'
paramsGetResources.orderType = 'DESC'
mybus.emit('chongzhi', {
type: titleName.value[number.value].name,
})
getAppResources()
}
const getAppResources = () => {
getIntegrationList()
}
//
const getIntegrationList = () => {
loadingData.value = true;
console.log('获取融合服务列表------------>');
let postData = {
limit: currentPageSize.value,
page: currentPage.value,
orderField: paramsGetResources.orderField,
orderType: paramsGetResources.orderType,
name: searchValue.value,
type: titleName.value[number.value].name,
}
getIntegrationServicesList(postData).then(
(res) => {
loadingData.value = false;
if (res.data.code !== 0) {
return message.error(res.data.msg)
}
console.log('res.data------------>', res.data);
resourceList.data = res.data.data.list || []
resourceTotal.value = res.data.data.total || 0
const loading = ref(true)
const currentPage = ref(1)
const currentPageSize = ref(5)
const pageSizeOptions = ref(['5', '10', '20', '50'])
const router = useRouter()
const select = router.currentRoute.value.query.select
const searchValue = ref('')
const Cardsname = ref(select)
const resourceList = reactive({ data: [] })
const resourceTotal = ref(0)
const current = ref(1)
const loadingData = ref(false)
//
const titleName = ref([
{
name: '打包模式',
},
(err) => {
loadingData.value = false;
message.error(err)
}
)
}
{
name: '赋能场景',
},
])
mybus.on('paramsGetResources', (ids) => {
if (ids && ids.length > 0) {
paramsGetResources.deptIds = ids
} else {
delete paramsGetResources.deptIds
const number = ref(0)
//
let listKey = ref(0)
//
const listKey2 = ref(0)
//
const paramsGetResources = {
pageNum: 1,
pageSize: currentPageSize.value,
type: titleName.value[number.value].name,
name: '',
orderField: 'create_date', // total visits 访 applyCount score collectCount
orderType: 'DESC', // ASC DESC
}
getAppResources()
console.log('paramsGetResources', paramsGetResources)
})
mybus.on('changePage', (page) => {
paramsGetResources.pageNum = page
getAppResources('分页查询')
})
mybus.on('changeSelcted', () => {
getAppResources()
})
mybus.on('refresh', () => {
paramsGetResources.pageNum = 1
currentPage.value = 1
getAppResources()
})
mybus.on('changeCondition', (condition) => {
paramsGetResources.orderField = condition.orderField
paramsGetResources.orderType = condition.orderType
getAppResources()
})
const changeCards = (val) => {
console.log(val)
number.value = val
chongzhi()
}
const pageChange = (val) => {
console.log(val)
loading.value = true
currentPage.value = val
paramsGetResources.pageNum = val
let params = '分页查询' //
getAppResources(params)
}
//
const onSearch = () => {
loading.value = true
currentPage.value = 1
}
//
const chongzhi = () => {
loading.value = true
//
searchValue.value = ''
//
currentPage.value = 1
currentPageSize.value = 5
//
paramsGetResources.pageNum = 1
paramsGetResources.pageSize = 5
paramsGetResources.orderField = 'create_date'
paramsGetResources.orderType = 'DESC'
mybus.emit('chongzhi', {
type: titleName.value[number.value].name,
})
getAppResources()
}
onMounted(() => {
console.log('222----onMounted-------->', 222);
listKey2.value++
getAppResources()
})
const getAppResources = () => {
getIntegrationList()
}
//
const onShowSizeChange = (current, pageSize) => {
currentPage.value = current
currentPageSize.value = pageSize
paramsGetResources.pageNum = current
paramsGetResources.pageSize = pageSize
getAppResources()
}
watch(currentPageSize, () => {
console.log('pageSize', currentPageSize.value)
})
//
const getIntegrationList = () => {
loadingData.value = true
console.log('获取融合服务列表------------>')
let postData = {
limit: currentPageSize.value,
page: currentPage.value,
orderField: paramsGetResources.orderField,
orderType: paramsGetResources.orderType,
name: searchValue.value,
type: titleName.value[number.value].name,
}
getIntegrationServicesList(postData).then(
(res) => {
loadingData.value = false
if (res.data.code !== 0) {
return message.error(res.data.msg)
}
console.log('res.data------------>', res.data)
return {
listKey,
searchValue,
currentPage,
resourceList,
resourceTotal,
pageChange,
listKey2,
Cardsname,
getAppResources,
chongzhi,
onSearch,
currentPageSize,
pageSizeOptions,
current,
loading,
titleName,
changeCards,
number,
loadingData,
}
},
components: {
HomeHeader,
HomeFooter,
searchResultList,
},
beforeUnmount() {
mybus.off('paramsGetResources')
mybus.off('changeCondition')
mybus.off('refresh')
mybus.off('changePage')
},
})
resourceList.data = res.data.data.list || []
resourceTotal.value = res.data.data.total || 0
},
(err) => {
loadingData.value = false
message.error(err)
}
)
}
mybus.on('paramsGetResources', (ids) => {
if (ids && ids.length > 0) {
paramsGetResources.deptIds = ids
} else {
delete paramsGetResources.deptIds
}
getAppResources()
console.log('paramsGetResources', paramsGetResources)
})
mybus.on('changePage', (page) => {
paramsGetResources.pageNum = page
getAppResources('分页查询')
})
mybus.on('changeSelcted', () => {
getAppResources()
})
mybus.on('refresh', () => {
paramsGetResources.pageNum = 1
currentPage.value = 1
getAppResources()
})
mybus.on('changeCondition', (condition) => {
paramsGetResources.orderField = condition.orderField
paramsGetResources.orderType = condition.orderType
getAppResources()
})
const pageChange = (val) => {
console.log(val)
loading.value = true
currentPage.value = val
paramsGetResources.pageNum = val
let params = '分页查询' //
getAppResources(params)
}
onMounted(() => {
console.log('222----onMounted-------->', 222)
listKey2.value++
getAppResources()
})
//
const onShowSizeChange = (current, pageSize) => {
currentPage.value = current
currentPageSize.value = pageSize
paramsGetResources.pageNum = current
paramsGetResources.pageSize = pageSize
getAppResources()
}
watch(currentPageSize, () => {
console.log('pageSize', currentPageSize.value)
})
return {
listKey,
searchValue,
currentPage,
resourceList,
resourceTotal,
pageChange,
listKey2,
Cardsname,
getAppResources,
chongzhi,
onSearch,
currentPageSize,
pageSizeOptions,
current,
loading,
titleName,
changeCards,
number,
loadingData,
}
},
components: {
HomeHeader,
HomeFooter,
searchResultList,
CanAssignCase,
},
beforeUnmount() {
mybus.off('paramsGetResources')
mybus.off('changeCondition')
mybus.off('refresh')
mybus.off('changePage')
},
})
</script>
<style lang="less" scoped>
.resultListSearchInput-father {
background: #f3f5f9;
padding: 0.2rem;
.resultListSearchInput-father {
background: #f3f5f9;
padding: 0.2rem;
// padding-left: 0.2rem;
// padding-top: 0.2rem;
.resultListSearchInput-son {
background: #fff;
padding: 0.2rem 0.2rem 0rem 0.3rem;
// padding-left: 0.2rem;
// padding-top: 0.2rem;
.resultListSearchInput-son {
background: #fff;
padding: 0.2rem 0.2rem 0rem 0.3rem;
.hengxian {
width: 100%;
height: 0.01rem;
background: rgba(150, 144, 144, 0.3);
margin-top: 0.2rem;
.hengxian {
width: 100%;
height: 0.01rem;
background: rgba(150, 144, 144, 0.3);
margin-top: 0.2rem;
}
}
}
}
.resultListSearchInput {
margin-left: 0.1rem;
.resultListSearchInput {
margin-left: 0.1rem;
:deep(.ant-input) {
width: 4rem;
height: 0.36rem;
background: #fff;
border-radius: 0.04rem;
: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;
margin-left: 2.5rem;
cursor: pointer;
}
: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;
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: 11.5rem;
.details-pageconetent {
height: 100%;
width: 100%;
display: flex;
padding-top: 0.2rem;
flex-direction: column;
font-size: 0.16rem;
justify-content: left;
background: #f3f5f9;
justify-content: center;
align-items: center;
margin-top: 0.67rem;
position: relative;
background: rgba(245, 243, 243, 0.3);
.pagination {
background: #f3f5f9;
padding-bottom: 0.6rem;
.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-title {
padding: 0.2rem;
.top {
min-height: 7.2rem;
position: relative;
width: 11.5rem;
display: flex;
font-size: 18px;
padding-top: 0.2rem;
flex-direction: column;
font-size: 0.16rem;
justify-content: left;
background: #f3f5f9;
.tabAll {
.pagination {
background: #f3f5f9;
padding-bottom: 0.6rem;
}
.top-title {
padding: 0.2rem;
display: flex;
font-size: 18px;
color: #000000;
margin-right: 35px;
cursor: pointer;
}
.tabAll:nth-child(1) {
margin-left: 20px;
}
.tabAll {
font-size: 18px;
color: #000000;
margin-right: 35px;
cursor: pointer;
}
.sel {
font-weight: 600;
color: #0087ff;
border-bottom: 0.02rem solid #0087ff;
.tabAll:nth-child(1) {
margin-left: 20px;
}
.sel {
font-weight: 600;
color: #0087ff;
border-bottom: 0.02rem solid #0087ff;
}
}
}
}
}
:deep(.ant-card-grid) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
word-break: break-all;
}
:deep(.ant-card-grid) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
word-break: break-all;
}
</style>