Merge branch 'dev_vite' of ssh://18.167.251.121:10002/aidlab/aida_front into dev_vite
This commit is contained in:
@@ -62,7 +62,7 @@ defineExpose({})
|
||||
v-model="getCollectionListData.projectName"
|
||||
:bordered="false"
|
||||
@keydown.enter="handleSearch"
|
||||
placeholder="123123"
|
||||
placeholder="Search"
|
||||
/>
|
||||
<!-- <SearchOutlined class="search_input_icon" @click="handleSearch" /> -->
|
||||
<SvgIcon name="CSearch" size="20" class="search_input_icon" @click="handleSearch" />
|
||||
|
||||
@@ -4,6 +4,7 @@ import { VueDraggable } from "vue-draggable-plus"
|
||||
import contentItem from "./contentItem.vue"
|
||||
import selectMenu from '@/component/modules/selectMenu.vue'
|
||||
import deleteDrafts from './deleteDrafts.vue'
|
||||
import { Https } from '@/tool/https'
|
||||
|
||||
//const props = defineProps({
|
||||
//})
|
||||
@@ -12,29 +13,21 @@ import deleteDrafts from './deleteDrafts.vue'
|
||||
let data = reactive({
|
||||
showDrafts: false,
|
||||
})
|
||||
const publishData = reactive({
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
isShowMark:false,
|
||||
isNoData:false,
|
||||
})
|
||||
const noPublishData = reactive({
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
isShowMark:false,
|
||||
isNoData:false,
|
||||
})
|
||||
const list = ref([
|
||||
{ id: "1" },
|
||||
{ id: "2" },
|
||||
{ id: "3" },
|
||||
{ id: "4" },
|
||||
{ id: "5" },
|
||||
{ id: "6" },
|
||||
{ id: "7" },
|
||||
{ id: "8" },
|
||||
{ id: "9" },
|
||||
{ id: "10" }
|
||||
])
|
||||
const list2 = ref([
|
||||
{ id: "1" },
|
||||
{ id: "2" },
|
||||
{ id: "3" },
|
||||
{ id: "4" },
|
||||
{ id: "5" },
|
||||
{ id: "6" },
|
||||
{ id: "7" },
|
||||
{ id: "8" },
|
||||
{ id: "9" },
|
||||
{ id: "10" }
|
||||
])
|
||||
const config = ref({
|
||||
"data-container-type": "root",
|
||||
@@ -77,6 +70,73 @@ const deleteDraft = (item: any)=>{
|
||||
})
|
||||
}
|
||||
|
||||
const vObserve = {
|
||||
mounted (el,binding) {
|
||||
// console.log(binding.instance);
|
||||
data.isShowMark = false
|
||||
data.isNoData = false
|
||||
let parentDom = el.parentNode
|
||||
new IntersectionObserver(
|
||||
(entries, observer) => {
|
||||
// 如果不是相交,则直接返回
|
||||
// console.log(entries[0]);
|
||||
if (!entries[0].intersectionRatio) return;
|
||||
data.pageNum += 1
|
||||
binding.value()
|
||||
},
|
||||
// { root:worksPage }
|
||||
).observe(el);
|
||||
}
|
||||
}
|
||||
|
||||
const getPublishedData = async ()=>{
|
||||
if(publishData.isShowMark && !publishData.isNoData)return
|
||||
publishData.isShowMark = true
|
||||
let value = {
|
||||
pageSize: publishData.pageSize,
|
||||
pageNum: publishData.pageNum,
|
||||
status: 1,
|
||||
}
|
||||
await getPublishList(value).then((res)=>{
|
||||
if(res.content.length == 0)publishData.isNoData = true
|
||||
list.value.push(...res.content)
|
||||
})
|
||||
publishData.isShowMark = false
|
||||
}
|
||||
const getNoPublishedData = async ()=>{
|
||||
if(noPublishData.isShowMark && !noPublishData.isNoData)return
|
||||
noPublishData.isShowMark = true
|
||||
let value = {
|
||||
pageSize: noPublishData.pageSize,
|
||||
pageNum: noPublishData.pageNum,
|
||||
status: 0,
|
||||
}
|
||||
await getPublishList(value).then((res)=>{
|
||||
if(res.content.length == 0)noPublishData.isNoData = true
|
||||
list2.value.push(...res.content)
|
||||
})
|
||||
noPublishData.isShowMark = false
|
||||
}
|
||||
const getPublishList = (data:any)=>{
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
Https.axiosGet(Https.httpUrls.getListingList,{params:data}).then((res:any)=>{
|
||||
resolve(res)
|
||||
}).catch((err:any)=>{
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const putListingStatus = ()=>{
|
||||
let data = {
|
||||
id:'',
|
||||
status:'',
|
||||
}
|
||||
Https.axiosPut(Https.httpUrls.putListingStatus,data).then((res:any)=>{
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const draftListing = (item: any)=>{
|
||||
//数组前面添加item
|
||||
list2.value.unshift(item)
|
||||
@@ -127,11 +187,7 @@ onMounted(()=>{
|
||||
nextTick(()=>{
|
||||
resizeObserver = new ResizeObserver((entries) => {
|
||||
for (const entry of entries) {
|
||||
// 获取元素尺寸
|
||||
const width = entry.contentRect.width
|
||||
const height = entry.contentRect.height
|
||||
const borderBoxSize = entry.borderBoxSize[0] // 包含边框
|
||||
const contentBoxSize = entry.contentBoxSize[0] // 内容区域
|
||||
if(upDataDomWidthTime)clearTimeout(upDataDomWidthTime)
|
||||
upDataDomWidthTime = setTimeout(()=>{
|
||||
setDomSize(width)
|
||||
@@ -225,6 +281,12 @@ const { showDrafts } = toRefs(data);
|
||||
@draftListing="draftListing"
|
||||
@editListing="editListing"
|
||||
/>
|
||||
<div v-show="!publishData.isNoData" class="material_content_list_loding">
|
||||
<span class="page_loading" v-show="!publishData.isShowMark" v-observe="getPublishedData"></span>
|
||||
<span v-show="publishData.isShowMark">
|
||||
<a-spin size="large" />
|
||||
</span>
|
||||
</div>
|
||||
</VueDraggable>
|
||||
</div>
|
||||
<div class="openOrCloseDrafts" :class="{'active': showDrafts}" @click="unfoldDrafits">
|
||||
@@ -259,6 +321,12 @@ const { showDrafts } = toRefs(data);
|
||||
@editListing="editListing"
|
||||
@publishListing="publishListing"
|
||||
/>
|
||||
<div v-show="!noPublishData.isNoData" class="material_content_list_loding">
|
||||
<span class="page_loading" v-show="!noPublishData.isShowMark" v-observe="getNoPublishedData"></span>
|
||||
<span v-show="noPublishData.isShowMark">
|
||||
<a-spin size="large" />
|
||||
</span>
|
||||
</div>
|
||||
</VueDraggable>
|
||||
</div>
|
||||
</div>
|
||||
@@ -329,6 +397,19 @@ const { showDrafts } = toRefs(data);
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
> .material_content_list_loding{
|
||||
width: 100%;
|
||||
height: 5rem;
|
||||
aspect-ratio: 1/1;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
> img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user