赋能场景存储查询条件
This commit is contained in:
parent
90a3aa8e37
commit
31a809f9d9
|
@ -1,19 +1,11 @@
|
|||
<template>
|
||||
<div class="box">
|
||||
<div class="CanCase">
|
||||
<div
|
||||
class="caseBox"
|
||||
v-for="(item, index) in caseList"
|
||||
:key="index"
|
||||
@click="toView(item)"
|
||||
>
|
||||
<a-image
|
||||
:preview="false"
|
||||
:src="
|
||||
item.fuseAttrList.filter((val) => val.attrType == '服务图片')[0]
|
||||
.attrValue
|
||||
"
|
||||
/>
|
||||
<div class="caseBox" v-for="(item, index) in caseList" :key="index" @click="toView(item)">
|
||||
<a-image :preview="false" :src="
|
||||
item.fuseAttrList.filter((val) => val.attrType == '服务图片')[0]
|
||||
.attrValue
|
||||
" />
|
||||
<h3>{{ item.name }}</h3>
|
||||
<p>发布时间 {{ item.updateDate }}</p>
|
||||
</div>
|
||||
|
@ -21,68 +13,83 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
||||
import { defineProps } from 'vue'
|
||||
import { ref, onMounted, onBeforeUnmount, watch, defineProps, defineEmits } from 'vue'
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
resourceList: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
selectCardsname: {
|
||||
type: String,
|
||||
default: '组件服务',
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
resourceList: {
|
||||
type: Object,
|
||||
default: () => { },
|
||||
},
|
||||
selectCardsname: {
|
||||
type: String,
|
||||
default: '组件服务',
|
||||
},
|
||||
})
|
||||
const emits = defineEmits(['saveSearchCodition'])
|
||||
|
||||
const caseList = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
caseList.value = props.resourceList.data
|
||||
console.log('caseList.value------------>', caseList.value);
|
||||
})
|
||||
onBeforeUnmount(() => { })
|
||||
function toView(item) {
|
||||
emits('saveSearchCodition', 1)
|
||||
router.push({
|
||||
path: '/integrationServicesDetails',
|
||||
query: {
|
||||
id: item.id,
|
||||
},
|
||||
})
|
||||
const caseList = ref([])
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
caseList.value = props.resourceList.data
|
||||
console.log(caseList.value, 'caseList.value')
|
||||
})
|
||||
onBeforeUnmount(() => {})
|
||||
function toView(item) {
|
||||
router.push({
|
||||
path: '/integrationServicesDetails',
|
||||
query: {
|
||||
id: item.id,
|
||||
},
|
||||
})
|
||||
watch(
|
||||
() => props.resourceList.data,
|
||||
(val) => {
|
||||
if (val) {
|
||||
caseList.value = val
|
||||
}
|
||||
}
|
||||
)
|
||||
</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;
|
||||
}
|
||||
.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>
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
:resourceList="resourceList" :resourceTotal="resourceTotal" @saveSearchCodition="saveSearchCodition"
|
||||
ref="searchResultListDom" :selectCardsname="number == 0 ? '融合服务' : '赋能场景'" />
|
||||
<CanAssignCase v-else v-show="resourceList.data && resourceList.data.length > 0" :resourceList="resourceList"
|
||||
:resourceTotal="resourceTotal" :selectCardsname="number == 0 ? '融合服务' : '赋能场景'" />
|
||||
@saveSearchCodition="saveSearchCodition" :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
|
||||
|
@ -53,22 +54,11 @@ import CanAssignCase from '@/views/home/components/CanAssignCase.vue'
|
|||
import { message } from 'ant-design-vue'
|
||||
|
||||
export default defineComponent({
|
||||
beforeRouteEnter(to, from, next) {
|
||||
console.log('to---integrationServices--beforeRouteEnter------->', to)
|
||||
console.log('from---integrationServices--beforeRouteEnter------->', from)
|
||||
console.log('next---integrationServices--beforeRouteEnter------->', next)
|
||||
// 返回按钮,刷新页面,所以from.name为undefined
|
||||
// if (from.name || from.name !== 'details') {
|
||||
// console.log('清空------------>')
|
||||
// localStorage.removeItem('DetailsPageconetent')
|
||||
// }
|
||||
next()
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
console.log('to---integrationServices--beforeRouteLeave------->', to)
|
||||
console.log('from---integrationServices--beforeRouteLeave------->', from)
|
||||
console.log('next---integrationServices--beforeRouteLeave------->', next)
|
||||
if (to.name !== 'packagingDetails') {
|
||||
if (to.name !== 'packagingDetails' && to.name !== 'integrationServicesDetails') {
|
||||
localStorage.removeItem('integrationServices')
|
||||
}
|
||||
next()
|
||||
|
@ -78,7 +68,7 @@ export default defineComponent({
|
|||
const loading = ref(true)
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(5)
|
||||
const pageSizeOptions = ref(['2','5', '10', '20', '50'])
|
||||
const pageSizeOptions = ref(['2', '5', '10', '20', '50'])
|
||||
const router = useRouter()
|
||||
const select = router.currentRoute.value.query.select
|
||||
const searchValue = ref('')
|
||||
|
@ -95,7 +85,6 @@ export default defineComponent({
|
|||
name: '赋能场景',
|
||||
},
|
||||
])
|
||||
const searchData = null;
|
||||
const number = ref(0)
|
||||
// 查询参数
|
||||
const paramsGetResources = {
|
||||
|
@ -110,39 +99,35 @@ export default defineComponent({
|
|||
const storageSearchInfo = JSON.parse(localStorage.getItem('integrationServices'))
|
||||
// 读取本地存储:表单赋值
|
||||
const handleSetSearchData = () => {
|
||||
console.log('storageSearchInfo------------>', storageSearchInfo)
|
||||
if (storageSearchInfo) {
|
||||
number.value = storageSearchInfo.type == '打包模式' ? 0 : 1;
|
||||
// 搜索名称
|
||||
searchValue.value = storageSearchInfo.name;
|
||||
currentPage.value = storageSearchInfo.page;
|
||||
currentPageSize.value = storageSearchInfo.limit;
|
||||
titleName.value[number.value].name = storageSearchInfo.type;;
|
||||
paramsGetResources.limit = storageSearchInfo.limit;
|
||||
paramsGetResources.page = storageSearchInfo.page;
|
||||
paramsGetResources.type = storageSearchInfo.type;
|
||||
|
||||
// 延迟使用,因为还没有返回跟挂载
|
||||
nextTick(() => {
|
||||
searchResultListDom.value.changeCondition({
|
||||
searchResultListDom.value && searchResultListDom.value.changeCondition && searchResultListDom.value.changeCondition({
|
||||
value: storageSearchInfo.orderField,
|
||||
orderType: storageSearchInfo.orderType,
|
||||
}, true)
|
||||
})
|
||||
console.log('paramsGetResources------------>', paramsGetResources);
|
||||
return;
|
||||
getIntegrationList()
|
||||
}
|
||||
}
|
||||
|
||||
const changeCards = (val) => {
|
||||
console.log(val)
|
||||
number.value = val
|
||||
// 打包模式
|
||||
number.value = val;
|
||||
paramsGetResources.type = titleName.value[number.value].name;
|
||||
resetAction()
|
||||
}
|
||||
|
||||
// 查询
|
||||
const onSearch = () => {
|
||||
|
||||
currentPage.value = 1
|
||||
getIntegrationList()
|
||||
}
|
||||
|
@ -168,9 +153,8 @@ export default defineComponent({
|
|||
// 获取融合服务列表
|
||||
const getIntegrationList = () => {
|
||||
loadingData.value = true
|
||||
console.log('获取融合服务列表------------>')
|
||||
paramsGetResources.name = searchValue.value;
|
||||
console.log('paramsGetResources------------>', paramsGetResources);
|
||||
console.log('paramsGetResources------参数下发------>', paramsGetResources);
|
||||
getIntegrationServicesList(paramsGetResources).then(
|
||||
(res) => {
|
||||
loadingData.value = false
|
||||
|
@ -194,13 +178,11 @@ export default defineComponent({
|
|||
delete paramsGetResources.deptIds
|
||||
}
|
||||
getIntegrationList()
|
||||
console.log('paramsGetResources-----paramsGetResources------->', paramsGetResources);
|
||||
})
|
||||
|
||||
mybus.on('changePage', (page) => {
|
||||
paramsGetResources.page = page
|
||||
console.log('paramsGetResources----changePage-------->', paramsGetResources);
|
||||
getIntegrationList('分页查询')
|
||||
getIntegrationList()
|
||||
})
|
||||
|
||||
mybus.on('changeSelcted', () => {
|
||||
|
@ -213,19 +195,15 @@ export default defineComponent({
|
|||
getIntegrationList()
|
||||
})
|
||||
mybus.on('changeCondition', (condition) => {
|
||||
console.log('changeCondition------>', condition)
|
||||
paramsGetResources.orderField = condition.orderField
|
||||
paramsGetResources.orderType = condition.orderType
|
||||
getIntegrationList()
|
||||
})
|
||||
|
||||
const pageChange = (val) => {
|
||||
console.log('val-----pageChange------->', val);
|
||||
currentPage.value = val
|
||||
paramsGetResources.page = val
|
||||
getIntegrationList() //判断是否是点击下面的分页的调用模糊查询方法还是点击搜索调用模糊查询方法
|
||||
console.log('paramsGetResources----pageChange-------->', paramsGetResources);
|
||||
|
||||
}
|
||||
|
||||
// 分页
|
||||
|
@ -238,8 +216,8 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
// 存储查询条件到本地
|
||||
const saveSearchCodition = () => {
|
||||
console.log('融合服务------------>', searchData);
|
||||
const saveSearchCodition = (n) => {
|
||||
console.log('融合服务-----存储查询条件到本地------->', paramsGetResources);
|
||||
localStorage.setItem(
|
||||
'integrationServices',
|
||||
JSON.stringify(paramsGetResources)
|
||||
|
@ -252,7 +230,6 @@ export default defineComponent({
|
|||
} else {
|
||||
getIntegrationList()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return {
|
||||
|
@ -275,7 +252,6 @@ export default defineComponent({
|
|||
onShowSizeChange,
|
||||
saveSearchCodition,
|
||||
searchResultListDom,
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -26,7 +26,7 @@ import {
|
|||
ref,
|
||||
watch,
|
||||
defineProps,
|
||||
nextTick,
|
||||
defineEmits,
|
||||
} from 'vue'
|
||||
import { getDevelopDocTree } from '@/api/home'
|
||||
import { message } from 'ant-design-vue'
|
||||
|
|
Loading…
Reference in New Issue