素材中心优化
This commit is contained in:
parent
b74724084e
commit
6719e1b4f1
|
|
@ -45,8 +45,7 @@ export function useCate(type: number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加分组
|
// 添加分组
|
||||||
const handleAddCate = async () => {
|
const handleAddCate = async (value: string) => {
|
||||||
const { value } = await feedback.prompt('', '添加分组')
|
|
||||||
await fileCateAdd({
|
await fileCateAdd({
|
||||||
type,
|
type,
|
||||||
name: value,
|
name: value,
|
||||||
|
|
@ -56,8 +55,7 @@ export function useCate(type: number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑分组
|
// 编辑分组
|
||||||
const handleEditCate = async (name: string, id: number) => {
|
const handleEditCate = async (value: string, id: number) => {
|
||||||
const { value } = await feedback.prompt('', '重命分组', { inputValue: name })
|
|
||||||
await fileCateEdit({
|
await fileCateEdit({
|
||||||
id,
|
id,
|
||||||
name: value
|
name: value
|
||||||
|
|
@ -180,8 +178,7 @@ export function useFile(
|
||||||
clearSelect()
|
clearSelect()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFileRename = async (name: string, id: number) => {
|
const handleFileRename = async (value: string, id: number) => {
|
||||||
const { value } = await feedback.prompt('', '重命名', { inputValue: name })
|
|
||||||
await fileRename({
|
await fileRename({
|
||||||
id,
|
id,
|
||||||
name: value
|
name: value
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,22 @@
|
||||||
<span class="muted m-r-10">···</span>
|
<span class="muted m-r-10">···</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<div
|
<popover-input
|
||||||
v-perms="['common:album:cateRename']"
|
v-perms="['common:album:cateRename']"
|
||||||
@click="handleEditCate(data.name, data.id)"
|
@confirm="handleEditCate($event, data.id)"
|
||||||
|
size="default"
|
||||||
|
:value="data.name"
|
||||||
|
width="400px"
|
||||||
|
:limit="20"
|
||||||
|
show-limit
|
||||||
|
teleported
|
||||||
>
|
>
|
||||||
<el-dropdown-item>命名分组</el-dropdown-item>
|
<div>
|
||||||
|
<el-dropdown-item>
|
||||||
|
命名分组
|
||||||
|
</el-dropdown-item>
|
||||||
</div>
|
</div>
|
||||||
|
</popover-input>
|
||||||
<div
|
<div
|
||||||
v-perms="['common:album:cateDel']"
|
v-perms="['common:album:cateDel']"
|
||||||
@click="handleDeleteCate(data.id)"
|
@click="handleDeleteCate(data.id)"
|
||||||
|
|
@ -57,9 +67,17 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center p-2 border-t border-br">
|
<div class="flex justify-center p-2 border-t border-br">
|
||||||
<el-button @click="handleAddCate" v-perms="['common:album:cateAdd']">
|
<popover-input
|
||||||
添加分组
|
v-perms="['common:album:cateAdd']"
|
||||||
</el-button>
|
@confirm="handleAddCate"
|
||||||
|
size="default"
|
||||||
|
width="400px"
|
||||||
|
:limit="20"
|
||||||
|
show-limit
|
||||||
|
teleported
|
||||||
|
>
|
||||||
|
<el-button> 添加分组 </el-button>
|
||||||
|
</popover-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="material__center flex flex-col">
|
<div class="material__center flex flex-col">
|
||||||
|
|
@ -195,14 +213,18 @@
|
||||||
|
|
||||||
<overflow-tooltip class="mt-1" :content="item.name" />
|
<overflow-tooltip class="mt-1" :content="item.name" />
|
||||||
<div class="operation-btns flex items-center">
|
<div class="operation-btns flex items-center">
|
||||||
<el-button
|
<popover-input
|
||||||
v-perms="['common:album:albumRename']"
|
v-perms="['common:album:albumRename']"
|
||||||
type="primary"
|
@confirm="handleFileRename($event, item.id)"
|
||||||
link
|
size="default"
|
||||||
@click="handleFileRename(item.name, item.id)"
|
:value="item.name"
|
||||||
|
width="400px"
|
||||||
|
:limit="20"
|
||||||
|
show-limit
|
||||||
|
teleported
|
||||||
>
|
>
|
||||||
重命名
|
<el-button type="primary" link> 重命名 </el-button>
|
||||||
</el-button>
|
</popover-input>
|
||||||
<el-button type="primary" link @click="handlePreview(item.uri)">
|
<el-button type="primary" link @click="handlePreview(item.uri)">
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -242,13 +264,17 @@
|
||||||
<el-table-column label="操作" width="150" fixed="right">
|
<el-table-column label="操作" width="150" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="inline-block" v-perms="['common:album:albumRename']">
|
<div class="inline-block" v-perms="['common:album:albumRename']">
|
||||||
<el-button
|
<popover-input
|
||||||
type="primary"
|
@confirm="handleFileRename($event, row.id)"
|
||||||
link
|
size="default"
|
||||||
@click.stop="handleFileRename(row.name, row.id)"
|
:value="row.name"
|
||||||
|
width="400px"
|
||||||
|
:limit="20"
|
||||||
|
show-limit
|
||||||
|
teleported
|
||||||
>
|
>
|
||||||
重命名
|
<el-button type="primary" link> 重命名 </el-button>
|
||||||
</el-button>
|
</popover-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="inline-block">
|
<div class="inline-block">
|
||||||
<el-button type="primary" link @click.stop="handlePreview(row.uri)">
|
<el-button type="primary" link @click.stop="handlePreview(row.uri)">
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ export default defineComponent({
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
if (props.hiddenUpload) fileList.value = []
|
||||||
materialRef.value?.clearSelect()
|
materialRef.value?.clearSelect()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue