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