优化素材中心

This commit is contained in:
xiangheng
2024-02-21 19:27:18 +08:00
parent 1dc7f7542a
commit aa2ecf115b
13 changed files with 215 additions and 249 deletions

View File

@@ -20,7 +20,7 @@ export function useCate(type: number) {
const cateLists = ref<any[]>([])
// 选中的分组id
const cateId = ref<number | string>('')
const cateId = ref<number | string>(0)
// 获取分组列表
const getCateLists = async () => {
@@ -28,10 +28,10 @@ export function useCate(type: number) {
type
})
const item: any[] = [
// {
// name: '全部',
// id: ''
// },
{
name: '全部',
id: 0
}
// {
// name: '未分组',
// id: 0
@@ -96,7 +96,6 @@ export function useFile(
size: number
) {
const tableRef = shallowRef()
const listShowType = ref('normal')
const moveId = ref(0)
const select = ref<any[]>([])
const isCheckAll = ref(false)
@@ -120,10 +119,6 @@ export function useFile(
resetPage()
}
const isSelect = (id: number) => {
return !!select.value.find((item: any) => item.id == id)
}
const batchFileDelete = async (id?: number[]) => {
await feedback.confirm(
'确认删除后,本地或云存储文件也将同步删除,如文件已被使用,请谨慎操作!'
@@ -167,7 +162,9 @@ export function useFile(
const cancelSelete = (id: number) => {
select.value = select.value.filter((item: any) => item.id != id)
}
const selectItems = (items: any[]) => {
select.value = items
}
const selectAll = (value: CheckboxValueType) => {
isIndeterminate.value = false
tableRef.value?.toggleAllSelection()
@@ -186,7 +183,6 @@ export function useFile(
getFileList()
}
return {
listShowType,
tableRef,
moveId,
pager,
@@ -199,10 +195,10 @@ export function useFile(
batchFileDelete,
batchFileMove,
selectFile,
isSelect,
clearSelect,
cancelSelete,
selectAll,
selectItems,
handleFileRename
}
}