刘妍 7 days ago
commit 69b3de724a

@ -7,6 +7,8 @@ enum Api {
AddAlgorithmsRepository = '/api/AlgorithmsRepository/AddAlgorithmsRepository',
// 修改算法
UpdateAlgorithmsRepository = '/api/AlgorithmsRepository/UpdateAlgorithmsRepository',
// 删除算法
DeleteAlgorithmsRepository = '/api/AlgorithmsRepository/DeleteAlgorithmsRepository'
}
export const GetAlgorithmsRepositoryList = (params) => defHttp.get({
@ -20,4 +22,8 @@ export const AddAlgorithmsRepository = (params) => defHttp.post({
export const UpdateAlgorithmsRepository = (params) => defHttp.post({
url: Api.UpdateAlgorithmsRepository,
params,
});
export const DeleteAlgorithmsRepository = (params) => defHttp.post({
url: `${Api.DeleteAlgorithmsRepository}?id=${params.id}`,
params,
});

@ -2,8 +2,8 @@
<div ref="scrollBox" class="show-image-div">
<a-image-preview-group>
<a-image
v-for="value in props.showInfoData.aiAchievementDetailList"
:key="value"
v-for="(value, index) in props.showInfoData.aiAchievementDetailList"
:key="index"
:width="232"
:height="140"
style="border-radius: 10px;"

@ -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>

@ -56,6 +56,7 @@
style="margin-bottom: 6px;"
class="item-select item-multiple-select"
mode="multiple"
placeholder="请选择算法"
v-model:value="algoIdsList"
:options="props.algorithmOptions"
@change="changeSelectAlgorithm"

@ -109,6 +109,13 @@ const emits = defineEmits(['changeDrawerModal','changeAddModal'])
}
}
.drawer-content{
height: calc(100vh - 63px);
overflow: auto;
scrollbar-width: none;
::-webkit-scrollbar{
width: 0;
height: 0;
}
padding: 30px;
.content-image{
width: 300px;
@ -164,7 +171,7 @@ const emits = defineEmits(['changeDrawerModal','changeAddModal'])
}
.item-description-value{
width: 294px;
height: 27px;
// height: 27px;
// background: rgba(216, 216, 216, 0.34);
padding-left: 28px;
font-family: PingFangSC-Medium;
@ -174,6 +181,11 @@ const emits = defineEmits(['changeDrawerModal','changeAddModal'])
line-height: 20px;
display: flex;
align-items: center;
// display: -webkit-box;
// -webkit-box-orient: vertical;
// -webkit-line-clamp: ;
// overflow: hidden;
// text-overflow: ellipsis;
}
}
.content-item{

@ -23,7 +23,7 @@
<div class="item-list" v-for="item in dataList">
<div class="image-div">
<img class="image-item" :src="`${VITE_GLOB_API_URL}/${item.cover}`">
<div class="image-icon">盖板缺失</div>
<!--<div class="image-icon">盖板缺失</div> -->
</div>
<div class="show-info-div">
<div class="info-title-div">

@ -91,6 +91,7 @@
<div class="interval"></div>
<div class="footer">
<a-button class="cancel-button" @click="emits('changeAddModal',false)"></a-button>
<a-button v-if="props.modalType == 'update'" class="delete-button" type="primary" @click="delData"></a-button>
<a-button class="save-button" type="primary" @click="submit"></a-button>
</div>
</a-spin>
@ -100,14 +101,14 @@
</template>
<script setup lang="ts">
import { ref, h, defineEmits, defineProps, onMounted } from "vue"
import { ref, h, defineEmits, defineProps, onMounted, createVNode } from "vue"
import { uploadFile } from '@/api/formrender/index';
import { PlusOutlined, } from '@ant-design/icons-vue';
import { ExclamationCircleOutlined, PlusOutlined, } from '@ant-design/icons-vue';
import SelectImageModal from "./SelectImageModal.vue";
import { ModelLabelsType } from './utils'
import { getAppEnvConfig } from '@/utils/env';
import { AddAlgorithmsRepository, UpdateAlgorithmsRepository } from '@/api/demo/ailist'
import { message } from "ant-design-vue";
import { AddAlgorithmsRepository, UpdateAlgorithmsRepository, DeleteAlgorithmsRepository } from '@/api/demo/ailist'
import { message, Modal } from "ant-design-vue";
const { VITE_GLOB_API_URL } = getAppEnvConfig();
const props = defineProps(['modalType', 'algorithmInfo'])
const emits = defineEmits(['changeAddModal', 'query'])
@ -226,6 +227,22 @@ const submit = () => {
})
}
}
const delData = () => {
Modal.confirm({
title: `确认删除该算法吗?`,
icon: createVNode(ExclamationCircleOutlined),
okText: '确认',
cancelText: '取消',
centered: true,
onOk() {
return DeleteAlgorithmsRepository({id: id.value}).then(res => {
message.success("删除成功")
emits('query')
emits('changeAddModal',false)
})
},
});
}
</script>
<style lang="scss" scoped>
@ -550,6 +567,20 @@ const submit = () => {
text-shadow: 0px 10px 30px rgba(0,0,6,0.15);
margin-right: 14px;
}
.delete-button{
width: 146px;
height: 40px;
background: #ed6f6f;
box-shadow: 0px 10px 30px 0px rgba(0,0,6,0.15);
border-radius: 4px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 16px;
color: #FFFFFF;
line-height: 33px;
text-shadow: 0px 10px 30px rgba(0,0,6,0.15);
margin-right: 14px;
}
.save-button{
width: 146px;
height: 40px;

Loading…
Cancel
Save