feat:
This commit is contained in:
parent
8ca8e359d4
commit
d695f8c053
@ -85,8 +85,11 @@ const putApplication: (
|
|||||||
* 删除应用
|
* 删除应用
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 applicaiton_id
|
||||||
*/
|
*/
|
||||||
const delApplication: (applicaiton_id: String) => Promise<Result<boolean>> = (applicaiton_id) => {
|
const delApplication: (
|
||||||
return del(`${prefix}/${applicaiton_id}`)
|
applicaiton_id: String,
|
||||||
|
loading?: Ref<boolean>
|
||||||
|
) => Promise<Result<boolean>> = (applicaiton_id, loading) => {
|
||||||
|
return del(`${prefix}/${applicaiton_id}`, undefined, {}, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -37,8 +37,11 @@ const getAllDateset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loadi
|
|||||||
* 删除数据集
|
* 删除数据集
|
||||||
* @param 参数 dataset_id
|
* @param 参数 dataset_id
|
||||||
*/
|
*/
|
||||||
const delDateset: (dataset_id: String) => Promise<Result<boolean>> = (dataset_id) => {
|
const delDateset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result<boolean>> = (
|
||||||
return del(`${prefix}/${dataset_id}`)
|
dataset_id,
|
||||||
|
loading
|
||||||
|
) => {
|
||||||
|
return del(`${prefix}/${dataset_id}`, undefined, {}, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -102,14 +102,6 @@ const paginationConfig = reactive({
|
|||||||
|
|
||||||
const searchValue = ref('')
|
const searchValue = ref('')
|
||||||
|
|
||||||
const noMore = computed(
|
|
||||||
() =>
|
|
||||||
applicationList.value.length > 0 &&
|
|
||||||
applicationList.value.length === paginationConfig.total &&
|
|
||||||
paginationConfig.total > 20 &&
|
|
||||||
!loading.value
|
|
||||||
)
|
|
||||||
|
|
||||||
function searchHandle() {
|
function searchHandle() {
|
||||||
paginationConfig.total = 0
|
paginationConfig.total = 0
|
||||||
paginationConfig.current_page = 1
|
paginationConfig.current_page = 1
|
||||||
@ -128,17 +120,11 @@ function deleteApplication(row: any) {
|
|||||||
confirmButtonClass: 'danger'
|
confirmButtonClass: 'danger'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = true
|
applicationApi.delApplication(row.id, loading).then(() => {
|
||||||
applicationApi
|
const index = applicationList.value.findIndex((v) => v.id === row.id)
|
||||||
.delApplication(row.id)
|
applicationList.value.splice(index, 1)
|
||||||
.then(() => {
|
MsgSuccess('删除成功')
|
||||||
const index = applicationList.value.findIndex((v) => v.id === row.id)
|
})
|
||||||
applicationList.value.splice(index, 1)
|
|
||||||
MsgSuccess('删除成功')
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,24 +75,6 @@ const paginationConfig = reactive({
|
|||||||
|
|
||||||
const searchValue = ref('')
|
const searchValue = ref('')
|
||||||
|
|
||||||
const noMore = computed(
|
|
||||||
() =>
|
|
||||||
datasetList.value.length > 0 &&
|
|
||||||
datasetList.value.length === paginationConfig.total &&
|
|
||||||
paginationConfig.total > 20 &&
|
|
||||||
!loading.value
|
|
||||||
)
|
|
||||||
const disabledScroll = computed(
|
|
||||||
() => datasetList.value.length > 0 && (loading.value || noMore.value)
|
|
||||||
)
|
|
||||||
|
|
||||||
function loadDataset() {
|
|
||||||
if (paginationConfig.total > paginationConfig.page_size) {
|
|
||||||
paginationConfig.current_page += 1
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function searchHandle() {
|
function searchHandle() {
|
||||||
paginationConfig.current_page = 1
|
paginationConfig.current_page = 1
|
||||||
datasetList.value = []
|
datasetList.value = []
|
||||||
@ -109,18 +91,11 @@ function deleteDateset(row: any) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = true
|
datasetApi.delDateset(row.id, loading).then(() => {
|
||||||
datasetApi
|
const index = datasetList.value.findIndex((v) => v.id === row.id)
|
||||||
.delDateset(row.id)
|
datasetList.value.splice(index, 1)
|
||||||
.then(() => {
|
MsgSuccess('删除成功')
|
||||||
const index = datasetList.value.findIndex((v) => v.id === row.id)
|
})
|
||||||
datasetList.value.splice(index, 1)
|
|
||||||
MsgSuccess('删除成功')
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user