融合服务支持收藏量

This commit is contained in:
guoyue 2022-09-08 13:12:40 +08:00
parent 5eefd4d306
commit 43aec16d92
5 changed files with 1848 additions and 1967 deletions

File diff suppressed because it is too large Load Diff

View File

@ -255,10 +255,6 @@
case '融合服务': case '融合服务':
router.push({ router.push({
path: '/integrationServices', path: '/integrationServices',
// path: '/DetailsPageconetent',
query: {
select: '融合服务',
},
}) })
break break
case 'CIM专区': case 'CIM专区':

View File

@ -0,0 +1,103 @@
<template>
<ul class="integrationServiceOrder">
<li
v-for="(item, i) in integrationOrderList"
:key="i"
@click="
changeOrder(i, item.value, item.orderType == 'DESC' ? 'ASC' : 'DESC')
"
>
{{ item.name }}
<span
class="arrow"
:class="
integrationOrder.orderType == 'ASC' &&
integrationOrder.orderField == item.value
? 'down'
: ''
"
></span>
</li>
</ul>
</template>
<script setup>
import { ref, reactive, nextTick, defineExpose } from 'vue'
import mybus from '@/myplugins/mybus'
const orderList = [
{
value: 'apply_count',
name: '申请量',
orderType: 'DESC',
},
{
value: 'collectCount',
name: '收藏量',
orderType: 'DESC',
},
{
value: 'create_date',
name: '发布时间',
orderType: 'DESC',
},
{
value: 'update_date',
name: '更新时间',
orderType: 'DESC',
},
]
const integrationOrderList = ref(JSON.parse(JSON.stringify(orderList)))
const integrationOrder = reactive({
orderField: '',
orderType: '',
})
// --
const changeOrder = (i, val, type) => {
let newType = type
integrationOrder.orderField = val
integrationOrder.orderType = newType
integrationOrderList.value[i].orderType = newType
mybus.emit('changeCondition', {
orderField: val,
orderType: newType,
})
}
const reset = () => {
integrationOrderList.value = JSON.parse(JSON.stringify(orderList))
integrationOrder.orderField = ''
integrationOrder.orderType = ''
}
defineExpose({
reset,
})
</script>
<style lang="less" scoped>
.integrationServiceOrder {
display: flex;
li {
width: 90px;
height: 12px;
text-align: center;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
.arrow {
display: inline-block;
width: 12px;
height: 12px;
background: url('~@/assets/newHome/arrow.png');
margin-left: 10px;
}
.down {
background: url('~@/assets/newHome/down.png');
margin-top: 6px;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

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