|
|
|
@ -3,14 +3,19 @@
|
|
|
|
|
<div class="left-menu-title">AI成果</div>
|
|
|
|
|
<div class="left-menu-search-div">
|
|
|
|
|
<a-select
|
|
|
|
|
v-model:value="type"
|
|
|
|
|
:allowClear="true"
|
|
|
|
|
placeholder="选择分类"
|
|
|
|
|
popupClassName="ai-achievement-classify-dropdown"
|
|
|
|
|
class="classify-select"
|
|
|
|
|
:options="classifyOptions"
|
|
|
|
|
@change="changeType"
|
|
|
|
|
/>
|
|
|
|
|
<a-range-picker class="date-select" />
|
|
|
|
|
<a-range-picker v-model:value="searchTime" class="date-select" :format="dateFormatList"
|
|
|
|
|
@change="changeSearchTime"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="show-list-div">
|
|
|
|
|
<div class="show-list-div" ref="scrollBox" @scroll="handleScroll">
|
|
|
|
|
<div :class="`list-item-outer ${selectItemId == item.id?'list-item-outer-select' : ''}`" v-for="(item,index) in dataList" >
|
|
|
|
|
<div class="list-item-inner">
|
|
|
|
|
<img class="item-image" :src="`${item.cover}`" >
|
|
|
|
@ -31,33 +36,102 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="loading" class="loading-text">加载中...</div>
|
|
|
|
|
<div v-else-if="dataList.length >= total" class="loading-text">没有更多数据了</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
|
import { UpdateWorkArea, UpdateAnnotation } from '@/api/demo/mediaLibrary';
|
|
|
|
|
import { useMessage } from '@/hooks/web/useMessage';
|
|
|
|
|
import { GetAiAchievementList } from '@/api/demo/aiachievement'
|
|
|
|
|
import { getAppEnvConfig } from '@/utils/env';
|
|
|
|
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
|
|
|
|
import { GetAlgorithmsRepositoryList } from '@/api/demo/ailist'
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
const emits = defineEmits([
|
|
|
|
|
'changeLeftMenuShow'
|
|
|
|
|
]);
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
GetAiAchievementList({page:1,limit:999}).then(res => {
|
|
|
|
|
console.log('res',res)
|
|
|
|
|
dataList.value = res.items
|
|
|
|
|
GetAlgorithmsRepositoryList({page: 1,limit: 999,}).then(res => {
|
|
|
|
|
total.value = res.total
|
|
|
|
|
classifyOptions.value = res.items.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
label: item.name,
|
|
|
|
|
value: item.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
fetchData()
|
|
|
|
|
})
|
|
|
|
|
const dateFormatList = ['YYYY-MM-DD', 'YYYY-MM-DD']
|
|
|
|
|
const selectItemId = ref()
|
|
|
|
|
const dataList = ref([])
|
|
|
|
|
const dataList = ref<any>([])
|
|
|
|
|
const type = ref()
|
|
|
|
|
const searchTime = ref()
|
|
|
|
|
const startTime = ref()
|
|
|
|
|
const endTime = ref()
|
|
|
|
|
const page = ref(1)
|
|
|
|
|
const limit = ref(10)
|
|
|
|
|
const total = ref(0)
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const scrollBox = ref<HTMLDivElement>()
|
|
|
|
|
const classifyOptions = ref([
|
|
|
|
|
{label:'1231231', value:'123123123'},
|
|
|
|
|
{label:'222', value:'222'},
|
|
|
|
|
{label:'333', value:'333'},
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
async function fetchData() {
|
|
|
|
|
if (loading.value) return
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const res = await GetAiAchievementList({
|
|
|
|
|
page: page.value,
|
|
|
|
|
limit:limit.value,
|
|
|
|
|
type: type.value,
|
|
|
|
|
startTime: startTime.value,
|
|
|
|
|
endTime: endTime.value
|
|
|
|
|
})
|
|
|
|
|
total.value = res.total
|
|
|
|
|
dataList.value = [...dataList.value, ...res.items]
|
|
|
|
|
page.value++
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async function searchFetchData() {
|
|
|
|
|
if (loading.value) return
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
page.value = 1
|
|
|
|
|
const res = await GetAiAchievementList({
|
|
|
|
|
page: page.value,
|
|
|
|
|
limit:limit.value,
|
|
|
|
|
type: type.value,
|
|
|
|
|
startTime: startTime.value,
|
|
|
|
|
endTime: endTime.value
|
|
|
|
|
})
|
|
|
|
|
total.value = res.total
|
|
|
|
|
dataList.value = [...res.items]
|
|
|
|
|
page.value++
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function handleScroll(e: Event) {
|
|
|
|
|
const el = e.target as HTMLElement
|
|
|
|
|
if (el.scrollTop + el.clientHeight >= el.scrollHeight - 10) {
|
|
|
|
|
if (dataList.value.length < total.value) {
|
|
|
|
|
fetchData()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const changeSearchTime = (value, dateString: [string, string]) => {
|
|
|
|
|
console.log('value',value)
|
|
|
|
|
console.log('dateFormat',dateString)
|
|
|
|
|
startTime.value = dateString[0]
|
|
|
|
|
endTime.value = dateString[1]
|
|
|
|
|
searchFetchData()
|
|
|
|
|
}
|
|
|
|
|
const changeType = () => {
|
|
|
|
|
searchFetchData()
|
|
|
|
|
}
|
|
|
|
|
function showInfo(item){
|
|
|
|
|
selectItemId.value = item.id
|
|
|
|
|
emits('changeLeftMenuShow',item);
|
|
|
|
@ -97,6 +171,9 @@
|
|
|
|
|
::v-deep(.ant-select-selection-placeholder) {
|
|
|
|
|
color: rgba(255, 255, 255, 0.15);
|
|
|
|
|
}
|
|
|
|
|
:deep(.ant-select-clear){
|
|
|
|
|
background: #252525;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.date-select{
|
|
|
|
|
width: 269px;
|
|
|
|
@ -281,4 +358,10 @@
|
|
|
|
|
background-color: #37383d !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.loading-text {
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #aaa;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
padding: 10px 0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|